Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present disclosure.
Fig. 1 is a flowchart of a service data processing method according to this specification. The method comprises the following steps:
step S101: and matching the business data processing request with the business rules in the rule engine.
Due to different service scenes, different service data processing requests exist, and the service data processing requests need to be identified and judged, and correct processing rules are selected.
In the prior art, various inputs are uniformly output through a rule engine by configuring different rules to obtain a processing result. The advent of the rules engine solves the complexity problem of rule management. The rules engine is a component that separates business decisions from application code and uses predefined semantic modules to write business decisions, accepts data input, interprets business rules, and makes business decisions based on the business rules. The rule engine can realize componentization and configuration, the engine does not need to care about services, a service layer does not need to judge and process a large number of branches, and meanwhile, service changes do not need to adjust processing logic and can be completed only by configuring different rules.
Fig. 2 shows a rule configuration scheme provided for the present specification. The rule configuration information includes, but is not limited to, the following: rule names, rule expressions, rule conditions, rule constituent elements, and the like.
The rule constituent elements refer to basic objects required to generate the rules, such as various parameters, symbols describing parameter relationships, remark codes and the like.
The rule condition is information for describing a usage pattern of a rule component element, and various determination steps can be set by using the rule condition.
In the embodiments of the present specification, a business rule is defined according to a specific business scenario. The business rule comprises two parts, namely a condition and a trigger operation, wherein the condition is used for judging the action of the business data, and the trigger operation is used for processing the business data, namely what operation needs to be executed when the condition is met. Meanwhile, priority is set for the business rules. The business rule priority is a rule attribute defined according to the execution sequence of the business rule, and the rule corresponding to the business rule priority is unique. The business rules are responded according to the priority, so that the response speed of the rule engine can be improved, and the processing speed of the business data request is accelerated.
The business rules matched with the business data processing requests are executed according to the priority of the business rules after the business data processing requests enter the rule engine. And if the service data processing request fails to be matched, continuing to match the service rules according to the priority of the service rules. And if the business data processing request is successfully matched, adding the successfully matched business rule into the successfully matched business rule of the business data processing request. And according to the circulation process and the priority of the business rules, completing the matching of all the business rules to obtain the business rules successfully matched by the business data processing request. In a practical application scenario, the number of business rules in the rule engine will generally not exceed 1000.
Step S102: and performing exclusion detection on the service rule successfully matched with the service data processing request according to the exclusion rule.
In order to avoid the rule configuration exception, the successfully matched service rule obtained by the service data processing request in step S101 needs to be further subjected to exclusion detection.
In embodiments of the present description, an exclusion rule is a rule that is triggered by the same business data processing request, separated from the business rule set. The exclusion rule sets the priority, and when the exclusion detection is carried out, the detection is carried out according to the priority of the exclusion rule. The priority of the exclusion rule is the same as the priority of the business rule in the rule engine. For a business rule for which there is no exclusion rule, the exclusion rule for that business rule is defined as null.
In the process of processing the service data, if the service rule successfully matched with the service data processing request is consistent with the exclusion rule, the exclusion detection is passed, and a configuration rule of the service rule successfully matched with the service data processing request is returned according to the exclusion rule. And if the business rule successfully matched with the business data processing request is inconsistent with the exclusion rule, the exclusion detection is abnormal.
Step S103: and processing the service data processing request according to the returned result of the rejection detection.
The service data processing request is executed on the service processor according to the result returned by the exclusion rule in step S102. And if the returned result of the exclusion detection is that the exclusion detection is passed, executing the service data processing request by using the configuration rule returned by the exclusion detection. And if the returned result of the rejection detection is that the rejection detection is abnormal, sending an abnormal alarm to the service data processing request.
Fig. 3 is a specific implementation of service data processing provided in an embodiment of this specification, which specifically includes:
step S301: and receiving a service data processing request.
Step S302: and the service data processing request enters a rule engine, and all rules are circularly traversed according to the priority of the service rules to obtain the service rules successfully matched with the service data processing request.
After the service data processing request of step 301 enters the rule engine, the plurality of service rules are executed according to the default priority. And if the service data processing request fails to be matched, continuing to match the service rules according to the priority of the service rules. And if the business data processing request is successfully matched with the business rule, adding the business rule into the business rule successfully matched with the business data processing request to obtain the business rule successfully matched with the business data processing request.
Step S303: and the business data processing request is matched with the successfully matched business rule, and exclusion detection is carried out according to the exclusion rule.
After the priority rule matching in step S302, the service rule that the service data processing request is successfully matched is obtained, and in order to ensure the correctness of the rule configuration, further exclusion detection is required. And according to the priority of the exclusion rule, taking the bar as a unit to retrieve the service rule from the service rules successfully matched with the service data processing request, and performing exclusion detection on the retrieved service rule from the service rules successfully matched with the service data processing request by using the exclusion rule of the retrieved service rule.
If the successfully matched service rule of the service data processing request is inconsistent with the exclusion rule, the exclusion detection is abnormal; if the matched business rule is consistent with the exclusion rule, the exclusion detection is passed, and according to the exclusion rule, the matched business rule returns a configuration rule.
According to the thought, the rules in the matching business rules are detected in sequence, and whether the exclusive relationship exists in the matching business rules is verified. Because the business data processing request is configured by a single rule, if the exclusion detection is passed, the rule with correct configuration is obtained, and the subsequent exclusion detection is stopped. And if the rejection rule detection is abnormal, continuously fishing the service rule from the service rule successfully matched with the service data processing request according to the priority of the rejection rule, and performing rejection detection on the service rule successfully matched with the service data processing request by using the rejection rule of the fished service rule until the rejection detection is passed or the rejection detection of all the service rules successfully matched with the service data processing request is completed. If the rejection detection is abnormal after all the successfully matched business rules of the business data processing request are subjected to the rejection detection, the business data processing request is not correctly configured with the rules, and the business is abnormal.
In an actual service scenario, since the service rule is set according to the service scenario, the situation of repeating the service rule may occur with the increase of the service scenarios, resulting in a rule configuration error. If two rules are defined, rule A: the payee and the counterpart are xxx companies, and the counterpart is a counterpart: and (5) opening the leaf. Rule B: collection, the opposite method: and (5) opening the leaf. The corporate of xxx in rule a is Zhang III, which is a duplicate of the corporate of rule B, but is not the same person. For a service data processing request: the collection is 100 yuan, the opposite company is xxx company, the method is Zhang III, and the opposite method is Zhang III. In this case, the 2 rules are all satisfied, and the matching rule lists of the business data processing request are a and B, i.e., xxx, zhang. But the business has a unique and clear definition for the business data processing request, so the rule configuration is in conflict.
In order to solve the above problem, an exclusion rule of the service data processing request is further defined according to the service data processing request rule. If the exclusion rule for the above-mentioned service is specified as: rule xxx, exclusive rule Zhang III. It is therefore necessary to determine if the list of actual rules hit is equal to xxx corporation + zhang. The actual configuration rule is xxx, zhang III, so the rule configuration is correct.
The matching rule xxx, zhang san of the business data processing request is a correct configuration rule, and the exclusion rule of xxx is zhang. The execution rule of the business data processing request is xxx, that is, the business requested by the business data processing request is executed according to rule a.
Step S304: and processing the service data processing request according to the rejection detection result.
The results of rejection detection include two types: if the successfully matched service rule of the service data processing request is inconsistent with the exclusion rule, the exclusion detection is abnormal; and if the successfully matched service rule of the service data processing request is consistent with the exclusion rule, the exclusion detection is passed. And processing the service data processing request according to a return result of the rejection detection. Rejecting detection abnormity, and sending an abnormity alarm to the service data processing request; and if the rejection detection is passed, processing the service data processing request according to the returned rule.
Specifically, the service data processing request is executed according to the obtained actual matching rule a, that is, the service requested by the service data processing request is executed according to the rule a. I.e., a request for payment transaction data, transfers 100 elements to the xxx company account.
To further illustrate the embodiments of the present invention, fig. 4 is an example of a theoretical matching rule and an expected matching rule corresponding to a business scenario in a rule configuration provided in an example of this specification. This example is for illustrative purposes only, and does not represent the actual number of business scenarios and business rules. In a particular implementation, the business scenarios and rules are more complex than in the example.
In one or more embodiments of the present specification, for different services, service rules corresponding to service scenarios, such as service rules a, B, C, and D, are defined according to service characteristics. That is, the matching rule desired for scenario 1 is business rule a, the matching rule desired for scenario 2 is business rule C, and the matching rule desired for scenario 3 is business rule D. In the actual service rule configuration, the successfully matched rules of the scene 1 are the service rules a and B, the successfully matched rules of the scene 2 are the service rule C, and the successfully matched rules of the scene 3 are the service rules C and D. Although the business rules are set according to the business scenarios, as the number of the business scenarios increases, the situation of repeating the business rules occurs, resulting in a rule configuration error.
In order to reduce rule configuration errors in a service scenario, the service scenario and the service rules are analyzed, and an exclusion rule is determined. The definition of the exclusion rule is made based on fig. 4. FIG. 5 is a diagram illustrating the priority and exclusion rules of business rules provided herein.
Defining priorities for the business rules A, B, C and D, wherein the priorities are relative to the priorities of other business rules, and one business rule corresponds to one priority; meanwhile, according to the logical relationship of the service scene, an exclusion rule is defined. The rule exclusion rule of the business rule a is the business rule B, that is, in the business scenario, the business rule a and the business rule B must exist simultaneously to consider the rule configuration to be correct. And if the successfully matched business rule of the business scene only has the business rule A or the business rule B, the rule configuration is considered to be wrong. Meanwhile, the exclusion rule has a unidirectional property, and the exclusion rule of the business rule a is the business rule B, but the exclusion rule of the business rule B is not necessarily the business rule a. The rule of the exclusion rule is similar to the union relationship, e.g., rule key1=1& & key2=2& & key3=3 of a, rule of B is key1=1& & key2=2, B must also be satisfied when a is satisfied, but a is not necessarily satisfied when B is satisfied.
This example is for illustrative purposes only, and does not represent an actual number of exclusion rules to explain the present specification. In a particular implementation, the number of rules and the exclusion rules may be more complex than in the example.
For further explanation of the present invention, fig. 6 is a specific implementation of another service data processing method provided in an embodiment of the present specification. The difference between this embodiment and the embodiment shown in fig. 3 is that, before the exclusion rule is detected, the business rules included in the exclusion rule are added, and the comparison with the business rules successfully matched with the business data processing request is performed. The method comprises the following specific steps:
and the service data processing request enters a rule engine, and is matched according to the priority of the service rule to obtain the service rule successfully matched with the service data processing request. And comparing the business rules contained in the exclusion rules with the business rules successfully matched with the business data processing request. And if the service rule contained in the exclusion rule comprises the service rule successfully matched with the service data processing request, performing exclusion detection on the service rule successfully matched with the service data processing request according to the exclusion rule. And if the business rules contained in the exclusion rules do not comprise the business rules successfully matched with the business data processing request, excluding detection exception and sending an exception alarm.
In an actual service scene, the service data processing request 1 traverses all service rules according to the priority of the service rules, and performs service rule matching to obtain successfully matched service rules A and B. Then, whether the business rules contained in the exclusion rules include the business rules successfully matched, that is, whether the exclusion rules include the exclusion rules of the business rule a and the business rule B is detected. If the exclusion rule does not include the exclusion rules of the business rule A and the business rule B, the exclusion detection is considered to be abnormal, and an abnormal alarm is sent out. And if the exclusion rule comprises the exclusion rules of the business rule A and the business rule B, performing next exclusion detection. In the next step of rejection detection, firstly, a service rule a is selected for rejection detection according to the priority of the rejection rule, as shown in fig. 5, the rejection rule of the service rule a is a service rule B, the rejection rule is consistent with the successfully matched service rule, and the rejection detection is passed; and further excluding the service rule B according to the exclusion rule of the service rule A to obtain the actual configuration rule of the service data processing request 1 as the service rule A, and processing the service data processing request 1 according to the service rule A.
Similarly, based on the above idea, the service rules successfully matched in the scenario 3 are the service rules B, C, and D, and the exclusion rule in the exclusion rule does not include the exclusion rules of the service rules B, C, and D, so that the exclusion of the scenario 3 detects an exception, and an exception alarm is issued to the scenario 3, thereby avoiding a rule configuration error.
Similarly, the successfully matched service rules of the scenario 5 are C and D, and the exclusion rule includes the exclusion rules of the service rule a and the service rule B, so that the next step of exclusion rule detection is performed. And according to the priority of the exclusion rule, the business rule C is fished from the successfully matched business rules for exclusion detection, and the exclusion rule of the business rule C is null, so that the actual configuration rule of the business scene 5 is not the business rule C. And then, a service rule D is fished for exclusion detection, the exclusion rule of the service rule D is a service rule C, and the configuration of the service rule is correct. And (4) the business rule C is discharged by using the exclusion rule, so that the actual configuration rule of the scene 5 is the business rule D, and the scene 5 is processed according to the business rule D.
In another embodiment of this specification, the service data processing request is matched with the service rule in the rule engine according to the priority of the service rule, and a rule that is successfully matched is obtained, then the rule of the service data processing request is configured correctly, and the service data processing request is processed according to the rule that is successfully matched.
Based on the rules defined in fig. 5 and fig. 6, the processing method of any service data processing provided in the foregoing embodiment is adopted to obtain the processing result diagram of the specific service data request shown in fig. 7. By adopting the method provided by the embodiment of the invention, the abnormal rule can be found, and the system risk of the business data processing is reduced.
Based on the same idea, as shown in fig. 8, a service data processing apparatus provided in an embodiment of this specification includes:
a receiving unit 801, configured to receive a service data processing request;
the rule engine unit 802 performs exclusion detection on the service rule successfully matched with the service data processing request according to an exclusion rule, wherein the exclusion rule reflects an exclusion relationship between different service rules;
the service processing unit 803 processes the service data processing request according to the result returned by the rejection detection.
Based on the same idea, an embodiment of this specification further provides a device for processing service data, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to process requests for business data.
Embodiments of the present specification also provide a computer-readable storage medium for storing a program, which when executed, implements a business data processing request.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
on the basis of conventional rule configuration, the embodiment of the specification adds exclusion detection, finds out rule configuration problems in real time, finds out exclusion rule abnormity, blocks services in time and reduces error scenes of multiple matching of single services.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
All 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 other embodiments. In particular, for the embodiments of the apparatus, the electronic device, and the nonvolatile computer storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and the relevant points can be referred to the partial description of the embodiments of the method.
The apparatus, the electronic device, the nonvolatile computer storage medium, and the method provided in the embodiments of the present specification correspond to each other, and therefore, the apparatus, the electronic device, and the nonvolatile computer storage medium also have similar advantageous technical effects to the corresponding method.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as ABEL (Advanced Boolean Expression Language), AHDL (alternate Hardware Description Language), traffic, CUPL (core universal Programming Language), HDCal, jhddl (Java Hardware Description Language), lava, lola, HDL, PALASM, rhyd (Hardware Description Language), and vhigh-Language (Hardware Description Language), which is currently used in most popular applications. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium that stores computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in purely computer readable program code means, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, respectively. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, the embodiments described herein may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus comprising the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
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, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The above description is only an example of the present disclosure, and is not intended to limit the present disclosure. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.