Rule calculation method and device and storage medium

By transmitting the real-time data and backlog data in the to be processed data to the index database and the general database, and combining stream processing and batch processing technology for rule calculation, the problem of high rule calculation delay when the data volume is too large is solved, and more efficient data processing is achieved.

CN119557337APending Publication Date: 2025-03-04CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411576295.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

When the amount of data is too large, the calculation delay of the data rules is high, resulting in the calculation lag of backlog data.

Method used

By transmitting the real-time data in the pending data to the metric database and transmitting the backlog data to the general database, the real-time data is processed using stream processing, batch processing is used to perform rule calculations on the backlog data, and the results are written to the rule result table.

Benefits of technology

The rule calculation time of backlog data is reduced, the data calculation delay is avoided, and the data processing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557337A_ABST
    Figure CN119557337A_ABST
Patent Text Reader

Abstract

The invention discloses a rule calculation method and device and a storage medium, and belongs to the technical field of data processing. The method comprises the steps of receiving a to-be-processed rate, determining a data receiving rate of to-be-processed data and a processing rate of real-time data in an index database, when the data receiving rate is greater than the processing rate, transmitting the real-time data in the to-be-processed data to the index database, and transmitting backlog data of the to-be-processed data to a universal database, and performing batch processing on the backlog data in the general database through rule calculation, performing stream processing on the real-time data in the index database, writing a batch processing result and a stream processing result into a rule result table, and generating a rule calculation result. According to the data processing method and the data processing device, rule calculation is carried out on the backlog data by adopting a batch processing mode while rule calculation of stream processing is carried out through a batch-stream combined data processing mode, so that the rule calculation time of the backlog data is shortened, and the delay of data rule calculation is prevented from being too long.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a rule calculation method, device and storage medium. Background Art

[0002] During the rule calculation process, based on the batch-stream integrated data processing method, rule calculation can process data continuously in quasi-real time through stream processing, while batch processing is used to process backlog data.

[0003] In related technologies, the rule calculation process usually obtains data that cannot be processed by stream processing after stream processing, and processes it as backlog data for batch processing. However, when the amount of data is large, the calculation of backlog data usually has a certain lag, resulting in a high delay in the rule calculation of the data.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present application is to provide a rule calculation method, device and storage medium, aiming to solve the technical problem of high delay in rule calculation of data when the amount of data is too large.

[0006] To achieve the above object, the present application provides a rule calculation method, which comprises the following steps: Receiving data to be processed, determining a data receiving rate of the data to be processed, and a processing rate of real-time data in the indicator database; When the data receiving rate is greater than the processing rate, the real-time data in the data to be processed is transmitted to the indicator database, and the backlog data of the data to be processed is transmitted to the general database; By rule calculation, batch processing is performed on the backlog data in the general database, and stream processing is performed on the real-time data in the indicator database; Write batch processing results and stream processing results into the rule result table of the column database to generate rule calculation results.

[0007] In one embodiment, when the data receiving rate is greater than the processing rate, before the step of transmitting the real-time data in the data to be processed to the indicator database and transmitting the backlog data of the data to be processed to the general database, the step further includes: Determining a data receiving rate of the data to be processed and a processing rate of real-time data in the indicator database; Calculating a rate difference between the data receiving rate and the processing rate; When the data receiving rate is greater than the processing rate, determining the real-time data and the backlog data in the data to be processed based on the rate difference; Alternatively, when the data receiving rate is lower than the processing rate, the data to be processed is taken as the real-time data and transmitted to the indicator database.

[0008] In one embodiment, when the data receiving rate is greater than the processing rate, the step of transmitting the real-time data in the data to be processed to the indicator database and transmitting the backlog data of the data to be processed to the general database includes: Acquire data to be processed, and determine the real-time data and the backlog data of the data to be processed; Filling the real-time data into the distributed intermediate table of the indicator database; And, filling the backlog data into the relational intermediate table of the general database.

[0009] In one embodiment, the step of batch processing the backlog data in the general database and stream processing the real-time data in the indicator database by using a rule engine includes: Determine the rule number of the real-time data through the configuration information table, and query the distributed intermediate table according to the rule number to determine the stream processing result of the real-time data; And / or, in the relational intermediate table of the general database, the backlog data is extracted, and batch rule calculation is performed on the backlog data based on preset rules to determine batch processing results of the backlog data.

[0010] In one embodiment, the step of determining the rule number of the real-time data by configuring the information table, and querying the distributed intermediate table according to the rule number to determine the stream processing result of the real-time data includes: Backing up the distributed intermediate table to generate a distributed slave table; In the configuration information table, the rule number matching the real-time data is obtained, and the distributed slave table is queried based on the rule number to obtain the target real-time data; Through the rule calculation interface, a rule calculation program is called to calculate the stream processing result of the target real-time data.

[0011] In one embodiment, after the step of writing the batch processing results and the stream processing results into the rule result table to generate the rule calculation results, the following steps are further included: Obtaining the rule result table in the rule calculation result; Through the qualification indicator layer, qualification calculation is performed on the rule result table based on the relationship between rules to generate a qualification calculation result.

[0012] In one embodiment, when the data receiving rate is greater than the processing rate, before the step of transmitting the real-time data in the data to be processed to the indicator database and transmitting the backlog data of the data to be processed to the general database, the step further includes: Receiving business data, and determining real-time business data and backlog business data in the business data; Preprocessing the backlogged business data in batches by using a batch preprocessing application, and preprocessing the real-time business data in real time by using a quasi-real-time preprocessing application; The data to be processed is generated according to the batch preprocessing results and the real-time preprocessing results.

[0013] In one embodiment, after the step of batch processing the backlog data in the general database and stream processing the real-time data in the indicator database through rule calculation, the method further includes: Determine the waiting time for processing the real-time data in the indicator database; Acquire the target real-time data whose waiting processing time is greater than a preset time threshold in the real-time data; The target real-time data is transmitted to the general database as the backlog data.

[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a rule calculation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the rule calculation method as described above.

[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the rule calculation method as described above are implemented.

[0016] One or more technical solutions proposed in this application have at least the following technical effects: The present application transmits the real-time data and backlog data in the data to be processed to the indicator database and the general database respectively when the data volume is too large and the data stream cannot be transmitted in real time, and uses the rule engine to process the real-time data in the indicator database in a stream processing manner while performing rule calculations on the backlog data in the general database in a batch processing manner, and writes the obtained batch processing results and stream processing results into the rule result table to generate rule calculation results. In this way, based on the data processing method combining batch and stream, when the amount of data to be processed is too large, the rule calculation time of the backlog data is reduced to avoid excessive data calculation delays. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 This is a flow chart of the first embodiment of the rule calculation method of this application; Figure 2 This is a flow chart of the second embodiment of the rule calculation method of this application; Figure 3 This is a flow chart of the third embodiment of the rule calculation method of this application; Figure 4 This is a flow chart of a fourth embodiment of the rule calculation method of the present application; Figure 5 This is a flowchart of a fifth embodiment of the rule calculation method of the present application; Figure 6 It is a structural diagram of a rule computing device of a hardware operating environment involved in an embodiment of the present application.

[0020] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0021] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0022] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0023] The main solution of the embodiment of the present application is: to transfer the real-time data in the data to be processed to the indicator database, and to transfer the backlog data of the data to be processed to the general database; through rule calculation, batch processing is performed on the backlog data in the general database, and stream processing is performed on the real-time data in the indicator database; the batch processing results and the stream processing results are written into the rule result table of the columnar database to generate the rule calculation results.

[0024] Since rule calculation usually adopts stream processing, which is a continuous data processing method, data is continuously generated and processed in the form of streams. Through continuous real-time processing of data, rule calculation based on stream processing can quickly respond to data changes and achieve low latency in data processing. However, when the amount of data received at the same time is too large, and the data processing speed of the stream processor is lower than the speed of receiving data, stream processing cannot complete the real-time processing of all received data. Data that cannot be processed in real time is in the data stream waiting for the stream processor to process, resulting in data backlog, resulting in a high delay in rule calculation of data when the amount of data is too large.

[0025] In the case where the amount of data is too large and the data stream cannot be transmitted in real time, the present application transmits the real-time data and backlog data in the data to be processed to the indicator database and the general database respectively, and uses the rule engine to process the real-time data in the indicator database in a stream processing manner while performing rule calculations on the backlog data in the general database in a batch processing manner, and writes the obtained batch processing results and stream processing results into the rule result table to generate rule calculation results, thereby reducing the rule calculation time of the backlog data when the amount of data to be processed is too large, and avoiding excessive data calculation delays.

[0026] In order to better understand the above technical solution, exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0027] It should be noted that the execution subject of this embodiment can be a rule calculation system, or a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a rule calculation device, etc. that can realize the above functions, and this embodiment does not specifically limit this. The following takes the rule calculation system as an example to illustrate this embodiment and the following embodiments.

[0028] Based on this, the present application embodiment provides a rule calculation method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the rule calculation method of the present application.

[0029] In this embodiment, the rule calculation method includes steps S10 to S30: Step S10: receiving a rate to be processed, determining a data receiving rate of the data to be processed, and a processing rate of real-time data in the indicator database; Step S20: when the data receiving rate is greater than the processing rate, the real-time data in the data to be processed is transmitted to the indicator database, and the backlog data of the data to be processed is transmitted to the general database; In this embodiment, the acquired data to be processed will be stored in the indicator database and the general database respectively. The indicator database will import the real-time data in the data to be processed into the indicator database, and use the real-time data for data batch processing for real-time rule calculation. The general database will import the backlog data in the data to be processed into the general database to batch process the backlog data.

[0030] It should be noted that stream processing is a technology that continuously processes new data events received. In stream processing, data is regarded as a series of infinite events from producers to consumers. The stream processing system can analyze, transform and respond to these events in real time, realizing real-time processing of the data stream composed of the data to be processed. Batch processing is an offline data processing method that takes a batch of data as input and processes it at a specific time or under certain conditions. In batch processing, data is divided into discrete blocks, and batch jobs process these data in a certain order and steps. Batch actions can be run periodically or under specific trigger conditions. Batch processing usually requires data to be stored in a centralized location for batch processing. Unlike stream processing, batch processing focuses more on batch operations on static data sets rather than continuous processing of real-time data streams.

[0031] Specifically, the data to be processed is transmitted to a general database or an indicator database. When the data processing speed of the indicator database is greater than the received data to be processed, it is transmitted to the indicator database. When the processing speed of the indicator database is less than the received data to be processed, it means that the data volume is too large and stream processing cannot achieve real-time processing of all real-time data. The data that cannot be processed in time is determined in the data to be processed and transmitted to the general database as backlog data.

[0032] In one example, the rule calculation system is based on the TiDB (Ti Distributed Database) database as the indicator database and the MySQL (My SeQuel Database) database as the general database. The TiDB database stores real-time data in the TiDB intermediate table, and the MySQL database stores backlog data in the MySQL intermediate table. When the indicator layer of the rule calculation system performs stream processing rule calculation, it obtains the real-time data to be calculated by querying the TiDB intermediate table, and obtains the MySQL intermediate table to obtain batches of backlog data.

[0033] Step S30: batch processing the backlog data in the general database and stream processing the real-time data in the indicator database through rule calculation; In this embodiment, the rule calculation system receives the real-time data to be processed in the indicator database based on stream processing, and immediately performs rule calculation on the real-time data, thereby ensuring low latency for real-time data rule calculation. At the same time, the general database saves the received backlog data and processes the backlog data in batches through batch processing, thereby quickly performing rule calculation on the backlog data in a way that batch data is processed simultaneously. The rule calculation system stores preset rule information. Based on the rule information, rule calculation of data can be performed.

[0034] In one embodiment, the rule calculation system includes an indicator layer responsible for processing and calculating various data indicators. The indicator layer can use quasi-real-time rule calculation for stream processing and batch rule calculation for batch processing. Among them, the indicator layer of the rule calculation system can use streaming computing frameworks such as Apache Storm and Apache Flink to implement quasi-real-time rule calculation and stream processing, and use big data processing frameworks such as Hadoop and Spark to implement batch rule calculation and batch processing.

[0035] Optionally, the rule calculation system can also use a rule engine to express business rules in an executable form and perform rule calculations based on preset conditions and data to be calculated. In batch processing scenarios, the rule engine can process large amounts of data in batches according to predefined rules. In stream processing scenarios, the rule engine can process each data unit in the data stream in real time.

[0036] Step S40: Write the batch processing results and the stream processing results into the rule result table of the column database to generate the rule calculation results.

[0037] In this embodiment, after the data to be processed is calculated by batch processing and / or stream processing rules, the rule calculation results are sent to the rule result table of the column database, and the rule calculation results include batch processing results and stream processing results. Among them, by replacing redis used for data caching with a column database that is more suitable for storing sparse matrices, the scalability and stability of data storage of rule calculation results can be effectively improved.

[0038] Specifically, the rule result table can be stored in a columnar database such as HBase. The table structure of the rule result table includes fields such as processing timestamp, processing type (batch processing / stream processing), rule number, and result value. After the rule calculation system writes the batch processing results and stream processing results into the rule result table of the columnar database, it will write the processing timestamp, processing type (batch processing / stream processing), rule number and other rule calculation related information into the rule result table to generate the rule calculation result. By extracting the rule calculation result, you can determine the result value of the rule calculation of the data to be processed, the processing timestamp, the rule number and other information in the rule result table of the rule calculation result, or write the corresponding structured query statement according to business needs to obtain the required rule calculation result.

[0039] In the embodiment of the present application, when the amount of data is too large and the data stream cannot be transmitted in real time, the real-time data and backlog data in the data to be processed are transmitted to the indicator database and the general database respectively, and through the rule engine, while the real-time data in the indicator database is processed by stream processing, the backlog data in the general database is calculated by batch processing, and the obtained batch processing results and stream processing results are written into the rule result table to generate rule calculation results. Therefore, based on the data processing method combining batch and stream, when the amount of data to be processed is too large, the rule calculation time of the backlog data is reduced to avoid excessive data calculation delay.

[0040] Based on the same inventive concept, the present application also provides a second embodiment, referring to Figure 2 , Figure 2 This is a flow chart of the second embodiment of the rule calculation method of the present application.

[0041] In this embodiment, as described in step S20, when the data receiving rate is greater than the processing rate, the real-time data in the data to be processed is transmitted to the indicator database, and before the backlog data of the data to be processed is transmitted to the general database, steps S21 to S23 are also included: Step S21: Calculating the rate difference between the data receiving rate and the processing rate; Step S22: when the data receiving rate is greater than the processing rate, determining the real-time data and the backlog data in the data to be processed based on the rate difference; Step S23: Alternatively, when the data receiving rate is lower than the processing rate, the data to be processed is used as the real-time data and transmitted to the indicator database.

[0042] In this embodiment, the rule calculation system can determine whether to use a batch-stream combined data processing method or a stream processing method to perform rule calculation on the data to be processed based on the data receiving rate of the data to be processed and the processing rate of the index layer rule calculation stream processing.

[0043] In one embodiment, when the data receiving rate is greater than the processing rate, the rule calculation system performs rule processing by combining batches and streams. The rule calculation system may calculate the index data volume transmitted to the index database and the general data volume transmitted to the general database based on the rate difference calculated between the data receiving rate and the processing rate, and transmit the real-time data whose data volume in the data to be processed is equal to the index data volume to the index database, and transmit the backlog data whose data volume in the data to be processed is equal to the general data volume to the general database. Alternatively, the rule calculation system may also determine the index data volume based on the processing rate, and transmit the real-time data whose data volume in the data to be processed is equal to the index data volume to the index database, and transmit the remaining data in the data to be processed as backlog data to the general database.

[0044] In another embodiment, if the data receiving rate is less than the processing rate, it means that the current indicator layer can still perform real-time rule calculation on all the data to be processed through stream processing. The rule calculation system will use stream processing to perform rule calculation on all the data to be processed.

[0045] Optionally, in order to avoid the failure to timely process the real-time data in the stream processing due to abnormal circumstances during the rule calculation process of the batch-stream combination, the rule calculation system records the waiting processing time of the real-time data in the indicator database, and obtains the target real-time data in the real-time data whose waiting processing time is greater than the preset time threshold. The target real-time data is transmitted to the general database as backlog data and batch processed as backlog data. For example, when processing the intermediate table, the data source usually includes quasi-real-time and batch processing. The batch data source can use T+1 day to automatically fill in the missing data of the quasi-real-time day and obtain the backlog data.

[0046] Furthermore, before performing rule calculation on the data to be processed, the rule calculation system needs to pre-process the received business data, filter out irrelevant data through data cleaning, and transform the data into data to be processed that is suitable for rule calculation. The rule calculation system can directly pre-process all business data, or use batch processing and stream processing to pre-process business data to avoid excessive data volume affecting pre-processing efficiency.

[0047] Exemplarily, after receiving business data and determining the real-time business data and backlog business data in the business data, the rule calculation system performs batch preprocessing on the backlog business data through a batch preprocessing application, and performs real-time preprocessing on the real-time business data through a quasi-real-time preprocessing application. Based on the batch preprocessing results and the real-time preprocessing results, the data to be processed is generated. For example, the business data is processed, filtered, cleaned, and associated to meet the conditions for rule calculation, and then sent to the MySQL and TiDB online libraries.

[0048] The embodiment of the present application determines whether to adopt a batch-stream combined rule calculation method or a stream processing rule calculation method based on whether the data received by the rule calculation system can be processed in real time, thereby further improving the real-time performance of the rule calculation.

[0049] Since the system introduced in the second embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of this application.

[0050] Based on the same inventive concept, the present application also provides a third embodiment, referring to Figure 3 , Figure 3 This is a flowchart of the third embodiment of the rule calculation method of the present application.

[0051] In this embodiment, when the data receiving rate is greater than the processing rate as described in step S20, the real-time data in the data to be processed is transmitted to the indicator database, and the backlog data of the data to be processed is transmitted to the general database, including steps S24 to S26: Step S24: acquiring the data to be processed, and determining the real-time data and the backlog data of the data to be processed; Step S25: Filling the real-time data into the distributed intermediate table of the indicator database; Step S26: and filling the backlog data into the relational intermediate table of the general database.

[0052] In this embodiment, the indicator database uses a distributed database to receive real-time data. The general database uses a relational database to store backlog data. The real-time data is filled into the distributed intermediate table of the indicator database, and the backlog data is filled into the relational intermediate table of the general database. Exemplarily, the indicator database is a TiDB database, and the general database is a MySQL database.

[0053] The embodiment of the present application stores the data to be processed in a database in a table format, which can respond to data more quickly when performing rule calculations at the indicator layer.

[0054] Since the system introduced in the third embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of the present application.

[0055] Based on the same inventive concept, the present application also provides a fourth embodiment, referring to Figure 4 , Figure 4 This is a flowchart of the fourth embodiment of the rule calculation method of the present application.

[0056] In this embodiment, as described in step S30, batch processing is performed on the backlog data in the general database through rule calculation, and stream processing is performed on the real-time data in the indicator database, including steps S31-S32: Step S31: determining the rule number of the real-time data through the configuration information table, and querying the distributed intermediate table according to the rule number to determine the stream processing result of the real-time data; In this embodiment, when performing stream processing, the rule calculation system backs up the distributed intermediate table and generates a distributed slave table. At the same time, after obtaining the rule number matching the real-time data from the preset configuration information table, the rule calculation system can query the distributed slave table based on the rule number to obtain the target real-time data, and call the rule calculation program to calculate the stream processing result of the target real-time data through the rule calculation interface.

[0057] Specifically, the rule calculation system calls the rule calculation program through the rule calculation interface, and inputs the obtained rule number into the rule calculation program through the rule calculation interface. The rule calculation program queries the distributed slave table according to the rule number, obtains the target real-time data, and performs rule calculation on the target real-time data based on the preset rules.

[0058] For example, after the quasi-real-time preprocessed data is written into the intermediate table, the rule ID to be calculated is obtained from the configuration information table, and then the quasi-real-time rule calculation is triggered. The quasi-real-time qualification calculation calculates the rule result by querying the intermediate table, and writes the rule result into the HBase rule result table.

[0059] Step S31: and / or, extracting the backlog data from the relational intermediate table of the general database, and performing batch rule calculation on the backlog data based on preset rules to determine batch processing results of the backlog data.

[0060] In this embodiment, batch rule calculation also synchronously calculates rule results and writes the rule results into the HBase rule result table through the file exchange system.

[0061] Since the system introduced in the fourth embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of this application.

[0062] Based on the same inventive concept, the present application also provides a fifth embodiment, referring to Figure 5 , Figure 5 This is a flowchart of the fifth embodiment of the rule calculation method of the present application.

[0063] In this embodiment, the rule calculation method further includes steps S50 to S60: Step S50: obtaining the rule result table in the rule calculation result; Step S60: Through the qualification indicator layer, based on the relationship between rules, the qualification calculation is performed on the rule result table to generate a qualification calculation result.

[0064] In this embodiment, after the quasi-real-time rule calculation sends the rule results to the rule result table, the quasi-real-time qualification calculation will be triggered. The qualification calculation obtains the results of each rule contained in the qualification by querying the rule result table, and then calculates the qualification results based on the relationship between the result rules, and sends the qualification results to the qualification result table. At the same time, the batch qualification calculation reads the batch rule result table to calculate the batch qualification results. The downstream system reads the quasi-real-time qualification result table and the batch qualification result table at the same time to obtain the final result.

[0065] Since the system introduced in the fifth embodiment of the present application is a system used to implement the method of the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the first embodiment of the present application belong to the scope of protection of the present application.

[0066] The present application provides a rule calculation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the rule calculation method in the above-mentioned embodiment 1.

[0067] Reference below Figure 6, which shows a schematic diagram of the structure of a rule calculation device suitable for implementing the embodiment of the present application. The rule calculation device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The rule calculation device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0068] like Figure 6 As shown, the rule computing device may include a processing device 1001 (e.g., a core processor, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the rule computing device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the rule computing device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a rule computing device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0069] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0070] The rule calculation device provided by the present application adopts the rule calculation method in the above embodiment, which can solve the technical problem that the delay of the rule calculation of data is high when the amount of data is too large. Compared with the prior art, the beneficial effects of the rule calculation device provided by the present application are the same as the beneficial effects of the rule calculation method provided by the above embodiment, and the other technical features in the rule calculation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0071] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0072] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0073] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the rule calculation method in the above-mentioned embodiment.

[0074] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0075] The computer-readable storage medium may be included in the rule computing device; or may exist independently without being assembled into the rule computing device.

[0076] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the rule computing device, the rule computing device: transmits the real-time data in the data to be processed to the indicator database, and transmits the backlog data of the data to be processed to the general database; through rule calculation, batch processes the backlog data in the general database, and stream processes the real-time data in the indicator database; writes the batch processing results and the stream processing results into the rule result table of the column database to generate the rule calculation results.

[0077] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0078] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0079] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0080] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned rule calculation method, and can solve the technical problem that the delay of rule calculation of data is high when the amount of data is too large. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the rule calculation method provided in the above-mentioned embodiment, and will not be repeated here.

[0081] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A rule calculation method, characterized in that: The method comprises the following steps: Receiving data to be processed, determining a data receiving rate of the data to be processed, and a processing rate of real-time data in an indicator database; When the data receiving rate is greater than the processing rate, the real-time data in the data to be processed is transmitted to the indicator database, and the backlog data of the data to be processed is transmitted to the general database; Through rule calculation, batch processing is performed on the backlog data in the general database, and stream processing is performed on the real-time data in the indicator database; Write batch processing results and stream processing results into the rule result table of the column database to generate rule calculation results.

2. The method according to claim 1, characterized in that Before the step of transmitting the real-time data in the data to be processed to the indicator database and transmitting the backlog data of the data to be processed to the general database when the data receiving rate is greater than the processing rate, the method further includes: Calculating a rate difference between the data receiving rate and the processing rate; When the data receiving rate is greater than the processing rate, determining the real-time data and the backlog data in the data to be processed based on the rate difference; Alternatively, when the data receiving rate is lower than the processing rate, the data to be processed is taken as the real-time data and transmitted to the indicator database.

3. The method according to claim 1, characterized in that When the data receiving rate is greater than the processing rate, the step of transmitting the real-time data in the data to be processed to the indicator database and transmitting the backlog data of the data to be processed to the general database comprises: Acquire data to be processed, and determine the real-time data and the backlog data of the data to be processed; Filling the real-time data into the distributed intermediate table of the indicator database; And, filling the backlog data into the relational intermediate table of the general database.

4. The method according to claim 3, characterized in that The step of batch processing the backlog data in the general database and stream processing the real-time data in the indicator database by using a rule engine includes: Determine the rule number of the real-time data through the configuration information table, and query the distributed intermediate table according to the rule number to determine the stream processing result of the real-time data; And / or, in the relational intermediate table of the general database, the backlog data is extracted, and batch rule calculation is performed on the backlog data based on preset rules to determine batch processing results of the backlog data.

5. The method according to claim 4, characterized in that The step of determining the rule number of the real-time data by configuring the information table, and querying the distributed intermediate table according to the rule number to determine the stream processing result of the real-time data includes: Backing up the distributed intermediate table to generate a distributed slave table; In the configuration information table, the rule number matching the real-time data is obtained, and the distributed slave table is queried based on the rule number to obtain the target real-time data; Through the rule calculation interface, a rule calculation program is called to calculate the stream processing result of the target real-time data.

6. The method according to claim 1, characterized in that After the step of writing the batch processing results and the stream processing results into the rule result table to generate the rule calculation results, the following steps are further included: Obtaining the rule result table in the rule calculation result; Through the qualification indicator layer, qualification calculation is performed on the rule result table based on the relationship between rules to generate a qualification calculation result.

7. The method according to claim 1, characterized in that Before the step of transmitting the real-time data in the data to be processed to the indicator database and transmitting the backlog data of the data to be processed to the general database when the data receiving rate is greater than the processing rate, the method further includes: Receiving business data, and determining real-time business data and backlog business data in the business data; Preprocessing the backlogged business data in batches by using a batch preprocessing application, and preprocessing the real-time business data in real time by using a quasi-real-time preprocessing application; The data to be processed is generated according to the batch preprocessing results and the real-time preprocessing results.

8. The method according to claim 1, characterized in that After the step of batch processing the backlog data in the general database and stream processing the real-time data in the indicator database through rule calculation, the method further includes: Determine the waiting time for processing the real-time data in the indicator database; Acquire the target real-time data whose waiting processing time is greater than a preset time threshold in the real-time data; The target real-time data is transmitted to the general database as the backlog data.

9. A rule computing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the rule calculation method according to any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the rule calculation method according to any one of claims 1 to 8 are implemented.