[go: up one dir, main page]

CN110096255B - Rule degradation processing method, device and system and data processing method - Google Patents

Rule degradation processing method, device and system and data processing method Download PDF

Info

Publication number
CN110096255B
CN110096255B CN201810078977.3A CN201810078977A CN110096255B CN 110096255 B CN110096255 B CN 110096255B CN 201810078977 A CN201810078977 A CN 201810078977A CN 110096255 B CN110096255 B CN 110096255B
Authority
CN
China
Prior art keywords
expression
rule
target
determining
execution result
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
CN201810078977.3A
Other languages
Chinese (zh)
Other versions
CN110096255A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201810078977.3A priority Critical patent/CN110096255B/en
Publication of CN110096255A publication Critical patent/CN110096255A/en
Application granted granted Critical
Publication of CN110096255B publication Critical patent/CN110096255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions

Landscapes

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

Abstract

The application discloses a rule degradation processing method, a rule degradation processing device, a rule degradation processing system and a rule degradation processing method. Wherein the method comprises the following steps: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from at least one expression, wherein the target expression is an expression needing degradation; and executing a first rule, wherein the execution result of the target expression is unknown. The method and the device solve the technical problem that the rule degradation processing mode in the prior art is to not run the rule any more and influence the service.

Description

Rule degradation processing method, device and system and data processing method
Technical Field
The present invention relates to the field of data processing, and in particular, to a rule degradation processing method, device and system, and a data processing method.
Background
The general rule execution mode is to execute according to the logic expression of the rule, perform data complement value on the left and right variables of each expression in the rule, then call the result (True/False) of the corresponding operator identification expression, and finally perform AND operation through the expression logic set on the rule to obtain the final rule execution result. For example, the expression logic of a rule is 1&2&3, in the execution process of the rule, the result of the expression 1 is calculated first, and if the result is False, the result of the whole rule is False. If the result of expression 1 is True (correct), the result of expression 2 is continued to be executed, and so on.
In some e-commerce large promotion scenarios, some regular expressions are time-consuming to calculate, for example, expression 1 is time-consuming to calculate, which affects the throughput of the whole system. It is common practice to downgrade the whole rule directly and not run it any more. However, this would reduce the yield of this rule to 0, which has an impact on the traffic.
Aiming at the problem that the rule degradation processing mode in the prior art is to not run the rule any more and influence is caused on the service, no effective solution is proposed at present.
Disclosure of Invention
The embodiment of the application provides a rule degradation processing method, a rule degradation processing device, a rule degradation processing system and a rule degradation processing method, and aims to at least solve the technical problem that the rule degradation processing mode in the prior art is that the rule is not operated any more and the service is influenced.
According to an aspect of the embodiments of the present application, there is provided a rule degradation processing method, including: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from at least one expression, wherein the target expression is an expression needing degradation; and executing a first rule, wherein the execution result of the target expression is unknown.
According to another aspect of the embodiments of the present application, there is also provided a rule degradation processing device, including: the system comprises an acquisition module for acquiring a first rule, wherein the first rule comprises at least one expression; the determining module is used for determining a target expression from at least one expression, wherein the target expression is an expression needing degradation; and the execution module is used for executing the first rule, wherein the execution result of the target expression is unknown.
According to another aspect of the embodiments of the present application, there is also provided a storage medium, including a stored program, where the program controls a device in which the storage medium is located to perform the following steps when running: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from at least one expression, wherein the target expression is an expression needing degradation; and executing a first rule, wherein the execution result of the target expression is unknown.
According to another aspect of the embodiments of the present application, there is also provided a processor for running a program, wherein the program executes the following steps: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from at least one expression, wherein the target expression is an expression needing degradation; and executing a first rule, wherein the execution result of the target expression is unknown.
According to another aspect of the embodiments of the present application, there is also provided a rule degradation processing system, including: a processor; and a memory, coupled to the processor, for providing instructions to the processor for processing the steps of: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from at least one expression, wherein the target expression is an expression needing degradation; and executing a first rule, wherein the execution result of the target expression is unknown.
According to another aspect of the embodiments of the present application, there is also provided a data processing method, including: obtaining a logic operation expression to be executed, wherein the logic operation expression comprises a first sub-expression and a residual sub-expression; determining the first sub-expression as an unknown result expression; executing the residual sub-expressions to obtain an intermediate result; and obtaining the result of the logic operation expression to be executed according to the logic operation between the intermediate result and the unknown result expression.
In this embodiment of the present application, after the first rule is acquired, first, a target expression may be determined from at least one expression included in the first rule, an execution result of the target expression is set to be unknown, the first rule is further executed, and an execution result of the first rule is obtained based on the execution result of each expression.
By the scheme provided by the embodiment of the application, the execution result of the target expression to be demoted is set to be unknown, and the purpose that the first rule can still be executed when the rule demotion processing is carried out is achieved, so that the technical effect of reducing the influence of the rule demotion on the service is achieved, and the technical problem that the rule demotion processing mode in the prior art is that the rule is not operated any more and the service is influenced is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a block diagram of a hardware architecture of a computer terminal (or mobile device) for implementing a rule degradation processing method according to an embodiment of the present application;
FIG. 2 is a flow chart of a rule degradation processing method according to embodiment 1 of the present application;
FIG. 3 is a schematic diagram of an alternative implementation of multiple rules requiring demotion according to embodiment 1 of the present application;
FIG. 4 is a schematic diagram of a rule degradation processing device according to embodiment 1 of the present application;
FIG. 5 is a flow chart of a data processing method according to embodiment 4 of the present application;
FIG. 6 is a schematic diagram of a data processing apparatus according to embodiment 5 of the present application; and
fig. 7 is a block diagram of a computer terminal according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise 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 apparatus 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.
First, partial terms or terminology appearing in describing embodiments of the present application are applicable to the following explanation:
rules: consists of a series of expressions and a logical expression, e.g., expression 1 is user id-! =123, expression 2 is buyer id= =123, expression 3 is seller id ≡ -! =123, the logical expression is 1&2|3, thus composing a rule. Currently, the expression in a rule consists of three logical interconnections, and either or both.
And (3) removing the reflection: the original result is True, the result after the de-inversion is False, whereas the original result is False, the result after the de-inversion is True, and the contents indicated by the de-inversion and the de-inversion are the same in this embodiment.
Example 1
In accordance with embodiments of the present application, there is also provided an embodiment of a rule degradation processing method, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system such as a set of computer executable instructions, and, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order other than that shown or described herein.
The method embodiment provided in the first embodiment of the present application may be executed in a mobile terminal, a computer terminal or a similar computing device. Fig. 1 shows a block diagram of a hardware structure of a computer terminal (or mobile device) for implementing a rule degradation processing method. As shown in fig. 1, the computer terminal 10 (or mobile device 10) may include one or more (shown as 102a, 102b, … …,102 n) processors 102 (the processors 102 may include, but are not limited to, a microprocessor MCU, a programmable logic device FPGA, etc. processing means), a memory 104 for storing data, and a transmission means 106 for communication functions. In addition, the method may further include: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power supply, and/or a camera. It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the rule degradation processing method in the embodiments of the present application, and the processor 102 executes the software programs and modules stored in the memory 104, thereby performing various functional applications and data processing, that is, implementing the rule degradation processing method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. The specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
It should be noted here that, in some alternative embodiments, the computer device (or mobile device) shown in fig. 1 described above may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that fig. 1 is only one example of a specific example, and is intended to illustrate the types of components that may be present in the computer device (or mobile device) described above.
In the above-described operating environment, the present application provides a rule degradation processing method as shown in fig. 2. Fig. 2 is a flowchart of a rule degradation processing method according to embodiment 1 of the present application. As shown in fig. 2, the method comprises the steps of:
in step S202, a first rule is obtained, the first rule including at least one expression.
The first rule in the above step S202 may be a rule that needs to be subjected to the degradation process, and the system may determine whether each expression needs to be subjected to the degradation process by judging the resource consumed by each expression included in the first rule, and if one expression included in the first rule needs to be subjected to the degradation process, determine that the first rule needs to be subjected to the degradation process.
For example, in the embodiment of the present application, the first rule is-! 1&2|3 are illustrated as examples, and the first rule includes three expressions, expression 1, expression 2, and expression 3, respectively.
In step S204, a target expression is determined from the at least one expression, where the target expression is an expression to be demoted.
In an alternative embodiment, in the application scenario of e-commerce large-scale promotion, the resources consumed by each expression can be calculated respectively, if the resources consumed by one expression exceed a preset threshold value, the cost of the expression is considered to be high, and degradation is required, so that the expression is determined to be a target expression.
For example, still with the first rule-! 1&2|3 is illustrated as an example, in the application scenario of e-commerce large-scale promotion, the resources consumed by the expression 1, the expression 2 and the expression 3 can be calculated respectively, and when the resources consumed by the expression 1 exceed a preset threshold value, the expression 1 is determined to be a target expression, and degradation is required.
It should be noted that, in the rule demotion process, only the target expression needs to be demoted.
In step S206, a first rule is executed, where the execution result of the target expression is unknown.
For example, the logic of the expression is user ID >3, and if the value of the user ID is known, it may be determined that the execution result of the expression is True or False; if the value of the user ID cannot be obtained or an abnormality occurs in the process of obtaining the value of the user ID, the execution result of the expression is unown.
In an alternative embodiment, for a common rule expression, the execution result generally only includes True and False, in this embodiment, the execution result is extended, an unknown is introduced, for a target expression, since the target expression needs to be degraded, the execution result of the target expression may not be calculated, and the execution result of the target expression may be directly determined as unknown, in the process of executing the first rule, the execution results of other expressions that do not need to be degraded may be calculated, and further, according to the execution results of all the expressions, the execution result of the whole first rule may be obtained.
It should be noted that, the execution result of the first rule may include True, false, and unknown, when the execution result of the first rule is unknown, it may be determined that the execution of the rule is unproductive, and when the execution result of the first rule is True or False, it may be determined that the execution of the rule is productive.
For example, still with the first rule-! 1&2|3 for example, when the rule is executed, since expression 1 needs to be downgraded, the execution result of expression 1 is unknown, then ≡!1 is unknown, and since expression 1 and expression 2 are in relation to each other, the execution result of expression (|1 & 2) is always unknown, and if the execution result of expression 3 is False, the execution result of the entire first rule is unknown; if the execution result of expression 3 is True, the execution result of the entire first rule is True.
The execution of one or more rules requiring degradation in an embodiment of the present application is described below in conjunction with figure 3,
as shown in fig. 3, in the existing rule downgrading process, in one request, since both rules r_1, r_2 and r_3 need to be downgraded, none of the three rules will execute (as the three matrices shown above in fig. 3), yielding 0; for the rule degradation manner provided in the embodiment of the present application, the rules r_1, r_2 and r_3 are all executed, where the execution result of r_1 is True (as shown by the vertical line rectangle in fig. 3), the execution result of r_2 is unknown (as shown by the diagonal line rectangle in fig. 3), and the execution result of r_3 is False (as shown by the horizontal line rectangle in fig. 3), that is, the rules r_1 and r_3 can obtain the execution result, and the output is not 0 at this time, so that the influence of rule degradation on the service is greatly reduced.
As can be appreciated based on the scheme defined in the above embodiment, after the first rule is acquired, the target expression may be first determined from at least one expression included in the first rule, the execution result of the target expression is set to be unknown, the first rule is further executed, and the execution result of the first rule is obtained based on the execution result of each expression.
By the scheme provided by the embodiment of the application, the execution result of the target expression to be demoted is set to be unknown, and the purpose that the first rule can still be executed when the rule demotion processing is carried out is achieved, so that the technical effect of reducing the influence of the rule demotion on the service is achieved, and the technical problem that the rule demotion processing mode in the prior art is that the rule is not operated any more and the service is influenced is solved.
In an alternative embodiment provided herein, determining a target expression from at least one expression includes: performing data analysis on at least one expression, and determining the operation cost corresponding to the at least one expression; and determining an expression with the operation cost larger than a preset threshold value as a target expression.
The operation cost can be the resource consumed by at least one expression, and the preset threshold can be a threshold preset according to the actual scene requirement in the application scene of large-scale promotion of the E-commerce, so that the operation cost is prevented from being too high, and the normal operation of the whole service is prevented from being influenced.
In an alternative embodiment, the operation cost of each expression may be calculated by performing data analysis on all the expressions in the first rule, and if the operation cost of one expression exceeds a preset threshold in the current application scenario, it is determined that the expression needs to be degraded, that is, it is determined that the expression is the target expression.
For example, still with the first rule-! 1&2 & lt 3 is illustrated as an example, in the application scenario of e-commerce large-scale promotion, data analysis can be performed on the expression 1, the expression 2 and the expression 3 respectively, the operation cost corresponding to each expression is determined, when the operation cost of the expression 1 exceeds a preset threshold, the expression 1 is determined to be a target expression, and degradation is required.
In an alternative embodiment provided herein, the first rule includes a target expression, a first expression, and a logic expression, where the first expression is an expression that does not require degradation, and the logic expression includes at least one of: and, or; under the condition that the logic expression is AND, if the execution result of the first expression is correct, the execution result of the first rule is unknown, and if the execution result of the first expression is wrong, the execution result of the first rule is wrong; if the logical expression is or, the execution result of the first rule is correct if the execution result of the first expression is correct, and if the execution result of the first expression is incorrect, the execution result of the first rule is unknown.
The first rule may consist of a target expression requiring degradation and an expression requiring no degradation, and a logical expression, which may include either or a combination of both.
For example, the first rule may be 1&2|3, where expression 1 is the target expression, expression 2 and expression 3 are the first expressions, the logical expressions include: and (≡), or (|).
For another example, in the embodiment of the present application, description is given by taking as an example that the execution result of expression 1 is True, the execution result of expression 2 is unknown, and the execution result of expression 3 is False, where the execution result of the first rule is unknown can be determined when the first rule is 1&2, the execution result of the first rule is False when the first rule is 3&2, the execution result of the first rule is True when the first rule is 1|2, and the execution result of the first rule is unknown when the first rule is 3|2.
Based on the above-described derivation process, the execution result of any one of the first rules may be obtained, and the execution result of the first rule may be executed to obtain a True or False result.
In an alternative embodiment provided in the present application, the first rule includes a target expression and a logic expression, where the logic expression includes a denoise, and an execution result of the first rule is unknown.
For example, the first rule may be-! 1, wherein expression 1 is a target expression, and the logic expression includes: and go back (|).
For another example, the embodiment of the present application will be described by taking the execution result of expression 1 as an example, where the first rule is ≡!1, it may be determined that the execution result of the first rule is unknown.
Based on the above derivation process, the execution result of any one of the first rules may be obtained.
It should be noted that the first rule may be composed of a target expression that needs to be downgraded and an expression that does not need to be downgraded, and a logic expression that may include a combination of and, or, and decon.
For example, the first rule may be-! 1&2|3, wherein expression 1 is the target expression, expression 2 and expression 3 are the first expression, the logical expression comprises: go back (|), and (≡), or (|).
In an alternative embodiment provided herein, after determining the target expression from the at least one expression, the method further includes: setting operation data for the first expression, and not setting operation data for the target expression; in executing the first rule, the first expression is executed by acquiring the operation data.
The operation data may be data calculated as a result of execution of the first expression.
In an alternative embodiment, after determining whether the expression is the target expression by performing data analysis on all the expressions in the first rule, in order to avoid resource consumption for executing the target expression, the execution result of the target expression may not be set to be the unknown, in order to obtain the execution result of the first rule, the execution data may be set to be the first expression, in the process of executing the first rule, the execution result of the first expression may be obtained through the execution data of the first expression, and further in combination with the execution result unknown of the target expression, thereby recognizing that the execution result of the first rule is obtained, and the execution result of the first rule may be unknown, or may have the determined value True or False.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
Example 2
There is also provided, according to an embodiment of the present application, a rule degradation processing apparatus for implementing the rule degradation processing method, as shown in fig. 4, where the apparatus 400 includes:
an obtaining module 402 is configured to obtain a first rule, where the first rule includes at least one expression.
A determining module 404, configured to determine a target expression from at least one expression, where the target expression is an expression to be demoted.
And an execution module 406, configured to execute the first rule, where the execution result of the target expression is unknown.
It should be noted that, the above-mentioned obtaining module 402, determining module 404 and executing module 406 correspond to steps S202 to S206 in embodiment 1, and the three modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in embodiment 1 above. It should be noted that the above-described module may be operated as a part of the apparatus in the computer terminal 10 provided in embodiment 1.
In an alternative embodiment provided herein, as shown in fig. 4, the determining module 404 includes: a first determining unit 408, configured to perform data analysis on at least one expression, and determine an operation cost corresponding to the at least one expression; the second determining unit 410 is configured to determine an expression with an operation cost greater than a preset threshold value as a target expression.
In an alternative embodiment provided herein, the first rule includes a target expression, a first expression, and a logic expression, where the first expression is an expression that does not require degradation, and the logic expression includes at least one of: and, or; as shown in fig. 4, the execution module 406 is further configured to, if the logic expression is yes, determine that the execution result of the first rule is unknown if the execution result of the first expression is correct, and determine that the execution result of the first rule is incorrect if the execution result of the first expression is incorrect; the execution module 406 is further configured to, if the logical expression is or, determine that the execution result of the first rule is correct if the execution result of the first expression is correct, and determine that the execution result of the first rule is unknown if the execution result of the first expression is incorrect.
In an alternative embodiment provided in the present application, the first rule includes a target expression and a logic expression, where the logic expression includes a denoise, and as shown in fig. 4, the execution module 406 is further configured to execute the first rule with an unknown execution result.
In an alternative embodiment provided in the present application, as shown in fig. 4, the apparatus 400 further includes: a setting module 412, configured to set the operation data for the first expression, and not set the operation data for the target expression; the execution module 406 is further configured to execute the first expression by acquiring the operation data in the process of executing the first rule.
It should be noted that, in the alternative or preferred real-time manner of this embodiment, reference may be made to the related description in embodiment 1, which is not described herein.
Example 3
According to an embodiment of the present application, there is also provided a rule degradation processing system for implementing the rule degradation processing method, including:
a processor; and
a memory, coupled to the processor, for providing instructions to the processor for processing the steps of: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from at least one expression, wherein the target expression is an expression needing degradation; and executing a first rule, wherein the execution result of the target expression is unknown.
It should be noted that, in the alternative or preferred real-time manner of this embodiment, reference may be made to the related description in embodiment 1, which is not described herein.
Example 4
In accordance with the embodiments of the present application, there is also provided an embodiment of a data processing method, it being noted that the steps shown in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order other than that shown or described herein.
Fig. 5 is a flowchart of a data processing method according to embodiment 4 of the present application. As shown in fig. 5, the method comprises the steps of:
in step S502, a logic operation expression to be executed is obtained, wherein the logic operation expression includes a first sub-expression and a remaining sub-expression.
The logical operation expression in the step S502 may be a sub-expression including a degradation processing required, and the first sub-expression and the remaining sub-expressions included in the logical operation expression may be connected to (and) or (i) through a logical expression; the first sub-expression described above may be an expression requiring degradation processing, and specifically may be determined according to the resources consumed by each expression included in the logical operation expression.
In an alternative embodiment, in the application scenario of e-commerce large-scale promotion, data analysis may be performed on all the sub-expressions in the logical operation expressions, so that the operation cost of each sub-expression is calculated respectively, that is, the resource consumed by each sub-expression is calculated, if the operation cost of one sub-expression exceeds a preset threshold value in the current application scenario, the cost of the sub-expression is considered to be higher, degradation is required, and therefore the expression is determined to be the first sub-expression, and the other expressions are the rest sub-expressions.
For example, in the embodiment of the present application, a logical operation expression is illustrated as 1&2|3, where the logical operation expression includes an expression 1, an expression 2, and an expression 3, in an application scenario of e-commerce large-scale promotion, data analysis may be performed on the expression 1, the expression 2, and the expression 3 respectively, to determine an operation cost corresponding to each expression, and when the operation cost of the expression 1 exceeds a preset threshold, it is determined that the expression 1 is a first sub-expression, degradation needs to be performed, and the expression (2|3) is a remaining sub-expression.
In step S504, the first sub-expression is determined to be an unknown result expression.
In an alternative embodiment, the execution result is extended in the embodiment of the present application, and an unknown unown is introduced, and for the first sub-expression, since the first sub-expression needs to be downgraded, the execution result of the first sub-expression may not be calculated, and it is directly determined that the execution result of the first sub-expression is determined to be unowned, that is, it is determined that the first sub-expression is an unknown result expression. For example, the logic of the expression is a user ID >3, and if the value of the user ID is not obtained or an abnormality occurs in the process of obtaining the value of the user ID, the expression is an unknown result expression.
It should be noted that, in the data processing process, only the first sub-expression needs to be downgraded, and the execution result of the first sub-expression is determined to be unknown.
For example, still illustrated with a logical operation expression of 1&2|3, when executing the first sub-expression, that is, executing expression 1, the execution result of expression 1 is unknown because of the degradation required for expression 1.
Step S506, executing the residual sub-expression to obtain an intermediate result.
In an alternative embodiment, a remaining sub-expression may be executed, where each sub-expression in the remaining sub-expressions is executed as True or False, for example, the logic of the expression is user ID >3, and if the value of the user ID is known, it may be determined that the execution result of the expression is True or False. Further, an intermediate result may be obtained based on the execution results of all the sub-expressions in the remaining sub-expressions.
For example, still taking the logical operation expression 1&2 & lt 3 as an example, when the remaining sub-expressions, that is, the expression (2|3) are executed, the execution result of the expression 2 and the execution result of the expression 3 may be calculated, respectively, and then the execution result of the expression (2|3) is obtained according to the execution results of the expression 2 and the expression 3, thereby obtaining an intermediate result.
Step S508, obtaining the result of the logic operation expression to be executed according to the logic operation between the intermediate result and the unknown result expression.
In an alternative embodiment, the result of the whole logical operation expression may be obtained through a logical operation according to the intermediate result and the execution result of the unknown result expression, when the logical operator in the whole logical operation expression is the AND (≡), if the intermediate result is True, the execution result of the whole logical operation expression may be determined to be unknown, and if the intermediate result is False, the execution result of the whole logical operation expression may be determined to be False; when the logical operator in the entire logical operation expression is or (|), if the intermediate result is True, the execution result of the entire logical operation expression may be determined to be True, and if the intermediate result is False, the execution result of the entire logical operation expression may be determined to be unknown.
It should be noted that, the execution result of the logical operation expression may include True, false, and unknown, when the execution result of the first rule is unknown, it may be determined that the execution of the rule is unproductive, and when the execution result of the first rule is True or False, it may be determined that the execution of the rule is productive.
For example, still taking the logical operation expression 1&2|3 as an example, when the entire logical operation expression is executed, since expression 1 and expression (2|3) are in a relationship with each other, if the execution result of expression (2|3) is False, the result of the entire logical operation expression is False; if the result of the execution of the expression (2|3) is True, the result of the entire logical operation expression is unknown.
It can be known based on the scheme defined in the above embodiment that, after the logic operation expression to be executed is obtained, the first sub-expression in the logic operation expression may be determined to be an unknown result expression, and the remaining sub-expressions are executed at the same time, so as to obtain an intermediate result, and further, according to the logic operation between the intermediate result and the unknown result expression, the result of the logic operation expression to be executed is obtained.
By the scheme provided by the embodiment of the application, the execution result of the first sub-expression to be degraded is set to be unknown, so that the purpose that the logic operation expression can still be executed when data processing is performed is realized, the technical effect of reducing the influence of rule degradation on the service is achieved, and the technical problem that the rule degradation processing mode in the prior art is to not run the rule any more and has influence on the service is solved.
Example 5
There is further provided, according to an embodiment of the present application, a data processing apparatus for implementing the above data processing method, as shown in fig. 6, the apparatus 600 includes:
the obtaining module 602 is configured to obtain a logical operation expression to be executed, where the logical operation expression includes a first sub-expression and a remaining sub-expression.
A determining module 604, configured to determine the first sub-expression as an unknown result expression.
The first execution module 606 is configured to execute the remaining sub-expressions to obtain an intermediate result.
The second execution module 608 is configured to obtain a result of the logic operation expression to be executed according to a logic operation between the intermediate result and the unknown result expression.
Here, the acquiring module 602, the determining module 604, the first executing module 606, the second executing module 608 and the steps S502 to S508 corresponding to the embodiment 4 are the same as the examples and the application scenarios implemented by the corresponding steps, but are not limited to those disclosed in the embodiment 4. It should be noted that the above-described module may be operated as a part of the apparatus in the computer terminal 10 provided in embodiment 1.
It should be noted that, in the alternative or preferred real-time manner of this embodiment, reference may be made to the related description in embodiment 4, which is not described herein.
Example 6
Embodiments of the present application may provide a computer terminal, which may be any one of a group of computer terminals. Alternatively, in the present embodiment, the above-described computer terminal may be replaced with a terminal device such as a mobile terminal.
Alternatively, in this embodiment, the above-mentioned computer terminal may be located in at least one network device among a plurality of network devices of the computer network.
In this embodiment, the above-mentioned computer terminal may execute the program code of the following steps in the rule degradation processing method: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from at least one expression, wherein the target expression is an expression needing degradation; and executing a first rule, wherein the execution result of the target expression is unknown.
Alternatively, fig. 7 is a block diagram of a computer terminal according to an embodiment of the present application. As shown in fig. 7, the computer terminal a may include: one or more (only one is shown) processors 702 and memory 704.
The memory may be used to store software programs and modules, such as program instructions/modules corresponding to the rule degradation processing method and apparatus in the embodiments of the present application, and the processor executes the software programs and modules stored in the memory, thereby executing various function applications and data processing, that is, implementing the rule degradation processing method described above. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory remotely located with respect to the processor, which may be connected to terminal a through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor may call the information and the application program stored in the memory through the transmission device to perform the following steps: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from at least one expression, wherein the target expression is an expression needing degradation; and executing a first rule, wherein the execution result of the target expression is unknown.
Optionally, the above processor may further execute program code for: performing data analysis on at least one expression, and determining the operation cost corresponding to the at least one expression; and determining an expression with the operation cost larger than a preset threshold value as a target expression.
Optionally, the above processor may further execute program code for: the first rule includes a target expression, a first expression, and a logical expression, the first expression being an expression that does not require demotion, the logical expression including at least one of: and, or; under the condition that the logic expression is AND, if the execution result of the first expression is correct, the execution result of the first rule is unknown, and if the execution result of the first expression is wrong, the execution result of the first rule is wrong; if the logical expression is or, the execution result of the first rule is correct if the execution result of the first expression is correct, and if the execution result of the first expression is incorrect, the execution result of the first rule is unknown.
Optionally, the above processor may further execute program code for: the first rule includes a target expression and a logical expression, the logical expression includes a denoise, wherein the execution result of the first rule is unknown.
Optionally, the above processor may further execute program code for: setting operation data for the first expression after determining the target expression from the at least one expression, and not setting operation data for the target expression; in executing the first rule, the first expression is executed by acquiring the operation data.
By adopting the embodiment of the application, a scheme for rule degradation processing is provided. After the first rule is acquired, a target expression may be first determined from at least one expression included in the first rule, an execution result of the target expression is set to be unknown, the first rule is further executed, and an execution result of the first rule is obtained based on the execution result of each expression.
By the scheme provided by the embodiment of the application, the execution result of the target expression to be demoted is set to be unknown, and the purpose that the first rule can still be executed when the rule demotion processing is carried out is achieved, so that the technical effect of reducing the influence of the rule demotion on the service is achieved, and the technical problem that the rule demotion processing mode in the prior art is that the rule is not operated any more and the service is influenced is solved.
It will be appreciated by those skilled in the art that the configuration shown in fig. 7 is only illustrative, and the computer terminal may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm-phone computer, a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 7 is not limited to the structure of the electronic device. For example, the computer terminal a may also include more or fewer components (such as a network interface, a display device, etc.) than shown in fig. 7, or have a different configuration than shown in fig. 7.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing a terminal device to execute in association with hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
Example 7
Embodiments of the present application also provide a storage medium. Alternatively, in this embodiment, the storage medium may be used to store the program code executed by the rule degradation processing method provided in the first embodiment.
Alternatively, in this embodiment, the storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
Alternatively, in the present embodiment, the storage medium is configured to store program code for performing the steps of: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from at least one expression, wherein the target expression is an expression needing degradation; and executing a first rule, wherein the execution result of the target expression is unknown.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (9)

1. A rule degradation processing method, comprising:
acquiring a first rule, wherein the first rule comprises at least one expression;
determining a target expression from the at least one expression, wherein the target expression is an expression needing degradation;
executing the first rule, wherein the execution result of the target expression is unknown;
wherein said determining a target expression from said at least one expression comprises: performing data analysis on the at least one expression, and determining the operation cost corresponding to the at least one expression; and determining an expression with the operation cost larger than a preset threshold value as the target expression.
2. The method of claim 1, wherein the first rule comprises the target expression, a first expression that is an expression that does not require demotion, and a logical expression that comprises at least one of: and, or; wherein,
If the logic expression is AND, if the execution result of the first expression is correct, the execution result of the first rule is unknown, and if the execution result of the first expression is wrong, the execution result of the first rule is wrong;
and if the logic expression is OR, if the execution result of the first expression is correct, the execution result of the first rule is correct, and if the execution result of the first expression is wrong, the execution result of the first rule is unknown.
3. The method of claim 1, wherein the first rule comprises the target expression and a logical expression comprising a de-reflection, wherein the result of execution of the first rule is unknown.
4. The method of claim 2, wherein after determining the target expression from the at least one expression, the method further comprises:
setting operation data for the first expression, and not setting operation data for the target expression;
in the process of executing the first rule, executing the first expression by acquiring the operation data.
5. A rule degradation processing apparatus, comprising:
an acquisition module for acquiring a first rule, the first rule comprising at least one expression;
the determining module is used for determining a target expression from the at least one expression, wherein the target expression is an expression needing degradation;
an execution module, configured to execute the first rule, where an execution result of the target expression is unknown;
the determining module is further used for carrying out data analysis on the at least one expression and determining operation cost corresponding to the at least one expression; and determining an expression with the operation cost larger than a preset threshold value as the target expression.
6. A storage medium comprising a stored program, wherein the program, when run, controls a device on which the storage medium resides to perform the steps of: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from the at least one expression, wherein the target expression is an expression needing degradation; executing the first rule, wherein the execution result of the target expression is unknown, and the determining the target expression from the at least one expression comprises:
Performing data analysis on the at least one expression, and determining the operation cost corresponding to the at least one expression;
and determining an expression with the operation cost larger than a preset threshold value as the target expression.
7. A processor for running a program, wherein the program when run performs the steps of: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from the at least one expression, wherein the target expression is an expression needing degradation; executing the first rule, wherein the execution result of the target expression is unknown, and the determining the target expression from the at least one expression comprises: performing data analysis on the at least one expression, and determining the operation cost corresponding to the at least one expression; and determining an expression with the operation cost larger than a preset threshold value as the target expression.
8. A rule degradation processing system, comprising:
a processor; and
a memory, coupled to the processor, for providing instructions to the processor to process the following processing steps: acquiring a first rule, wherein the first rule comprises at least one expression; determining a target expression from the at least one expression, wherein the target expression is an expression needing degradation; executing the first rule, wherein the execution result of the target expression is unknown, and the determining the target expression from the at least one expression comprises: performing data analysis on the at least one expression, and determining the operation cost corresponding to the at least one expression; and determining an expression with the operation cost larger than a preset threshold value as the target expression.
9. A method of data processing, comprising:
obtaining a logic operation expression to be executed, wherein the logic operation expression comprises a first sub-expression and a residual sub-expression;
determining the first sub-expression as an unknown result expression;
executing the residual sub-expression to obtain an intermediate result;
and obtaining the result of the logic operation expression to be executed according to the logic operation between the intermediate result and the unknown result expression.
CN201810078977.3A 2018-01-26 2018-01-26 Rule degradation processing method, device and system and data processing method Active CN110096255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810078977.3A CN110096255B (en) 2018-01-26 2018-01-26 Rule degradation processing method, device and system and data processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810078977.3A CN110096255B (en) 2018-01-26 2018-01-26 Rule degradation processing method, device and system and data processing method

Publications (2)

Publication Number Publication Date
CN110096255A CN110096255A (en) 2019-08-06
CN110096255B true CN110096255B (en) 2023-05-02

Family

ID=67441788

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810078977.3A Active CN110096255B (en) 2018-01-26 2018-01-26 Rule degradation processing method, device and system and data processing method

Country Status (1)

Country Link
CN (1) CN110096255B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6021405A (en) * 1996-08-23 2000-02-01 Tandem Computers, Inc. System and method for optimizing database queries with improved performance enhancements
CN1505880A (en) * 2001-04-30 2004-06-16 �ƶ��Ѷ��� Method for enhancing link adaptation in cellular systems to distinguish between high and low variability
CN103198065A (en) * 2012-01-06 2013-07-10 北京奇策科技有限公司 Optimization method for regular expression matching circuit
CN104243619A (en) * 2014-10-17 2014-12-24 上海瀚银信息技术有限公司 Distributed mobile payment system
CN106201537A (en) * 2016-07-18 2016-12-07 浪潮通用软件有限公司 A kind of data processing method and device
CN106296399A (en) * 2015-06-11 2017-01-04 交通银行股份有限公司 The data processing method of business rule formulation and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6021405A (en) * 1996-08-23 2000-02-01 Tandem Computers, Inc. System and method for optimizing database queries with improved performance enhancements
CN1505880A (en) * 2001-04-30 2004-06-16 �ƶ��Ѷ��� Method for enhancing link adaptation in cellular systems to distinguish between high and low variability
CN103198065A (en) * 2012-01-06 2013-07-10 北京奇策科技有限公司 Optimization method for regular expression matching circuit
CN104243619A (en) * 2014-10-17 2014-12-24 上海瀚银信息技术有限公司 Distributed mobile payment system
CN106296399A (en) * 2015-06-11 2017-01-04 交通银行股份有限公司 The data processing method of business rule formulation and system
CN106201537A (en) * 2016-07-18 2016-12-07 浪潮通用软件有限公司 A kind of data processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
BPEL系统开发中异构数据处理的解决方案;尤海鹏;《电脑知识与技术》;20081205(第34期);全文 *

Also Published As

Publication number Publication date
CN110096255A (en) 2019-08-06

Similar Documents

Publication Publication Date Title
US20160210632A1 (en) Secured payment method and relevant device and system
EP3780702A1 (en) Method and device for monitoring network data
EP3605323A1 (en) Method for generating network slice template and for applying network slice template, and apparatus
CN114691390B (en) User-mode program processing method and device, storage medium and processor
CN110858201B (en) Data processing method and system, processor and storage medium
CN110675219B (en) Page and order generation method, system, computer equipment and storage medium
CN112417164A (en) Information recommendation method and device, storage medium and electronic device
US20200004785A1 (en) Automatic grouping based on user behavior
CN108632211B (en) Binding method and device of intelligent equipment
CN119338010A (en) Data processing method and device based on large model, storage medium and electronic device
CN114553870B (en) Data processing method and device based on distributed cluster
CN109005301B (en) Intermediate number management and control method and intermediate number management and control device
CN108965403B (en) Operation and maintenance monitoring connection establishing method and terminal equipment
CN110762773A (en) Upgrading method of air conditioner and air conditioner
CN110096255B (en) Rule degradation processing method, device and system and data processing method
CN117097789A (en) Data processing method and device, electronic equipment and storage medium
CN112698818A (en) Point exchange method and device based on activity page and point exchange system
CN116228544B (en) Image processing method and device and computer equipment
CN109408104B (en) Method and device for acquiring game integration information
CN111026995A (en) Method and device for information association between applications and storage medium
CN113194045B (en) Data traffic analysis method, device, storage medium and processor
CN110609701A (en) Method, apparatus and storage medium for providing service
CN114040399A (en) Equipment binding method and device, storage medium and electronic device
CN113919511A (en) Federal learning method and device
CN116468127B (en) Error symptom information processing method and device and computer equipment

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