CN113688158A - Processing method, device, equipment, system and medium for business rule verification - Google Patents

Processing method, device, equipment, system and medium for business rule verification Download PDF

Info

Publication number
CN113688158A
CN113688158A CN202111045759.8A CN202111045759A CN113688158A CN 113688158 A CN113688158 A CN 113688158A CN 202111045759 A CN202111045759 A CN 202111045759A CN 113688158 A CN113688158 A CN 113688158A
Authority
CN
China
Prior art keywords
rule
server
service
user
rule data
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
CN202111045759.8A
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.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding 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 Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202111045759.8A priority Critical patent/CN113688158A/en
Publication of CN113688158A publication Critical patent/CN113688158A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The application provides a processing method, a device, equipment, a system and a medium for business rule verification. The method is applied to a service server and comprises the following steps: receiving a rule checking request of a service, wherein the rule checking request comprises user information and/or order information of a user; acquiring rule data corresponding to the service from a local cache of the service server, wherein the rule data are data which are acquired by the service server from a cache server cluster and stored in the local cache of the service server and are used for verifying whether a user and/or a user order meet a preset service rule or not, and the rule data in the cache server cluster are data which are acquired by a task server from a database and are sent to the cache server cluster for storage; verifying the user and/or the user order according to the rule data corresponding to the service to obtain a verification result, wherein the verification result comprises whether the user and/or the user order conforms to the service rule; and returning the verification result to the terminal equipment of the user.

Description

Processing method, device, equipment, system and medium for business rule verification
Technical Field
The present application relates to computer technologies, and in particular, to a method, an apparatus, a device, a system, and a medium for processing a business rule check.
Background
In a shopping scenario, it is often necessary to verify business rules of information of a user or order information of the user, so as to execute business decisions corresponding to the business rules for the user or order meeting the business rules.
The business rules are typically stored in a database. When each user enters an article detail page or orders are placed, the terminal equipment of the user sends a service rule verification request to the service server, and the service server further performs service rule verification. At present, a service server periodically obtains rule data from a database and stores the rule data in a local cache of the service server, and during each time of service rule verification, the service server obtains the rule data from the local cache, verifies the rule data according to a received service rule, and returns a verification result to a terminal device of a user.
However, the number of the service servers is large, and if each service server obtains the rule data from the database, the access pressure on the database is generated.
Disclosure of Invention
The application provides a processing method, a processing device, equipment, a processing system and a processing medium for service rule verification, which are used for solving the problem that the number of service servers is large, and if each service server acquires rule data from a database, the database is subjected to access pressure.
In a first aspect, the present application provides a processing method for service rule verification, which is applied to a service server, and the method includes: receiving a rule checking request of a service, wherein the rule checking request comprises user information and/or order information of a user; acquiring rule data corresponding to the service from a local cache of the service server, wherein the rule data are obtained by the service server from a cache server cluster and stored in the local cache of the service server, and are used for verifying whether a user and/or a user order conforms to a preset service rule, and the rule data in the cache server cluster are data obtained by a task server from a database and sent to the cache server cluster for storage; checking the user and/or the order of the user according to the rule data corresponding to the service to obtain a checking result, wherein the checking result comprises whether the user and/or the order of the user accord with the service rule or not; and returning the verification result to the terminal equipment of the user.
In some optional embodiments, the method further comprises: acquiring rule data from the cache server every preset time; and storing the acquired rule data to a local cache of the service server.
In some optional embodiments, the rule data includes a plurality of service rule groups, each service rule group is obtained by grouping the obtained rule data by the task server, and each service rule group corresponds to one service decision.
In some alternative embodiments, the rule data comprises a plurality of rules; the rule data sent by the task server to the cache server cluster is a rule group obtained by combining the rules with incidence relations in the multiple rules by the task server.
In a second aspect, the present application provides a processing method for checking a business rule, which is applied to a task server, and the method includes: acquiring rule data from a database at preset time intervals; sending the rule data to a cache server; the rule data in the cache server is used for being provided to a business server, so that the business server stores the rule data to a local cache of the business server, and when a rule checking request is received, the rule data is obtained from the local cache to check the rule checking request, and a checking result is obtained, wherein the checking result includes whether user data and/or order data meet business rules.
In some optional embodiments, the rule data comprises a plurality of rules, the method further comprising: grouping the rule data to obtain rule groups, wherein each rule group corresponds to a service decision; and/or a rule group obtained by combining the rules with the association relation in the plurality of rules.
In some optional embodiments, the method further comprises: determining whether rule data in a database is changed; and if the rule data are changed, acquiring the changed rule data from the database and sending the changed rule data to the cache server.
In some optional embodiments, the determining whether the rule data in the database is changed includes: and if a prompt message that the rule data sent by the configuration server changes is received, determining that the rule data in the database changes.
In some optional embodiments, each rule in the plurality of rules corresponds to a usage frequency, and after the rule data is obtained from the database at every preset time interval, the method further includes: determining rule data of which the use frequency of the rule data is greater than or equal to a preset frequency in the rule data to obtain target rule data; and sending the target rule data to a cache server.
In a third aspect, the present application provides a processing apparatus for checking a business rule, including: the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a rule checking request of a service, and the rule checking request comprises information of a user and/or order information of the user; the acquisition module is used for acquiring the rule data corresponding to the service from the local cache of the service server, wherein the rule data are acquired by the service server from the cache server cluster and stored in the local cache of the service server, and are used for verifying whether a user and/or an order of the user conforms to a service rule, and the rule data in the cache server cluster are data acquired by the task server from the database and sent to the cache server cluster for storage; the verification module is used for verifying the user and/or the order of the user according to the rule data corresponding to the service to obtain a verification result, wherein the verification result comprises whether the user and/or the order of the user accord with the service rule or not; and the return module is used for returning the verification result to the terminal equipment of the user.
In a fourth aspect, the present application provides a processing apparatus for checking a business rule, including: the acquisition module is used for acquiring rule data from the database at preset time intervals; the sending module is used for sending the rule data to a cache server; the rule data in the cache server is used for being provided to a business server, so that the business server stores the rule data to a local cache of the business server, and when a rule checking request is received, the rule data is obtained from the local cache to check the rule checking request, and a checking result is obtained, wherein the checking result includes whether user data and/or order data meet business rules.
In a fifth aspect, the present application provides a processing system for checking a business rule, including: a service server for performing the method according to the first aspect; a task server for performing the method according to the second aspect; and the cache server is respectively connected with the service server and the task server.
In a sixth aspect, the present application provides a computer device comprising: a memory, a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to implement the method of the first aspect.
In a seventh aspect, the present application provides a computer-readable storage medium having stored thereon computer-executable instructions for implementing the method according to the first aspect when executed by a processor.
In an eighth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the method of the first aspect.
The processing method, device, equipment, system and medium for service rule verification, provided by the application, are used for regularly acquiring rule data from a database through a task server and pushing the rule data to a cache server. The business server actively pulls the rule data from the cache server regularly and stores the rule data in a local cache. Therefore, when the rule checking request is received, the rule data can be directly obtained from the local cache and the rule checking is carried out. Because the local cache and the application program run in the same process, delay and overhead on a network do not exist when the local cache is accessed, so that the operation of the local cache is very fast, the time for acquiring the service rule can be shortened, the service verification efficiency is improved, and high-concurrency scenes and the like are met. In the embodiment, one task server accesses the database and then stores the database in the cache server cluster, the service server directly obtains the rule data from the cache server cluster, and the cache server cluster comprises a plurality of cache servers, so that the access of the plurality of service servers can be met, and the access pressure to the database is reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
FIG. 1 is an architecture diagram of a prior art business rule check;
fig. 2 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 3 is a flowchart of a processing method for checking a business rule according to an embodiment of the present application;
fig. 4 is a logic diagram of a processing method for checking a business rule according to an embodiment of the present application;
FIG. 5A is a graph illustrating pressure test results provided by an embodiment of the present application;
FIG. 5B is a graph illustrating pressure test results provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of a processing apparatus for checking a business rule according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of another processing apparatus for business rule checking according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The rule engine is a component embedded in the application program, and realizes the separation of business decisions from the application program code and the writing of business decisions by using predefined semantic modules. The rule engine accepts data input, interprets business rules, and makes business decisions based on the business rules. Wherein a business rule comprises a set of conditions and operations performed under the conditions to represent a piece of business logic of an application. The rule engine can load an external business rule into the business system when the business system works, and the business system can carry out rule verification according to the business rule.
The rules engine mainly comprises two stages: and configuring and checking the business rules. These two parts will be described separately below with reference to the attached drawings:
FIG. 1 is an architecture diagram of a prior art business rule check. As shown in fig. 1, the architecture of the business rule check includes: a configuration unit 1 and a verification unit 2; wherein, configuration unit 1 includes: a configuration layer 11, a service layer 12 and a data layer 13.
The configuration layer 11 includes at least one computer device for providing a function of configuring the business rule. Illustratively, the computer device of the configuration layer 11 provides a configuration page of the business rules, and the operator configures the business rules on the configuration page, where the configured business rules include: user type rules, order type rules, interface type rules, and logic type rules.
The user type rule refers to a rule for verifying a user, such as: whether the user is a new user, whether the user is a real-name user, whether the user is a white bar user, whether the user is a super-white user, and the like.
The order type rule refers to a rule for checking an order, such as: the order type must be a fee refill, the order type must be an a source order, the order type must be a B source order, etc.
Interface type rules, the service logic judges that it needs to rely on other Remote Procedure Call (RPC) interfaces, and calls other interfaces to judge whether the rules pass.
Logic type rules, for example: and (4) carrying out rules of combinational logic calculation such as size comparison, inclusion and time range.
After the configuration layer 11 configures the business rules, the service layer 12 needs to classify the business rules into activity rules, right rules, participation rules and large text rules again according to the user type rules, order type rules, interface type rules and logic rules;
for example, the activity rule includes a rule related to a specific activity, for example, if the number of items in the order is greater than or equal to a preset number, a corresponding business decision, for example, an offer, may be given to the order. The active rules may include at least one of user-type rules, order-type rules, interface-type rules, and logic rules.
The entitlement rule refers to a usage rule of the offer, i.e., a restriction condition when the offer is used, for example, a corresponding offer is paid using a white bar.
The engagement rules refer to the total number of engagements for each person for an activity.
The large text rule is a special rule, for example, the limit of Stock Keeping Unit (SKU), 10 or more SKU IDs may be configured in the rule configuration, and since the number of configured SKU IDs is too large, the storage amount in the rule table is large, so that this part of data is stored separately in another table, which is the large text.
The data layer 13 includes a database, the configuration layer 11 stores the configured service rule into the database 13, and when the service takes effect, the service rule corresponding to the service takes effect.
The verification unit 2 includes: a user layer 21, a gateway layer 22, a load layer 23, a service layer 24 and a data layer 25.
The user layer 21 includes a user terminal, such as a smart phone, a tablet computer, and the like.
The gateway layer 22 includes gateways; the user layer 21 is communicatively connected to the load layer 23 via the gateway layer 22.
The load layer 23 includes a plurality of load balancing servers, which are used for performing traffic forwarding, that is, determining a service server for processing a request of a user through a load balancing policy.
The service layer 24 includes a plurality of business servers, each of which has a rules engine disposed therein.
The data layer 25 includes a database.
Based on the architecture in fig. 1, the flow of service verification includes: when a user accesses a service system through a user terminal, the user terminal enters one of the servers in the load layer through the gateway, the server determines a service server for processing a user request through a load balancing strategy, and forwards the user request to the service server, and the service server pulls a service rule from the database. The obtained business rules include single rule information and large text rule information, for example: whether it is a new user rule, whether the order is contained in a SKU white list (perhaps tens of thousands), etc. And then grouping the business rules to form a rule group, and then submitting the rule group to a verification engine for verifying the business rules. And finally, packaging all the verification results of the time and returning the verification results to an upstream system.
In the related art, the rule engine performs the business rule check in real time. That is, each user accessing the service system will perform the service verification process. Thus, the database is frequently accessed to obtain the business rules, which is very stressful for the database. And for the rule engine, the time consumption of rule verification is long, and if high-traffic high-concurrency scenes are met, the efficiency of rule verification is low, so that the user experience is poor.
In some related technologies, it is proposed to set a local cache at the service server side, and the service server stores the rule data obtained from the database in the local cache, however, the number of the service servers is large, and if each service server obtains the rule data from the database, access pressure is applied to the database. In addition, the memory of the local cache is small, and the storage time is short, so that the access frequency of the service server to the database is high, and the access pressure of the database is further increased.
In view of the above technical problems, the inventors of the present application found that: in the whole rule checking process, for each rule checking, the rule engine needs to acquire rule data from the database, and accessing the database needs to establish connection with the database first and then query the business rules in the database, and it still takes time for the database to return the query result to the rule engine, which is the reason that the rule checking efficiency is low. Therefore, if the link of accessing the database in the whole rule checking process can be omitted, the rule checking efficiency can be improved. Most rule data needs to be stored persistently, so that the database cannot be omitted. Each service server is provided with a local cache, and if the rule data in the database can be stored in the local cache, so that the rule engine acquires the service rule from the local cache, the time consumption of database access can be reduced, and the rule checking efficiency can be improved. And the load layer comprises a plurality of service servers, and if each service server acquires the service rules from the database, the access pressure on the database is still caused. In order to solve the problem, a cache server cluster and task servers may be disposed between the database and the service servers, the task servers are configured to periodically pull the rule data from the database, and store the data acquired from the database into the cache server cluster, and each service server may periodically pull the rule data from the cache server cluster. Therefore, the access to the database can be reduced while the stability of the whole system is ensured, the time consumption of the rule engine for acquiring the rule data is reduced, and the service rule checking efficiency is improved.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a schematic view of an application scenario provided in the embodiment of the present application. As shown in fig. 2, the application scenario includes: the system comprises a terminal device 21, a gateway 22, a plurality of service servers 23, a cache server 24, a task server 25 and a database 26;
the terminal device 21 may be a smart phone, a tablet computer, a personal computer, or the like.
The terminal device 21 is communicatively connected to one of a plurality of service servers 23 via a gateway 22, wherein each service server 23 provides one type of application.
The plurality of service servers 23 are respectively connected with the cache server 24 in a communication way, the cache server 24 is connected with the task server 25 in a communication way, and the task server 25 is connected with the database 26 in a communication way.
Fig. 3 is a flowchart of a processing method for service rule verification provided in an embodiment of the present application, and as shown in fig. 3, the processing method for service rule verification includes the following steps:
s301, at preset time intervals, the task server acquires rule data from the database.
And S302, the task server sends the acquired rule data to a cache server.
And S303, the cache server receives and stores the rule data.
In steps S301 to S303, the task server actively pulls the rule data from the database at regular time in a manner of a regular task, and pushes the rule data to the cache server, and the cache server stores the received rule data.
In some alternative embodiments, the cache server may be a distributed cache server including a master server and a plurality of slave servers. The task server pushes the acquired rule data to the master server and synchronizes to the plurality of slave servers by the master server.
The distributed cache server may be a Redis cache server or a Memcached cache server.
The cache server has the characteristics of quick access and no need of considering the size of a memory, but is used as a storage type server and does not have an access function to the outside. Therefore, the present embodiment first obtains the rule data from the database through the task server and stores the rule data in the cache server.
In this embodiment, the task server is used to avoid querying the database in the data querying process. For example, if there is no task server and there is no rule data in the local cache, the service server needs to cache the rule data in the server, and if there is no rule data in the cache server, the service server also needs to query the rule data in the database. After the task server is added, the data in the cache server can be ensured to be consistent with the data in the database, and after the business server does not inquire the regular data in the local cache, the business server only needs to inquire the data in the cache server and does not need to inquire the data in the database.
S304, the business server obtains the rule data from the cache server and stores the rule data in a local cache of the business server.
In this step, the service server actively pulls the rule data from the cache server in a timing task mode at regular time and stores the rule data in the local cache. The method specifically comprises the following steps: and at preset time intervals, the service server acquires the rule data from the cache server and stores the acquired rule data to a local cache of the service server.
If the business server accesses the cache server to obtain the rule data, network connection with the cache server is required to be established. Thus, there is still time consumption and delay of network transmission, and therefore, the service server obtains the rule data from the cache server and stores the rule data in the local cache of the service server. When the service server receives the rule checking request, the rule data is directly read from the local cache and the rule is checked, so that the time delay and time consumption of network transmission can be saved.
S305, the terminal device sends a rule checking request of the service to the service server, wherein the rule checking request comprises information of the user and/or order information of the user.
In some scenarios, the user's information includes user login information, such as an account number, a nickname, a cell phone number, and so forth. The order information of the user comprises information such as the quantity of the items in the order, the total amount data of the order and the like.
In this embodiment, the triggering condition of the rule checking request of the service at least includes at least one of the following conditions: the user logs in the service system, the user searches for articles, the user places an order, an order is generated and the like.
When a user logs in a service system, searches for articles, places an order to generate a settlement page or generates an order, the terminal equipment of the user is triggered to send a rule verification request to a service server.
Wherein each service corresponds to a rule set.
S306, the service server receives the rule checking request of the service.
S307, the business server acquires the rule data from the local cache, and performs rule verification on the user information and/or the order information according to the rule data to obtain a verification result, wherein the verification result comprises whether the user and/or the order of the user accord with the business rule or not.
In some scenarios, the rule data includes a rule of whether or not it is a new user. The embodiment determines whether the user is a new user according to the login information of the user or whether the user is a new user of a certain shop according to the historical order data of the user.
In other scenarios, the rule data includes a rule of whether the total amount of the order is greater than a preset amount. The embodiment determines whether the amount of the user's order is greater than the preset amount according to the total amount of the user's current order.
In still other scenarios, the rule data includes a rule of whether the quantity of the item in the order is greater than a preset quantity. The present embodiment determines whether the total number of the items in the user's order is greater than the preset number according to the total number of the items in the user's current order. Further, the rule data may be a rule whether the number of the same Stock Keeping Unit (SKU) in the order is larger than a preset number.
S308, the service server returns the verification result to the terminal equipment of the user.
In this embodiment, each service rule group corresponds to recommendation information. Illustratively, if the user is a new user, generating preferential information that the new user has the use right for the user, and recommending the preferential information to the user.
In the embodiment, the rule data is obtained from the database at regular time through the task server and is pushed to the cache server. The business server actively pulls the rule data from the cache server regularly and stores the rule data in a local cache. Therefore, when the rule checking request is received, the rule data can be directly obtained from the local cache and the rule checking is carried out. Because the local cache and the application program run in the same process, delay and overhead on a network do not exist when the local cache is accessed, so that the operation of the local cache is very fast, the time for acquiring the service rule can be shortened, the service verification efficiency is improved, and high-concurrency scenes and the like are met. In the embodiment, one task server accesses the database and then stores the database in the cache server cluster, the service server directly obtains the rule data from the cache server cluster, and the cache server cluster comprises a plurality of cache servers, so that the access of the plurality of service servers can be met, and the access pressure to the database is reduced.
In the related art, when the business server performs rule verification on the user information and/or the order information, the business server performs rule verification on the user information and/or the order information according to the business rule group. Thus, the business server needs to group the rule data after pulling the rule data from the database, which is time-consuming. In order to reduce the time consumption as much as possible, in this embodiment, the task server may group the rule data acquired from the database to obtain a plurality of service rule groups, and then send the plurality of service rule groups to the cache server. Therefore, the business server acquires the grouped business rule group from the cache server, and the grouping step is omitted, so that the time consumption of rule verification can be further shortened, and the business verification efficiency is improved.
Grouping may be understood as continuing to classify rules classified in the service layer 12, i.e. dividing rules with the same attributes into a group, thereby reducing the number of calls, for example, if 5 types of rules are included in the active rules, and if 3 types of rules have the same attributes, then the 3 types of rules may be divided into a group.
On the basis of the above embodiment, the rule data in the database includes a plurality of rules, and there may be an association between the plurality of rules, so in order to further reduce the time for the business server to perform rule checking, the task server may also combine the rules with the association into a rule group, and then send the rule group to the cache server.
Illustratively, one rule in the database includes: whether the order is included in the SKU white list. And the SKU white list includes the identifications of the plurality of items, so the database stores the identifications of the plurality of items in text form. After the task server obtains the rule data, the identifiers of the multiple articles and the rule need to be combined to obtain a rule group, and then the rule group is sent to the cache server.
Fig. 4 is a logic diagram of a processing method for checking a business rule according to an embodiment of the present application. As shown in fig. 4, the architecture includes: the system comprises a user layer, a gateway layer, a load layer, a service layer, a local cache layer, a distributed cache layer, a task layer and a data layer; the user layer, the gateway layer, the load layer and the data layer can be described with reference to fig. 1. Compared with fig. 1, in this embodiment, a task layer, a local cache layer, and a distributed cache layer are added, and the role of the service layer is also changed. The service layer does not need to pull the rule data from the database and perform grouping any more, the service layer pulls the grouped rule group from the local cache, and the pulling and grouping of the rule data are completed by the task server.
Fig. 5A is a schematic diagram of a pressure test result provided in the embodiment of the present application.
Fig. 5B is a schematic diagram of a pressure test result provided in the embodiment of the present application.
As shown in fig. 5A, a pressure measurement analysis is performed by taking the traffic server metrics from TP99 (the lowest time consumption required to satisfy a nineteen percent network request).
As shown in fig. 5B, a pressure measurement analysis is performed by the traffic server from TP999 (the lowest time consumption required to satisfy a network request of nine hundred and ninety nine thousandths) metrics. By comparison, the TP999 index is reduced by about 40ms, and the reduction ratio is 30%.
On the basis of the above embodiment, after the operator configures the rule data at the configuration end, the rule data is usually not changed, the task server acquires the rule data from the database regularly, still causes access pressure to the database, in order to reduce the access pressure on the database, after the task server acquires the rule data from the database and sends the rule data to the cache server, the task server is in a monitoring state, that is, monitoring whether the rule data in the database changes, if the rule data changes, acquiring the changed rule data from the database and sending the changed rule data to the cache server, or acquiring all rule data from the database, comparing all rule data acquired at the current time with rule data acquired at the last time, determining changed rule data, and sending the changed rule data to the cache server.
Specifically, determining whether rule data in the database changes includes: and if receiving a prompt message that the rule data sent by the configuration server changes, determining that the rule data in the database changes, otherwise, determining that the rule data in the database does not change. After the configuration end changes the rule data, an operator can send a prompt message to the task server through the configuration end to prompt the task server that the rule data in the database changes.
In some optional embodiments, the memory of the local cache is small, and the rule data includes many business rules, some of which are not commonly used, and storing the part of the rule data that is not commonly used in the local cache occupies the storage space of the local cache. In order to solve the problem, in this embodiment, the task server may further obtain the use frequency of each service rule from the service server, and determine rule data in which the use frequency of the rule data is greater than or equal to a preset frequency in the rule data, so as to obtain target rule data; and sending the target rule data to a cache server.
After the preset frequency is set, the business server can be caused to fail to inquire the business rules from the local cache, at this time, the business server can inquire the business rules from the cache server, if the inquiry is still failed, the business rules can be continuously inquired from the database, and the inquired business rules are synchronously updated to the cache server and the local cache.
In the embodiment, the task server executes timed (every minute) tasks, pulls the valid rule data from the database for query, groups the rule data into rule groups, and pushes the rule groups to the cache server. And each individual service server pulls data from the cache server and then stores the data in a local cache. When the terminal equipment of the user accesses the service system, the terminal equipment enters an application program provided by a single service server through a gateway, and the service server directly obtains a related rule group from a local cache and then delivers the rule group to a verification engine for verification judgment of the rule. And finally, packaging and returning all the regular verification results to an upstream system.
On the basis of the foregoing method embodiment, fig. 6 is a schematic structural diagram of a processing device for business rule verification provided in the embodiment of the present application, and as shown in fig. 6, the device includes:
a receiving module 601, configured to receive a rule checking request of a service, where the rule checking request includes information of a user and/or order information of the user;
an obtaining module 602, configured to obtain, from a local cache of the service server, rule data corresponding to the service, where the rule data is obtained by the service server from a cache server cluster and is stored in the local cache of the service server, and is used to check whether a user and/or an order of the user conforms to a service rule, and the rule data in the cache server cluster is data obtained by a task server from a database and is sent to the cache server cluster for storage;
the checking module 603 is configured to check the user and/or the order of the user according to the rule data corresponding to the service, so as to obtain a checking result, where the checking result includes whether the user and/or the order of the user meet the service rule;
a returning module 604, configured to return the verification result to the terminal device of the user.
In some embodiments of the present application, the obtaining module 602 is further configured to obtain rule data from the cache server every preset time interval, and store the obtained rule data in a local cache of the service server.
In some embodiments of the present application, the rule data includes a plurality of service rule groups, each service rule group is obtained by grouping the obtained rule data by the task server, and each service rule group corresponds to one service decision.
In some embodiments of the present application, the rule data comprises a plurality of rules; the rule data sent by the task server to the cache server cluster is a rule group obtained by combining the rules with incidence relations in the multiple rules by the task server.
On the basis of the foregoing method embodiment, fig. 7 is a schematic structural diagram of a processing device for business rule verification provided in the embodiment of the present application, and as shown in fig. 7, the device includes:
an obtaining module 701, configured to obtain rule data from a database every preset time interval;
a sending module 702, configured to send the rule data to a cache server;
the rule data in the cache server is used for being provided to a business server, so that the business server stores the rule data to a local cache of the business server, and when a rule checking request is received, the rule data is obtained from the local cache to check the rule checking request, and a checking result is obtained, wherein the checking result includes whether user data and/or order data meet business rules.
In some embodiments of the present application, the rule data comprises a plurality of rules, the apparatus further comprising: a grouping module 703;
a grouping module 703, configured to group the rule data to obtain rule groups, where each rule group corresponds to a service decision; and/or a rule group obtained by combining the rules with the association relation in the plurality of rules.
In some embodiments of the present application, the apparatus further comprises: a determination module 704;
a determining module 704, configured to determine whether rule data in the database changes; and if the rule data are changed, acquiring the changed rule data from the database and sending the changed rule data to the cache server.
In some embodiments of the present application, the determining module 704 determines whether the rule data in the database is changed, including: and if a prompt message that the rule data sent by the configuration server changes is received, determining that the rule data in the database changes.
In some embodiments of the present application, if each rule in the plurality of rules corresponds to a use frequency, the determining module 704 is further configured to determine rule data in which the use frequency of the rule data in the rule data is greater than or equal to a preset frequency, so as to obtain target rule data; a sending module 702, configured to send the target rule data to a cache server.
The processing apparatus for service rule verification provided in this embodiment may be used to implement the technical solution of the processing method for service rule verification in the foregoing embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. For example, the determining module 704 may be a separate processing element, or may be implemented by being integrated into a chip of the apparatus, or may be stored in a memory of the apparatus in the form of program code, and the determining module 704 may be invoked by a processing element of the apparatus to perform the functions of the determining module 704. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element here may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 8, the computer apparatus may include: a transceiver 801, a processor 802, a memory 803.
The processor 802 executes computer-executable instructions stored in the memory, causing the processor 802 to perform the aspects of the embodiments described above. The processor 802 may be a general-purpose processor including a central processing unit CPU, a Network Processor (NP), and the like; but also a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
A memory 803 is coupled to the processor 802 via the system bus and communicates with the processor, and the memory 803 is used for storing computer program instructions.
The transceiver 801 may be used to receive operating instructions.
The system bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus. The transceiver is used to enable communication between the database access device and other computers (e.g., clients, read-write libraries, and read-only libraries). The memory may include Random Access Memory (RAM) and may also include non-volatile memory (non-volatile memory).
The electronic device provided in the embodiment of the present application may be used in a technical scheme for executing the processing method for checking the service rule in the foregoing embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
The embodiment of the application further provides a chip for running the instruction, and the chip is used for executing the technical scheme of the processing method for checking the business rule in the embodiment.
The embodiment of the present application further provides a computer-readable storage medium, where a computer instruction is stored in the computer-readable storage medium, and when the computer instruction runs on a computer, the computer is enabled to execute the technical solution of the processing method for checking the service rule in the foregoing embodiment.
The embodiment of the present application further provides a computer program product, where the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium, at least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, the at least one processor can implement the technical solution of the processing method for business rule verification in the foregoing embodiment.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (15)

1. A processing method for service rule verification is applied to a service server, and the method comprises the following steps:
receiving a rule checking request of a service, wherein the rule checking request comprises user information and/or order information of a user;
acquiring rule data corresponding to the service from a local cache of the service server, wherein the rule data are obtained by the service server from a cache server cluster and stored in the local cache of the service server, and are used for verifying whether a user and/or a user order conforms to a preset service rule, and the rule data in the cache server cluster are data obtained by a task server from a database and sent to the cache server cluster for storage;
checking the user and/or the order of the user according to the rule data corresponding to the service to obtain a checking result, wherein the checking result comprises whether the user and/or the order of the user accord with the service rule or not;
and returning the verification result to the terminal equipment of the user.
2. The method of claim 1, further comprising:
acquiring rule data from the cache server every preset time;
and storing the acquired rule data to a local cache of the service server.
3. The method according to claim 1 or 2, wherein the rule data comprises a plurality of service rule groups, each service rule group is obtained by grouping the obtained rule data by the task server, and each service rule group corresponds to a service decision.
4. The method according to claim 1 or 2, wherein the rule data comprises a plurality of rules;
the rule data sent by the task server to the cache server cluster is a rule obtained by combining rules with incidence relations in the multiple rules by the task server.
5. A processing method for business rule verification is applied to a task server, and comprises the following steps:
acquiring rule data from a database at preset time intervals;
sending the rule data to a cache server;
the rule data in the cache server is used for being provided to a business server, so that the business server stores the rule data to a local cache of the business server, and when a rule checking request is received, the rule data is obtained from the local cache to check the rule checking request, and a checking result is obtained, wherein the checking result includes whether user data and/or order data meet business rules.
6. The method of claim 5, wherein the rule data comprises a plurality of rules, the method further comprising:
grouping the rule data to obtain rule groups, wherein each rule group corresponds to a service decision;
and/or the presence of a gas in the gas,
and combining the rules with the association relationship in the plurality of rules to obtain a rule group.
7. The method of claim 5 or 6, further comprising:
determining whether rule data in a database is changed;
and if the rule data are changed, acquiring the changed rule data from the database and sending the changed rule data to the cache server.
8. The method of claim 7, wherein determining whether rule data in the database has changed comprises:
and if a prompt message that the rule data sent by the configuration server changes is received, determining that the rule data in the database changes.
9. The method of claim 6, wherein each rule of the plurality of rules corresponds to a usage frequency, and after the rule data is obtained from the database at the preset time interval, the method further comprises:
determining rule data of which the use frequency of the rule data is greater than or equal to a preset frequency in the rule data to obtain target rule data;
and sending the target rule data to a cache server.
10. A processing apparatus for business rule checking, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a rule checking request of a service, and the rule checking request comprises information of a user and/or order information of the user;
the acquisition module is used for acquiring the rule data corresponding to the service from the local cache of the service server, wherein the rule data are acquired by the service server from the cache server cluster and stored in the local cache of the service server, and are used for verifying whether a user and/or an order of the user conforms to a service rule, and the rule data in the cache server cluster are data acquired by the task server from the database and sent to the cache server cluster for storage;
the verification module is used for verifying the user and/or the order of the user according to the rule data corresponding to the service to obtain a verification result, wherein the verification result comprises whether the user and/or the order of the user accord with the service rule or not;
and the return module is used for returning the verification result to the terminal equipment of the user.
11. A processing apparatus for business rule checking, comprising:
the acquisition module is used for acquiring rule data from the database at preset time intervals;
the sending module is used for sending the rule data to a cache server;
the rule data in the cache server is used for being provided to a business server, so that the business server stores the rule data to a local cache of the business server, and when a rule checking request is received, the rule data is obtained from the local cache to check the rule checking request, and a checking result is obtained, wherein the checking result includes whether user data and/or order data meet business rules.
12. A system for processing business rule checks, comprising:
a traffic server for performing the method of any one of claims 1-4;
a task server for performing the method of any one of claims 5-9;
and the cache server is respectively connected with the service server and the task server.
13. A computer device, comprising: a memory, a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to implement the method of any one of claims 1-9.
14. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, perform the method of any one of claims 1-9.
15. A computer program product, characterized in that it comprises a computer program which, when being executed by a processor, carries out the method of any one of claims 1 to 9.
CN202111045759.8A 2021-09-07 2021-09-07 Processing method, device, equipment, system and medium for business rule verification Pending CN113688158A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111045759.8A CN113688158A (en) 2021-09-07 2021-09-07 Processing method, device, equipment, system and medium for business rule verification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111045759.8A CN113688158A (en) 2021-09-07 2021-09-07 Processing method, device, equipment, system and medium for business rule verification

Publications (1)

Publication Number Publication Date
CN113688158A true CN113688158A (en) 2021-11-23

Family

ID=78585563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111045759.8A Pending CN113688158A (en) 2021-09-07 2021-09-07 Processing method, device, equipment, system and medium for business rule verification

Country Status (1)

Country Link
CN (1) CN113688158A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7206848B1 (en) * 2000-09-21 2007-04-17 Hewlett-Packard Development Company, L.P. Intelligently classifying and handling user requests in a data service system
CN103473848A (en) * 2013-09-27 2013-12-25 浪潮齐鲁软件产业有限公司 Network invoice checking frame and method based on high concurrency
CN106027644A (en) * 2016-05-18 2016-10-12 广州市忆科计算机系统有限公司 Service checking method and system
CN106649349A (en) * 2015-10-30 2017-05-10 腾讯科技(深圳)有限公司 Method, device and system for data caching, applicable to game application
US20170230457A1 (en) * 2016-02-05 2017-08-10 Microsoft Technology Licensing, Llc Idempotent Server Cluster
CN108366110A (en) * 2018-02-05 2018-08-03 山东地主网络科技创新有限公司 A kind of website data interactive system and method
CN109408751A (en) * 2018-09-27 2019-03-01 腾讯科技(成都)有限公司 A kind of data processing method, terminal, server and storage medium
CN110471934A (en) * 2019-08-19 2019-11-19 泰康保险集团股份有限公司 Method of calibration, device, medium and the electronic equipment of business datum
CN111445206A (en) * 2020-03-26 2020-07-24 深圳壹账通智能科技有限公司 Workflow control method and system
CN113032432A (en) * 2021-02-22 2021-06-25 北京齐尔布莱特科技有限公司 Data caching processing method, system, computing device and readable storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7206848B1 (en) * 2000-09-21 2007-04-17 Hewlett-Packard Development Company, L.P. Intelligently classifying and handling user requests in a data service system
CN103473848A (en) * 2013-09-27 2013-12-25 浪潮齐鲁软件产业有限公司 Network invoice checking frame and method based on high concurrency
CN106649349A (en) * 2015-10-30 2017-05-10 腾讯科技(深圳)有限公司 Method, device and system for data caching, applicable to game application
US20170230457A1 (en) * 2016-02-05 2017-08-10 Microsoft Technology Licensing, Llc Idempotent Server Cluster
CN106027644A (en) * 2016-05-18 2016-10-12 广州市忆科计算机系统有限公司 Service checking method and system
CN108366110A (en) * 2018-02-05 2018-08-03 山东地主网络科技创新有限公司 A kind of website data interactive system and method
CN109408751A (en) * 2018-09-27 2019-03-01 腾讯科技(成都)有限公司 A kind of data processing method, terminal, server and storage medium
CN110471934A (en) * 2019-08-19 2019-11-19 泰康保险集团股份有限公司 Method of calibration, device, medium and the electronic equipment of business datum
CN111445206A (en) * 2020-03-26 2020-07-24 深圳壹账通智能科技有限公司 Workflow control method and system
CN113032432A (en) * 2021-02-22 2021-06-25 北京齐尔布莱特科技有限公司 Data caching processing method, system, computing device and readable storage medium

Similar Documents

Publication Publication Date Title
CN107633016B (en) Data processing method and device and electronic equipment
CN110119292B (en) System operation parameter query method, matching method, device and node equipment
CN110780870B (en) Service execution method, device, equipment and storage medium
CN114189525B (en) Service request method and device and electronic equipment
CN108984567B (en) Service data management system and method
CN109783512A (en) Data processing method, device, computer equipment and storage medium
CN110909013B (en) Service list generation method, device, equipment and computer readable storage medium
CN110011930B (en) Load balancing method and device for multi-union chain in block chain
EP4083810A1 (en) Query method and apparatus suitable for olap query engine
CN110110165B (en) Dynamic routing method and device for query engine in precomputation system
CN112866421B (en) Intelligent contract operation method and device based on distributed cache and NSQ
CN113127168A (en) Service distribution method, system, device, server and medium
CN113364853A (en) Business service system, business request method and gateway equipment
CN108564462A (en) Acquisition methods, terminal device and the medium of collage-credit data
CN110941674A (en) Block chain-based compliance audit method, device, system and storage medium
CN116402446B (en) Cargo management method, device, medium and electronic equipment
CN112419044A (en) Credit auditing method, equipment, electronic device and storage medium
CN107066522A (en) The access method and device of database
CN106446050A (en) Method and system for subscription by aiming at changed data of database
CN111159131A (en) Performance optimization method, device, equipment and computer readable storage medium
CN107193749B (en) Test method, device and equipment
CN107045466B (en) Service data auditing method, device and system
CN110351345B (en) Method and device for processing service request
CN113688158A (en) Processing method, device, equipment, system and medium for business rule verification
CN110502339A (en) Data service resource allocation methods, device, system and 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