CN114092116A - Business rule checking method and device and electronic equipment - Google Patents

Business rule checking method and device and electronic equipment Download PDF

Info

Publication number
CN114092116A
CN114092116A CN202111420066.2A CN202111420066A CN114092116A CN 114092116 A CN114092116 A CN 114092116A CN 202111420066 A CN202111420066 A CN 202111420066A CN 114092116 A CN114092116 A CN 114092116A
Authority
CN
China
Prior art keywords
target
rule
service
business
verification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111420066.2A
Other languages
Chinese (zh)
Inventor
余永昌
刘成武
牙正苇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Vipshop Payment Service Co ltd
Original Assignee
Zhejiang Vipshop Payment Service Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Vipshop Payment Service Co ltd filed Critical Zhejiang Vipshop Payment Service Co ltd
Priority to CN202111420066.2A priority Critical patent/CN114092116A/en
Publication of CN114092116A publication Critical patent/CN114092116A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/01Customer relationship services
    • G06Q30/012Providing warranty services

Abstract

The invention relates to a method, a device and electronic equipment for verifying a business rule, wherein the method comprises the following steps: acquiring a target service scene, a target service activity and a target verification parameter configured by a user; determining a target business rule corresponding to the target business scene and the target business activity according to a preset business rule table; constructing a target business rule chain according to the target rule attribute of the target business rule; the target business rule chain is verified according to the target verification parameters to obtain a verification result, the target business rule chain is constructed according to the target rule attributes of the target business rules, and a business verification process is constructed without manual coding, so that if the process of the business rule verification is changed, the corresponding rule attributes of the business rules can be directly modified, and the labor cost is low.

Description

Business rule checking method and device and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for verifying a business rule, and an electronic device.
Background
With the rise of online shopping, a large number of business activities and business scenarios may exist in an online shopping platform, for example, the business activities may be red packet issuing, full and short, and the business scenarios may include previewing, payment confirmation, consumption and the like, so that a large number of business rules may exist.
After configuring corresponding service rules for different service activities and scene interfaces, the service rules need to be verified in order to ensure the stability of subsequent service rules. At present, a method for verifying a business rule generally includes that a business rule is used as a basic component, and business rules corresponding to different business activities and business scenes are manually coded into a verification process, so that the business rule process is verified, and therefore once more businesses are added, more places are involved in changing, and labor cost is high.
Disclosure of Invention
In order to solve the technical problems, the invention provides a method and a device for verifying a business rule, an electronic device and a computer storage medium, and the specific scheme is as follows:
in a first aspect, a method for verifying a business rule is provided, which is applied to a rule engine, and the method includes: acquiring a target service scene, a target service activity and a target verification parameter configured by a user; determining a target business rule corresponding to the target business scene and the target business activity according to a preset business rule table; constructing a target business rule chain according to the target rule attribute of the target business rule; and verifying the target service rule chain according to the target verification parameter to obtain a verification result.
In a preferred embodiment, the preset service rule table includes a preset service rule definition table and a preset service activity rule table; before determining the target business rule corresponding to the target business scenario and the target business activity according to a preset business rule table, the method further comprises the following steps: constructing the preset service rule definition table according to a preset service rule and a rule attribute, wherein the rule attribute comprises service activity types and service scenes, and each service activity type at least corresponds to one service activity ID and at least one service rule; and combining the service activity ID and the service rule corresponding to the service activity type to which the service activity ID belongs to obtain the preset service activity rule table.
In a preferred embodiment, the target business activity comprises a target activity type and a target activity ID; the determining, according to a preset service rule table, a target service rule corresponding to the target service scenario and the target service activity includes: determining a first service rule table from the preset service rule definition table according to the target activity type and the target service scene; determining a second business rule table from the preset business activity rule table according to the target activity ID; and determining a target business rule according to the first business rule table and the second business rule table.
In a preferred embodiment, the constructing a target business rule chain according to the target rule attribute of the target business rule includes: acquiring a checker list, wherein the checkers in the checker list correspond to rule codes in rule attributes one to one; determining a target checker corresponding to the target service rule according to the checker list and a target rule code in the target rule attribute; and sequencing the target checkers according to the target rule priority in the target rule attribute so as to obtain a target business rule chain.
In a preferred embodiment, the checking the target service rule chain according to the target checking parameter to obtain a checking result includes: verifying according to the target verification parameters and a target verification method of the target verifier to obtain a sub-verification result corresponding to the target verifier; and determining the verification result according to the sub-verification result of the target verifier.
In a preferred embodiment, the determining the verification result according to the sub-verification result of the target verifier includes: acquiring a current sub-verification result of a current target verifier; if the current sub-verification results are all successful in verification, the target verifier is put into a rollback list; until all the target verifiers are verified successfully, the verification result is successful; and if the current sub-verification result is verification failure, determining that the verification result is verification failure.
In a preferred embodiment, before determining that the verification result is a verification failure, the method further includes: rolling back according to the rolling back method of the target verifier in the rolling back list; wherein, the rollback method is a reverse method of the verification method.
In a preferred embodiment, before the obtaining the verification result by verifying the target service rule chain according to the target verification parameter, the method further includes: acquiring a target rule state in the target rule attribute and whether the target service rule is closed to be processed; the checking the target service rule chain according to the target checking parameter to obtain a checking result further comprises: if the target rule state is invalid and the target service rule is not closed to process, the sub-verification result of the target service rule is verification failure; and if the target rule state is invalid and the target service rule is closed to process, the sub-verification result of the target service rule is successful.
In a second aspect, a device for verifying a business rule is provided, which is applied to a rule engine, and the device includes: the acquisition module is used for acquiring a target service scene, a target service activity and a target verification parameter configured by a user; the determining module is used for determining a target business rule corresponding to the target business scene and the target business activity according to a preset business rule table; the construction module is used for constructing a target business rule chain according to the target rule attribute of the target business rule; and the checking module is used for checking the target service rule chain according to the target checking parameter to obtain a checking result.
In a third aspect, an electronic device is provided, including: one or more processors; and memory associated with the one or more processors for storing program instructions which, when read and executed by the one or more processors, perform the method as previously described.
In the invention, the preset rule list is established in advance, the corresponding target service rule can be determined according to the target service scene and the target service activity input by a user in a shorter time, and if a service scene or a service activity is newly added, the preset rule list can be modified, so that the method has stronger expansibility.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a method for verifying a business rule according to an embodiment of the present invention;
FIG. 2 is a flow chart of determining a target business rule in an embodiment of the present invention;
FIG. 3 is a flow chart of the construction of a target business rule chain in an embodiment of the present invention;
FIG. 4 is a flow chart of a verification process in an embodiment of the invention;
FIG. 5 is a diagram of a device for checking business rules according to an embodiment of the present invention;
fig. 6 is an architecture diagram of an electronic device in an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The following describes a method, an apparatus and an electronic device for verifying a business rule according to the present invention with reference to the accompanying drawings.
As shown in fig. 1, the present invention provides a method for verifying a business rule, which is applied to a rule engine, and the method includes:
s101, acquiring a target service scene, a target service activity and a target verification parameter configured by a user.
In this step, the target service scenario is a service scenario related to the transaction platform, and may be divided into multiple types, for example, calculation, preferential confirmation, consumption, and distribution, the target service activities are some service activities designed by the transaction platform, the target service activities may be red packet activities, full deactivation activities, and discount activities, the target verification parameter is a parameter for verifying the target service rule, and after a target service rule chain corresponding to the target service rule is constructed, verification is performed through the target verification parameter.
S102, determining a target business rule corresponding to the target business scene and the target business activity according to a preset business rule table.
In this step, before checking the service rule, a preset service rule table is pre-constructed according to the service scenario and the service activity, the preset service rule table stores preset service rules, different service scenarios and service activities correspond to different service rules, and for a certain service scenario and service activity, multiple service rules may be corresponding, so that after the target service scenario and the target service activity are determined, the target service rule obtained from the preset service rule table may also include multiple types.
S103, constructing a target business rule chain according to the target rule attribute of the target business rule.
In this step, the rule attribute includes rule code, rule version, rule priority, rule state, whether the rule is closed, and service scene type and service activity type corresponding to the rule, where the rule code is an identifier of the service rule, and different service rules have different rule codes; the rule version is the version of the business rule; the rule priority is the execution sequence of the business rule in the business rule chain, and the higher the priority is, the more the sequence in the business rule chain is, the priority is to check the business rule; the rule state is whether the service rule is valid, if the service rule is valid, the service rule can be executed in a service rule chain, and if the service rule is invalid, the rule needs to be judged by closing the processing state; the rule closing processing is to judge whether the rule passes or not according to the rule closing processing value when the rule state is invalid.
And S104, verifying the target service rule chain according to the target verification parameters to obtain a verification result.
In this step, examples of the verification parameters may be a user number, a merchant number, an order amount, and payment information in a payment list, such as a payment method, a usage bank, a card type, and the like.
In the invention, a preset rule list is established in advance, and the preset rule list covers different service scenes and service rules corresponding to service activities, therefore, when the rules are checked, the corresponding target business rules can be determined in a short time according to the target business scenes and the target business activities input by the user, furthermore, if a new service scene or service activity is added, the preset rule list can be modified, so that the method has stronger expansibility, further, a target service rule chain is constructed according to the target rule attribute of the target service rule, and a service checking flow does not need to be constructed by manual coding, therefore, if the flow of the service rule checking is changed, the method can be directly realized by modifying the rule attribute corresponding to the business rule, the labor cost is low, and the modification process of the business rule verification is more flexible and easier.
In a preferred embodiment, the preset service rule table includes a preset service rule definition table and a preset service activity rule table;
s102, before determining the target business rule corresponding to the target interface scene and the target activity according to the preset business rule list, the method further comprises the following steps:
constructing a preset service rule definition table according to a pre-configured service rule and a rule attribute, wherein the rule attribute comprises service activity types and service scenes, and each service activity type at least corresponds to one service activity ID and at least one service rule;
and combining the service activity ID with the service rule corresponding to the service activity type to which the service activity ID belongs to obtain a preset service activity rule table.
In this step, as shown in fig. 2, the preset service rule table includes two types of rule tables, one type is a preset service rule definition table, and the other type is a preset service activity rule table, where the preset service rule definition table is used to store rule data, and the rule data includes service rules and rule attributes, such as a bank check rule, a payment method rule, an activity time check rule, an activity amount check rule, an activity group check rule, an order amount check rule, a first card binding check rule, and the rule attributes further include service scenarios and activity types corresponding to the service rules.
Each preset business rule definition table corresponds to a business rule, each business rule corresponds to an activity type and a business scenario, and the same activity type and business scenario may correspond to a plurality of business rules, for example, for the activity type and the business scenario of red packet activity + release, there may be a plurality of corresponding business rules, and thus, each activity type at least includes one business rule. Different types of service activities correspond to at least one service activity ID, such as red packet activity 1, red packet activity 2, red packet activity 3, etc., for example, and the different service activities are distinguished according to the activity IDs.
In order to determine the business rule corresponding to each activity, the business activity ID and the business rule corresponding to the activity type to which the business activity ID belongs are combined to obtain a preset business activity rule table, and the preset business activity rule table records the business activity ID and the corresponding business rule, for example, the business rule 1, the business rule 2, the business rule 3 corresponding to the red packet activity + distribution is the business rule 1-3 in the distribution scene corresponding to the red packet activity 1, and 3 preset business activity rule tables are generated.
In this embodiment, the service rules corresponding to the service scenario and the activity type are stored in the preset service rule definition table, the preset service activity rule table is determined according to the service activity, and different data are stored in different preset service tables, so that on one hand, the storage capacity of each preset service table is reduced, and on the other hand, when the target service rule is obtained subsequently, the query efficiency is high.
In a preferred embodiment, the target business activity includes a target activity type and a target activity ID;
determining a target business rule corresponding to the target business scene and the target business activity according to a preset business rule table; the method comprises the following steps:
determining a first business rule table from a preset business rule definition table according to the target activity type and the target business scene;
determining a second business rule table from a preset business activity rule table according to the target activity ID;
and determining a target business rule according to the first business rule table and the second business rule table.
In this embodiment, with continuing reference to fig. 2, the target business activity input by the user is a specific business activity, which includes a target activity type and a target activity ID, so that when the target business rule is confirmed, the first business rule table determined from the preset business rule definition table according to the target activity type and the target business scenario includes all the business rules corresponding to the target activity type and the target scenario; according to the target activity ID and the second service rule table determined in the preset service activity rule table, which includes all the service rules corresponding to the target activity ID, the intersection is taken from the first service rule table and the second service rule table, that is, the target service rule table is determined, for example, the target activity type is red packet, the target activity ID is red packet 1, the target service scene is issue, the first service rule table includes red packet and all the service rules corresponding to the issue, the second service rule table includes all the service rules corresponding to the red packet 1, therefore, the intersection is taken from the first service rule table and the second service rule table to obtain the red packet 1 and the service rules corresponding to the issue are the target service rules.
In the invention, the target business rule is determined according to the first business rule table and the second business rule table, and the target activity ID and the target business rule corresponding to the target business scene can be quickly and accurately obtained.
In a preferred embodiment, constructing the target business rule chain according to the target business rule table comprises:
acquiring a checker list, wherein the checkers in the checker list correspond to rule codes in the rule attributes one to one;
determining a target checker corresponding to the target service rule according to the checker list and the target rule code in the target rule attribute;
and sequencing the target checkers according to the target rule priority in the target rule attribute so as to obtain a target business rule chain.
In this step, the rule engine has a plurality of verifiers, and after the rule engine is started, the defined verifiers are initialized. The checker includes a checking method adopted when the business rule is checked, and the checker is in one-to-one correspondence with the rule codes in the rule attribute, that is, one business rule corresponds to one checker. When a target business rule chain is constructed, a target checker corresponding to a target business rule can be determined according to the checker list and the target rule code.
As shown in fig. 3, after the target verifier determines, the target verifiers are sorted according to the target rule priority in the target rule attribute, so that the arranged target verifiers can be obtained and put into the target verifier list to obtain the target service rule chain.
In the invention, the target checker is obtained according to the target rule attribute, and then the target service rule chain is determined according to the target rule priority, therefore, when the checking method and the checking method of the service rule are changed, only the corresponding checker and the rule priority need to be changed, and then, when the checking process of different service rules with the same service rule is changed, only one time of modification is needed, repeated modification is not needed, and the rule checking efficiency of the rule engine is improved.
Furthermore, the invention uniformly configures execution aging log output of the business rules, can observe the execution aging of each business rule, and automatically adjusts the execution sequence of the rules, namely the priority of the preset business rule definition table, thereby ensuring the minimization of the system overhead.
In a preferred embodiment, the checking the target service rule chain according to the target checking parameter to obtain the checking result includes:
verifying according to the target verification parameters and a target verification method of the target verifier to obtain a sub-verification result corresponding to the target verifier;
and determining a verification result according to the sub-verification result of the target verifier.
In this embodiment, the checking process of the target service rule chain includes checking according to the target checking parameter and a target checking method of the target checker to obtain a sub-checking result corresponding to the target checker, determining a final checking result after obtaining the sub-checking result, and returning the checking result to the user.
In a preferred embodiment, determining the verification result according to the sub-verification results of all the target verifiers includes:
acquiring a current sub-verification result of a current target verifier;
if the current sub-verification results are all successful in verification, the target verifier is put into a rollback list; until all the target verifiers are successfully verified, the verification result is successful;
and if the current sub-verification result is verification failure, determining that the verification result is verification failure.
In this embodiment, as for the method for checking the target service rule chain as traversing the target verifier in the target verifier list, as shown in fig. 4, a sub-check result corresponding to the current target verifier is obtained, after the sub-check result is obtained, the target verifier whose sub-check result is successful is put into the rollback list to prepare for subsequent rollback, and then the target checking method of the next target verifier is continuously executed, if the current sub-check result is failed in the checking process, the subsequent target verifier does not need to check, directly determines that the checking is failed, and returns the checking result to the user.
In a preferred embodiment, before determining that the verification result is a verification failure, the method further includes:
rolling back according to a rolling back method of the target verifier in the rolling back list;
wherein, the rollback method is a reverse method of the verification method.
In this embodiment, if the current sub-verification result is a verification failure, the rollback method of the target verifier in the rollback list starts to be executed, that is, reverse verification is performed, if A, B, C service rules are executed, the execution order is from a to B to C, after a and B are executed, C is not executed, at this time, rollback is performed, the execution data of a and B is restored to the state before the execution is not performed, and finally, the consistency of the data is ensured.
In the invention, when a certain rule fails to be checked, the executed rule can be automatically rolled back, manual hard coding processing is not needed, and a large amount of labor cost is saved.
In a preferred embodiment, before checking the target service rule chain according to the target checking parameter to obtain the checking result, the method further includes:
acquiring a target rule state in the target rule attribute and whether the target service rule is closed to be processed;
the obtaining of the sub-verification result corresponding to the target verifier by verifying according to the target verification parameter and the target verification method of the target verifier further comprises:
if the target rule state is invalid and the target service rule is not closed, the sub-verification result of the target service rule is verification failure;
and if the target rule state is invalid and the target service rule is closed to process, the self-sub verification result of the target service rule is successful.
In this embodiment, the target rule state includes valid and invalid, and the target rule state can be set to be invalid or valid by itself; whether the target service rule is closed or not is judged to be closed when the closing processing value reaches a closing processing threshold value. If the target rule state is invalid and the target business rule is not closed, the target business rule cannot pass verification, and the sub-verification result is verification failure; if the target rule state is invalid and the target business rule is closed to process, the target business rule passes verification, and the sub-verification result is verification success, so that the business availability of the rule engine can still be ensured under the condition that the rule is unavailable due to the service failure of the third party.
As shown in fig. 5, the present invention further provides a device for verifying a business rule, which is applied to a rule engine, and the device includes:
an obtaining module 501, configured to obtain a target service scene, a target service activity, and a target verification parameter configured by a user;
a determining module 502, configured to determine, according to a preset service rule table, a target service rule corresponding to a target service scenario and a target service activity;
a constructing module 503, configured to construct a target business rule chain according to the target rule attribute of the target business rule;
the checking module 504 is configured to check the target service rule chain according to the target checking parameter to obtain a checking result.
In a preferred embodiment, the preset service rule table includes a preset service rule definition table and a preset service activity rule table;
the building module 503 includes a first building unit, configured to build a preset service rule definition table according to a preconfigured service rule and a rule attribute, where the rule attribute includes a service activity type and a service scenario, and each service activity type corresponds to at least one service activity ID and at least one service rule; and the second construction unit is used for combining the service activity ID with the service rule corresponding to the service activity type to which the service activity ID belongs to obtain a preset service activity rule table.
In a preferred embodiment, the target business activity includes a target activity type and a target activity ID;
502 the determining module further comprises: the first determining unit is used for determining a first service rule table from a preset service rule definition table according to the target activity type and the target service scene; the second determining unit is used for determining a second business rule table from the preset business activity rule table according to the target activity ID; and the third determining unit is used for determining the target business rule according to the first business rule table and the second business rule table.
In a preferred embodiment, the 503 building module includes a checker list obtaining unit, configured to obtain a checker list, where the checkers in the checker list correspond to the rule codes in the rule attribute one to one;
the target checker determining unit is used for determining a target checker corresponding to the target service rule according to the checker list and the target rule code in the target rule attribute; and the target business rule chain determining unit is used for sequencing the target checkers according to the target rule priority in the target rule attribute so as to obtain the target business rule chain.
In a preferred embodiment, the verification module 504 further comprises: the sub-verification result determining unit is used for verifying according to the target verification parameters and a target verification method of the target verifier to obtain a sub-verification result corresponding to the target verifier; and the verification result determining unit is used for determining the verification result according to the sub-verification result of the target verifier.
In a preferred embodiment, the checking module 504 further includes a current sub-checking result determining unit, configured to determine a current sub-checking result of the current target checker; the rollback unit is used for putting the target verifier into a rollback list if the current sub-verification results are all successful in verification; the verification result determining unit is further used for determining that the verification result is successful until all the target verifiers are successfully verified; and if the current sub-verification result is verification failure, determining that the verification result is verification failure.
In a preferred embodiment, the rollback unit is further configured to perform rollback according to a rollback method of the target verifier in the rollback list; wherein, the rollback method is a reverse method of the verification method.
In a preferred embodiment, the obtaining module 501 is further configured to obtain a target rule state in the target rule attribute and whether the target service rule is to close processing;
the checking module 504 is further configured to, if the target rule state is invalid and the target business rule is not closed to process, determine that the sub-checking result of the target business rule is a checking failure; and if the target rule state is invalid and the target service rule is closed to process, the sub-verification result of the target service rule is successful in verification.
The service rule checking device of the invention can realize the beneficial effects of the service rule checking method as described above, and is not described herein again.
The present invention also provides an electronic device, comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform a method of checking a business rule.
For the execution process and the technical effect that can be achieved in this embodiment, please refer to the description of the verification method applied to the service rule, which is not described herein again.
The present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for checking the business rule, and please refer to the foregoing description for the execution process and the technical effect that can be achieved by the method, which are not described herein again.
The present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for checking the business rule, and please refer to the foregoing description for the execution process and the technical effect that can be achieved by the method, which are not described herein again.
Fig. 6 illustrates an architecture of an electronic device, which may specifically include a processor 610, a video display adapter 611, a disk drive 612, an input/output interface 613, a network interface 614, and a memory 620. The processor 610, the video display adapter 611, the disk drive 612, the input/output interface 613, the network interface 614, and the memory 620 may be communicatively connected by a communication bus 630.
The processor 610 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solution provided by the present invention.
The Memory 620 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 620 may store an operating system 621 for controlling the operation of the computer system, a Basic Input Output System (BIOS) for controlling low-level operations of the computer system. In addition, a web browser 623, a data storage management system 624, a device identification information processing system 625, and the like may also be stored. The device identification information processing system 725 may be an application program that implements the operations of the foregoing steps in the embodiment of the present invention. In summary, when the technical solution provided by the present invention is implemented by software or firmware, the relevant program codes are stored in the memory 620 and called for execution by the processor 610.
The input/output interface 613 is used for connecting an input/output module to realize information input and output. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The network interface 614 is used for connecting a communication module (not shown in the figure) to realize the communication interaction between the device and other devices. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 630 includes a path that transfers information between the various components of the device, such as processor 610, video display adapter 611, disk drive 612, input/output interface 613, network interface 614, and memory 620.
It should be noted that although the above devices only show the processor 610, the video display adapter 611, the disk drive 612, the input/output interface 613, the network interface 614, the memory 620, the bus 630, etc., in a specific implementation, the device may also include other components necessary for normal operation. Furthermore, it will be understood by those skilled in the art that the apparatus described above may also include only the components necessary to implement the inventive arrangements, and need not include all of the components shown in the figures.
The computer program product of the invention comprises a computer program carried on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means, or installed from the memory, or installed from the ROM. The computer program, when executed by a processor, performs the functions defined above in the method of embodiments of the invention.
It should be noted that the computer readable medium of the embodiments of the present invention may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present invention, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the server; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: when the peripheral mode of the terminal is detected to be not activated, acquiring a frame rate of an application on the terminal; when the frame rate meets the screen-off condition, judging whether a client acquires screen information of the terminal; and controlling the screen to enter an immediate dimming mode in response to the judgment result that the client does not acquire the screen information of the terminal.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the client computer, partly on the client computer, as a stand-alone software package, partly on the client computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The method, the apparatus and the electronic device for verifying the business rules provided by the present invention are described in detail, and a specific example is applied in the description to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.

Claims (10)

1. A method for verifying a business rule, applied to a rule engine, the method comprising:
acquiring a target service scene, a target service activity and a target verification parameter configured by a user;
determining a target business rule corresponding to the target business scene and the target business activity according to a preset business rule table;
constructing a target business rule chain according to the target rule attribute of the target business rule;
and verifying the target service rule chain according to the target verification parameter to obtain a verification result.
2. The method of claim 1, wherein the predefined business rule table comprises a predefined business rule definition table and a predefined business activity rule table;
before determining the target business rule corresponding to the target business scenario and the target business activity according to a preset business rule table, the method further comprises the following steps:
constructing the preset service rule definition table according to a preset service rule and a rule attribute, wherein the rule attribute comprises service activity types and service scenes, and each service activity type at least corresponds to one service activity ID and at least one service rule;
and combining the service activity ID and the service rule corresponding to the service activity type to which the service activity ID belongs to obtain the preset service activity rule table.
3. The method of claim 2, wherein the target business activity comprises a target activity type and a target activity ID;
the determining, according to a preset service rule table, a target service rule corresponding to the target service scenario and the target service activity includes:
determining a first service rule table from the preset service rule definition table according to the target activity type and the target service scene;
determining a second business rule table from the preset business activity rule table according to the target activity ID;
and determining a target business rule according to the first business rule table and the second business rule table.
4. The method of claim 1, wherein constructing a target business rule chain according to a target rule attribute of the target business rule comprises:
acquiring a checker list, wherein the checkers in the checker list correspond to rule codes in rule attributes one to one;
determining a target checker corresponding to the target service rule according to the checker list and a target rule code in the target rule attribute;
and sequencing the target checkers according to the target rule priority in the target rule attribute so as to obtain a target business rule chain.
5. The method of claim 4, wherein the checking the target business rule chain according to the target checking parameter to obtain a checking result comprises:
verifying according to the target verification parameters and a target verification method of the target verifier to obtain a sub-verification result corresponding to the target verifier;
and determining the verification result according to the sub-verification result of the target verifier.
6. The method of claim 5, wherein the determining the verification result from the sub-verification result of the target verifier comprises:
acquiring a current sub-verification result of a current target verifier;
if the current sub-verification results are all successful in verification, the target verifier is put into a rollback list; until all the target verifiers are verified successfully, the verification result is successful;
and if the current sub-verification result is verification failure, determining that the verification result is verification failure.
7. The method of claim 6, wherein before determining that the verification result is a verification failure, the method further comprises:
rolling back according to the rolling back method of the target verifier in the rolling back list;
wherein, the rollback method is a reverse method of the verification method.
8. The method according to any one of claims 5 to 7, wherein before the obtaining the verification result by verifying the target business rule chain according to the target verification parameter, the method further comprises:
acquiring a target rule state in the target rule attribute and whether the target service rule is closed to be processed;
the checking the target service rule chain according to the target checking parameter to obtain a checking result further comprises:
if the target rule state is invalid and the target service rule is not closed to process, the sub-verification result of the target service rule is verification failure;
and if the target rule state is invalid and the target service rule is closed to process, the sub-verification result of the target service rule is successful.
9. A business rule verification apparatus, applied to a rule engine, the apparatus comprising:
the acquisition module is used for acquiring a target service scene, a target service activity and a target verification parameter configured by a user;
the determining module is used for determining a target business rule corresponding to the target business scene and the target business activity according to a preset business rule table;
the construction module is used for constructing a target business rule chain according to the target rule attribute of the target business rule;
and the checking module is used for checking the target service rule chain according to the target checking parameter to obtain a checking result.
10. An electronic device, comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the method of any of claims 1-8.
CN202111420066.2A 2021-11-26 2021-11-26 Business rule checking method and device and electronic equipment Pending CN114092116A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111420066.2A CN114092116A (en) 2021-11-26 2021-11-26 Business rule checking method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111420066.2A CN114092116A (en) 2021-11-26 2021-11-26 Business rule checking method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114092116A true CN114092116A (en) 2022-02-25

Family

ID=80304916

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111420066.2A Pending CN114092116A (en) 2021-11-26 2021-11-26 Business rule checking method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114092116A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115185616A (en) * 2022-09-14 2022-10-14 深圳依时货拉拉科技有限公司 Business rule engine and processing method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115185616A (en) * 2022-09-14 2022-10-14 深圳依时货拉拉科技有限公司 Business rule engine and processing method thereof

Similar Documents

Publication Publication Date Title
US20160210632A1 (en) Secured payment method and relevant device and system
CN103313216B (en) Message prompt method, system and device for communication account
US20160321628A1 (en) Online payment method, system, and apparatus
CN107205057A (en) A kind of game resource update method, device and client
CN110377522B (en) Transaction scene testing method, device, computing equipment and medium
CN106557962A (en) Method of payment, apparatus and system
CN112035344A (en) Multi-scenario test method, device, equipment and computer readable storage medium
CN104376452A (en) System and method for managing payment success rate on basis of international card payment channel
CN113361838A (en) Business wind control method and device, electronic equipment and storage medium
CN112308590B (en) Parameter processing method and device, computing equipment and storage medium
CN114092116A (en) Business rule checking method and device and electronic equipment
CN104462934A (en) Information processing method and electronic equipment
CN109087089B (en) Payment method, payment device and terminal equipment
CN110321122A (en) The development approach and relevant device of browser application
CN109446081A (en) For the test method of HTML5 webpage, system, equipment and medium
CN112286796A (en) Software testing method, device and storage medium
CN110111188B (en) Business handling method and equipment
CN110175915B (en) Service execution result obtaining method and system based on block chain
CN114285774B (en) Flow recording method and device, electronic equipment and storage medium
CN114428815A (en) Data storage method and device, electronic equipment and computer readable medium
CN113868531A (en) Information acquisition method and device, electronic device and medium
CN112600803B (en) Web end data signature method and device and computer equipment
CN114091909A (en) Collaborative development method, system, device and electronic equipment
CN114374703A (en) Method, device and equipment for acquiring cloud mobile phone information and storage medium
CN113890906A (en) Call forwarding method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination