CN112800095B - Data processing method, device, equipment and storage medium - Google Patents

Data processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112800095B
CN112800095B CN202110396849.5A CN202110396849A CN112800095B CN 112800095 B CN112800095 B CN 112800095B CN 202110396849 A CN202110396849 A CN 202110396849A CN 112800095 B CN112800095 B CN 112800095B
Authority
CN
China
Prior art keywords
condition
service
rule set
target
field
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.)
Active
Application number
CN202110396849.5A
Other languages
Chinese (zh)
Other versions
CN112800095A (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110396849.5A priority Critical patent/CN112800095B/en
Publication of CN112800095A publication Critical patent/CN112800095A/en
Application granted granted Critical
Publication of CN112800095B publication Critical patent/CN112800095B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/24564Applying rules; Deductive queries
    • 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/22Indexing; Data structures therefor; Storage structures
    • 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/24553Query execution of query operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a data processing method, a device, equipment and a storage medium, wherein the method comprises the steps of obtaining target service data and target service check information, wherein the target service check information comprises a plurality of condition check nodes which are arranged in sequence, and each condition check node corresponds to a condition field in a preset service rule; determining an initial business rule set corresponding to the target business data; traversing a plurality of conditional check nodes; performing condition verification on the target service data based on a condition field corresponding to the currently traversed condition verification node to obtain a condition verification result; updating an initial service rule set based on the condition checking result; and when the traversal is finished, taking the service rule in the current updated initial service rule set as a target service rule matched with the target service data. By the technical scheme, the business rule matched with the target business data can be determined quickly and accurately, the data processing efficiency is improved, and the memory occupation is reduced.

Description

Data processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a data processing method, apparatus, device, and storage medium.
Background
With the continuous growth of business, a large number of business rules are often needed in an enterprise system, when data is input, how to respond or process the input data can be automatically determined according to the business rules, in order to process the data in a targeted manner more scientifically and reasonably, a large number of business rules need to be configured according to different conditions of the data, and with the continuous update of business requirements, the number of the business rules becomes more and more huge.
When data input is detected, if the data are compared and matched with a large number of business rules one by one, a large amount of time and calculation amount are consumed, and a large performance pressure is brought to a server, so that a more reliable and efficient scheme needs to be provided.
Disclosure of Invention
In order to solve the problems in the prior art, the present application provides a data processing method, apparatus, device and storage medium. The technical scheme is as follows:
one aspect of the present application provides a data processing method, where the method includes:
acquiring target service data and target service check information, wherein the target service check information comprises a plurality of condition check nodes which are arranged in sequence, and each condition check node corresponds to a condition field in a preset service rule;
determining an initial business rule set corresponding to the target business data;
traversing the plurality of sequentially arranged conditional check nodes;
performing condition verification on the target service data based on a condition field corresponding to the currently traversed condition verification node to obtain a condition verification result;
updating the initial business rule set based on the condition checking result;
and when the traversal is finished, taking the service rule in the current updated initial service rule set as a target service rule matched with the target service data.
Another aspect of the present application provides a data processing apparatus, including:
the service data acquisition module is used for acquiring target service data and target service check information, wherein the target service check information comprises a plurality of condition check nodes which are arranged in sequence, and each condition check node corresponds to a condition field in a preset service rule;
an initial service rule set determining module, configured to determine an initial service rule set corresponding to the target service data;
the traversing module is used for traversing the plurality of condition check nodes which are arranged in sequence;
the condition checking module is used for carrying out condition checking on the target service data based on a condition field corresponding to the currently traversed condition checking node to obtain a condition checking result;
an initial service rule set updating module, configured to update the initial service rule set based on the condition checking result;
and the target business rule determining module is used for taking the business rules in the current updated initial business rule set as the target business rules matched with the target business data when the traversal is finished.
Another aspect of the present application provides a data processing apparatus, which includes a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded by the processor and executed to implement the data processing method as described above.
Another aspect of the present application provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the data processing method as described above.
The data processing method, the data processing device, the data processing equipment and the storage medium have the following technical effects:
according to the method, target service data and target service verification information are obtained, the target service verification information comprises a plurality of condition verification nodes which are arranged in sequence, each condition verification node corresponds to a condition field in a preset service rule, and each condition verification node conducts condition verification of one condition field, so that rule matching can be conducted quickly and accurately, and memory occupation and performance pressure of a server are reduced; performing condition verification on target service data by traversing a plurality of condition verification nodes arranged in sequence and based on a condition field corresponding to the currently traversed condition verification node to obtain a condition verification result, and updating an initial service rule set; when the traversal is finished, the service rule in the current updated initial service rule set is used as the target service rule matched with the target service data, the service rule matched with the target service data can be determined orderly and rapidly, and the data processing efficiency is improved.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of an application environment provided by an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of another data processing method provided in the embodiments of the present application;
FIG. 4 is a schematic flow chart diagram of another data processing method provided in the embodiments of the present application;
FIG. 5 is a schematic flow chart diagram of another data processing method provided in the embodiments of the present application;
FIG. 6 is a schematic flow chart diagram of another data processing method provided in the embodiments of the present application;
FIG. 7 is a schematic diagram of a create page of a business rule table provided by an embodiment of the present application;
FIG. 8 is a schematic flow chart diagram of another data processing method provided in the embodiments of the present application;
FIG. 9 is a schematic flow chart diagram of another data processing method provided in the embodiments of the present application;
FIG. 10 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
fig. 11 is a hardware block diagram of a server for implementing a data processing method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, 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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. Examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar function throughout.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
According to the data processing method disclosed by the application, the related data can be stored on the blockchain, for example, the target service data can be stored on the blockchain.
Referring to fig. 1, fig. 1 is a schematic diagram of an application environment provided by the present application, and as shown in fig. 1, the application environment may include a client 01 and a server 02.
In this embodiment, the client 01 may be configured to send a target rule matching request to the server 02, where the target rule matching request carries target service data and a target service verification identifier, so that the server 02 determines target service verification information from a plurality of service verification information according to the target service verification identifier, and the server 02 performs conditional verification on the target service data by using the target service verification information to determine a target service rule matched with the target service data. The client 01 may also receive service processing policy information corresponding to the target service data sent by the server 02, and execute service processing corresponding to the target service data according to the corresponding service processing policy information. In practical applications, the client 02 may include, but is not limited to, terminal devices such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart wearable device (e.g., a smart watch), a network device, a firewall, and the like.
In this embodiment, the server 02 may be configured to obtain target service data and target service verification information, perform conditional verification on the target service data according to the target service verification information, determine a target service rule matched with the target service data, and determine service processing policy information corresponding to the target service data according to the target service rule; the server 02 may further obtain an original service rule set, and generate target service verification information according to the original service rule set. Optionally, the server 02 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like.
Referring to fig. 1, in practical applications, a client 01 may send a target rule matching request to a server 02, where the target rule matching request carries target service data and a target service check identifier, the server 02 may determine target service check information from a plurality of service check information according to the target service check identifier, where the target service check information may include a plurality of condition check nodes arranged in sequence, and each condition check node corresponds to a condition field in a preset service rule, then the server 02 may determine an initial service rule set corresponding to the target service data, traverse the plurality of condition check nodes arranged in sequence, perform condition check on the target service data based on the condition field corresponding to the currently traversed condition check node to obtain a condition check result, and update the initial service rule set based on the condition check result, when the traversal is finished, the service rule in the currently updated initial service rule set is used as a target service rule matched with the target service data, and the service processing policy information corresponding to the target service data is determined according to the target service rule, then, the server 02 may send the corresponding service processing policy information to the client 01, and the client 01 may execute the service processing corresponding to the target service data according to the corresponding service processing policy information.
In the embodiment of the present application, the client 01 and the server 02 may be directly or indirectly connected through a wired or wireless communication manner, and the present application is not limited herein.
Fig. 2 is a flow chart of a data processing method provided in an embodiment of the present application, and the present specification provides the method operation steps as described in the embodiment or the flow chart, but more or less operation steps can be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. In practice, the system or server product may be implemented in a sequential or parallel manner (e.g., parallel processor or multi-threaded environment) according to the embodiments or methods shown in the figures. Specifically, as shown in fig. 2, the method may include:
s201: and acquiring target service data and target service verification information.
In this embodiment of the application, the target service data may represent original data that needs to be subjected to rule matching, and by determining a service rule that matches the target service data, the service rule that matches the target service data may be utilized to perform corresponding service processing. For example, when performing diet health assessment, the target business data may be user information and diet data input by a target user, a business rule matched with the target business data is determined, and a diet health level and food recommendation information are obtained according to the matched business rule.
Specifically, the target service checking information may include a plurality of condition checking nodes arranged in sequence, and in one embodiment, the plurality of condition checking nodes arranged in sequence may be a plurality of condition checking nodes ordered according to a condition differentiation index, for example, a plurality of condition checking nodes arranged in an order from a large condition differentiation index to a small condition differentiation index; each condition check node in the target service check information corresponds to one condition field in a preset service rule. In this embodiment of the present application, the target service checking information is a single linked list, the single linked list is a data structure of chain access, a set of storage units with any addresses are used to store data elements in a linear table, each node in the single linked list only stores data that needs to be stored and an address of a next node, adjacent nodes are linked by pointers, the memory usage is low, and it is beneficial to reduce the performance pressure of a server, and the node is written in C + + language, a rule engine is a component embedded in an application program, and it can strip service rules from service codes, and predefined semantic specifications are used to implement the stripped service rules; the rule engine evaluates the business rules by receiving the input data and makes business decisions; the utilization of the single linked list is beneficial to realizing a rule engine and determining the business rules matched with the target business data, the matching efficiency is high, the occupation of the memory of the server is reduced, the performance pressure of the server is reduced, the C + + language compiling is beneficial to being flexibly and quickly integrated into various C + + frameworks and can be compiled into a dynamic link library for being called by other languages, and the applicability of the business rule verification information is improved.
In this embodiment, referring to fig. 3, the obtaining of the target service data and the target service verification information may include:
s301: and receiving a target rule matching request sent by the client.
Specifically, the target rule matching request may carry the target service data and the target service check identifier. The target rule matching request may be generated in response to a rule matching triggering operation, for example, jump to a preset activity page, or detect a trigger of a preset control (for example, a user clicks a control for performing a diet health assessment), and then, the client may acquire target business data (for example, acquire user information and input diet data). Due to different service requirements, the server may store a large amount of different service verification information (single linked list), such as service verification information for performing diet health assessment, service verification information for performing sleep quality assessment, and the like, and when the target rule matching request is generated, a corresponding target service verification identifier may be determined according to a preset active page or a preset control, where the target service verification identifier may be an identification code composed of numbers, letters, and the like, for example, table1, and the target service verification identifier may be used to enable the server to determine the target service verification information from a plurality of service verification information.
S303: and determining the target service check information from a plurality of service check information according to the target service check identifier.
In this embodiment of the application, each piece of service checking information may include a corresponding service checking identifier, for example, when a target service checking identifier carried by the target rule matching request is table1, the server may determine, from the plurality of pieces of service checking information, the service checking information with the service checking identifier of table1 according to the target service checking identifier, and use the service checking information as the target service checking information.
By receiving a target rule matching request sent by a client, the target service checking information is determined from a plurality of service checking information according to the target service checking identifier, and the real-time performance and reliability of service rule matching are improved.
S203: and determining an initial business rule set corresponding to the target business data.
In this embodiment, the initial service rule set corresponding to the target service data may include all service rules corresponding to the target service check information, and in an embodiment, the target service check information may be obtained by obtaining an original service rule set including a plurality of preset service rules, and performing classification and merging processing according to condition fields, and when the initial service rule set corresponding to the target service data is determined, all service rules in the original service rule set may be used as the initial service rule set, for example, the initial service rule set may be {1,2,3,4,5,6}, where a number indicates an identifier of a service rule, that is, the number sequentially represents service rule 1 and service rule 892 2 …, service rule 6.
By determining the initial service rule set corresponding to the target service data, the initial service rule set is favorable for being updated for multiple times by using target service verification information subsequently, so that the service rule matched with the target service data is obtained, and the reliability of rule matching is improved.
S205: and traversing the plurality of condition check nodes which are arranged in sequence.
In the embodiment of the application, the plurality of condition check nodes arranged in sequence can be traversed to perform comprehensive and reliable condition check on the target service data, so that the reliability of rule matching is improved; in a specific embodiment, the plurality of condition check nodes arranged in sequence may be a plurality of condition check nodes sorted according to a condition distinguishing indicator, for example, a plurality of conditional check nodes arranged in the order of the conditional differentiation indexes from large to small, wherein, the condition distinguishing index can represent the distinguishing degree of the condition check node to the service data, the larger the condition distinguishing index is, the larger the distinguishing degree of the condition check node to the service data is, the fewer the values of the field which can be traversed by the condition check node are, namely, the condition check node can better screen the service data, is beneficial to improving the efficiency of condition check, and then the efficiency of business rule matching is improved, the calculation pressure of a server is reduced, the data throughput is improved, a large amount of business data can be subjected to condition verification at one time, and then the business rule matching is realized.
S207: and carrying out condition verification on the target service data based on the condition field corresponding to the currently traversed condition verification node to obtain a condition verification result.
In an embodiment of the present application, the business rule may include a plurality of condition fields, each of which may characterize a condition type of the business rule, for example, in performing a dietary health assessment, the condition fields of the business rule may include, but are not limited to: gender, age less than or equal to, age greater than or equal to, food type. Each condition check node in the target service check information corresponds to one condition field in a preset service rule, when any condition check node is traversed, condition check is carried out on the target service data based on the condition field corresponding to the currently traversed condition check node to obtain a condition check result, the service rule (the service rule matched with the target service data) currently hit by the target service data can be determined, and each condition check node carries out check on one condition field, so that the rule matching efficiency and flexibility are improved, the structure of the target service check information is simple, clear and light, and the memory occupation and performance pressure of a server are reduced.
In this embodiment of the application, each condition check node may include at least one preset mapping information of a corresponding condition field, where each preset mapping information represents mapping information between a corresponding field value and a business rule, for example, when the condition field is a gender, the field value may include a male and a female, the business rule corresponding to the male is 1,2, and 3, the business rule corresponding to the female is 4,5, and 6, and the at least one preset mapping information (at this time, two preset mapping information) of the condition field may be represented as: "sex = male: {1,2,3 }; sex = woman: {4,5,6}".
Referring to fig. 4, the performing conditional checking on the target service data based on the condition field corresponding to the currently traversed conditional checking node to obtain a conditional checking result may include:
s401: and determining corresponding first service attribute information in the target service data according to the condition field corresponding to the currently traversed condition check node.
In this embodiment, the target service data may include a plurality of service attribute information, such as gender, age, and the like; the corresponding first service attribute information in the target service data may be determined according to the condition field corresponding to the currently traversed condition check node, for example, if the condition field corresponding to the currently traversed condition check node is a gender, the service attribute information of the gender (for example, gender: male) may be determined from the target service data, and the service attribute information of the gender is used as the corresponding first service attribute information in the target service data.
The corresponding first service attribute information in the target service data is determined according to the condition field corresponding to the currently traversed condition checking node, so that condition checking can be performed by combining the corresponding service attribute information in the target service data, and the reliability of condition checking is improved.
S403: and determining a first field value satisfied by the first service attribute information.
In this embodiment of the present application, each condition check node may include at least one preset mapping information of a corresponding condition field, and each preset mapping information represents mapping information between a corresponding field value and a service rule, and a plurality of field values included in the condition check node may be traversed to determine a first field value that is satisfied by the first service attribute information; in the above embodiment, the first service attribute information gender: and if the male is determined, the value of the first field satisfied by the first service attribute information is taken as the male.
S405: and determining a service rule set corresponding to the first field value according to at least one preset mapping information of the condition field corresponding to the currently traversed condition check node.
In this embodiment of the present application, each condition check node may include at least one preset mapping information of a corresponding condition field, where each preset mapping information represents mapping information between a corresponding field value and a service rule, and a service rule set corresponding to a first field value may be determined according to the at least one preset mapping information of the condition field corresponding to the currently traversed condition check node, for example, if the first field value satisfied by the first service attribute information is male, then a field value may be determined as a service rule set corresponding to the male according to at least one preset mapping information (gender = male: {1,2,3}, gender = female: {4,5,6 }) of a condition field corresponding to the currently traversed condition check node, and if the field value is a service rule set corresponding to the male and is {1,2,3}.
According to the at least one piece of preset mapping information of the condition field corresponding to the currently traversed condition check node, the service rule set corresponding to the first field value can be quickly and accurately determined in one node, the condition check of one condition field can be completed only through one node, the rule matching efficiency is favorably improved, and the performance pressure of the server is reduced.
S407: and taking the corresponding business rule set as the condition checking result.
In the embodiment of the present application, the service rule in the corresponding service rule set is a service rule hit by the target service data at the currently traversed condition check node; after determining the service rule set corresponding to the first field value according to the at least one preset mapping information of the condition field corresponding to the currently traversed condition check node, the corresponding service rule set may be used as the condition check result, for example, at this time, according to the at least one preset mapping information, it may be determined that the service rule set corresponding to the field value is {1,2,3}, and {1,2,3}, that is, based on the condition field (gender) corresponding to the currently traversed condition check node, the target service data is subjected to condition check, and an obtained condition check result is a service rule hit by the target service data at the currently traversed condition check node.
The condition verification is carried out on the target service data based on the condition fields corresponding to the currently traversed condition verification nodes to obtain a condition verification result, and the condition fields can be verified on one condition verification node, namely, each condition verification node is responsible for the verification of one condition type, so that the rule matching is favorably and orderly carried out, the rule matching efficiency is improved, and the memory occupation and the performance pressure of the server are reduced.
S209: the initial set of business rules is updated based on the conditional checking results described above.
In the embodiment of the application, after the condition verification is performed on the target service data based on the condition field corresponding to the currently traversed condition verification node to obtain a condition verification result, the initial service rule set is updated based on the condition verification result; specifically, updating the initial business rule set based on the condition checking result may include: taking the intersection of the condition checking result and the initial service rule set, and taking the obtained intersection as an updated initial service rule set; for example, at this time, the initial service rule set is {1,2,3,4,5,6}, the condition check result is {1,2,3}, an intersection of the condition check result and the initial service rule set is taken, and an obtained intersection is {1,2,3}, and at this time, this intersection ({ 1,2,3 }) can be used as the updated initial service rule set.
By updating the initial service rule set based on the condition verification result, the service rule hit by the target service data can be updated reasonably and orderly after each condition field is verified, and the reliability of service rule matching is improved.
S211: and when the traversal is finished, taking the service rule in the current updated initial service rule set as a target service rule matched with the target service data.
In this embodiment of the present application, after performing conditional checking on the target service data based on a condition field corresponding to a currently traversed condition checking node each time to obtain a condition checking result, an initial service rule set is updated based on the condition checking result, in the above embodiment, the initial service rule set is updated to be {1,2,3}, the next condition checking node is traversed (for example, the condition field corresponding to the next node is less than or equal to the age, the service attribute information corresponding to the target service data is age =17, one of the preset mapping information (mapping information between field value and service rule) is "age less than or equal to 18: {1,3,4 }", the condition checking result obtained by the target service data at the condition checking node at this time is {1,3,4}, and the condition checking result {1,3,4} and the current initial service rule set ({ 1,2,3 }) to obtain an intersection set of {1,3}, where the intersection set ({ 1,3 }) can be used as the updated initial service rule set, and so on, until traversing the plurality of sequentially arranged condition check nodes is completed, that is, the target service data is subjected to condition check of all condition fields in the preset service rule, the service rule in the current updated initial service rule set is the service rule finally hit by the target service data (the service rule hit after the check of all condition fields), and the service rule in the current updated initial service rule set can be used as the target service rule matched with the target service data.
By traversing the plurality of condition check nodes arranged in sequence, when any condition check node is traversed, condition check is carried out on the target service data based on a condition field corresponding to the currently traversed condition check node to obtain a condition check result, check of one condition field can be carried out on one condition check node, rule matching is carried out reasonably and orderly, the efficiency of rule matching is improved, and the memory occupation and performance pressure of the server are reduced; and finally, when the traversal is finished, the service rule in the current updated initial service rule set is used as the target service rule matched with the target service data, so that the reliability of service rule matching is favorably improved.
In an embodiment of the application, referring to fig. 5, after updating the initial service rule set based on the condition checking result, the method may further include:
s501: and detecting whether the updated initial business rule set is empty.
In this embodiment of the present application, the updated initial service rule set may be empty, for example, the condition check result is {1,3,4}, and the current initial service rule set is {2,6}, an intersection is taken between the condition check result and the current initial service rule set, and the obtained intersection is an empty set, that is, the updated initial service rule set is empty at this time.
S503: and when the updated initial service rule set is empty, accessing the last conditional check node of the currently traversed conditional check nodes.
In the embodiment of the application, the target service check information can be traversed by using a depth-first search mode, and the conditional check nodes in the target service check information are traversed according to the order of the conditional check nodes. In some embodiments, the fields in the conditional check node take values that are mutually exclusive and do not contain overlapping parts, e.g., gender is male or female only; in other embodiments, the value of the field in the condition check node may include a coincidence portion, for example, when the condition field is less than or equal to the age, at least one preset mapping information (in this case, three preset mapping information) of the condition field may be represented as: "age less than or equal to 18: {2,6 }; age less than or equal to 20: {1,3 }; age less than or equal to 25: {4,5}". When the first field value satisfied by the first service attribute information is determined, the plurality of field values included in the condition check node can be traversed at the condition check node, and when any field value satisfied by the first service attribute information is traversed, the field value is taken as the first field value satisfied by the first service attribute information. For example, at this time, if the service attribute information of the age in the target service data is 17, when the field value of the age smaller than or equal to 18 is traversed, the service attribute information can be used as the first field value satisfied by the first service attribute information, and the service attribute information can be obtained according to the fact that "the age is smaller than or equal to 18: {2,6} "this mapping information, confirm the condition check result at this moment is {2,6 }. Taking the condition node with the age less than or equal to the condition field as the last condition check node, assuming that the updated initial service rule set is {2,6}, the condition check result obtained by the currently traversed condition check node (for example, the corresponding condition field is greater than or equal to the height) is {1,3,4}, and the intersection is empty, that is, the updated initial service rule set is empty, then the last condition check node of the currently traversed condition check node (the corresponding condition field is the condition check node with the age less than or equal to the age) may be returned to be accessed, and when the last condition check node of the currently traversed condition check node is returned to be accessed, the initial service rule set is returned to be in the state before the update of the last condition check node (assuming that the condition check node with the age less than or equal to the condition field at this time is the first condition check node in the target service check information, the initial set of traffic rules reverts back to the state of {1,2,3,4,5,6} before the last conditional check node update). And the last conditional check node re-determines the field value met by the target service data to obtain a conditional check result, and re-updates the initial service rule set.
S505: and determining corresponding second service attribute information in the target service data according to the condition field corresponding to the last condition check node.
In this embodiment of the present application, a specific process of determining the corresponding second service attribute information in the target service data according to the condition field corresponding to the previous condition checking node is similar to step S401, for example, at this time, the condition field corresponding to the previous condition checking node is an age, which is smaller than or equal to, and the corresponding second service attribute information in the target service data is determined to be an age.
S507: and determining a second field value satisfied by the second service attribute information.
Specifically, the value of the second field is different from the value of the first field of the last conditional check node; in the above embodiment, the value of the first field of the last conditional check node is that the age is less than or equal to 18, and the at least one preset mapping information of the conditional field may be represented as: "age less than or equal to 18: {2,6 }; age less than or equal to 20: {1,3 }; age less than or equal to 25: {4,5} ", at this time, the condition check node may continue to traverse the plurality of field values included therein, and when the next field value satisfied by the second service attribute information is traversed, the field value is taken as the second field value, and at this time, the second field value may be an age of less than or equal to 20.
S509: and determining a service rule set corresponding to the value of the second field according to at least one preset mapping information of the condition field corresponding to the last condition check node.
In the above embodiment, the at least one preset mapping information of the condition field corresponding to the previous condition checking node may be represented as: "age less than or equal to 18: {2,6 }; age less than or equal to 20: {1,3 }; age less than or equal to 25: {4,5} ", where the second field value may be an age of less than or equal to 20, and the set of business rules corresponding to the second field value may be determined to be {1,3} according to the at least one preset mapping information.
S511: and taking the service rule set corresponding to the value of the second field as the condition checking result.
In this embodiment, at this time, the service rule set ({ 1,3 }) corresponding to the value of the second field may be used as the condition check result, and the initial service rule set is returned to the state before updating as {1,2,3,4,5,6 }. At this time, the initial service rule set may be updated again according to the condition check result, and the updated initial service rule set is {1,3}, which is used as the initial service rule set at this time to deeply search for the next condition check node.
In the embodiment of the application, if the matching fails (the updated initial service rule set is empty), the service rule matching is directly performed again from the first condition check node, which brings a lot of repeated data processing and access, wastes time and computing resources and brings unnecessary load pressure to the server; after the initial service rule set is updated based on the condition check result, whether the updated initial service rule set is empty is detected, when the updated initial service rule set is empty, a last condition check node which accesses the currently traversed condition check node is returned, the initial service rule set is returned to the state before the last condition check node is updated, the last condition check node re-determines the field value met by the target service data to obtain the condition check result, and the initial service rule set is updated again, so that the method is beneficial to quickly and accurately determining the service rule hit by the target service data, improving the comprehensiveness and reliability of service rule matching and reducing the load pressure of a server.
In an embodiment of the present application, referring to fig. 6, the method may further include:
s601: an original set of business rules is obtained.
Specifically, the original service rule set may include a plurality of preset service rules, and each preset service rule includes field values of a plurality of condition fields. In this embodiment of the application, the obtaining of the original service rule set may include:
1) and in response to the operation of creating the business rule table, creating an initial business rule table.
Referring to fig. 7, fig. 7 is a schematic diagram of a creating page of a business rule table provided in this embodiment, where the creating page of the business rule table may include a business rule table description adding area and a condition field configuration area, and the condition field configuration area may include a condition field addition control and a plurality of field attribute configuration boxes of a condition field, and field attributes of the condition field may include, but are not limited to, a field name, a field function description, a field data type, and a field operator of the condition field, where the field data type may include, but is not limited to, an integer, a character string, a boolean value, and a date; the field operators may include, but are not limited to = (equal), | = (not equal), > (greater), < (less), > = (greater than or equal), < (= less), and in (among these values), and bit operations and function operations may also be extended quickly. The field attribute configuration boxes described above may correspondingly include a field name input box, a field function description input box, a field data type check box, and a field operator check box. The method can flexibly add a plurality of condition fields and configure field attribute information on a creating page of the service rule table, and create the initial service rule table according to the configured condition fields. In the embodiment of the present application, the initial service rule table may be stored in a JSON array format, where each configured condition field is a JSON data, and JSON is a lightweight data exchange format, and stores and represents data in a text format completely independent of a programming language, so that the hierarchical structure is simple and clear, which is beneficial to analysis and generation by a computer, and the JSON format storage is beneficial to improving the network transmission efficiency of data.
In the embodiment of the present application, the condition field configuration information of the initial service rule table may be displayed in response to the field configuration query instruction of the initial service rule table, and the currently configured condition field and the corresponding field attribute information may be displayed on the display page of the condition field configuration information, so as to perform data inspection, improve the accuracy of condition field configuration, and further improve the reliability of rule matching.
2) And responding to the configuration operation of the business rules, generating a plurality of preset business rules according to the initial business rule table, and generating the original business rule set according to the preset business rules.
Specifically, the service rule configuration operation may be sent according to service rule requirement information; the initial service rule table comprises a plurality of condition fields configured to the field attribute information, and at the moment, the field value of each condition field can be filled in response to the service rule configuration operation to generate a plurality of preset service rules; referring to table1, the original business rule set shown in table1 includes 3 preset business rules, and the two columns of information of the diet health level and the food recommendation are results (business processing policy information) corresponding to the rules. In the embodiment of the present application, the original service rule set may also be stored in a database in a JSON array format, where each preset service rule is a JSON data.
Table 1:
Figure 544583DEST_PATH_IMAGE001
and generating a plurality of preset business rules according to the initial business rule table and generating the original business rule set according to the preset business rules by responding to business rule configuration operation, thereby being beneficial to flexibly and efficiently generating the preset business rules. In some embodiments, a preset service rule may be added, updated or deleted according to a service rule requirement, the original service rule set is updated, and the server may obtain the updated original service rule set to regenerate the service verification information (single linked list).
S603: and combining the same field values in each condition field to obtain a service rule set corresponding to each field value in each condition field.
And generating a plurality of preset business rules according to the initial business rule table and generating the original business rule set according to the preset business rules by responding to business rule configuration operation, thereby being beneficial to flexibly and efficiently generating the preset business rules. In some embodiments, a preset service rule may be added, updated or deleted according to a service rule requirement, the original service rule set is updated, and the server may obtain the updated original service rule set to regenerate the service verification information (single linked list).
S603: and combining the same field values in each condition field to obtain a service rule set corresponding to each field value in each condition field.
And generating a plurality of preset business rules according to the initial business rule table and generating the original business rule set according to the preset business rules by responding to business rule configuration operation, thereby being beneficial to flexibly and efficiently generating the preset business rules. In some embodiments, a preset service rule may be added, updated or deleted according to a service rule requirement, the original service rule set is updated, and the server may obtain the updated original service rule set to regenerate the service verification information (single linked list).
S603: and combining the same field values in each condition field to obtain a service rule set corresponding to each field value in each condition field.
In this embodiment, each condition field may have the same field value, and taking table1 as an example, the same field value in the condition field of gender may be merged to obtain a service rule set corresponding to each field value in the condition field of gender, that is, the service rule set corresponding to gender = male is {1,2}, and the service rule set corresponding to gender = female is {3,4 }; and for the condition field with the age being larger than or equal to the age, the service rule set corresponding to the field value with the age being larger than or equal to 18 is obtained after combination processing and is {1,2,3,4 }. By combining the same field values in each condition field, the storage space is saved, and the verification speed during condition verification is improved.
In the embodiment of the application, a business rule set (including at least one business rule identifier) corresponding to each field value can be stored by using a Bitset array, the Bitset is essentially a bit array, and one byte has 8 bits.
S605: and generating corresponding preset mapping information according to each field value and the corresponding service rule set.
In this embodiment of the present application, corresponding preset mapping information may be generated according to each field value and the corresponding service rule set, and each preset mapping information may represent mapping information between the corresponding field value and the service rule, for example, the field value of the condition field for the gender includes a male and a female, the service rule set corresponding to the field value for the male is {1,2}, and the corresponding preset mapping information generated according to the field value for the male for the gender and the corresponding service rule set is "gender = male: {1,2} ", the service rule set corresponding to the value of this field for women is {3,4}, and then the corresponding preset mapping information generated according to the value of this field for women and the corresponding service rule set for gender is" gender = woman: {3,4}".
S607: and generating a corresponding condition check node according to at least one preset mapping information of each condition field.
For example, in the condition field of gender, the at least one preset mapping information may be represented as: "sex = male: {1,2 }; sex = woman: {3,4} ", a corresponding condition check node may be generated according to at least one preset mapping information of the condition field of the gender, and the condition check node may be subsequently used to perform condition check on the condition field of the gender. In the embodiment of the application, the corresponding condition check node can be generated according to at least one preset mapping information of each condition field, and the information of one condition field is integrated in one condition check node in sequence, so that the structure is simple and clear, and the memory occupation of the server can be reduced; and one condition check node can check one condition field, namely each condition check node is responsible for checking one condition type, so that the rule matching is favorably and orderly carried out, the rule matching efficiency is improved, and the performance pressure of the server is reduced.
S609: and generating the target service check information according to the condition check nodes corresponding to the plurality of condition fields.
In the embodiment of the application, the target service verification information can be generated according to the condition verification nodes corresponding to the plurality of condition fields, the target service verification information is a single linked list, each condition verification node in the single linked list corresponds to one condition field of a preset service rule, the number of the condition verification nodes is irrelevant to the number of the service rules and is only relevant to the number of the condition fields, the structure is simple and clear, the verification of one condition field can be performed on each condition verification node, the efficiency of matching the service rules is improved, the memory occupation of the server is reduced, and the performance pressure of the server is reduced.
In an embodiment of the present application, referring to fig. 8, the generating the target service check information according to the condition check nodes corresponding to the plurality of condition fields may include:
s801: and determining the condition distinguishing index of each condition check node according to the field value number of each condition field.
The condition distinguishing index can represent the distinguishing degree of the condition check node on the service data; in this embodiment of the present application, the condition distinguishing index of each condition check node may be calculated based on the field value number of the condition field corresponding to the condition check node, for example, taking the reciprocal of the field value number as the condition distinguishing index. Taking table1 as an example, the field values of the condition field of gender are 2 (male and female), the field values of the condition field of age greater than or equal to 1 (age greater than or equal to 18), the field values of the condition field of age less than or equal to 3, and the field values of the condition field of food type are 4, then the 4 condition check nodes are sequentially arranged according to the sequence of the condition distinguishing indexes from big to small: the age is greater than or equal to the corresponding condition check node, the condition check node corresponding to the gender, the age is less than or equal to the corresponding condition check node, and the condition check node corresponding to the food type. In the embodiment of the application, the larger the condition distinguishing index is, the larger the distinguishing degree of the condition check node on the service data is, and the fewer field values which can be traversed by the condition check node are, that is, the condition check node can better screen the service data.
S803: and sequencing the condition check nodes corresponding to the plurality of condition fields according to the condition distinguishing indexes of the condition check nodes corresponding to the plurality of condition fields to obtain the target service check information.
Specifically, the sorting the conditional checking nodes corresponding to the multiple conditional fields according to the conditional differentiation indexes of the conditional checking nodes corresponding to the multiple conditional fields to obtain the target service checking information may include: and arranging the condition check nodes corresponding to the plurality of condition fields according to the sequence of the condition distinguishing indexes from big to small to obtain the target service check information.
The condition check nodes corresponding to the condition fields are sequenced according to the condition distinguishing indexes of the condition check nodes corresponding to the condition fields to obtain the target service check information, so that the condition check efficiency is improved, the service rule matching efficiency is improved, the calculation pressure of a server is reduced, the data throughput is improved, a large amount of service data can be subjected to condition check at one time, and the service rule matching is realized.
In an embodiment of the present application, referring to fig. 9, the method may further include:
s901: and determining the service processing strategy information corresponding to the target service data according to the target service rule.
In this embodiment of the present application, each service rule may further include corresponding service processing policy information, where the service processing policy information may represent result data of the service data after hitting the service rule; for example, in performing a diet health assessment, the business process strategy information may include diet health level and food recommendation information.
S903: and sending the corresponding business processing strategy information to a client so that the client executes the business processing corresponding to the target business data according to the corresponding business processing strategy information.
In the embodiment of the present application, the client may execute the service processing corresponding to the target service data according to the corresponding service processing policy information, and in the embodiment, after receiving the service processing policy information (the diet health level and the food recommendation information) corresponding to the target service data, the client may display the service processing policy information in a report form, and determine the link corresponding to the food according to the food recommendation information.
The business processing strategy information corresponding to the target business data is determined according to the target business rule, and the corresponding business processing strategy information is sent to the client, so that the client executes the business processing corresponding to the target business data according to the corresponding business processing strategy information, and the business processing corresponding to the target business data is favorably and flexibly executed.
According to the technical scheme provided by the embodiment of the application, the condition verification is carried out on the target service data by traversing a plurality of condition verification nodes arranged in sequence, when any condition verification node is traversed, based on the condition field corresponding to the currently traversed condition verification node, so that the condition verification result is obtained, the condition field can be verified at one condition verification node, the rule matching can be reasonably and orderly carried out, the rule matching efficiency is improved, and the memory occupation and the performance pressure of the server are reduced; and finally, when the traversal is finished, the service rule in the current updated initial service rule set is used as the target service rule matched with the target service data, so that the reliability of service rule matching is favorably improved. After the initial service rule set is updated based on the condition check result, whether the updated initial service rule set is empty is detected, when the updated initial service rule set is empty, a last condition check node which accesses the currently traversed condition check node is returned, the initial service rule set is returned to the state before the last condition check node is updated, the last condition check node re-determines the field value met by the target service data to obtain the condition check result, and the initial service rule set is updated again, so that the method is beneficial to quickly and accurately determining the service rule hit by the target service data, improving the comprehensiveness and reliability of service rule matching and reducing the load pressure of a server. The condition check nodes corresponding to the condition fields are sequenced according to the condition distinguishing indexes of the condition check nodes corresponding to the condition fields to obtain the target service check information, so that the condition check efficiency is improved, the service rule matching efficiency is improved, the calculation pressure of a server is reduced, the data throughput is improved, a large amount of service data can be subjected to condition check at one time, and the service rule matching is realized.
An embodiment of the present application further provides a data processing apparatus, as shown in fig. 10, the apparatus may include:
a service data obtaining module 1010, configured to obtain target service data and target service check information, where the target service check information includes multiple condition check nodes arranged in sequence, and each condition check node corresponds to a condition field in a preset service rule;
an initial service rule set determining module 1020, configured to determine an initial service rule set corresponding to the target service data;
a traversing module 1030, configured to traverse the plurality of sequentially arranged conditional check nodes;
the condition checking module 1040 is configured to perform condition checking on the target service data based on a condition field corresponding to a currently traversed condition checking node, so as to obtain a condition checking result;
an initial business rule set updating module 1050 configured to update the initial business rule set based on the condition checking result;
and a target business rule determining module 1060, configured to take the business rule in the currently updated initial business rule set as the target business rule matched with the target business data when the traversal is finished.
In this embodiment of the present application, each condition check node includes at least one preset mapping information of a corresponding condition field, and each preset mapping information represents mapping information between a corresponding field value and a service rule; the condition checking module 1040 may include:
a first service attribute information determining unit, configured to determine, according to a condition field corresponding to the currently traversed condition check node, corresponding first service attribute information in the target service data;
a first field value-taking unit, configured to determine a first field value that is satisfied by the first service attribute information;
a first service rule set determining unit, configured to determine, according to at least one preset mapping information of a condition field corresponding to the currently traversed condition check node, a service rule set corresponding to a value of the first field;
and the first condition checking result determining unit is used for taking the corresponding business rule set as the condition checking result.
In this embodiment, the apparatus may further include:
an initial service rule set detection unit, configured to detect whether the updated initial service rule set is empty after updating the initial service rule set based on the condition check result;
a node access unit, configured to access a previous conditional check node of the currently traversed conditional check nodes when the updated initial service rule set is empty;
a second service attribute information determining unit, configured to determine, according to the condition field corresponding to the previous condition check node, corresponding second service attribute information in the target service data;
a second field value determining unit, configured to determine a second field value that is satisfied by the second service attribute information, where the second field value is different from the first field value of the last conditional check node;
a second service rule set determining unit, configured to determine, according to at least one preset mapping information of the condition field corresponding to the last condition check node, a service rule set corresponding to the value of the second field;
and the first condition checking result determining unit is used for taking the service rule set corresponding to the second field value as the condition checking result.
In this embodiment, the apparatus may further include:
an original service rule set obtaining unit, configured to obtain an original service rule set, where the original service rule set includes a plurality of preset service rules, and each preset service rule includes field values of a plurality of condition fields;
a merging processing unit, configured to merge the same field value in each condition field to obtain a service rule set corresponding to each field value in each condition field;
a mapping information generating unit, configured to generate corresponding preset mapping information according to the value of each field and the corresponding service rule set;
the condition check node generating unit is used for generating a corresponding condition check node according to at least one piece of preset mapping information of each condition field;
and the target service check information generating unit is used for generating the target service check information according to the condition check nodes corresponding to the plurality of condition fields.
Specifically, the target service verification information generating unit may include:
a condition distinguishing index determining unit, configured to determine a condition distinguishing index of each condition check node according to the field value number of each condition field;
and the node sorting unit is used for sorting the condition check nodes corresponding to the plurality of condition fields according to the condition distinguishing indexes of the condition check nodes corresponding to the plurality of condition fields to obtain the target service check information.
In this embodiment of the application, the service data obtaining module 1010 may include:
a target rule matching request receiving unit, configured to receive a target rule matching request sent by a client, where the target rule matching request carries the target service data and a target service verification identifier;
and the target service verification information determining unit is used for determining the target service verification information from a plurality of service verification information according to the target service verification identifier.
In this embodiment, the apparatus may further include:
the service processing strategy information determining module is used for determining service processing strategy information corresponding to the target service data according to the target service rule;
and the service processing strategy information sending module is used for sending the corresponding service processing strategy information to a client so that the client executes service processing corresponding to the target service data according to the corresponding service processing strategy information.
The device and method embodiments in the device embodiment are based on the same application concept.
The embodiment of the present application provides a computer device, which includes a processor and a memory, where at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the data processing method provided by the above method embodiment.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and data processing by operating the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the apparatus, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, a server, or a similar computing device, that is, the computer device may include a mobile terminal, a computer terminal, a server, or a similar computing device. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, a big data and artificial intelligence platform, and the like. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. Taking the example of the application running on a server, fig. 11 is a hardware structure block diagram of a server for implementing the data processing method according to the embodiment of the present application. As shown in FIG. 11, the server 1100 may vary widely in configuration or performance and may include one or more Central Processing Units (CPUs) 1110 (processors 1110 may include, but are not limited to, Processing devices such as microprocessor MCUs or programmable logic devices FPGAs), memory 1130 for storing data, one or more storage media 1120 (e.g., one or more mass storage devices) storing applications 1123 or data 1122. The memory 1130 and the storage medium 1120 may be, among other things, transient storage or persistent storage. The program stored in the storage medium 1120 may include one or more modules, each of which may include a series of instruction operations for a server. Still further, the central processor 1110 may be configured to communicate with the storage medium 1120, and execute a series of instruction operations in the storage medium 1120 on the server 1100. The server 1100 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input-output interfaces 1140, and/or one or more operating systems 1121, for example
Figure 890113DEST_PATH_IMAGE002
Figure 712576DEST_PATH_IMAGE003
Figure 979609DEST_PATH_IMAGE004
,
Figure 709668DEST_PATH_IMAGE005
Figure 909705DEST_PATH_IMAGE006
And so on.
The Processor 1110 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The input output interface 1140 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the server 1100. In one example, i/o Interface 1140 includes a Network adapter (NIC) that may be coupled to other Network devices via a base station to communicate with the internet. In one example, the input/output interface 1140 can be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Operating system 1121 can include system programs, such as a framework layer, a core library layer, a driver layer, etc., for handling various basic system services and performing hardware-related tasks, for implementing various basic business and processing hardware-based tasks.
It will be understood by those skilled in the art that the structure shown in fig. 11 is only an illustration and is not intended to limit the structure of the electronic device. For example, server 1100 may also include more or fewer components than shown in FIG. 11, or have a different configuration than shown in FIG. 11.
Embodiments of the present application further provide a computer-readable storage medium, where the storage medium may be disposed in a server to store at least one instruction or at least one program for implementing a data processing method in the method embodiments, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the data processing method provided in the method embodiments.
Alternatively, in this embodiment, the storage medium may be located in at least one network server of a plurality of network servers of a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations described above.
As can be seen from the embodiments of the data processing method, the data processing device, the data processing apparatus, the data processing storage medium, or the computer program provided by the present application, in the present application, a plurality of condition check nodes arranged in sequence are traversed, and when any condition check node is traversed, condition check is performed on the target service data based on a condition field corresponding to the currently traversed condition check node, so as to obtain a condition check result, and the condition check node can perform check on one condition field, which is beneficial to performing rule matching reasonably and orderly, improving the efficiency of rule matching, and reducing the memory occupation and performance pressure of the server; and finally, when the traversal is finished, the service rule in the current updated initial service rule set is used as the target service rule matched with the target service data, so that the reliability of service rule matching is favorably improved. After the initial service rule set is updated based on the condition check result, whether the updated initial service rule set is empty is detected, when the updated initial service rule set is empty, a last condition check node which accesses the currently traversed condition check node is returned, the initial service rule set is returned to the state before the last condition check node is updated, the last condition check node re-determines the field value met by the target service data to obtain the condition check result, and the initial service rule set is updated again, so that the method is beneficial to quickly and accurately determining the service rule hit by the target service data, improving the comprehensiveness and reliability of service rule matching and reducing the load pressure of a server. The condition check nodes corresponding to the condition fields are sequenced according to the condition distinguishing indexes of the condition check nodes corresponding to the condition fields to obtain the target service check information, so that the condition check efficiency is improved, the service rule matching efficiency is improved, the calculation pressure of a server is reduced, the data throughput is improved, a large amount of service data can be subjected to condition check at one time, and the service rule matching is realized.
It should be noted that: the sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may 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.
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, for the apparatus, device and storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (8)

1. A method of data processing, the method comprising:
acquiring target service data and target service check information, wherein the target service check information comprises a plurality of condition check nodes which are arranged in sequence, and each condition check node corresponds to a condition field in a preset service rule; each condition check node comprises at least one preset mapping information of a corresponding condition field, and each preset mapping information represents the mapping information between a corresponding field value and a service rule;
determining an initial business rule set corresponding to the target business data;
traversing the plurality of sequentially arranged conditional check nodes;
determining corresponding first service attribute information in the target service data according to a condition field corresponding to a currently traversed condition check node;
determining a first field value met by the first service attribute information;
determining a service rule set corresponding to the first field value according to at least one preset mapping information of the condition field corresponding to the currently traversed condition check node;
taking the corresponding business rule set as the condition checking result;
updating the initial business rule set based on the condition checking result;
detecting whether the updated initial service rule set is empty;
when the updated initial service rule set is empty, accessing the last conditional check node of the currently traversed conditional check nodes; determining corresponding second service attribute information in the target service data according to the condition field corresponding to the last condition check node; determining a second field value satisfied by the second service attribute information, wherein the second field value is different from the first field value of the last conditional check node; determining a service rule set corresponding to the second field value according to at least one preset mapping information of the condition field corresponding to the last condition check node; taking a service rule set corresponding to the second field value as the condition checking result; returning the initial service rule set to a state before updating, and updating the initial service rule set again according to the condition checking result;
and when the traversal is finished, taking the service rule in the current updated initial service rule set as a target service rule matched with the target service data.
2. The method of claim 1, further comprising:
acquiring an original service rule set, wherein the original service rule set comprises a plurality of preset service rules, and each preset service rule comprises field values of a plurality of condition fields;
merging the same field values in each condition field to obtain a service rule set corresponding to each field value in each condition field;
generating corresponding preset mapping information according to each field value and the corresponding service rule set;
generating a corresponding condition check node according to at least one preset mapping information of each condition field;
and generating the target service checking information according to the condition checking nodes corresponding to the plurality of condition fields.
3. The method of claim 2, wherein the generating the target traffic check information according to the condition check nodes corresponding to the plurality of condition fields comprises:
determining a condition distinguishing index of each condition check node according to the field value number of each condition field;
and sequencing the condition check nodes corresponding to the plurality of condition fields according to the condition distinguishing indexes of the condition check nodes corresponding to the plurality of condition fields to obtain the target service check information.
4. The method of claim 1, wherein the obtaining target service data and target service verification information comprises:
receiving a target rule matching request sent by a client, wherein the target rule matching request carries the target service data and a target service check identifier;
and determining the target service checking information from a plurality of service checking information according to the target service checking identifier.
5. The method of claim 1, further comprising:
determining service processing strategy information corresponding to the target service data according to the target service rule;
and sending the corresponding business processing strategy information to a client so that the client executes the business processing corresponding to the target business data according to the corresponding business processing strategy information.
6. A data processing apparatus, characterized in that the apparatus comprises:
the service data acquisition module is used for acquiring target service data and target service check information, wherein the target service check information comprises a plurality of condition check nodes which are arranged in sequence, and each condition check node corresponds to a condition field in a preset service rule; each condition check node comprises at least one preset mapping information of a corresponding condition field, and each preset mapping information represents the mapping information between a corresponding field value and a service rule;
an initial service rule set determining module, configured to determine an initial service rule set corresponding to the target service data;
the traversing module is used for traversing the plurality of condition check nodes which are arranged in sequence;
the condition checking module is used for determining corresponding first service attribute information in the target service data according to a condition field corresponding to a currently traversed condition checking node; determining a first field value met by the first service attribute information; determining a service rule set corresponding to the first field value according to at least one preset mapping information of the condition field corresponding to the currently traversed condition check node; taking the corresponding business rule set as the condition checking result;
an initial service rule set updating module, configured to update the initial service rule set based on the condition checking result;
an initial service rule set detection unit, configured to detect whether the updated initial service rule set is empty;
a node access unit, configured to access a previous conditional check node of the currently traversed conditional check nodes when the updated initial service rule set is empty;
a second service attribute information determining unit, configured to determine, according to the condition field corresponding to the previous condition check node, corresponding second service attribute information in the target service data;
a second field value determining unit, configured to determine a second field value that is satisfied by the second service attribute information, where the second field value is different from the first field value of the last conditional check node;
a second service rule set determining unit, configured to determine, according to at least one preset mapping information of the condition field corresponding to the last condition check node, a service rule set corresponding to the value of the second field;
a first condition checking result determining unit, configured to use a service rule set corresponding to the second field value as the condition checking result;
the initial service rule set updating module is further configured to, when the updated initial service rule set is empty, return the initial service rule set to a state before updating, and renew the initial service rule set according to the condition verification result of the first condition verification result determining unit;
and the target business rule determining module is used for taking the business rules in the current updated initial business rule set as the target business rules matched with the target business data when the traversal is finished.
7. A data processing apparatus, characterized in that the apparatus comprises a processor and a memory, in which at least one instruction or at least one program is stored, which is loaded and executed by the processor to implement the data processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, in which at least one instruction or at least one program is stored, which is loaded and executed by a processor to implement the data processing method according to any one of claims 1 to 5.
CN202110396849.5A 2021-04-13 2021-04-13 Data processing method, device, equipment and storage medium Active CN112800095B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110396849.5A CN112800095B (en) 2021-04-13 2021-04-13 Data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110396849.5A CN112800095B (en) 2021-04-13 2021-04-13 Data processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112800095A CN112800095A (en) 2021-05-14
CN112800095B true CN112800095B (en) 2021-07-13

Family

ID=75816967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110396849.5A Active CN112800095B (en) 2021-04-13 2021-04-13 Data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112800095B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113282624B (en) * 2021-05-25 2024-05-14 北京达佳互联信息技术有限公司 Rule matching method, device, electronic equipment and storage medium
CN113240351A (en) * 2021-06-28 2021-08-10 平安信托有限责任公司 Business data consistency checking method and device, electronic equipment and medium
CN113377785B (en) * 2021-08-16 2021-11-02 宜科(天津)电子有限公司 Industrial data processing system
CN113886199B (en) * 2021-08-31 2024-04-19 联想(北京)有限公司 Data processing method and device
CN113837584B (en) * 2021-09-17 2024-04-12 平安养老保险股份有限公司 Service processing system and abnormal data processing method based on service processing system
CN113986384A (en) * 2021-10-28 2022-01-28 数字天堂(北京)网络技术有限公司 Processing device, method, equipment and storage medium based on client and cloud
CN114611155B (en) * 2022-03-15 2022-12-13 云粒智慧科技有限公司 Data management node verification method, device, equipment and medium
CN115185616B (en) * 2022-09-14 2022-12-13 深圳依时货拉拉科技有限公司 Business rule engine device and processing method of business rule engine
CN117422585B (en) * 2023-12-15 2024-05-17 中山市三乐电子有限公司 State monitoring method and system of inductance production and manufacturing control system

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060253205A1 (en) * 2005-05-09 2006-11-09 Michael Gardiner Method and apparatus for tabular process control
WO2015036817A1 (en) * 2013-09-15 2015-03-19 Yogesh Chunilal Rathod Structured updated status, requests, user data & programming based presenting & accessing of connections
CN104731800B (en) * 2013-12-20 2018-10-23 中国银联股份有限公司 Data analysis set-up
CN109634956A (en) * 2018-11-16 2019-04-16 王亚萍 A kind of building method and system of taxation informatization message rule verification engine
CN111061678B (en) * 2019-12-10 2023-05-23 深圳奇迹智慧网络有限公司 Service data processing method, device, computer equipment and storage medium
CN111711623A (en) * 2020-06-15 2020-09-25 深圳前海微众银行股份有限公司 Data verification method and device
CN112100250B (en) * 2020-11-23 2021-03-16 支付宝(杭州)信息技术有限公司 Data processing method and device
CN112445874A (en) * 2020-12-10 2021-03-05 腾讯科技(深圳)有限公司 Node information checking method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112800095A (en) 2021-05-14

Similar Documents

Publication Publication Date Title
CN112800095B (en) Data processing method, device, equipment and storage medium
CN111459993B (en) Configuration updating method, device, equipment and storage medium based on behavior analysis
CN110795697B (en) Method and device for acquiring logic expression, storage medium and electronic device
CN107480268A (en) Data query method and device
CN112506486A (en) Search system establishing method and device, electronic equipment and readable storage medium
CN105117489B (en) Database management method and device and electronic equipment
CN113835874A (en) Deep learning service scheduling method, system, terminal and storage medium
CN114090838A (en) Method, system, electronic device and storage medium for large data visual display
CN115599359A (en) Code generation method, device, equipment and medium
CN115905630A (en) Graph database query method, device, equipment and storage medium
CN111639077A (en) Data management method and device, electronic equipment and storage medium
CN111475494A (en) Mass data processing method, system, terminal and storage medium
CN108154024A (en) A kind of data retrieval method, device and electronic equipment
CN115687810A (en) Webpage searching method and device and related equipment
CN112835921A (en) Slow query processing method and device, electronic equipment and storage medium
CN109542890B (en) Data modification method, device, computer equipment and storage medium
CN111159213A (en) Data query method, device, system and storage medium
CN113792232B (en) Page feature calculation method, page feature calculation device, electronic equipment, page feature calculation medium and page feature calculation program product
CN115168509A (en) Processing method and device of wind control data, storage medium and computer equipment
CN115455006A (en) Data processing method, data processing device, electronic device, and storage medium
CN114328486A (en) Data quality checking method and device based on model
CN115168358A (en) Database access method and device, electronic equipment and storage medium
CN114281549A (en) Data processing method and device
CN114115796A (en) Data processing method and device, computer readable medium and electronic equipment
CN113868138A (en) Method, system, equipment and storage medium for acquiring test data

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
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40043827

Country of ref document: HK