Business data rule judgment method, device, equipment and storage medium
By independently configuring and judging each condition in the business data rule judgment system, the problem in the existing technology that a single condition change requires updating the entire rule is solved, and the scalability and back-end linkage capabilities of the rules are improved.
Patent Information
- Application Number
- CN202011356700.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-26
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2040-11-26
AI Technical Summary
In the existing technology, a change in a single condition requires updating the configuration data of the entire rule, resulting in poor scalability of the rule and difficulty in linking with the backend.
By determining the target rules corresponding to the target business functions, obtain the condition configuration data corresponding to the target rules, and judge whether these conditions are met based on the business data, and obtain the rule judgment results. Each condition has independent configuration data, and only needs to be updated when modifying or adding conditions. The corresponding configuration data does not affect other conditions.
It improves the scalability of rules, prevents a single condition change from affecting the entire rule, and enhances the linkage ability with the back-end system.
Smart Images

Figure CN112434952B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of rule judgment, and in particular to a business data rule judgment method, device, equipment and storage medium. Background Art
[0002] The rules and regulations set by the enterprise are to control the behavior of employees. For example, the rules and regulations set by the enterprise may include enterprise attendance rules and regulations, enterprise car rules and regulations, or enterprise welfare rules and regulations. Take the enterprise car rules and regulations as an example to illustrate. In the rules and regulations of enterprise car use, managers are required to set specific rules and regulations on the B-end, and the management and control system must be able to automatically determine the rules and regulations when users use the car on the C-end.
[0003] Since each company has different management demands, managers of different companies will set up a variety of rules and regulations. Some companies even have the need for customized rules and regulations. How to ensure that each company can quickly configure the desired rules and regulations, and how to ensure that new rules and regulations do not affect each other, this brings great challenges to technical colleagues; in the existing technology, most rules and regulations are stored in the form of configuration data of the entire rule.
[0004] However, this configuration and storage method requires that changes to a single condition require updating the data corresponding to the entire rule, resulting in poor scalability of the rules and difficulty in linking with the backend. Summary of the invention
[0005] In view of this, the purpose of this application is to provide a business data rule judgment method, device, equipment and storage medium, which can solve the problem in the prior art that changes to a single condition require updating the configuration data of the entire rule, resulting in poor rule scalability and difficulty in linking with the back end, thereby achieving the effect of improving the scalability of the rules.
[0006] In a first aspect of the present application, the present application provides a method for determining business data rules, the method comprising:
[0007] Determine the target rules corresponding to the target business functions;
[0008] According to the target rule, obtaining configuration data of at least one condition corresponding to the target rule;
[0009] According to the configuration data of the at least one condition, respectively judging whether the service data of the target service function meets the at least one condition, and obtaining a judgment result of the at least one condition;
[0010] According to the judgment result of the at least one condition, a rule judgment result of the target business function is obtained.
[0011] Optionally, obtaining a rule judgment result of the target business function according to the judgment result of the at least one condition includes:
[0012] A Boolean aggregation operation is performed on the judgment result of the at least one condition to obtain the rule judgment result.
[0013] Optionally, judging respectively whether the service data of the target service function meets the at least one condition according to the configuration data of the at least one condition, and obtaining the judgment result of the at least one condition includes:
[0014] According to the configuration data of the at least one condition, in a concurrent execution manner, it is respectively determined whether the business data of the target business function meets the at least one condition, and a determination result of the at least one condition is obtained.
[0015] Optionally, the at least one condition includes: a complex condition, the complex condition includes: a plurality of single conditions; the determining, based on the configuration data of the at least one condition, whether the business data of the target business function satisfies the at least one condition, and obtaining the determination result of the at least one condition includes:
[0016] According to the configuration data of the multiple single conditions, respectively judging whether the business data satisfies the multiple single conditions, and obtaining judgment results of the multiple single conditions;
[0017] Perform an OR logic operation on the judgment results of the multiple single conditions to obtain the judgment result of the complex condition.
[0018] Optionally, judging respectively whether the service data satisfies the multiple single conditions according to the configuration data of the multiple single conditions to obtain the judgment results of the multiple single conditions includes:
[0019] According to the configuration data of the multiple single conditions, it is recursively determined whether the business data satisfies the multiple single conditions, and the determination results of the multiple single conditions are obtained.
[0020] Optionally, the configuration data of each single condition in the at least one condition includes: configuration parameters of each single condition, matching method of each single condition, parameters to be matched of each single condition, and control method of each single condition;
[0021] The step of determining, based on the configuration data of the at least one condition, whether the service data of the target service function satisfies the at least one condition and obtaining a determination result of the at least one condition comprises:
[0022] Acquire target data corresponding to the to-be-matched parameter from the business data;
[0023] Calling the judgment function corresponding to the matching method to match the target data and the configuration parameters to obtain the matching result of each single condition;
[0024] According to the matching result of each single condition and the control method, the judgment result of each single condition is obtained.
[0025] Optionally, the control method is the whitelist control method, or the blacklist control method.
[0026] Optionally, acquiring configuration data of at least one condition corresponding to the target rule according to the target rule includes:
[0027] According to the target rule, using a preset rule condition mapping table, determining identification information of at least one condition corresponding to the target rule;
[0028] According to the identification information of the at least one condition, configuration data of the at least one condition is acquired from a preset database.
[0029] Optionally, before acquiring configuration data of the at least one condition from a preset database according to the identification information of the at least one condition, the method further includes:
[0030] The configuration data of each of the conditions is stored in the database in the form of serialized data.
[0031] In a second aspect of the present application, the present application further provides a business data rule judgment device, the device comprising: a determination module, an acquisition module and a judgment module, wherein:
[0032] The determination module is used to determine the target rule corresponding to the target business function;
[0033] The acquisition module is used to acquire configuration data of at least one condition corresponding to the target rule according to the target rule;
[0034] The judgment module is used to judge whether the business data of the target business function meets the at least one condition according to the configuration data of the at least one condition, and obtain the judgment result of the at least one condition;
[0035] The acquisition module is specifically configured to obtain a rule judgment result of the target business function according to a judgment result of the at least one condition.
[0036] Optionally, the acquisition module is specifically used to perform a Boolean aggregation operation on the judgment result of the at least one condition to obtain the rule judgment result.
[0037] Optionally, the judgment module is specifically used to judge whether the business data of the target business function meets the at least one condition in a concurrent execution manner according to the configuration data of the at least one condition, and obtain the judgment result of the at least one condition.
[0038] Optionally, the at least one condition includes: a complex condition, and the complex condition includes: multiple single conditions; the judgment module is specifically used to judge whether the business data meets the multiple single conditions according to the configuration data of the multiple single conditions, and obtain the judgment results of the multiple single conditions;
[0039] The acquisition module is specifically used to perform a logical operation on the judgment results of the multiple single conditions to obtain the judgment result of the complex condition.
[0040] Optionally, the judgment module is specifically used to recursively judge whether the business data satisfies the multiple single conditions according to the configuration data of the multiple single conditions, so as to obtain the judgment results of the multiple single conditions.
[0041] Optionally, the configuration data of each single condition in the at least one condition includes: configuration parameters of each single condition, matching method of each single condition, parameters to be matched of each single condition, and control method of each single condition; the device further includes: a matching module, wherein:
[0042] The acquisition module is used to acquire the target data corresponding to the to-be-matched parameter from the business data;
[0043] The matching module is used to call the judgment function corresponding to the matching method, match the target data and the configuration parameters, and obtain the matching result of each single condition;
[0044] The acquisition module is specifically used to obtain the judgment result of each single condition according to the matching result of each single condition and the control method.
[0045] Optionally, the determination module is specifically configured to determine identification information of at least one condition corresponding to the target rule by using a preset rule condition mapping table according to the target rule;
[0046] The acquisition module is specifically configured to acquire configuration data of the at least one condition from a preset database according to identification information of the at least one condition.
[0047] In the third aspect of the present application, a business data rule judgment device is provided, which includes a processor, a storage medium and a bus. The storage medium stores machine-readable instructions executable by the processor. When the business data rule judgment device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any method described in the first aspect.
[0048] In a fourth aspect of the present application, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any method described in the first aspect are executed.
[0049] Based on any of the above aspects, after determining the target rule according to the target business function, the configuration data of at least one condition corresponding to the target rule can be determined, and then the business data of the target business function can be judged whether the business data satisfies at least one condition corresponding to the target rule, and the rule judgment result of the target business function can be obtained according to the judgment result. This judgment method is based on the corresponding target rule determined according to the target business function, and the rule judgment result is obtained by jointly judging the business data of the target business function and the configuration data of at least one condition under the target rule, that is, the rule judgment result is related to the judgment result of each condition. Since each condition in the rule of the present application has its own configuration data, when modifying the configuration data of each condition, it will not affect the configuration data of other conditions, and when adding a condition, it only needs to add the configuration data corresponding to the condition under the rule, thereby solving the problem in the prior art that the change of a single condition requires updating the configuration data of the entire rule, resulting in low scalability of the rule and difficulty in linkage with the back end, thereby improving the scalability of the rule. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A schematic diagram of the structure of a business data rule judgment system provided in one embodiment of the present application;
[0052] Figure 2 A flowchart of a method for determining business data rules provided in an embodiment of the present application;
[0053] Figure 3 A structural diagram of the mapping relationship between rules and conditions provided in an embodiment of the present application;
[0054] Figure 4 A flowchart of a business data rule determination method provided by another embodiment of the present application;
[0055] Figure 5 A flowchart of a business data rule determination method provided by another embodiment of the present application;
[0056] Figure 6 A schematic diagram of the structure of a business data rule determination device provided in one embodiment of the present application;
[0057] Figure 7 A schematic diagram of the structure of a business data rule determination device provided in another embodiment of the present application;
[0058] Figure 8 A schematic diagram of the structure of a business data rule judgment device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0059] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0060] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0061] In order to enable those skilled in the art to use the contents of this application, the following implementation methods are given in combination with the business data rule judgment of the enterprise version of online car-hailing for specific application scenarios. For those skilled in the art, the general principles defined here can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the business data rule judgment of the enterprise version of online car-hailing, it should be understood that this is only an exemplary embodiment, and this application can be applied to various situations where business data rule judgment is required, such as: business data rule judgment of application programs (such as business data rule judgment of ordinary online car-hailing applications, business data rule judgment of audio and video applications), business data rule judgment of company management (such as business data rule judgment of company attendance, business data rule judgment of company welfare), etc.
[0062] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0063] One aspect of the present application relates to a business data rule judgment system. The system can determine a target rule according to a target business function determined by a user from multiple business functions, then obtain configuration data of at least one condition corresponding to the target rule according to the target rule, and judge whether the business data of the target business function satisfies at least one condition according to the configuration data of at least one condition, and obtain a judgment result, and determine a rule judgment result of the target business function according to the judgment result, wherein the target business function may include one condition or multiple conditions, and the rule judgment result is determined according to the judgment results of all conditions in the target business function.
[0064] It is worth noting that before the present application was filed, the storage method of most rule systems in the prior art was to store each rule in the form of configuration data of the entire rule, which resulted in the need to modify the configuration data of the entire rule when modifying conditions or adding new conditions, resulting in poor scalability of the rules and front-end visualization effects, and difficulty in linkage with the back-end.
[0065] The business data rule judgment method provided by the present application can determine the configuration data of at least one condition corresponding to the target rule after determining the target rule according to the target business function, and then judge whether the business data satisfies at least one condition corresponding to the target rule according to the business data of the target business function, and obtain the rule judgment result of the target business function according to the judgment result. This judgment method is based on the corresponding target rule determined according to the target business function, and the rule judgment result is obtained by jointly judging the business data of the target business function and the configuration data of at least one condition under the target rule, that is, the rule judgment result is related to the judgment result of each condition. Since each condition in the rule of the present application has its own configuration data, when modifying the configuration data of each condition, it will not affect the configuration data of other conditions, and when adding a condition, it is only necessary to add the configuration data corresponding to the condition under the corresponding rule, without modifying the data corresponding to the entire rule. This can solve the problem in the prior art that the change of a single condition requires updating the configuration data of the entire rule, resulting in low scalability of the rule and difficulty in linkage with the back end, thereby achieving the effect of improving the scalability of the rule.
[0066] Figure 1 1 is a schematic diagram of the architecture of a business data rule judgment system 100 provided in an embodiment of the present application. For example, the business data rule judgment system 100 may be a business data rule judgment service for an enterprise version of online car-hailing, or any platform or scenario involving business data rule judgment. Figure 1 As shown, the business data rule judgment system 100 may include one or more of a server 110 , a network 120 , a service terminal 130 and a database 140 .
[0067] In some embodiments, the server 110 may include a processor. The processor may process information and / or data related to the service request to perform one or more functions described in the present application. For example, the processor may determine the user's intent based on the service request obtained from the service terminal 130. In some embodiments, the processor may include one or more processing cores (e.g., a single-core processor (S) or a multi-core processor (M)). By way of example only, the processor may include a central processing unit (CPU), an application specific integrated circuit (ASIC), an application specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller unit, a reduced instruction set computer (RISC), or a microprocessor, or any combination thereof.
[0068] In some embodiments, the device type corresponding to the service terminal 130 may be a mobile device, such as a wearable device, a smart mobile device, a tablet computer, a laptop computer, etc. Taking the business data rule judgment service scenario of the enterprise version of online car-hailing as an example, the service terminal 130 may be a user's mobile phone. The user logs in to the application through the mobile phone and determines the target business function among multiple business functions of the application. The server judges the business data of the target business function according to the configuration data of at least one condition corresponding to the target rule corresponding to the target business function, and obtains the judgment result of the target business function according to the judgment result of at least one condition, thereby realizing the judgment of the business data rule.
[0069] In some embodiments, the database 140 may be connected to the network 120 to communicate with one or more components (e.g., the server 110, the service terminal 130, the service provider, etc.) in the business data rule determination system 100. One or more components in the business data rule determination system 100 may access data or instructions stored in the database 140 via the network 120. In some embodiments, the database 140 may be directly connected to one or more components in the business data rule determination system 100, or the database 140 may also be part of the server 110.
[0070] The following is combined with the above Figure 1 The content described in the business data rule judgment system 100 shown is a detailed description of the business data rule judgment method provided in the embodiment of the present application. The following business data rule judgment method is applied to the above-mentioned system. The execution subject can be a service terminal or a server. It should be understood that the preset scenarios can be designed and adjusted according to user needs. Any scenario involving business data rule judgment or rule judgment can be used, and is not limited to the two scenarios given in the embodiment.
[0071] Reference Figure 2 As shown, it is a flow chart of a method for determining business data rules provided by an embodiment of the present application. In the following embodiments, the business data rule determination service scenario of the enterprise version of online car-hailing is used as an example for explanation. The method includes:
[0072] S201: Determine a target rule corresponding to a target business function.
[0073] For example, in some possible embodiments, the target business function is the target business function determined by the user through touch operation, voice input operation, etc. on the business function selection interface after logging into the enterprise version of the online car-hailing application through the terminal device; wherein the function selection interface can display at least one business function, such as: fixed-point commuting function, overtime function, designated driver function, reimbursement function, business trip function or self-paid car function, etc. For example, after the user logs into the enterprise version of the online car-hailing application, he selects the business trip function on the function selection interface. At this time, the target business function is determined to be the business trip function, and the target rule at this time is the target rule corresponding to the business trip function.
[0074] Among them, the way for users to log in to the enterprise version of the online car-hailing application can be, for example, through mobile phone number and verification code verification, or through corporate account and password, or through face recognition, or through voiceprint recognition. The specific method for users to log in to the enterprise version of the online car-hailing application can be adjusted according to user needs and is not limited to the above embodiments, as long as it can uniquely indicate the user's identity information.
[0075] Optionally, in one embodiment of the present application, after a user logs in to the enterprise version of the online car-hailing application through a terminal device, the business functions corresponding to users in different positions in the enterprise may be the same or different. For example, the business functions corresponding to management users may include fixed-point commuting function, overtime function, designated driver function, reimbursement function, business trip function or self-paid taxi function, etc., and the business functions corresponding to grassroots users may include overtime function, designated driver function, business trip function or self-paid taxi function, etc.; the correspondence between users and business functions and the usage rights are pre-configured by the enterprise, and each user can automatically obtain the corresponding relationship corresponding to the user's identity information after successfully logging in. The specific business functions include content and the correspondence with the user can be flexibly adjusted according to user needs, and this application does not impose any restrictions here.
[0076] Among them, each business function has its corresponding rules. Different business functions may correspond to different rules. Each rule is pre-configured according to the business function, and during the application process, each rule can be modified and updated according to user feedback or iteration of functional requirements.
[0077] S202: According to the target rule, obtain configuration data of at least one condition corresponding to the target rule.
[0078] Among them, the target rule may include at least one condition, such as: time condition, position condition, location condition or health condition, among which the location condition may include: starting location condition and / or destination point condition. The content that the specific conditions may include can be flexibly adjusted according to user needs and is not limited to the above embodiments. The target rule may include configuration data of one condition, or configuration data of multiple conditions. The configuration data of the conditions included in the specific target rule is determined according to the user's pre-configuration, and this application does not impose any restrictions here.
[0079] Optionally, the method for obtaining the configuration data of at least one condition corresponding to the target rule may be, for example: obtaining a rule condition mapping table corresponding to the target rule according to the target rule, and then obtaining the configuration data of the target rule and the corresponding at least one condition according to the rule condition mapping table.
[0080] By way of example, in one embodiment of the present application, after obtaining the target rule, a preset rule condition mapping table is used to determine the identification information of at least one condition corresponding to the target rule; and then, based on the identification information of at least one condition, configuration data of at least one condition is obtained from a preset database.
[0081] The configuration data of each single condition is pre-stored in the database in the form of serialized data.
[0082] Among them, this method of using a preset rule-condition mapping table to store each condition corresponding to the rule in a database allows managers of different companies or designers of different applications to configure the conditions corresponding to each rule according to the preset rule-condition mapping table. They only need to set the mapping relationship between each condition and the rule to set up a customized rule system according to their own needs, thereby ensuring that the required rule system can be quickly configured, and the configuration data of each condition is stored in a serialized form, thereby realizing component-based storage, abstracting each single condition in the rule into a component, so that each single condition can be serialized into a piece of data, and thus flexibly stored in a relational database or a non-relational database, so that when adding new rules or conditions later, or modifying each condition, it can be ensured that adding new rules or conditions, or modifying conditions, will not affect other rules or conditions.
[0083] For example, in some possible embodiments, the rule-condition mapping table can be a rule-condition mapping table, which can include a mapping relationship between multiple rules and the conditions corresponding to each rule; it can also be multiple rule-condition mapping tables, that is, each rule has a corresponding rule-condition mapping table for mapping the conditions corresponding to the rule.
[0084] Figure 3 A schematic diagram of the mapping relationship between rules and conditions provided in an embodiment of the present application. A condition may be included in only one rule or in multiple rules. Figure 3 As shown, conditions 1 and 2 are only referenced by rule 1, conditions 4 and 5 are only referenced by rule 2, but condition 3 is referenced by both rule 1 and rule 2.
[0085] For example: if the rule condition table is a rule condition mapping table, the identification information of each condition may have a mapping relationship with one rule or with multiple rules; if there are multiple rule condition tables, the identification information of each condition may be in one rule condition mapping table or in multiple rule condition mapping tables, that is, each condition may be referenced by one rule or by multiple rules. The tabular form of the specific rule condition mapping table and the reference method of each condition can be flexibly adjusted according to user needs, and this application does not impose any restrictions on this.
[0086] S203: According to the configuration data of at least one condition, determine whether the business data of the target business function meets at least one condition, and obtain a determination result of at least one condition.
[0087] Among them, the business data of the target business function is the business data corresponding to the user that needs to be obtained under the target business function, and may include, for example, the user's current starting location data, time data, health data or destination data, etc. The content included in the specific business data can be flexibly adjusted according to user needs and is not limited to the above embodiments.
[0088] For example, in one embodiment of the present application, it is possible to determine whether the business data of the target business function meets at least one condition in a concurrent execution manner based on the configuration data of at least one condition, and obtain a determination result of at least one condition.
[0089] Among them, since each condition in the rules of the present application is stored independently and decoupled from each other, each condition can be executed concurrently, and each condition can run and judge by itself, be executed concurrently and obtain the judgment results of each condition. For example, in one embodiment of the present application, for example, each condition in the target rule can be traversed, and each condition can be judged and executed concurrently through the lightweight thread gorutine feature of the computer programming language golang.
[0090] S204: Obtain a rule judgment result of the target business function according to the judgment result of at least one condition.
[0091] For example, in one embodiment of the present application, a Boolean aggregation operation may be performed on the judgment result of at least one condition to obtain a rule judgment result.
[0092] By adopting the business data rule judgment method provided in the embodiment of the present application, after determining the target rule according to the target business function, the configuration data of at least one condition corresponding to the target rule can be determined, and then according to the business data of the target business function, it can be judged whether the business data satisfies at least one condition corresponding to the target rule, and the rule judgment result of the target business function can be obtained according to the judgment result. This judgment method is based on the corresponding target rule determined according to the target business function, and the rule judgment result is obtained by jointly judging the business data of the target business function and the configuration data of at least one condition under the target rule, that is, the rule judgment result is related to the judgment result of each condition. Since each condition in the rule of the present application has its own configuration data, when modifying the configuration data of each condition, it will not affect the configuration data of other conditions, and when adding a condition, it only needs to add the configuration data corresponding to the condition under the rule, thereby solving the problem in the prior art that the change of a single condition requires updating the configuration data of the entire rule, resulting in low scalability of the rule and difficulty in linkage with the back end, thereby improving the scalability of the rule.
[0093] Optionally, based on the above embodiment, the embodiment of the present application may also provide a business data rule judgment method. The following is an example of the implementation process of obtaining the judgment results of each condition in the above method in combination with the accompanying drawings. Figure 4 A flowchart of a business data rule determination method provided by another embodiment of the present application. In one embodiment of the present application, at least one condition may include: a complex condition, wherein the complex condition includes: multiple single conditions; Figure 4 As shown, S203 may include:
[0094] S205: According to the configuration data of the multiple single conditions, determine respectively whether the business data satisfies the multiple single conditions, and obtain determination results of the multiple single conditions.
[0095] Among them, complex conditions refer to conditions that include multiple single conditions. In the process of designing complex conditions, a data structure designed for a single condition can be used. For example, the Condition_val data structure can be used for design, where the structure stores an array composed of identity identifiers of multiple single conditions.
[0096] S206: Perform an OR logic operation on the judgment results of multiple single conditions to obtain a judgment result of a complex condition.
[0097] In which, in the process of determining complex conditions, for example, based on the configuration data of multiple single conditions, it is recursively determined whether the business data satisfies multiple single conditions to obtain the determination results of multiple single conditions. In one embodiment of the present application, the configuration data of the single conditions may include identification information of each single condition, that is, through the identification information of each single condition, the single condition corresponding to each identification information is obtained from the preset data structure, and the determination results of each single condition in the complex condition are determined recursively. The determination results of each single condition are operated according to the logic of OR, and the operation result is the determination result of the complex condition.
[0098] For example, a complex condition may include condition 1 and condition 2, wherein condition 1 may be, for example, that when the location is in Xi'an, the car is available after 21:00; condition 2 may be, for example, that when the location is in Beijing, the car is available after 20:30; that is, in the complex condition, as long as one of condition 1 or condition 2 passes the judgment, the judgment result of the complex condition is determined to be passed, and only when both condition 1 and condition 2 fail the judgment, the judgment result of the complex condition is determined to be failed.
[0099] Optionally, based on the above embodiment, the embodiment of the present application may also provide a business data rule judgment method. The following is an example of the implementation process of obtaining the judgment results of each condition in the above method in combination with the accompanying drawings. Figure 5A flow chart of a business data rule judgment method provided for another embodiment of the present application. In one embodiment of the present application, the configuration data of each single condition in at least one condition may include, for example: configuration parameters of each single condition, matching method of each single condition, parameters to be matched of each single condition, and management and control method of each single condition; Figure 5 As shown, S103 may include:
[0100] S207: Obtain target data corresponding to the parameters to be matched from the business data.
[0101] For example, in one embodiment of the present application, the corresponding target data in the business data can be determined according to the parameter type in the parameters to be matched, wherein the target data is data having the same data type as the parameter type in the parameters to be matched.
[0102] S208: calling the judgment function corresponding to the matching method, matching the target data and the configuration parameters, and obtaining the matching result of each single condition.
[0103] Optionally, in an embodiment of the present application, the configuration data of each single condition may also include identification information of each single condition and the type of configuration parameters of each single condition, wherein the control mode of each single condition may be determined by a control field, wherein the control field may be, for example, an effect field, and the configuration data may be designed in the form of a table field, for example, as shown in Table 1:
[0104]
[0105] Table 1
[0106] S209: Obtain the judgment result of each single condition according to the matching result of each single condition and the control method.
[0107] Among them, by setting the control method field, the conversion of the blacklist or whitelist judgment logic can be avoided. When a single condition passes the judgment, the value of the control method field is allow. When a single condition fails to pass the judgment, the value of the control method field is deny. Only when the value of each single condition under the rule is allow, the rule is determined to have passed the judgment. Otherwise, it is returned that the rule has failed the judgment. That is, by using the control method field when judging each single condition, the execution result of each single condition can be determined according to the control method field, and then the final execution result is determined according to the execution result of each single condition, thereby realizing the free configuration of the blacklist and whitelist.
[0108] For example, the target business function is overtime car use. At this time, the target rule includes two conditions: the location is Xi'an, and the car use time is after 21:00. In one embodiment of the present application, the business data of the current target business function includes: when the location is Xi'an and the car use time is 20:00, the location condition is determined by the matching results and the control method to return the judgment result of allow, and the time condition is determined by the matching results and the control method to return the judgment result of deny. At this time, the rule judgment result returned for the target business function is failed, and the user cannot use the car under the overtime car business function; in one embodiment of the present application, the business data of the current target business function may include, for example: when the location is Xi'an and the car use time is 22:00, the location condition is determined by the matching results and the control method to return the judgment result of allow, and the time condition is determined by the matching results and the control method to return the judgment result of allow. At this time, the rule judgment result returned for the target business function is passed, and the user can use the car under the overtime car business function.
[0109] For example, in some possible embodiments, the control method may be a whitelist control method or a blacklist control method.
[0110] The whitelist control method can be achieved by setting positive conditions. For example, you can set the condition 1 that the health data needs to meet as the whitelist condition. At this time, you can set condition 1 corresponding to the whitelist health data. Then, when the health data in the business data of the target business function meets condition 1, the control method determines that the returned judgment result is allow; the blacklist control method can, for example, set reverse conditions. For example, you can set some location data as the blacklist, then you can set condition 2 that does not include certain location data. Then, when the location data in the condition data of the target business function meets condition 2, that is, does not include the blacklist location data, the control method determines that the returned judgment result is allow; if the blacklist location data is included, the returned judgment result is deny; that is, according to the control method, it can be flexibly configured whether to pass the judgment or not when the conditions are met, thereby realizing flexible configuration of blacklist control method and whitelist control method.
[0111] By adopting the business data rule judgment method provided by the present application, by adding a control method field in each condition, the judgment result of each condition can be determined according to the control method field, thereby realizing flexible and direct configuration of the blacklist and the whitelist, avoiding the conversion of business logic, and the components between the conditions in the rule are set and serialized and stored in the database, so that when the conditions are modified or added, other conditions will not be affected; and each condition can run and explain itself. In the stage of judging whether the target rule passes the judgment, the concurrency characteristics can be used to execute all conditions under the target rule in parallel to obtain the judgment results of each single condition, and perform Boolean aggregation operations based on the judgment results to determine the final rule judgment results.
[0112] Based on the same inventive concept, a business data rule judgment device corresponding to the business data rule judgment method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned business data rule judgment method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repetition of the beneficial effects will not be repeated.
[0113] Figure 6 A schematic diagram of a business data rule determination device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device includes: a determination module 301, an acquisition module 302 and a judgment module 303, wherein:
[0114] The determination module 301 is used to determine the target rule corresponding to the target business function.
[0115] The acquisition module 302 is used to acquire configuration data of at least one condition corresponding to the target rule according to the target rule.
[0116] The judgment module 303 is used to judge whether the business data of the target business function meets at least one condition according to the configuration data of at least one condition, and obtain the judgment result of at least one condition.
[0117] The acquisition module 302 is specifically configured to obtain a rule judgment result of a target business function according to a judgment result of at least one condition.
[0118] Optionally, the acquisition module 302 is specifically configured to perform a Boolean aggregation operation on the judgment result of at least one condition to obtain a rule judgment result.
[0119] Optionally, the judgment module 303 is specifically configured to judge whether the business data of the target business function satisfies at least one condition in a concurrent execution manner according to the configuration data of at least one condition, and obtain a judgment result of at least one condition.
[0120] Optionally, at least one condition includes: a complex condition, and the complex condition includes: multiple single conditions; the judgment module 303 is specifically used to judge whether the business data satisfies multiple single conditions according to the configuration data of the multiple single conditions, and obtain the judgment results of the multiple single conditions.
[0121] The acquisition module 302 is specifically used to perform a logical operation on the judgment results of multiple single conditions to obtain the judgment results of complex conditions.
[0122] Optionally, the judgment module 303 is specifically configured to recursively judge whether the business data satisfies the multiple single conditions according to the configuration data of the multiple single conditions, and obtain the judgment results of the multiple single conditions.
[0123] Figure 7 A schematic diagram of the structure of a business data rule judgment device provided in an embodiment of the present application, wherein the configuration data of each single condition in at least one condition includes: configuration parameters of each single condition, matching method of each single condition, parameters to be matched of each single condition, and control method of each single condition; Figure 7 As shown, the device further includes: a matching module 304, wherein:
[0124] The acquisition module 302 is used to acquire target data corresponding to the to-be-matched parameters from the business data.
[0125] The matching module 304 is used to call the judgment function corresponding to the matching method, match the target data and the configuration parameters, and obtain the matching result of each single condition.
[0126] The acquisition module 302 is specifically used to obtain the judgment result of each single condition according to the matching result of each single condition and the control method.
[0127] Optionally, the determination module 301 is specifically configured to determine identification information of at least one condition corresponding to the target rule by using a preset rule condition mapping table according to the target rule.
[0128] The acquisition module 302 is specifically configured to acquire configuration data of at least one condition from a preset database according to identification information of at least one condition.
[0129] Figure 8 A schematic diagram of a business data rule determination device provided in an embodiment of the present application, wherein the business data rule determination device may be, for example, a client device of an enterprise application, or an application server of an enterprise application service, and the present application does not impose any restrictions thereon. Figure 8As shown, the business data rule judgment device includes: a processor 601, a memory 602 and a bus 603; the memory 602 stores machine-readable instructions executable by the processor 601. When the business data rule judgment device is running, the processor 601 communicates with the memory 602 through the bus 603, and the processor 601 executes the machine-readable instructions to execute the steps of the business data rule judgment method provided in the aforementioned method embodiment.
[0130] Specifically, the machine-readable instructions stored in the memory 602 are the execution steps of the business data rule judgment method described in the aforementioned embodiment of the present application. The processor 601 can execute the business data rule judgment method to process the business data of the target business function. Therefore, the business data rule judgment device also has all the beneficial effects described in the aforementioned method embodiment, and this application will not repeat the description.
[0131] It should be noted that the processor 601 can be a general-purpose computer or a special-purpose computer, as well as other servers for processing data, etc., all of which can be used to implement the business data rule judgment method of the present application. Although the present application only describes the business data rule judgment method through computers and servers, for convenience, the functions described in the present application can also be implemented in a distributed manner on multiple similar platforms to balance the processing load.
[0132] For example, the business data rule judgment device may include one or more processors for executing program instructions, a communication bus, and different forms of storage media, such as a disk, ROM, or RAM, or any combination thereof. Exemplarily, the computer platform may also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present application can be implemented according to these program instructions.
[0133] For ease of explanation, only one processor is described in the above embodiment. However, it should be noted that the business data rule determination device in the present application may also include multiple processors, so the steps performed by one processor described in the present application may also be performed jointly or individually by multiple processors.
[0134] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned business data rule determination method are executed.
[0135] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, it can execute the above-mentioned business data rule judgment method, thereby solving the problem that the prior art cannot flexibly support the configuration of blacklists and whitelists and is prone to misjudgment.
[0136] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0137] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0138] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0139] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0140] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for determining business data rules, It is characterized in that The method comprises: Determine a target rule corresponding to a target business function, where the target business function is a target business function determined by a user through a touch operation or a voice input operation on a business function selection interface after the user logs in to the enterprise version of the online car-hailing application through a terminal device; According to the target rule, configuration data of at least one condition corresponding to the target rule is obtained, where the configuration data of each single condition in the at least one condition includes: configuration parameters of each single condition, matching mode of each single condition, parameters to be matched of each single condition, and control mode of each single condition, where the control mode is a whitelist control mode or a blacklist control mode, and the whitelist control mode is determined by setting a positive condition; According to the configuration data of the at least one condition, whether the business data of the target business function meets the at least one condition is judged in a concurrent execution manner, and a judgment result of the at least one condition is obtained, which includes: Acquire target data corresponding to the to-be-matched parameter from the business data; Calling the judgment function corresponding to the matching method to match the target data and the configuration parameters to obtain the matching result of each single condition; According to the matching result of each single condition and the control method, a judgment result of each single condition is obtained; Obtaining a rule judgment result of the target business function according to a judgment result of the at least one condition, wherein obtaining configuration data of at least one condition corresponding to the target rule according to the target rule includes: According to the target rule, using a preset rule condition mapping table, determining identification information of at least one condition corresponding to the target rule; According to the identification information of the at least one condition, the configuration data of the at least one condition is obtained from a preset database, wherein before obtaining the configuration data of the at least one condition from the preset database according to the identification information of the at least one condition, the method further includes storing the configuration data of each condition in the database in the form of serialized data.
2. The method according to claim 1, It is characterized in that The step of obtaining a rule judgment result of the target business function according to the judgment result of the at least one condition includes: A Boolean aggregation operation is performed on the judgment result of the at least one condition to obtain the rule judgment result.
3. The method according to claim 1, It is characterized in that The at least one condition includes: a complex condition, wherein the complex condition includes: a plurality of single conditions; and the configuration data of the at least one condition is used to determine whether the business data of the target business function satisfies the at least one condition, and the determination result of the at least one condition is obtained, including: According to the configuration data of the multiple single conditions, respectively judging whether the business data satisfies the multiple single conditions, and obtaining judgment results of the multiple single conditions; Perform an OR logic operation on the judgment results of the multiple single conditions to obtain the judgment result of the complex condition.
4. The method according to claim 3, It is characterized in that The determining, based on the configuration data of the multiple single conditions, whether the business data satisfies the multiple single conditions respectively, and obtaining the determination results of the multiple single conditions includes: According to the configuration data of the multiple single conditions, it is recursively determined whether the business data satisfies the multiple single conditions, and the determination results of the multiple single conditions are obtained.
5. A business data rule judgment device, It is characterized in that The device comprises: a determination module, an acquisition module and a judgment module, wherein: The determination module is used to determine the target rule corresponding to the target business function, where the target business function is the target business function determined by the user through touch operation or voice input operation on the business function selection interface after logging into the enterprise version of the online car-hailing application through the terminal device; The acquisition module is used to acquire, according to the target rule, configuration data of at least one condition corresponding to the target rule, wherein the configuration data of each single condition in the at least one condition includes: configuration parameters of each single condition, matching mode of each single condition, parameters to be matched of each single condition, and control mode of each single condition, wherein the control mode is a whitelist control mode or a blacklist control mode, and the whitelist control mode is determined by setting a positive condition; The judgment module is used to judge whether the business data of the target business function meets the at least one condition in a concurrent execution manner according to the configuration data of the at least one condition, and obtain the judgment result of the at least one condition, which includes: Acquire target data corresponding to the to-be-matched parameter from the business data; Calling the judgment function corresponding to the matching method to match the target data and the configuration parameters to obtain the matching result of each single condition; According to the matching result of each single condition and the control method, a judgment result of each single condition is obtained; The acquisition module is specifically configured to obtain a rule judgment result of the target business function according to a judgment result of the at least one condition, wherein the obtaining, according to the target rule, configuration data of at least one condition corresponding to the target rule includes: The determination module determines identification information of at least one condition corresponding to the target rule using a preset rule condition mapping table according to the target rule; The acquisition module acquires the configuration data of the at least one condition from a preset database according to the identification information of the at least one condition, wherein before acquiring the configuration data of the at least one condition from the preset database according to the identification information of the at least one condition, the process further includes storing the configuration data of each condition in the database in the form of serialized data.
6. A business data rule judgment device, It is characterized in that The device includes: a processor, a storage medium and a bus, the storage medium stores machine-readable instructions executable by the processor, when the business data rule judgment device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to execute the method described in any one of claims 1 to 4 above.
7. A storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is executed.
