Rule matching method and device, server and computer readable storage medium
By pre-storing business rules in the database and leveraging the fast access capabilities of high-speed memory, the problems of high maintenance costs and slow decision-making speed caused by a large number of business rules in the system are solved, thereby improving business processing efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BANK OF CHINA
- Filing Date
- 2023-06-30
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies suffer from high system maintenance costs and slow decision-making speed due to the large number of business rules in the system.
By pre-storing business rules for each business scenario in the database, and upon receiving business information to be matched, the business scenario is determined based on the business identifier. If it is the first match, the business rules are read from the database and initially filtered before being placed in high-speed storage. If it is not the first match, the rules are directly filtered in high-speed storage, thus improving matching efficiency by leveraging the fast access characteristics of high-speed storage.
It improves the efficiency of rule maintenance for business personnel, reduces repetitive work for developers, improves development and system maintenance efficiency, and enhances the efficiency and accuracy of rule matching through fast access to high-speed storage.
Smart Images

Figure CN116910097B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the financial field or other fields, and in particular to a rule matching method, apparatus, server, and computer-readable storage medium. Background Technology
[0002] With the diversification of banking services, business personnel will set corresponding business rules in different business scenarios and different business systems. Business personnel input parameters at the front end, search for the corresponding rules for matching and calculation, and obtain the corresponding decision results. After obtaining the decision results, business personnel will proceed to the next step.
[0003] Faced with a massive number of business rules, if these rules cannot be managed well, it will be difficult for business personnel to find and maintain them; for developers, the code is highly coupled with business logic, and changes in business logic will increase the workload of developers; if multiple different scenarios use the same business rules, then developers will also need to do a lot of repetitive work.
[0004] Therefore, existing business systems suffer from problems such as high maintenance costs and slow decision-making speed due to the large number of business rules in the system. Summary of the Invention
[0005] This application provides a rule matching method, apparatus, server, and computer-readable storage medium to solve the problems of high system maintenance costs and slow decision-making speed caused by a large number of business rules in the existing technology, thereby achieving the technical effect of improving the system's maintenance efficiency and business processing efficiency.
[0006] Firstly, this application provides a rule matching method, including:
[0007] Receive the service identifier and service data of the service to be matched, and determine the service scenario to which the service to be matched belongs based on the service identifier;
[0008] Based on the service identifier, determine whether a candidate service rule set corresponding to the service scenario exists in the preset high-speed memory;
[0009] If it does not exist, then an initial business rule set corresponding to the business scenario is determined from a preset business rule database, the initial business rule set is subjected to a first rule filter to obtain the candidate business rule set, and the candidate business rule set is stored in the high-speed memory; or...
[0010] If it exists, the candidate business rule set is filtered by a second rule in the high-speed memory to obtain the target business rule set corresponding to the business scenario;
[0011] The business data is parsed and matched based on the business rules in the target business rule set, and the matched business decision results are returned to the business system.
[0012] Optionally, determining whether a candidate service rule set corresponding to the service scenario exists in a preset high-speed memory based on the service identifier includes:
[0013] Obtain the scenario and rule set mapping cache table stored in the high-speed memory, and match the rule set corresponding to the service identifier in the scenario and rule set mapping cache table;
[0014] If a match is successful, it means that a candidate business rule set corresponding to the business scenario exists in the high-speed memory; if a match is unsuccessful, it means that a candidate business rule set corresponding to the business scenario does not exist in the high-speed memory.
[0015] Optionally, the step of determining an initial business rule set corresponding to the business scenario in a preset business rule database, and performing a first rule filtering on the initial business rule set to obtain the candidate business rule set includes:
[0016] Obtain the scenario and rule mapping database table stored in the business rule database, and determine the initial business rule set corresponding to the business scenario based on the business identifier and the scenario and rule mapping database table;
[0017] The rule status of each business rule in the initial business rule set is determined; wherein, the rule status includes an active status and a time-limited status; the active status includes an activated status and an inactive status; the time-limited status includes an inactive status, a valid status, and an expired status;
[0018] By removing business rules that are inactive or invalid from the initial business rule set, a candidate business rule set corresponding to the business scenario is obtained.
[0019] Optionally, the second rule filtering of the candidate service rule set in the high-speed memory includes:
[0020] In the high-speed memory, the business rules that are inactive in the candidate business rule set are determined and removed to obtain the target business rule set corresponding to the business scenario.
[0021] Optionally, the step of parsing and matching the business data based on the business rules in the target business rule set, and then providing the matched business decision results, includes:
[0022] For any given business rule, determine the rule conditions for the current business rule;
[0023] Obtain a preset rule parser, and based on the rule parser and the rule conditions, parse and generate a rule expression for the current business rule, and perform matching processing on the business data based on the rule expression;
[0024] If a match is successful, the decision result corresponding to the current business rule will be used as the business decision result for the data to be matched, and the business decision result will be returned to the business system.
[0025] If the match fails, continue parsing and matching the next business rule until a match is successful to obtain the business decision result of the data to be matched, and then return the business decision result to the business system.
[0026] Optionally, after returning the business decision result to the business system, the method further includes:
[0027] In the high-speed memory, the business rules in the target business rule set that are in an invalid state are identified and removed to obtain an updated target business rule set.
[0028] Optionally, the method further includes:
[0029] The rule identifier of the rule to be modified is determined based on the preset modification event table in the business rule database, and the rule identifier is used to determine whether the rule to be modified is stored in the high-speed memory.
[0030] If it exists, the rule information stored in the high-speed memory is updated based on the rule conditions stored in the business rule database for the rule to be modified.
[0031] Secondly, this application also provides a rule matching device, comprising:
[0032] The identification and data receiving module is used to receive the service identifier and service data of the service to be matched, and to determine the service scenario corresponding to the service to be matched based on the service identifier;
[0033] The candidate business rule set determination module is used to determine whether a candidate business rule set corresponding to the business scenario exists in a preset high-speed memory based on the business identifier.
[0034] The candidate business rule set acquisition module is configured to, if not existing, determine an initial business rule set corresponding to the business scenario from a preset business rule database, perform a first rule filtering on the initial business rule set to obtain the candidate business rule set, and store the candidate business rule set in the high-speed memory; or...
[0035] The target business rule set acquisition module is used to perform a second rule filtering on the candidate business rule set in the high-speed memory if it exists, so as to obtain the target business rule set corresponding to the business scenario.
[0036] The business rule matching module is used to parse and match the business data based on the business rules in the target business rule set, and return the matched business decision results to the business system.
[0037] Thirdly, this application also provides a server, including: a memory and a processor;
[0038] Memory; memory for storing executable instructions of the processor;
[0039] The processor executes executable instructions stored in the memory to implement the rule matching method as described in the first aspect.
[0040] Fourthly, this application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the rule matching method as described in the first aspect.
[0041] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the rule matching method described in the first aspect of the embodiments of the present invention.
[0042] In the technical solution provided in this application, business personnel pre-store the business rules and corresponding business scenarios for each business scenario in a database. This improves the efficiency of subsequent rule maintenance for business personnel, and developers can directly develop matching logic based on the business rules in the database, reducing a large amount of repetitive work for developers and improving development efficiency as well as the maintenance efficiency of the subsequent business matching system. Furthermore, when receiving business information for a business to be matched, if the business scenario to which the business belongs is determined to be matched for the first time based on the business identifier, the corresponding business rules for that business scenario need to be read from the database. After initial screening, the business rules are placed in high-speed storage so that when a business under that business scenario needs to be matched again, it can be directly matched from the high-speed storage. Conversely, if the business scenario to which the user's business belongs is determined to be matched not to be matched for the first time based on the business identifier, rule screening can continue directly in the high-speed storage. Based on the screened rules, the business data is matched to obtain the decision result regarding that business. Because high-speed memory has the advantage of fast access speed, the rule matching in the above technical solution can improve the rule matching efficiency. Furthermore, the first rule screening is performed before the business rules are put into the high-speed memory to filter out rules that do not meet the first screening condition, and the second screening is performed before matching in the high-speed memory to further filter out rules that do not meet the second condition. This further improves the processing efficiency and matching accuracy of rule matching, thereby achieving the technical effect of improving business processing efficiency. Attached Figure Description
[0043] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0044] Figure 1 An application scenario diagram of the rule matching method provided in this application;
[0045] Figure 2 Another application scenario diagram of the rule matching method provided in this application;
[0046] Figure 3 This is a flowchart illustrating a rule matching method provided in this application according to an exemplary embodiment;
[0047] Figure 4 This is a flowchart illustrating another rule matching method provided in this application according to an embodiment;
[0048] Figure 5 This is a flowchart illustrating another rule matching method provided in this application according to an embodiment;
[0049] Figure 6This is a flowchart illustrating another rule matching method provided in this application according to an exemplary embodiment;
[0050] Figure 7 This is a schematic diagram of the structure of a rule matching device provided in accordance with an exemplary embodiment of this application;
[0051] Figure 8 This application provides a schematic diagram of the structure of a server according to an embodiment of the present application.
[0052] Figure 9 This is a block diagram illustrating another server according to an exemplary embodiment.
[0053] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0054] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0055] It should be noted that 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, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0056] It should be noted that the rule matching method and apparatus of this application can be used in the financial field, or in any field other than the financial field. The application field of the rule matching method and apparatus of this application is not limited.
[0057] With the diversification of banking services, business personnel set corresponding business rules in different business scenarios and systems. When a user conducts a transaction, the business personnel retrieve the corresponding business rules and input them into the matching logic developed by the developers. This matching and calculation yields the appropriate business decision, which the business personnel then use to proceed with the next step. However, managing a massive number of business rules can lead to difficulties for business personnel in finding and maintaining them. Furthermore, if the same business rules are used in multiple scenarios, developers need to repeatedly develop different matching logic within the business system, resulting in significant repetitive work. Therefore, existing business systems suffer from high maintenance costs and slow decision-making speeds due to the large number of business rules and diverse business scenarios.
[0058] The rule matching method provided in this application aims to solve the aforementioned technical problems of the prior art. The technical concept of this application is as follows: Business personnel pre-store business rules and their corresponding business scenarios in a database, which improves the efficiency of subsequent rule maintenance. Furthermore, developers can directly develop matching logic based on the business rules in the database, reducing repetitive work and improving development efficiency as well as the maintenance efficiency of the subsequent business matching system. Further, upon receiving business information for a business to be matched, if the business scenario to which the business belongs is determined to be the first match based on the business identifier, the corresponding business rules for that business scenario need to be read from the database. These rules are then initially filtered and stored in a high-speed memory, so that when another business in the same scenario needs matching, it can be directly matched from the high-speed memory. Conversely, if the business scenario to which the user's business belongs is determined to be the first match based on the business identifier, rule filtering can continue directly in the high-speed memory. The filtered rules are then used to match the business data to obtain a decision result regarding that business. Because high-speed memory has the advantage of fast access speed, the rule matching in the above technical solution can improve the rule matching efficiency. Furthermore, the first rule screening is performed before the business rules are put into the high-speed memory to filter out rules that do not meet the first screening condition, and the second screening is performed before matching in the high-speed memory to further filter out rules that do not meet the second condition. This further improves the processing efficiency and matching accuracy of rule matching, thereby achieving the technical effect of improving business processing efficiency.
[0059] Figure 1 This is a diagram illustrating an application scenario of the rule matching method provided in this application. For example... Figure 1 As shown, it includes terminals and servers. There are at least two terminals. Figure 1In the illustrated embodiment, the terminals include a business terminal 101 for business personnel and a development terminal 102 for developers. The server 103 is pre-configured with a high-speed memory 104 and a database 105. Specifically, business personnel pre-configure business rules for each scenario using the business terminal 101, and integrate multiple business rules for the same scenario into a rule set for that scenario, storing the rule sets corresponding to each business scenario in the pre-configured database 105 on the server 103. Further, developers develop matching logic for different scenarios on the development terminal 102, storing the developed matching logic in the server 103. Specifically, during matching logic development, the business rules stored in the database 105 of the server 103 can be directly called based on the business scenario information. Therefore, when developing matching logic, if the same business rule is used, developers do not need to repeatedly write the business rule, reducing a significant amount of repetitive work. Furthermore, if business personnel modify the business rule later, developers do not need to modify the already written matching logic, improving development and maintenance efficiency. When a business operator receives business information from a user for a service to be matched, they send the information to server 103. If server 103 determines that the business scenario to which the user's service belongs is a first-time match based on the business identifier in the business information, it needs to read the corresponding business rules from database 105, perform initial screening of the business rules, and then store them in high-speed storage 104. Optionally, if the business scenario to which the user's service belongs is not a first-time match, the rules can be further filtered directly in high-speed storage 104. Based on the filtered rules, the business data is matched to obtain a decision result regarding the service, and the decision result is returned to business terminal 101 so that the business operator can provide feedback on the decision result to the user.
[0060] Figure 2 Another application scenario diagram of the rule matching method provided in this application. Optional, such as Figure 2 As shown, the terminal in the application scenario may also include a client 106 corresponding to the user. When performing business matching, the user can directly send business information to the server 103 based on the client 106. After the server 103 gives the decision result, it will directly feed back to the client 106 so that the user can know the decision result in a timely manner.
[0061] It is worth noting that the business terminal and client in this application can be, but are not limited to, various forms of digital computers, such as laptops, desktop computers, workstations, and personal digital assistants. The business terminal and client can also be various forms of mobile devices, such as cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. This application does not limit the form of the terminal equipment for the business terminal and client.
[0062] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These 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 now be described with reference to the accompanying drawings.
[0063] Figure 3 This is a flowchart illustrating a rule matching method provided in this application according to an exemplary embodiment. Figure 3 As shown, the rule matching method provided in this application includes:
[0064] S210. Receive the service identifier and service data of the service to be matched, and determine the service scenario to which the service to be matched belongs based on the service identifier.
[0065] In this embodiment, the service to be matched can be a service that the user is currently subscribed to. The service identifier can be the service code identifier of the service to be matched, which determines the business scenario to which the service to be matched belongs. Different scenarios can be included in different fields. For example, in the telecommunications sector, the service to be matched can be a mobile phone plan or broadband plan that the user is currently subscribed to. In the financial sector, the service to be matched can be a savings card application, credit card application, or other similar service that the user is currently subscribed to. Of course, different business scenarios are also included within the same field. Business data can be understood as the specific parameters subsequently used for matching with business rules, playing a crucial role in the business decision-making outcome.
[0066] Specifically, users can directly input business information related to the business to be matched into the client, which then uploads this information to the server, allowing the server to obtain the business identifier and data of the business to be matched. Optionally, users can also inform business personnel of the above information, who then upload this information to the server via their business terminals. The server then uses this received information to determine the business identifier and data of the business to be matched.
[0067] Optionally, upon receiving the business data and business identifier of the business to be matched, the business scenario corresponding to the business to be matched is determined based on the business identifier, so as to retrieve the business rules corresponding to the business scenario, thereby enabling matching processing based on the business data and business rules.
[0068] Specifically, a pre-defined mapping table of scenario types and identifiers is stored in the server's database. Upon receiving a business identifier, the business identifier is matched against scenarios in the mapping table to determine the corresponding business scenario, thereby identifying the business scenario to which the business to be matched belongs. Optionally, pre-defined fields of the business identifier can also be obtained, and the business scenario corresponding to the business identifier can be determined based on the content of the pre-defined fields and a pre-set type field. For example, when the first field of the business identifier is field 'a', the corresponding business scenario is scenario 1; when the first field is field 'b', the corresponding business scenario is scenario 2. Of course, the above method of determining the business scenario based on the identifier is merely an exemplary description of the technical solution of this application and is not intended to limit the technical solution of this application. This application does not specifically limit the method of determining the business scenario.
[0069] S220. Determine whether a candidate business rule set corresponding to the business scenario exists in the preset high-speed memory based on the business identifier. If not, execute step S230 first, and then continue to execute step S240 after executing step S230; otherwise, if yes, execute step S240 directly.
[0070] In this embodiment, high-speed memory can be understood as a temporary memory with high-speed access. For example, it can be a cache, or other high-speed memory, as long as it has the advantage of fast access speed. This embodiment does not specifically limit the high-speed memory. Therefore, in this embodiment, by performing rule matching processing in high-speed memory, the matching efficiency can be improved. Since rule matching for scenario data of any business scenario requires generating decision results based on the business rules and business data in the business rule set corresponding to the business scenario, it is necessary to pre-generate the business rule set corresponding to each business scenario before matching. Here, the business rule set can be understood as a collection of multiple business rules under the same business scenario, and the business rule can be understood as data of conditions and corresponding decision behaviors. In this application, before implementing the technical solution of this application, a database storing the business rule set can be pre-built in the server. In the database, each rule set exists in the form of a table structure, that is, the business rules and rule set information of each business rule set are stored correspondingly. Furthermore, the multiple business rules contained in the rule set also exist in the form of a table structure, specifically, the conditions and decision results can be stored correspondingly. The candidate business rule set can be understood as the filtering rule set obtained after filtering the rule set corresponding to the business scenario in the database based on preset filtering conditions.
[0071] It should be noted that the pre-built database technical solution in this application facilitates subsequent maintenance of rules by business personnel and maintenance of developed matching logic by developers. For example, when modifying business rules, business personnel can quickly identify and modify the rules by looking up the table. Simultaneously, when developers generate various matching logics by calling the data table, if the rule identifier information remains unchanged, developers do not need to modify the matching logic; if the rule identifier information changes, they only need to modify the calling information, without needing to meticulously modify the specific matching logic. Furthermore, for calls to the same set of rules in different logics, it is not necessary to repeatedly write the specific business rules; only the rule identifier information needs to be called repeatedly. This reduces a significant amount of repetitive work for developers and improves the efficiency of system maintenance.
[0072] Specifically, the candidate business rule set stored in the high-speed memory can be understood as being stored during the previous rule processing. If rule matching has not been performed before, the corresponding candidate business rule set cannot be found in the high-speed memory. In other words, rule matching cannot be performed in the high-speed memory at this time. The candidate business rule set needs to be read from the preset rule database in the server before subsequent matching processing can be performed.
[0073] Therefore, before matching a business to be matched, it is necessary to determine in advance whether the high-speed memory stores a set of candidate business rules corresponding to the business scenario to which the business to be matched belongs.
[0074] Specifically, the corresponding business scenario can be identified through the business identifier. Based on this, it is determined whether a candidate business rule set corresponding to the business scenario exists in the high-speed memory. Optionally, if it does not exist, the candidate business rule set corresponding to the business scenario needs to be read into the high-speed memory, and then rule matching is performed in the high-speed memory based on the candidate business rule set; otherwise, if it exists, rule matching can be directly performed in the high-speed memory based on the candidate business rule set to obtain the decision result.
[0075] S230. Determine the initial business rule set corresponding to the business scenario in the preset business rule database, perform first rule filtering on the initial business rule set to obtain the candidate business rule set, and store the candidate business rule set in the high-speed memory.
[0076] In the embodiments of this application, the first rule can be a pre-set filtering condition, such as a filtering condition for invalid rules, or other filtering conditions, which are not limited thereto.
[0077] Optionally, in order to reduce the amount of data processed during the import of business rule sets into high-speed memory, the business rules corresponding to the business scenario are first read and filtered to obtain candidate business rule sets, and then the candidate business rule sets are stored in high-speed memory.
[0078] Specifically, when the initial business rule set corresponding to the business scenario is found in the database, the business rules in the initial business rule set can be initially screened based on the filtering conditions of the first rule. Rules that do not meet the preset conditions are removed, and the business rules that meet the conditions in the business rule set are formed into a candidate business rule set corresponding to the business scenario. The candidate business rule set is then stored in a high-speed memory.
[0079] S240. Perform a second rule filtering on the candidate business rule set in the high-speed memory to obtain the target business rule set corresponding to the business scenario.
[0080] In this embodiment, the second rule can also be understood as a pre-set filtering condition. It should be noted that the second filtering condition is a different filtering condition from the first filtering condition. Optionally, the second rule can be a filtering condition for a rule that has not yet taken effect; of course, it can also be other filtering conditions, which are not limited thereto.
[0081] Specifically, if it is determined that the high-speed memory stores a set of candidate rules corresponding to the business scenario to which the data to be matched belongs, a second rule is obtained, and the business rules in the set of candidate business rules are filtered again based on the filtering conditions corresponding to the second rule. Business rules that do not meet the filtering conditions of the second rule are removed to obtain the remaining set of business rules. A target set of business rules is formed based on the remaining set of business rules, and the business data is matched based on the target set of business rules to obtain a decision result.
[0082] S250. Based on the business rules in the target business rule set, the business data is parsed and matched, and the matched business decision results are returned to the business system.
[0083] In this embodiment of the application, based on the acquisition of the target business rule set, the business data received by the server is matched according to the target business rule set to obtain the decision result after matching processing, and the decision result is returned to the business system so that the user can know the decision result corresponding to the data to be matched.
[0084] Specifically, based on the preset rule priority, the matching order of each business rule in the target rule set is determined, and the first business rule used for matching is determined based on the above matching order. This business rule is then matched with the business data. If the match is successful, the decision result corresponding to the business rule is used as the decision result of the business to be matched; otherwise, if the first business rule fails to match the business data of the business to be matched, the second business rule is sequentially matched with the business data of the business to be matched; if the match still fails, the next business rule is matched sequentially until a match is successful, and the decision result of the business to be matched is obtained.
[0085] It should be noted that the business system can be a business system set up on the business terminal of the business personnel. In this case, when the business system receives the decision result corresponding to the business to be matched, the business personnel can forward the decision result to the corresponding user so that the user can know the decision result corresponding to the business to be matched. Alternatively, the business system can also be a business system set up on the client side. In this case, when the client's business system receives the decision result returned by the server, the user can directly know the decision result corresponding to the business to be matched.
[0086] In the above technical solution, business personnel pre-store the business rules and their corresponding business scenarios in the database. This improves the efficiency of rule maintenance and allows developers to directly develop matching logic based on the business rules in the database, reducing repetitive work and improving development and maintenance efficiency of the business matching system. Furthermore, upon receiving business information for a business to be matched, if the business scenario is determined to be the first match based on the business identifier, the corresponding business rules for that scenario are retrieved from the database. These rules are then initially filtered and stored in high-speed memory for future matching of businesses within the same scenario. Conversely, if the business scenario is not the first match based on the business identifier, rule filtering continues in the high-speed memory. The filtered rules are then used to match the business data, yielding a decision regarding the business. Because high-speed memory has the advantage of fast access speed, the rule matching in the above technical solution can improve the rule matching efficiency. Furthermore, the first rule screening is performed before the business rules are put into the high-speed memory to filter out rules that do not meet the first screening condition, and the second screening is performed before matching in the high-speed memory to further filter out rules that do not meet the second condition. This further improves the processing efficiency and matching accuracy of rule matching, thereby achieving the technical effect of improving business processing efficiency.
[0087] Figure 4This is a flowchart illustrating another rule matching method provided in this application according to an embodiment. See also... Figure 4 This embodiment can be understood as a specific description of the steps mentioned in the methods described in the above embodiments, and may specifically include:
[0088] S310: Receive the service identifier and service data of the service to be matched, and determine the service scenario to which the service to be matched belongs based on the service identifier.
[0089] Specifically, for the understanding and examples of the technical means, technical effects and technical terms in step S310, please refer to the explanation of step S210 in the above embodiments, which will not be repeated in this embodiment.
[0090] S320. Determine whether a set of candidate business rules corresponding to a business scenario exists in a preset high-speed memory based on the business identifier.
[0091] For an understanding and example of the technical means, technical effects, and technical terms in step S320, please refer to the explanation of step S220 in the above embodiments.
[0092] Based on the above implementation method, in this embodiment, the determination step in step S320 may specifically include:
[0093] S321. Obtain the scene and rule set mapping cache table stored in the high-speed memory, and match the rule set corresponding to the business identifier in the scene and rule set mapping cache table.
[0094] In this embodiment, the scenario-rule set mapping cache table can be understood as a mapping table pre-built in high-speed memory that associates and stores scenarios and rule sets. Specifically, this high-speed memory mapping table includes candidate business rule sets and rule set information stored in high-speed memory; specifically, the rule set information may include business scenario information corresponding to the candidate business rule sets. For example, the business scenario information may include a business identifier, that is, the business identifier and the candidate business rule set are stored in the scenario-rule set mapping table.
[0095] Specifically, when the high-speed memory receives a service identifier, it matches the service identifier with the identifiers stored in the high-speed memory table of the above-mentioned scenario and rule mapping to achieve the matching of the rule set corresponding to the service identifier.
[0096] S322. Determine if the match was successful.
[0097] If the matching fails, it means that there is no candidate business rule set corresponding to the business scenario in the high-speed memory. Step S330 needs to be executed first, and then step S340 needs to be executed.
[0098] If a match is successful, it means that there is a set of candidate business rules corresponding to the business scenario in the high-speed memory, and step S340 can be executed directly.
[0099] Specifically, the received service identifier is compared with each service identifier stored in the high-speed mapping memory table. If a matching service identifier is found in the high-speed mapping memory table, the match is successful. The high-speed memory service rule set corresponding to the service identifier in the high-speed mapping memory table is then used as the rule set for matching the received service identifier, and subsequent rule matching is performed directly. That is, step S340 can be executed directly.
[0100] Optionally, if none of the service identifiers stored in the high-speed memory table match the received service identifiers, it indicates a mismatch. In this case, the high-speed memory does not store the candidate rule set corresponding to the received service identifier, and the candidate service rule set needs to be retrieved from the database and stored in the high-speed memory. That is, step S330 needs to be executed first, and then step S340 needs to be executed.
[0101] S330. Determine the initial business rule set corresponding to the business scenario in the preset business rule database, perform first rule filtering on the initial business rule set to obtain a candidate business rule set, and store the candidate business rule set in a high-speed memory, and then perform subsequent rule matching.
[0102] Specifically, for the understanding and examples of the technical means, technical effects, and technical terms in step S330, please refer to the explanation of step S230 in the above embodiments.
[0103] Based on the above implementation method, in this embodiment, step S330 may specifically include:
[0104] S331. Obtain the scenario and rule mapping database table stored in the business rule database, and determine the initial business rule set corresponding to the business scenario based on the business identifier and the scenario and rule mapping database table.
[0105] In this embodiment, the business rule database can be understood as a database pre-built by the server for storing business rules. After business personnel set multiple business rules on the business terminal, they generate a rule set data table for each set business rule and upload the data table to the business rule database. Specifically, the database also pre-builds scenario and rule set mapping tables. The scenario-to-rule set mapping table can be understood as a mapping table pre-built on the server that associates and stores scenarios and rule sets. Specifically, this mapping table includes the initial business rule set and rule set information stored on the server; specifically, the rule set information may include business scenario information corresponding to the initial business rule set. For example, the business scenario information may include a business identifier, that is, the business identifier in the scenario-to-rule set mapping table is stored corresponding to the initial business rule set.
[0106] Specifically, the received service identifier is compared with the service identifiers stored in the mapping database table. If a matching service identifier is found in the mapping database table, the match is successful, and the candidate service rule set corresponding to the service identifier in the mapping database table is used as the initial service rule set for matching the received service identifier.
[0107] Optionally, if the business identifiers stored in the mapping database are inconsistent with the received business identifiers, it indicates that the match was unsuccessful. In this case, the server does not store the initial rule set corresponding to the received business identifier. The system can then report the business scenario that no matching business was found and generate a message indicating whether the business identifier was entered correctly. This allows business personnel or users to check the business information and re-match the modified business information, ultimately successfully completing the business matching and obtaining the decision result.
[0108] S332. Determine the rule status of each business rule in the initial business rule set; wherein, the rule status includes activation status and expiration status; activation status includes activated status and inactivated status; expiration status includes inactive status, valid status and expired status.
[0109] In this embodiment, business personnel configure the rule status of each business rule during rule configuration to control whether the business rule can be executed for matching based on the rule status. Specifically, the rule status in this application includes an active status and a time-limited status; the active status includes an activated status and an inactive status; the time-limited status includes an ineffective status, a valid status, and an expired status. The active status indicates whether the business rule is activated. Specifically, an activated status indicates that the business rule can be used for business matching in the current state; conversely, an inactive status indicates that the business rule cannot be used for business matching at present. Furthermore, business personnel can set time limits for the rule status to flexibly control the use of business rules. Specifically, the time-limited status indicates whether the business rule is within its validity period. Specifically, an ineffective status indicates that the effective start time of the business rule is later than the current time, meaning it will take effect in the future and will be available in the future, but cannot be used in the current time. An expired status indicates that the effective end time of the business rule is earlier than the current time, meaning it was available before but cannot be used in the current period. The "valid" status indicates that the earliest effective time of this business rule is earlier than the current time, and the latest effective time is later than the current time, meaning it can be used within the current time frame.
[0110] Specifically, the status field representing the rule status is searched in the rule information stored in the business rule data table, and the rule status of each business rule in the initial business rule set is determined based on the status field.
[0111] S333. Remove business rules that are inactive or invalid from the initial business rule set to obtain the candidate business rule set corresponding to the business scenario.
[0112] In this embodiment, after determining the rule status of each business rule in the initial business rule set based on the above implementation method, a first rule is set to filter out business rules in the initial business rule set that are inactive or invalid. Further, rule filtering is performed based on the above filtering rule, and the filtered business rules are taken as the business rules to be removed from the initial business rule set. These filtered business rules are then removed to obtain a candidate business rule set.
[0113] In the above technical solution, business rules that are in an inactive or invalid state are selected as the first rule and then eliminated after selection to obtain a candidate business rule set. By eliminating business rules that cannot be used for business matching, the amount of data processed in the process of storing rules in high-speed memory is reduced, and the storage space in high-speed memory can be reduced, thereby improving business matching efficiency and business system maintenance efficiency.
[0114] S340. Perform a second rule filtering on the candidate business rule set in the high-speed memory to obtain the target business rule set corresponding to the business scenario.
[0115] Specifically, for the understanding and examples of the technical means, technical effects, and technical terms in step S340, please refer to the explanation of step S240 in the above embodiments.
[0116] Based on the above implementation method, in this embodiment, step S340 may specifically include:
[0117] S341. In the high-speed memory, identify the business rules in the candidate business rule set that are inactive, and remove the business rules in the inactive state to obtain the target business rule set corresponding to the business scenario.
[0118] In this embodiment, if the high-speed memory contains a set of candidate business rules based on the above implementation method, the rule status of each business rule in the candidate business rule set is determined, and a second rule is set to filter out business rules in an inactive state from the initial business rule set. Further, rule filtering is performed based on the above filtering conditions, and the filtered business rules are taken as the business rules to be eliminated from the candidate business rule set. These filtered business rules are then eliminated to obtain the target business rule set.
[0119] In the above technical solution, business rules that are not in effect are selected as the second rule and then removed after filtering to obtain the target business rule set. By further removing business rules that cannot be matched in the current time, the amount of data processing in the rule matching process is reduced, thereby improving the matching efficiency.
[0120] S350. Based on the business rules in the target business rule set, the business data is parsed and matched, and the matched business decision results are returned to the business system.
[0121] Specifically, for the understanding and examples of the technical means, technical effects and technical terms in step S350, please refer to the explanation of step S250 in the above embodiments, which will not be repeated in this embodiment.
[0122] In the above technical solution, upon receiving business information for a service to be matched, if the business scenario to which the service belongs is determined to be matched for the first time based on the business identifier, the corresponding business rules for that business scenario need to be retrieved from the database. These rules are then initially filtered and stored in a high-speed memory so that when services in the same scenario require matching later, they can be directly matched from the high-speed memory. Furthermore, business rules in an inactive or invalid state are selected as the first rules and then removed after filtering, resulting in a candidate set of business rules. By removing business rules that cannot be used for matching, the amount of data processed during rule storage in the high-speed memory is reduced, and the storage space in the high-speed memory is also reduced, improving business matching efficiency and business system maintenance efficiency. Conversely, if the business scenario to which the user's service belongs is determined to be matched based on the business identifier is not the first time matching, rule filtering can continue directly in the high-speed memory. Business rules in an inactive state are selected as the second rules and then removed after filtering, resulting in a target set of business rules. By further removing business rules that cannot be matched in the current time, the amount of data processed during rule matching is reduced, thereby improving matching efficiency and achieving the technical effect of improving business processing efficiency.
[0123] Figure 5 This is a flowchart illustrating another rule matching method provided in this application according to an embodiment. See also... Figure 5 This embodiment can be understood as a specific description of the steps mentioned in the methods described in the above embodiments, and may specifically include:
[0124] S410: Receive the service identifier and service data of the service to be matched, and determine the service scenario to which the service to be matched belongs based on the service identifier.
[0125] Specifically, for the understanding and examples of the technical means, technical effects and technical terms in step S410, please refer to the explanation of step S210 in the above embodiments, which will not be repeated in this embodiment.
[0126] S420. Based on the service identifier, determine whether a candidate service rule set corresponding to the service scenario exists in the preset high-speed memory. If it does not exist, first execute step S430, and then continue to execute step S440 after executing step S430; otherwise, directly execute step S440.
[0127] Specifically, for the understanding and examples of the technical means, technical effects and technical terms in step S420, please refer to the explanation of steps S220 and S321-S322 in the above embodiments, which will not be repeated in this embodiment.
[0128] S430. Determine the initial business rule set corresponding to the business scenario in the preset business rule database, perform first rule filtering on the initial business rule set to obtain the candidate business rule set, and store the candidate business rule set in the high-speed memory.
[0129] Specifically, for the understanding and examples of the technical means, technical effects and technical terms in step S430, please refer to the explanation of steps S230 and S331-S333 in the above embodiments, which will not be repeated in this embodiment.
[0130] S440. Perform a second rule filtering on the candidate business rule set in the high-speed memory to obtain the target business rule set corresponding to the business scenario.
[0131] Specifically, for the understanding and examples of the technical means, technical effects and technical terms in step S440, please refer to the explanation of steps S240 and S341 in the above embodiments, which will not be repeated in this embodiment.
[0132] S450. Based on the business rules in the target business rule set, the business data is parsed and matched, and the matched business decision results are returned to the business system.
[0133] For an understanding and example of the technical means, technical effects, and technical terms in step S450, please refer to the explanation of step S250 in the above embodiments.
[0134] Based on the above implementation method, in this embodiment, step S450 may specifically include:
[0135] S451. For any business rule, determine the rule conditions of the current business rule.
[0136] In this embodiment, since each business rule is stored in the database in a table structure, and each business rule includes rule conditions and corresponding decision behaviors, the rule conditions in the database can be found based on the rule information of the business rule. For example, in a payment scenario, the decision rows corresponding to the rule conditions of each business rule in the target business rule set include: payment amounts that meet the first numerical range, such as less than one thousand, with the payment amount remaining unchanged; payment amounts that meet the second numerical range, such as greater than one thousand but less than five thousand, with the payment amount reduced by ten percent; and payment amounts that meet the third numerical range, such as greater than five thousand, with the payment amount reduced by fifteen percent.
[0137] S452. Obtain the preset rule parser, and based on the rule parser and rule conditions, parse and generate the rule expression of the current business rule, and perform matching processing on the business data based on the rule expression.
[0138] In the embodiments of the present application, the preset rule parser may include, but is not limited to, the Aviator text parser. Specifically, input the rule conditions of any business rule into the above parser to obtain the parsed rule expression as the output. Exemplarily, based on the rule conditions mentioned in S451 above, the business rule expressions in the target business rule set may be: (date<1000)||(1000<date<5000)||(date>5000). It should be noted that there are three business rules in the above expression.
[0139] It should be noted that in the present application, all business rules in the target business rule set can be parsed jointly, or each business rule in the target business rule set can be parsed separately, and the parsing method is not limited.
[0140] It should also be noted that in the present application, the parsing of rule conditions can not only support the parsing of regular expressions, but also support custom functions. Business personnel can increase the parsing methods of rules by extending functions to implement the corresponding parsing of rule conditions.
[0141] In the above embodiment, based on the preset parser for rule condition parsing, it is easy for developers to transition and transplant, and the learning curve is very low, reducing the requirements for the professional capabilities of developers.
[0142] S453. Determine whether the match is successful.
[0143] If the match is successful, execute step S454; otherwise, return to step S451 to continue parsing and matching the next business rule until the business decision result of the data to be matched is obtained successfully, and return the business decision result to the business system.
[0144] In the embodiments of the present application, after obtaining the parsed expression of the rule conditions, match the expression of the rule conditions with the business data of the business to be matched.
[0145] Exemplarily, still taking the data in the above steps as an example, if the input business data is 3000, then match the business data with the first rule (date<1000). It can be seen that the data does not meet the condition range, so the match is unsuccessful. Further, continue to match the next business rule (1000<date<5000), and the data meets the condition range, so the match is successful.
[0146] S454. Use the decision result corresponding to the current business rule as the business decision result of the data to be matched, and return the business decision result to the business system.
[0147] In this embodiment of the application, if the business data of the business to be matched and the rule conditions of the business rule are successfully matched, the decision result corresponding to the rule is taken as the decision result corresponding to the business to be matched, and the decision result is returned to the business system so that the user can know the decision result corresponding to the data to be matched.
[0148] It should be noted that this application embodiment supports two decision-making forms: the decision result can be returned after parsing an expression, or it can be returned directly as a string.
[0149] In the above technical solution, rule matching is performed in a high-speed memory, which improves the matching efficiency. Furthermore, a second filtering process is performed before matching in the high-speed memory to further filter out rules that do not meet the second condition, thereby improving the processing efficiency and accuracy of rule matching, and ultimately enhancing business processing efficiency. Moreover, by first parsing the business rules during the matching process and then matching the parsed expressions with the business parameters, business decision results can be obtained quickly and accurately, further improving matching efficiency and accuracy.
[0150] Figure 6 This is a flowchart illustrating another rule matching method provided by this application according to an exemplary embodiment. This embodiment can be understood as an extended embodiment that expands upon the technical solution of the application based on the above embodiments. See also... Figure 6 The method in this embodiment may specifically include:
[0151] S510: Receive the service identifier and service data of the service to be matched, and determine the service scenario to which the service to be matched belongs based on the service identifier.
[0152] Specifically, for the understanding and examples of the technical means, technical effects and technical terms in step S510, please refer to the explanation of step S210 in the above embodiments, which will not be repeated in this embodiment.
[0153] S520. Based on the service identifier, determine whether a candidate service rule set corresponding to the service scenario exists in the preset high-speed memory. If it does not exist, first execute step S230, and then continue to execute step S240 after executing step S230; otherwise, directly execute step S240.
[0154] Specifically, for the understanding and examples of the technical means, technical effects and technical terms in step S520, please refer to the explanation of steps S220 and S321-S322 in the above embodiments, which will not be repeated in this embodiment.
[0155] S530. Determine the initial business rule set corresponding to the business scenario in the preset business rule database, perform first rule filtering on the initial business rule set to obtain the candidate business rule set, and store the candidate business rule set in the high-speed memory.
[0156] Specifically, for the understanding and examples of the technical means, technical effects and technical terms in step S530, please refer to the explanation of steps S230 and S331-S333 in the above embodiments, which will not be repeated in this embodiment.
[0157] S540. Perform a second rule filtering on the candidate business rule set in the high-speed memory to obtain the target business rule set corresponding to the business scenario.
[0158] Specifically, for the understanding and examples of the technical means, technical effects and technical terms in step S540, please refer to the explanation of steps S240 and S341 in the above embodiments, which will not be repeated in this embodiment.
[0159] S550: Based on the business rules in the target business rule set, the business data is parsed and matched, and the matched business decision results are returned to the business system.
[0160] For an understanding and example of the technical means, technical effects, and technical terms in step S550, please refer to the explanation of steps S250 and S451-S454 in the above embodiments. They will not be repeated in this embodiment.
[0161] S560. In the high-speed memory, identify the business rules in the target business rule set that are in an invalid state, and remove the business rules in the invalid state to obtain the updated target business rule set.
[0162] In this embodiment, since the various services stored in the high-speed memory may become invalid over time, the rule status of each service rule in the high-speed memory can be retrieved again at preset time intervals. The rules in the target rule set that are in an invalid state can be identified as rules to be removed, and these rules to be removed can be removed to update the target rule set and obtain the updated target service rule set corresponding to each service scenario.
[0163] In the above technical solution, by removing the business rules that are in an invalid state from the high-speed memory, an updated target business rule set can be obtained, which can further reduce the storage space in the high-speed memory and improve the resource utilization of the high-speed memory.
[0164] Based on the above embodiments, the technical solution of this application embodiment further includes: determining the rule identifier of the rule to be modified based on the preset modification event table in the business rule database, and determining whether the rule to be modified is stored in the high-speed memory based on the rule identifier; if it exists, updating the rule information stored in the high-speed memory based on the rule conditions of the rule to be modified stored in the business rule database.
[0165] In this embodiment, business personnel can also modify the business rules stored in the server's database and simultaneously update the business rules in the high-speed storage to ensure data storage consistency and thus guarantee the accuracy of subsequent rule matching. For example, rule modification can include adding, modifying, and deleting rules.
[0166] Specifically, a rule modification interface is pre-configured in the business terminal, allowing business personnel to modify business rules. Furthermore, after business personnel modify business rules in the rule set using the modification interface, the specific modifications can be recorded in a pre-configured event table. For example, the event table may record fields including, but not limited to, modification name and unique identifier of the rule set.
[0167] Optionally, in this embodiment, the storage format of the rule set in the high-speed memory can be a map. Specifically, the key is a unique identifier composed of three fields: rule set name, module, and type. The above identifier is also the three field values that need to be entered when matching business rules. The value is all the information of the rule set and associated rules.
[0168] Furthermore, the server can configure the polling time. Specifically, when the polling time arrives, the server can create a scheduled task to read the newly added events in the event table. Then, it uses the key value to determine whether the modified business rule set in the event table exists in the high-speed storage. If it does not exist, no high-speed storage update is needed; otherwise, if it exists, the corresponding business rule set and business rules are deleted from the high-speed storage. Finally, the modified business rule set and business rules are retrieved from the business rule database and read into the high-speed storage, completing the synchronization and update of the high-speed storage and ensuring data consistency between the high-speed storage and the server's business rule database.
[0169] It should be noted that when polling the event table, the server can record the maximum time ID obtained in this poll. When the next polling occurs, it will start polling from the maximum event ID recorded last time, avoiding a full table scan of the event table, reducing the number of scans and improving processing efficiency.
[0170] In the above technical solution, business personnel can modify the business rule set or rule data. While the server is refining the business rules in the database, it will also update the business rule stored in the high-speed storage to ensure the consistency of the data stored in the high-speed storage and the database, thereby improving the matching accuracy when performing rule matching in the future.
[0171] Figure 7 This is a schematic diagram of a rule matching device provided in this application according to an exemplary embodiment. See also... Figure 7 The device includes: an identification and data receiving module 610, a candidate service rule set determination module 620, a candidate service rule set acquisition module 630, a target service rule set acquisition module 640, and a service rule matching module 650; wherein,
[0172] The identification and data receiving module 610 is used to receive the service identifier and service data of the service to be matched, and to determine the service scenario corresponding to the service to be matched based on the service identifier.
[0173] The candidate business rule set determination module 620 is used to determine whether a candidate business rule set corresponding to a business scenario exists in a preset high-speed memory based on the business identifier;
[0174] The candidate business rule set acquisition module 630 is used to, if the rule set does not exist, determine the initial business rule set corresponding to the business scenario from a preset business rule database, perform a first rule filtering on the initial business rule set to obtain a candidate business rule set, and store the candidate business rule set in a high-speed memory; or...
[0175] The target business rule set acquisition module 640 is used to perform a second rule filtering on the candidate business rule set in the high-speed memory if it exists, so as to obtain the target business rule set corresponding to the business scenario.
[0176] The business rule matching module 650 is used to parse and match business data based on the various business rules in the target business rule set, and return the matched business decision results to the business system.
[0177] Optionally, the candidate business rule set determination module 620 can be used for:
[0178] Retrieve the scenario and rule set mapping cache table stored in the high-speed memory, and match the rule set corresponding to the business identifier in the scenario and rule set mapping cache table;
[0179] If a match is successful, it means that a candidate set of business rules corresponding to the business scenario exists in the high-speed memory; if a match is unsuccessful, it means that a candidate set of business rules corresponding to the business scenario does not exist in the high-speed memory.
[0180] Optionally, the candidate business rule set acquisition module 630 can be used for:
[0181] Obtain the scenario and rule mapping database table stored in the business rules database, and determine the initial business rule set corresponding to the business scenario based on the business identifier and the scenario and rule mapping database table;
[0182] Determine the rule status of each business rule in the initial business rule set; the rule status includes activation status and expiration status; the activation status includes activated status and inactivated status; the expiration status includes inactive status, valid status and expired status.
[0183] Remove business rules that are inactive or invalid from the initial business rule set to obtain the candidate business rule set corresponding to the business scenario.
[0184] Optionally, the target business rule set acquisition module 640 can be used for:
[0185] In the high-speed memory, identify the business rules in the candidate business rule set that are inactive, and remove the business rules in the inactive state to obtain the target business rule set corresponding to the business scenario.
[0186] Optional, the business rule matching module 650 can be used for:
[0187] For any given business rule, determine the rule conditions for the current business rule;
[0188] Obtain a preset rule parser, parse and generate a rule expression for the current business rule based on the rule parser and rule conditions, and perform matching processing on the business data based on the rule expression;
[0189] If a match is successful, the decision result corresponding to the current business rule will be used as the business decision result for the data to be matched, and the business decision result will be returned to the business system.
[0190] If the match fails, continue parsing and matching the next business rule until a match is successful to obtain the business decision result of the data to be matched, and then return the business decision result to the business system.
[0191] Optionally, the device is also used for:
[0192] In the high-speed memory, identify the business rules in the target business rule set that are in an invalid state, and remove the business rules in the invalid state to obtain the updated target business rule set.
[0193] Optionally, the device is also used for:
[0194] The rule identifier of the rule to be modified is determined based on the preset modification event table in the business rule database, and the rule identifier is used to determine whether the rule to be modified is stored in the high-speed memory.
[0195] If it exists, the rule information stored in the high-speed storage is updated based on the rule conditions stored in the business rule database for the rule to be modified.
[0196] Figure 8 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Figure 8 As shown, the server in this embodiment may include:
[0197] At least one processor 701; and
[0198] Memory 702 communicatively connected to at least one processor;
[0199] The memory 702 stores instructions that can be executed by at least one processor 701, which, when executed by at least one processor 701, cause the server to perform the method as described in any of the above embodiments.
[0200] Alternatively, the memory 702 can be either standalone or integrated with the processor 701.
[0201] The implementation principle and technical effects of the server provided in this embodiment can be found in the foregoing embodiments, and will not be repeated here.
[0202] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method of any of the foregoing embodiments.
[0203] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method of any of the foregoing embodiments.
[0204] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.
[0205] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0206] 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), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor. The memory may include high-speed RAM, and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.
[0207] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0208] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components within a server or host device.
[0209] Figure 9 This is a block diagram illustrating another server according to an exemplary embodiment. Figure 9 In this context, the server can be a blade server, a mainframe computer, or other suitable computer.
[0210] Server 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input / output (I / O) interface 812, sensor component 814, and communication component 816.
[0211] Processing component 802 typically controls the overall operation of server 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0212] Memory 804 is configured to store various types of data to support the operation of server 800. Examples of this data include instructions for any application or method operating on server 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0213] Power supply component 806 provides power to various components of server 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to server 800.
[0214] Multimedia component 808 includes a screen that provides an output interface between server 800 and user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When server 800 is in an operating mode, such as a shooting mode or video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0215] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when server 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0216] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0217] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of server 800. For example, sensor assembly 814 can detect the on / off state of server 800, the relative positioning of components such as the display and keypad of server 800, changes in the position of server 800 or a component of server 800, the presence or absence of user contact with server 800, the orientation or acceleration / deceleration of server 800, and temperature changes of server 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0218] Communication component 816 is configured to facilitate wired or wireless communication between server 800 and other devices. Server 800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0219] In an exemplary embodiment, server 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0220] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0221] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A rule matching method characterized by, include: Receive the service identifier and service data of the service to be matched, and determine the service scenario to which the service to be matched belongs based on the service identifier; Based on the service identifier, determine whether a candidate service rule set corresponding to the service scenario exists in the preset high-speed memory; If it does not exist, the initial business rule set corresponding to the business scenario is determined in the preset business rule database, the initial business rule set is filtered by the first rule to obtain the candidate business rule set, and the candidate business rule set is stored in the high-speed memory. or, If it exists, the candidate business rule set is filtered by a second rule in the high-speed memory to obtain the target business rule set corresponding to the business scenario; The business data is parsed and matched based on the business rules in the target business rule set, and the matched business decision results are returned to the business system. The step of determining whether a candidate service rule set corresponding to the service scenario exists in a preset high-speed memory based on the service identifier includes: Obtain the scenario and rule set mapping cache table stored in the high-speed memory, and match the rule set corresponding to the service identifier in the scenario and rule set mapping cache table; If a match is successful, it means that a candidate business rule set corresponding to the business scenario exists in the high-speed memory; if a match is unsuccessful, it means that a candidate business rule set corresponding to the business scenario does not exist in the high-speed memory. The step of determining the initial business rule set corresponding to the business scenario in a preset business rule database, and performing a first rule filtering on the initial business rule set to obtain the candidate business rule set includes: Obtain the scenario and rule mapping database table stored in the business rule database, and determine the initial business rule set corresponding to the business scenario based on the business identifier and the scenario and rule mapping database table; The rule status of each business rule in the initial business rule set is determined; wherein, the rule status includes an active status and a time-limited status; the active status includes an activated status and an inactive status; the time-limited status includes an inactive status, a valid status, and an expired status; Remove business rules that are inactive or invalid from the initial business rule set to obtain a candidate business rule set corresponding to the business scenario. The second rule filtering of the candidate service rule set in the high-speed memory includes: In the high-speed memory, the business rules that are inactive in the candidate business rule set are determined and removed to obtain the target business rule set corresponding to the business scenario.
2. The method of claim 1, wherein, The process involves parsing and matching the business data based on the various business rules in the target business rule set, and then generating the matching business decision results, including: For any given business rule, determine the rule conditions for the current business rule; Obtain a preset rule parser, and based on the rule parser and the rule conditions, parse and generate a rule expression for the current business rule, and perform matching processing on the business data based on the rule expression; If a match is successful, the decision result corresponding to the current business rule will be used as the business decision result for the data to be matched, and the business decision result will be returned to the business system. If the match fails, continue parsing and matching the next business rule until a match is successful to obtain the business decision result of the data to be matched, and then return the business decision result to the business system.
3. The method according to claim 2, characterized in that, After returning the business decision results to the business system, the process also includes: In the high-speed memory, the business rules in the target business rule set that are in an invalid state are identified and removed to obtain an updated target business rule set.
4. The method according to any of claims 1 to 3, characterized in that, The method further includes: The rule identifier of the rule to be modified is determined based on the preset modification event table in the business rule database, and the rule identifier is used to determine whether the rule to be modified is stored in the high-speed memory. If it exists, the rule information stored in the high-speed memory is updated based on the rule conditions stored in the business rule database for the rule to be modified.
5. A rule matching apparatus characterized by comprising: include: The identification and data receiving module is used to receive the service identifier and service data of the service to be matched, and to determine the service scenario corresponding to the service to be matched based on the service identifier; The candidate business rule set determination module is used to determine whether a candidate business rule set corresponding to the business scenario exists in a preset high-speed memory based on the business identifier. The candidate business rule set acquisition module is used to determine the initial business rule set corresponding to the business scenario in a preset business rule database if the rule set does not exist, perform a first rule filtering on the initial business rule set to obtain the candidate business rule set, and store the candidate business rule set in the high-speed memory. or, The target business rule set acquisition module is used to perform a second rule filtering on the candidate business rule set in the high-speed memory if it exists, so as to obtain the target business rule set corresponding to the business scenario. The business rule matching module is used to parse and match the business data based on the business rules in the target business rule set, and return the matched business decision results to the business system. The candidate business rule set determination module is specifically used for: Obtain the scenario and rule set mapping cache table stored in the high-speed memory, and match the rule set corresponding to the service identifier in the scenario and rule set mapping cache table; If a match is successful, it means that a candidate business rule set corresponding to the business scenario exists in the high-speed memory; if a match is unsuccessful, it means that a candidate business rule set corresponding to the business scenario does not exist in the high-speed memory. The candidate business rule set acquisition module is specifically used for: Obtain the scenario and rule mapping database table stored in the business rule database, and determine the initial business rule set corresponding to the business scenario based on the business identifier and the scenario and rule mapping database table; The rule status of each business rule in the initial business rule set is determined; wherein, the rule status includes an active status and a time-limited status; the active status includes an activated status and an inactive status; the time-limited status includes an inactive status, a valid status, and an expired status; Remove business rules that are inactive or invalid from the initial business rule set to obtain a candidate business rule set corresponding to the business scenario. The target business rule set acquisition module is specifically used for: In the high-speed memory, the business rules that are inactive in the candidate business rule set are determined and removed to obtain the target business rule set corresponding to the business scenario.
6. A server, characterized by include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 4.