Data processing method, system and device and computer equipment
By querying and applying target date rule groups in nodes of distributed systems, the accounting dates of transaction data are automatically updated, and the problems of accounting date errors and inefficiency in the existing technology are solved, and efficient automated data processing is achieved.
Patent Information
- Application Number
- CN202510008366.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-25
Smart Images

Figure CN119887417A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, system, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] Since banking systems generally record accounts, there is a design for accounting dates. The accounting date refers to the date when user records and reports are generated. That is, when accounting is performed, the date when accounting entries are generated is the accounting date. Generally speaking, the accounting date of the transaction data of a transaction is determined through data processing methods.
[0003] The current data processing method determines the current system accounting date as the accounting date of each transaction for the transaction data. The system accounting date will change according to certain rules in response to natural date changes. Specifically, when the system completes processing the transaction data set of the day and the current time reaches the preset switching time, the system accounting date will switch to the next day. When there is a delay between the processing efficiency and switching time of the system processing transaction data, the system will process the transaction data of the day according to the system accounting date of the previous day.
[0004] However, the current data processing method has delays in processing efficiency and switching time, which causes the accounting date of the current transaction data to be wrong. It is necessary to manually modify the accounting date of each wrong transaction data to obtain the correct accounting date. The amount of data to be manually modified is large and the modification speed is slow. Therefore, the current data processing method is inefficient. Summary of the invention
[0005] Based on this, it is necessary to provide a data processing method, system, apparatus, computer equipment, computer-readable storage medium and computer program product to address the above technical issues.
[0006] In a first aspect, the present application provides a data processing method, which is applied to a node in a distributed system, and the method includes:
[0007] Receive transaction data of a target business, and query a target date rule group corresponding to the target business according to a target business identifier in the transaction data;
[0008] Determining a target date rule that matches the transaction data in the target date rule group based on the priority of each date rule in the target date rule group;
[0009] The transaction date in the transaction data is updated according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data.
[0010] In one embodiment, the target date rule group includes various date rules, and determining the target date rule that matches the transaction data in the target date rule group based on the priority of each date rule in the target date rule group includes:
[0011] According to the order of priority of each date rule from high to low, determine whether the transaction data meets the constraint conditions in the date rule one by one;
[0012] If the transaction data satisfies the constraint condition in the date rule, the date rule is determined as a target date rule.
[0013] In one embodiment, the target date rule group includes a first date rule of a first type and a second date rule of a second type; the first date rule has a higher priority than the second date rule.
[0014] In one embodiment, the determining whether the transaction data satisfies the constraint condition in the date rule includes:
[0015] If the date rule is the first date rule, judging whether the transaction data satisfies the constraint condition in the date rule based on the transaction date, user identifier, scenario code, resource type and application system code in the transaction data;
[0016] If the date rule is the second date rule, based on the transaction date in the transaction data, it is determined whether the transaction data satisfies the constraint condition in the date rule.
[0017] In one embodiment, updating the transaction date in the transaction data according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data includes:
[0018] Determining the accounting period corresponding to the transaction data in the accounting date calculation rule in the target date rule;
[0019] Date operations are performed on the accounting period and the transaction date in the transaction data to obtain the accounting date corresponding to the transaction data.
[0020] In a second aspect, the present application further provides a data processing system, the system comprising:
[0021] A terminal, for generating a target date rule group for a target business;
[0022] A distributed system includes nodes, wherein the nodes are used to receive transaction data of a target business, and query a target date rule group corresponding to the target business according to a target business identifier in the transaction data; determine a target date rule matching the transaction data in the target date rule group based on the priority of each date rule in the target date rule group; and update a transaction date in the transaction data according to an accounting period in the target date rule to obtain an accounting date corresponding to the transaction data.
[0023] In one embodiment, the target date rule group for generating the target business includes:
[0024] In response to a request to establish a date rule of the target business, a date rule template is acquired; the date rule template includes a first date rule template and a second date rule template;
[0025] generating a first date rule of a first type based on the first date rule template, and generating a second date rule of a second type based on the second date rule template;
[0026] A target date rule group for the target business is constructed based on the first date rule and the second date rule.
[0027] In one embodiment, the first date rule template includes a default constraint condition, a default accounting date calculation rule, and a default priority; and generating a first date rule of the first type based on the first date rule template includes:
[0028] Determine a first constraint condition based on a default transaction date, each default user identifier, each default scenario code, each default currency, and each default application system code in the default constraint condition;
[0029] Determining a first accounting date calculation rule based on the default accounting date calculation rule, and determining a first priority based on the default priority;
[0030] A first date rule of a first type is generated based on the first constraint, the first priority, and the first accounting date calculation rule.
[0031] In a third aspect, the present application further provides a data processing device, comprising:
[0032] A query module, used to receive transaction data of a target business, and query a target date rule group corresponding to the target business according to a target business identifier in the transaction data;
[0033] a matching module, configured to determine a target date rule matching the transaction data in the target date rule group based on the priority of each date rule in the target date rule group;
[0034] An updating module is used to update the transaction date in the transaction data according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data.
[0035] In a fourth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0036] Receive transaction data of a target business, and query a target date rule group corresponding to the target business according to a target business identifier in the transaction data;
[0037] Determining a target date rule that matches the transaction data in the target date rule group based on the priority of each date rule in the target date rule group;
[0038] The transaction date in the transaction data is updated according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data.
[0039] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0040] Receive transaction data of a target business, and query a target date rule group corresponding to the target business according to a target business identifier in the transaction data;
[0041] Determining a target date rule that matches the transaction data in the target date rule group based on the priority of each date rule in the target date rule group;
[0042] The transaction date in the transaction data is updated according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data.
[0043] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0044] Receive transaction data of a target business, and query a target date rule group corresponding to the target business according to a target business identifier in the transaction data;
[0045] Determining a target date rule that matches the transaction data in the target date rule group based on the priority of each date rule in the target date rule group;
[0046] The transaction date in the transaction data is updated according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data.
[0047] The above-mentioned data processing method, system, device, computer equipment, computer-readable storage medium and computer program product receive the transaction data of the target business, and query the target date rule group corresponding to the target business according to the target business identifier in the transaction data; determine the target date rule matching the transaction data in the target date rule group based on the priority of each date rule in the target date rule group; update the transaction date in the transaction data according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data. With this method, the target date rule of the accounting date of the transaction data is determined in real time by determining the target date rule group corresponding to the target business and determining the matching target date rule of the transaction data. Furthermore, the accounting date of the transaction data is determined based on the target date rule and the fixed transaction date, so as to realize the automatic determination of the accounting date according to the transaction date, avoid the error of switching the accounting date, that is, avoid the manual modification of the accounting date, reduce the time of determining the accounting date, and improve the efficiency of the data processing method. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 An application environment diagram of a data processing method in an embodiment;
[0050] Figure 2 is a flow chart of a data processing method in one embodiment;
[0051] Figure 3 A schematic diagram of a process of querying a target date rule in an embodiment;
[0052] Figure 4 A schematic diagram of a process for determining whether transaction data satisfies a constraint condition in one embodiment;
[0053] Figure 5 A schematic diagram of a process for determining an accounting date in one embodiment;
[0054] Figure 6 A schematic diagram of a process for constructing a target date rule group in one embodiment;
[0055] Figure 7 A schematic diagram of a process for generating a first date rule in one embodiment;
[0056] Figure 8 A schematic diagram of an architecture for determining an accounting date for transaction data of different application systems in one embodiment;
[0057] Fig. 9 is a structural block diagram of a data processing device in one embodiment;
[0058] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. 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.
[0060] The data processing method provided in the embodiment of the present application can be applied to Figure 1 In the data processing system 100 shown. The data processing system 100 includes a terminal 110 and a distributed system 120. The distributed system 120 includes nodes 121. The terminal 110 communicates with the distributed system 120 via a network. The nodes 121 in the distributed system 120 are connected via a network. Among them, the terminal 110 can be but is not limited to various personal computers, laptops, tablet computers, etc. The types of nodes 121 are divided into master nodes and slave nodes, collectively referred to as nodes. Nodes 121 are generally servers. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0061] In the traditional data processing method, the slave node receives the transaction data sent by the application system, and for each transaction data, the current system accounting date determines the accounting date corresponding to the transaction data. When the current time reaches the preset switching time, the master node in the distributed system sends a switching instruction for the system accounting date to each slave node in the distributed system. The slave node receives the switching instruction for the system accounting date and determines whether the current transaction data has been processed. If the current transaction data has been processed, the slave node switches the system accounting date to the next day. If the current transaction data has not been processed, the slave node will not switch the system accounting date. That is, there is a delay between the processing efficiency and switching time of the system in processing transaction data, and the system will process the transaction data of the day according to the system accounting date of the previous day.
[0062] However, due to the delay between the processing efficiency and switching time of the system, the accounting date of the current transaction data will be wrong. Manual correction will be made to the wrong accounting date in the accounting system and the wrong accounting date of the transaction data to obtain the correct transaction date. However, when there are a large number of accounting date errors, it takes a lot of time to manually correct the accounting dates in the accounting system and transaction data one by one. Therefore, the current data processing method is inefficient.
[0063] Furthermore, even if all slave nodes are able to switch the system accounting date, since each slave node receives the switching instruction at a different time, there will be differences in the time at which each slave node switches the system accounting date, which will result in different accounting dates being obtained when each slave node processes transaction data at the same time.
[0064] Based on the above-mentioned traditional data processing method, the embodiment of the present application provides a data processing method, which determines the target date rule group corresponding to the target business and determines the matching target date rule of the transaction data, and determines the target date rule of the accounting date of the transaction data in real time. Furthermore, the accounting date of the transaction data is determined based on the target date rule and the fixed transaction date, which realizes the automatic determination of the accounting date according to the transaction date, avoids the error of switching the accounting date, that is, avoids the manual modification of the accounting date, reduces the time of determining the accounting date, and improves the efficiency of the data processing method. At the same time, by directly determining the accounting date in the transaction data, the data range of the system for repairing the error of switching the accounting date is greatly reduced, and there is no need to repair the transaction data, which improves the efficiency of the data processing method.
[0065] In addition, by sending a date rule group to each node, each node can directly determine the accounting date based on the date rule group, avoiding the switching of system transaction dates and ensuring that each node obtains the same accounting date when processing transaction data of the same rule at the same time.
[0066] In an exemplary embodiment, Figure 2 As shown, a data processing method is provided, which is applied to Figure 1 The node 121 (hereinafter, the reference numeral is omitted, referred to as the node) in FIG. 1 is taken as an example to illustrate, and the following steps 202 to 206 are included. Among them:
[0067] Step 202: Receive transaction data of the target business, and query the target date rule group corresponding to the target business according to the target business identifier in the transaction data.
[0068] The transaction data includes a target business identifier of the target business.
[0069] In implementation, the node pre-stores the date rule group of each business. The application system sends each transaction data of the target business to each node. The node receives the transaction data of the target business. Then, the node queries the target date rule group corresponding to the target business based on the target business identifier. The target date rule group is used to determine the accounting date of the transaction data generated by the target business.
[0070] Specifically, the terminal generates a target date rule group for the target business and sends the target date rule group to the distributed system. The distributed system receives the target date rule group and sends the target date rule group to each node in the distributed system. Each node receives the target date rule group and stores the target date rule group. In the process of the application system executing the target business, the application system generates each transaction data of the target business and sends each transaction data to the distributed system so that the distributed system determines the accounting date of each transaction data. Specifically, the distributed system receives each transaction data of the target business and sends each transaction data of the target business to each node. The node receives the transaction data of the target business and queries the target date rule group corresponding to the target business according to the target business identifier in the transaction data.
[0071] In an exemplary embodiment, the application system is a loan system. The target business is a loan business. In the process of executing the loan business, the loan system generates loan data of each loan business. The application system sends each loan data to the distributed system. The distributed system distributes each loan data to each node. Each node receives the loan data and queries the target date rule group corresponding to the loan business according to the loan business identifier in the loan data.
[0072] In an exemplary embodiment, when the application system executes the target business, a transaction occurs and generates transaction data of the transaction. The application system determines whether each transaction triggers an accounting event based on the business rules and the transaction data. If the transaction triggers an accounting event, the application system sends the transaction data of the transaction to the distributed system so that the distributed system determines the accounting date of the transaction. For example, the business rule may be that only transactions with a successful transaction status trigger an accounting event.
[0073] In an optional embodiment, if the node does not find the target date rule group corresponding to the target service, the node sends a message to the terminal indicating that there is no target date rule group corresponding to the target service, so that the terminal generates a target date rule group for the target service.
[0074] Optionally, the application system may be but is not limited to a deposit system, a loan system, etc., and the business rules may be but are not limited to a transaction status. The embodiment of the present application does not limit the application system and the business rules.
[0075] Optionally, the target service is any service in the application system, and the embodiment of the present application does not limit the target service.
[0076] Step 204: Determine the target date rule that matches the transaction data in the target date rule group based on the priority of each date rule in the target date rule group.
[0077] Among them, the date rules in the target date rule group have different priorities.
[0078] In implementation, the node determines whether the current date rule matches the transaction data one by one according to the order of priority of each date rule from high to low and the accounting elements in the transaction data. If the current date rule matches the transaction data, the node determines the current date rule as the target date rule.
[0079] Specifically, the date rule contains constraints. The node determines whether the transaction data meets the constraints of the current date rule one by one according to the order of priority of each date rule from high to low and the accounting elements in the transaction data. If the transaction data meets the constraints of the current date rule, the node determines the current date rule as the target date rule.
[0080] Step 206, updating the transaction date in the transaction data according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data.
[0081] In implementation, the node determines the accounting period of the transaction data in the target date rule and the transaction date in the transaction data. Then, the node processes the accounting period and transaction date to obtain the accounting date corresponding to the transaction data.
[0082] In the above data processing method, by determining the target date rule group corresponding to the target business and determining the matching target date rule of the transaction data, the target date rule of the accounting date of the transaction data is determined in real time. Furthermore, the accounting date of the transaction data is determined based on the target date rule and the fixed transaction date, which realizes the automatic determination of the accounting date according to the transaction date, avoids the error of switching the accounting date, that is, avoids the manual modification of the accounting date, reduces the time of determining the accounting date, and improves the efficiency of the data processing method.
[0083] In an exemplary embodiment, the target date rule group includes various date rules, such as Figure 3 As shown, the specific processing process of step 204 includes steps 302 to 304. Among them:
[0084] Step 302: In descending order of priority of each date rule, determine whether the transaction data satisfies the constraint conditions in the date rule one by one.
[0085] In implementation, the node sorts each date rule in descending order of priority to obtain a date rule sequence. Then, the node determines whether the transaction data satisfies the constraints in the date rules in the date rule sequence one by one based on the accounting elements in the transaction data.
[0086] Specifically, the date rule includes the priority of the date rule. The node determines the priority of each date rule in each date rule. Then, the node sorts the date rules in order of priority from high to low to obtain a date rule sequence. Then, based on the date rule sequence, the node determines whether the accounting elements in the transaction data meet the constraints in the date rule. If the accounting elements meet the constraints in the date rule, the node executes the following step 206. If the accounting elements do not meet the constraints in the date rule, the node continues to determine whether the transaction data meets the constraints in the next date rule until the transaction data meets the constraints in the date rule.
[0087] In an exemplary embodiment, the priority is a number, the larger the number, the lower the priority; the smaller the number, the higher the priority. The target date rule group includes 4 date rules, namely date rule A, date rule B, date rule C and date rule D. The priority of date rule A is 1; the priority of date rule C is 2, the priority of date rule B is 101; the priority of date rule D is 102. Then, the node sorts the date rules in order from high to low priority to obtain a date rule sequence. The date rule sequence is date rule A, date rule C, date rule B and date rule D. The node determines whether the transaction data meets the constraint conditions of date rule A. If the transaction data meets the constraint conditions of date rule A, the node executes the above step 206. If the transaction data does not meet the constraint conditions of date rule A, the node continues to determine whether the transaction data meets the constraint conditions of date rule C until the transaction data meets the constraint conditions of the date rule.
[0088] Step 304: If the transaction data meets the constraint conditions in the date rule, the date rule is determined as a target date rule.
[0089] In implementation, if the accounting elements in the transaction data meet the constraints in the date rule, the node determines that the date rule is the date rule that matches the transaction data, and determines the date rule as the target date rule, so as to facilitate the determination of the accounting date of the transaction data according to the target date rule.
[0090] In an exemplary embodiment, the transaction data is loan data. If the accounting elements in the loan data meet the constraint conditions in the date rule, the node determines the date rule as a target date rule. Thus, the accounting date of the loan data is determined according to the accounting period in the target date rule.
[0091] In this embodiment, the target date rules are determined in the target date rule group in descending order of priority of the date rules, and the target date rules for matching the transaction data are automatically determined, which facilitates the subsequent determination of the accounting date based on the target date rules.
[0092] In an exemplary embodiment, the target date rule group includes a first date rule of a first type and a second date rule of a second type; the first date rule has a higher priority than the second date rule.
[0093] In implementation, the target date rule group includes a first date rule of the first type and a second date rule of the second type. The first date rule of the first type is a specific date rule. The second date rule of the second type is a default date rule. The default date rule is generally applicable to all application systems (full business). The specific date rule is applicable to specific products and specific scenarios. The priority of the first date rule is higher than that of the second date rule. That is, the priority of the specific date rule is higher than that of the default date rule.
[0094] Specifically, the node determines whether the accounting elements in the transaction data meet the constraints in the first date rule. If the accounting elements in the transaction data meet the constraints in the first date rule, the node determines the first date rule as the target date rule. If the accounting elements in the transaction data do not meet the constraints in the first date rule, the node determines whether the accounting elements in the transaction data meet the constraints in the second date rule. Since the second date rule is applicable to each business. Therefore, generally speaking, the accounting elements in the transaction data meet the constraints in the second date rule. In the case where the accounting elements in the transaction data meet the constraints in the second date rule, the node determines the second date rule as the target date rule.
[0095] Optionally, the target date rule group may include 1 or 2 first date rules, and may also include 1 or 2 second date rules. The embodiment of the present application does not limit the number of first date rules and second date rules in the target date rule group.
[0096] In this embodiment, by setting the first date rule and the second date rule, it is possible to adapt to various types of businesses, meet the accounting date determination requirements of transaction data of different businesses, and expand the scope of application of the data processing method.
[0097] In an exemplary embodiment, Figure 4 As shown, the specific processing process of determining whether the transaction data meets the constraint conditions in the date rule in step 302 includes steps 402 to 404. Among them:
[0098] Step 402: If the date rule is the first date rule, based on the transaction date, user identifier, scenario code, resource type and application system code in the transaction data, determine whether the transaction data meets the constraint conditions in the date rule.
[0099] The transaction date is the date when the transaction was generated. The user ID is the ID of the transaction user, and the user ID is the system tenant. The system tenant can be a user type code or a user code. The application system code is the ID of the application system that generated the transaction data. The resource type is the resource type of the resource transferred in the transaction. The resource type can be a currency, such as US dollars or RMB. The scenario code is the identifier of the transaction scenario. The scenarios include deposits and withdrawals, that is, the scenario code includes a deposit scenario code and a withdrawal scenario code.
[0100] In implementation, if the date rule is the first date rule, the accounting elements in the transaction data are the transaction date, user ID, scenario code, resource type, and application system code. The node determines whether the transaction data meets the constraints in the first date rule based on the transaction date, user ID, scenario code, resource type, and application system code, thereby clarifying whether the transaction data matches the first date rule.
[0101] Specifically, the constraints include constraints of accounting elements. The constraints include date constraints of transaction date, user constraints of user identifier, scenario constraints of scenario code, resource constraints of resource type, and system constraints of application system code. The node determines whether the transaction date in the transaction data satisfies the date constraints, and determines whether the user identifier satisfies the user constraints. Then, the node determines whether the scenario code satisfies the scenario constraints, and determines whether the resource type satisfies the resource constraints. Then, the node determines whether the application system code satisfies the system conditions. When each accounting element satisfies the corresponding constraints, the node determines that the transaction data satisfies the constraints of the first date rule, and determines the first date rule as the target constraint. If there are accounting elements that do not satisfy the resource constraints, the node executes the following step 404.
[0102] In an exemplary embodiment, the constraints in the first date rule are that the transaction time is greater than December 25, 2023 and less than January 1, 2024, the application system code is LOAN (loan), the scenario code is NPL (a deposit loan identifier), and the currency is CNY (Chinese Yuan). The node receives two transaction data, namely transaction data X and transaction data Y. The transaction time in transaction data X is December 26, 2023, the application system code is LOAN, the scenario code is NPL, and the currency is CNY. The transaction time in transaction data Y is December 26, 2023, the application system code is LOAN, the scenario code is NPL, and the currency is USD. The node determines that the transaction data meets the constraints of the first date rule based on the transaction date, user identifier, scenario code, resource type, and application system code in transaction data X, and determines the first date rule as the target date rule for transaction data X. The node determines that the currency USD in transaction data Y does not meet the constraint condition of CNY. Therefore, the node determines that the transaction data Y does not satisfy the constraint condition of the first date rule, and executes the following step 404 .
[0103] Optionally, the user ID is a system tenant in the bank system, and the user ID can also be a user type code, which represents the type of the transaction user. The application system code represents the type of the application system, and the source of the transaction data can be clearly identified through the application system code.
[0104] Step 404: If the date rule is the second date rule, based on the transaction date in the transaction data, determine whether the transaction data satisfies the constraint condition in the date rule.
[0105] In implementation, if the date rule is a second date rule, the constraints of the second date rule only include the date constraints of the transaction date. The node determines the transaction date in the transaction data and determines whether the transaction date satisfies the date constraints. If the transaction date satisfies the date constraints, the node determines the second date as the target date rule.
[0106] In an exemplary embodiment, the target date rule group includes various second date rules. If the transaction date does not meet the date constraint of the current second date rule, the node determines whether the transaction data meets the date constraint of the next second date rule according to the priority of each second date rule until the transaction data meets the date constraint of the second date rule. It should be noted that a default second date rule is generally stored in the node, which does not set a date constraint, but is set with an accounting date calculation rule. If the transaction data does not match the first date rules and the remaining second date rules, the node determines the default second date rule as the target date rule corresponding to the transaction data.
[0107] In an exemplary embodiment, the target date rule group includes two first date rules and two second date rules, as shown in Table 1 below:
[0108] Table 1
[0109]
[0110] Among them, Table 1 above is a schematic table of the target date rule group. As shown in Table 1 above, the target date rule group includes two first date rules of the first type and two second date rules of the second type. The first date rules are the first date rule with serial number 1 and the first date rule with serial number 2. The second date rules are the second date rule with serial number 3 and the second date rule with serial number 4. The second date rule with serial number 4 is the default second date rule. The constraints of the first date rule with serial number 1 include that the transaction time (transaction date) is greater than or equal to December 25, 2023 and less than January 1, 2024, the application system code is LOAN, the scenario code is NPL, and the currency is CNY. The constraints of the first date rule with serial number 2 include that the transaction time (transaction date) is greater than or equal to 23:00:00 on December 31, 2023 and less than January 1, 2024, and the application system code is DP. The constraints of the second date rule with serial number 3 are that the difference between the transaction time and the current time is greater than 1 hour. The second date rule with sequence number 4 has no constraints.
[0111] The node determines whether the transaction data meets the first date rule with sequence number 1 based on the transaction time (transaction date), application system code, scenario code and currency of the transaction data. If the transaction data does not meet the first date rule with sequence number 1, the node determines whether the transaction data meets the first date rule with sequence number 2 according to the transaction time and application system code of the transaction data. If the transaction data does not meet the second date rule with sequence number 3, the node determines whether the transaction data meets the second date rule with sequence number 101 according to the transaction date of the transaction data.
[0112] In this embodiment, by judging whether the transaction data meets the constraint conditions of the first date rule and judging whether the transaction data meets the constraint conditions of the second date rule, the target date rule of transaction data of various businesses can be automatically matched, thereby improving the efficiency of the data processing method and expanding the scope of application of the data processing method.
[0113] In an exemplary embodiment, Figure 5 As shown, the specific processing process of step 206 includes steps 502 to 504. Among them:
[0114] Step 502: Determine the accounting period corresponding to the transaction data in the accounting date calculation rule in the target date rule.
[0115] The target date rules include accounting date calculation rules.
[0116] In implementation, the node determines the accounting period corresponding to the transaction data in the accounting date calculation rule. The accounting period is a fixed difference between the accounting date and the transaction date.
[0117] In an exemplary embodiment, the accounting period is 7. The node determines 7 as the accounting period corresponding to the transaction data in the accounting date calculation rule.
[0118] Step 504, performing date calculation on the accounting period and the transaction date in the transaction data to obtain the accounting date corresponding to the transaction data.
[0119] During implementation, the node performs date addition operations on the accounting period and the transaction date in the transaction data, and determines the result of the date addition operation as the accounting date corresponding to the transaction data.
[0120] In an exemplary embodiment, the transaction date in the transaction data is December 26, 2023, and the accounting period is 7 days. The node performs a date addition operation on the accounting period of 7 days and the transaction date of December 26, 2023, and obtains that the accounting date corresponding to the transaction data is January 2, 2024.
[0121] In this embodiment, based on the accounting period in the target date rule and the fixed transaction date, the accounting period of the transaction data can be automatically determined, thereby improving the efficiency of the data processing method.
[0122] In an exemplary embodiment, Figure 1 As shown, a data processing system 100 is provided, which includes: a terminal 110, which is used to generate a target date rule group for a target business; a distributed system 120, which includes nodes 121, and the nodes 121 are used to receive transaction data of the target business, and query the target date rule group corresponding to the target business according to the target business identifier in the transaction data; based on the priority of each date rule in the target date rule group, determine the target date rule matching the transaction data in the target date rule group; update the transaction date in the transaction data according to the accounting period in the target date rule, and obtain the accounting date corresponding to the transaction data.
[0123] In implementation, the data processing system 100 includes a terminal 110 and a distributed system 120. The distributed system 120 includes nodes 121. The terminal 110 generates a target date rule group for the target business according to the date rule template, and sends the target date rule group to the distributed system 120. The distributed system 120 sends the target date rule group to each node 121, so that each node 121 can determine the accounting date of the transaction data of the target business according to the target date rule group. Node 121 is used to execute the above steps 202 to 206. Among them, the specific processing process of steps 202 to 206 has been described in detail in the above embodiments, and the embodiments of this application will not be repeated here.
[0124] In an optional embodiment, the terminal 110 may also generate date rule groups for other services according to the target date template. The node may also process transaction data of other services in other application systems at the same time, that is, the node may process transaction data of services of multiple application systems at the same time.
[0125] In this embodiment, the terminal generates a target date rule group and sends the target date rule group to each node, so that under the distributed structure, different nodes can conveniently and uniformly determine the accounting date of the transaction data of the target business according to the target date rule group. In addition, the node determines the target date rule of the accounting date of the transaction data in real time by determining the matching target date rule of the transaction data. Furthermore, the node determines the accounting date of the transaction data based on the target date rule and the fixed transaction date, realizes the automatic determination of the accounting date according to the transaction date, avoids the error of switching the accounting date, that is, avoids the manual modification of the accounting date, reduces the time of determining the accounting date, and improves the efficiency of the data processing method.
[0126] In one embodiment, Figure 6 As shown, the specific process of generating the target date rule group for the target business includes steps 602 to 606. Among them:
[0127] Step 602: In response to a request to establish a date rule for the target business, a date rule template is obtained.
[0128] The date rule template includes a first date rule template and a second date rule template.
[0129] In implementation, the target user terminal sends a request to establish the date rule of the target service. The computer device responds to the request to establish the date rule of the target service and obtains the date rule template. Then, the computer device updates the date rule template according to the target service identifier of the target service in the establishment request.
[0130] Specifically, when the target date rule group of the target business is not stored in the node, the node sends a message to the computer device that the target date rule group of the target business does not exist. The computer device displays a message that the target date rule group of the target business does not exist, so that the target user clearly understands that the target business lacks the target date rule group. The target user sends a request to establish the date rule of the target business to the computer device. In response to the request to establish the date rule of the target business, the computer device obtains a date rule template and creates a template new page to display the date rule template. Specifically, the computer device displays the first date rule template and the second date rule template.
[0131] Step 604: Generate a first date rule of a first type based on the first date rule template, and generate a second date rule of a second type based on the second date rule template.
[0132] The date rule template includes default constraints, default accounting date calculation rules and default priorities. The default constraints of the first date rule template include default transaction dates, default user IDs, default scenario codes, default currencies and default application system codes, while the default constraints of the second date rule template only include default transaction dates.
[0133] In implementation, the computer device determines a first constraint based on a constraint in a first date rule template, and determines a first accounting date calculation rule according to a default accounting date rule calculation rule in the first date rule template. The computer device determines a first priority according to a default priority in the first date rule template. Then, the computer device generates a first date rule of a first type according to the first constraint, the first priority, and the first accounting date calculation rule. The computer device determines a second constraint based on a default transaction date in a second date rule template, and determines a second accounting date calculation rule according to a default accounting date rule calculation rule in the second date rule template. The computer device determines a second priority according to the default priority in the second date rule template. Then, the computer device generates a second date rule of a second type according to the second constraint, the second priority, and the second accounting date calculation rule.
[0134] In an exemplary embodiment, the target user triggers the display of detailed information of the second date rule. In response to the triggering action of displaying the detailed information of the second date rule, the computer device displays the default constraint condition, the default accounting date calculation rule, and the default priority. In response to the editing action of the default transaction date, the computer device obtains the date range input by the target user, and determines the date range as the second constraint condition. In response to the editing operation of the default accounting cycle, the computer device obtains the cycle input by the target user, and determines the cycle as the second accounting cycle. Then, the computer device determines the second accounting date calculation rule according to the second accounting cycle. In response to the triggering operation of the default priority among the default priorities, the computer device determines the triggered default priority as the second priority. The computer device combines the second constraint condition, the second priority, and the second accounting date calculation rule to obtain a second type of second date rule.
[0135] For example, computer equipment refers to 23:00 as T (T is any natural number not equal to 0). The accounting date before 23:00 (including 23:00) on day T is T, the accounting date from 23:00 to 24:00 on day T is T+1, and the accounting date from 0:00 to 23:00 on day T+1 is T+1.
[0136] Step 606: construct a target date rule group for the date business based on the first date rule and the second date rule.
[0137] In implementation, the computer device combines the first date rule and the second date rule according to the priority of the first date rule and the second date rule to obtain a target date rule group for the target business.
[0138] In an optional embodiment, the target user can trigger a new first date rule template. In response to the trigger action of the new first date rule template, the computer device copies the first date rule template to obtain a new first date rule template. The computer device generates two first date rules based on the new first date rule template and the first date rule template. Similarly, the target user can trigger a new second date rule template. In response to the trigger action of the new second date rule template, the computer device copies the second date rule template to obtain a new second date rule template. The computer device generates two second date rules based on the new second date rule template and the second date rule template. The computer device constructs a target date rule group for the target business according to each first date rule and each second date rule.
[0139] In this embodiment, by configuring the first date rule and the second date rule, and generating the target date rule group according to the first date rule and the second date rule, it is possible to meet the business system based on the middle-office architecture under the distributed cloud native architecture. The accounting center in the business middle-office needs to support the needs of different products, and at the same time meet the basic needs of different accounting dates of different tenants in the multi-tenant system.
[0140] In one embodiment, the first date rule template includes default constraints, default accounting date calculation rules, and default priorities; Figure 7 As shown, the specific processing process of generating the first type of the first date rule based on the first date rule template in step 604 includes steps 702 to 706. Among them:
[0141] Step 702, determining the first constraint condition based on the default transaction date, each default user identifier, each default scenario code, each default currency and each default application system code in the default constraint condition.
[0142] In implementation, the computer device determines the date constraint condition according to the default transaction date. Then, the computer device determines the application system code in each default application system code, and determines the application system code as the system constraint condition. The computer device determines the user identifier in each default user identifier, and determines the user identifier as the user constraint condition. The computer device determines the scene code in each default scene code, and determines the scene code as the scene constraint condition. The computer device determines the currency in each default currency, and determines the currency as the resource constraint condition. The computer device combines the date constraint condition, the system constraint condition, the user constraint condition, the scene constraint condition and the resource constraint condition to obtain the first constraint condition.
[0143] In an exemplary embodiment, the target user triggers the display of the detailed information of the first date rule. In response to the triggering action of displaying the detailed information of the first date rule, the computer device displays the default constraint condition, the default accounting date calculation rule and the default priority. In response to the editing action of the default transaction date, the computer device obtains the date range input by the target user and determines the date range as the date constraint condition. The computer device displays each default user identification. The target user triggers the user identification in each default user identification. In response to the triggering operation of the user identification, the computer device determines the triggered user identification as the user constraint condition. The computer device displays each default application system code. The target user triggers the application system code in each default application system code. In response to the triggering operation of the application system code, the computer device determines the triggered application system code as the system constraint condition. The computer device displays each default scenario code. The target user triggers the scenario code in each default scenario code. In response to the triggering operation of the scenario code, the computer device determines the triggered scenario code as the scenario constraint condition. The computer device displays each default currency. The target user triggers the currency in each default currency. The computer device responds to the triggering operation of the currency and determines the triggered currency as the resource constraint condition. The computer device combines the date constraint condition, the system constraint condition, the user constraint condition, the scene constraint condition and the resource constraint condition to obtain the first constraint condition.
[0144] Step 704 : determining a first accounting date calculation rule based on the default accounting date calculation rule, and determining a first priority based on the default priority.
[0145] The default accounting date calculation rules include the default accounting period.
[0146] In implementation, the computer device determines the first accounting cycle according to the default accounting cycle, and determines the first accounting cycle as the first accounting date calculation rule. The computer device determines the first priority among the default priorities.
[0147] In an exemplary embodiment, the computer device responds to the editing operation of the default accounting cycle, obtains the cycle input by the target user, and determines the cycle as the first accounting cycle. Then, the computer device determines the first accounting date calculation rule according to the first accounting cycle. In response to the triggering operation of the default priority among the default priorities, the computer device determines the triggered default priority as the first priority.
[0148] Step 706: Generate a first date rule of the first type based on the first constraint condition, the first priority and the first accounting date calculation rule.
[0149] In implementation, the computer device combines the first constraint condition, the first priority, and the first accounting date calculation rule to obtain a first date rule of the first type.
[0150] In this embodiment, the first date rule is personalizedly configured through default constraints, default priorities and default accounting date voyage first date rules, which is suitable for various scenarios and various users, and expands the scope of application of the data processing method.
[0151] In an exemplary embodiment, Figure 8 Schematic diagram of the architecture for determining the accounting date for transaction data in different application systems. Figure 8 As shown, the application systems are application A and application B. Application A sends transaction data (accounting events) to the accounting center (distributed system). The nodes in the distributed system determine the target date rule corresponding to the transaction data of application A, and determine the accounting date of the transaction data as the transaction date according to the target date rule. Then, the node generates the accounting entry of application A according to the transaction date of the transaction data of application A. Application B sends transaction data (accounting events) to the accounting center (distributed system). The nodes in the distributed system determine the target date rule corresponding to the transaction data of application B, and determine the date of the accounting date + 1 of the transaction data as the transaction date according to the target date rule. Then, the node generates the accounting entry of application B according to the transaction date of the transaction data of application B.
[0152] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0153] Based on the same inventive concept, the embodiment of the present application also provides a data processing device for implementing the data processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more data processing device embodiments provided below can refer to the limitations on the data processing method above, and will not be repeated here.
[0154] In an exemplary embodiment, Fig. 9 As shown, a data processing device 900 is provided, comprising: a query module 901, a matching module 902 and an update module 903, wherein:
[0155] The query module 901 is used to receive the transaction data of the target business and query the target date rule group corresponding to the target business according to the target business identifier in the transaction data.
[0156] The matching module 902 is used to determine the target date rule that matches the transaction data in the target date rule group based on the priority of each date rule in the target date rule group.
[0157] The updating module 903 is used to update the transaction date in the transaction data according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data.
[0158] In an exemplary embodiment, the target date rule group includes various date rules, and the query module 901 includes a first receiving submodule and a first query submodule. The first query submodule includes:
[0159] The first judgment submodule is used to judge whether the transaction data meets the constraint conditions in the date rules one by one according to the priority order of each date rule from high to low.
[0160] The first determination submodule is used to determine the date rule as a target date rule if the transaction data satisfies the constraint condition in the date rule.
[0161] In an exemplary embodiment, the target date rule group includes a first date rule of a first type and a second date rule of a second type; the first date rule has a higher priority than the second date rule.
[0162] In an exemplary embodiment, the first determination submodule includes:
[0163] The second judgment submodule is used to judge whether the transaction data meets the constraint conditions in the date rule based on the transaction date, user identifier, scenario code, resource type and application system code in the transaction data if the date rule is the first date rule.
[0164] The third judgment submodule is used to judge whether the transaction data meets the constraint condition in the date rule based on the transaction date in the transaction data if the date rule is the second date rule.
[0165] In an exemplary embodiment, the update module 903 includes:
[0166] The second determination submodule is used to determine the accounting period corresponding to the transaction data in the accounting date calculation rule in the target date rule.
[0167] The first operation submodule is used to perform date operation on the accounting period and the transaction date in the transaction data to obtain the accounting date corresponding to the transaction data.
[0168] Each module in the above data processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0169] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.10As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used in the data processing method. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method is implemented.
[0170] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0171] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0173] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0174] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0175] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0176] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0177] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data processing method, characterized in that: The method is applied to a node in a distributed system, and the method comprises: Receive transaction data of a target business, and query a target date rule group corresponding to the target business according to a target business identifier in the transaction data; Determining a target date rule that matches the transaction data in the target date rule group based on the priority of each date rule in the target date rule group; The transaction date in the transaction data is updated according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data.
2. The method according to claim 1, characterized in that The target date rule group includes various date rules, and determining the target date rule matching the transaction data in the target date rule group based on the priority of each date rule in the target date rule group includes: According to the order of priority of each date rule from high to low, determine whether the transaction data meets the constraint conditions in the date rule one by one; If the transaction data satisfies the constraint condition in the date rule, the date rule is determined as a target date rule.
3. The method according to claim 2, characterized in that The target date rule group includes a first date rule of a first type and a second date rule of a second type; the first date rule has a higher priority than the second date rule.
4. The method according to claim 2, characterized in that: The determining whether the transaction data satisfies the constraint condition in the date rule includes: If the date rule is the first date rule, judging whether the transaction data satisfies the constraint condition in the date rule based on the transaction date, user identifier, scenario code, resource type and application system code in the transaction data; If the date rule is the second date rule, based on the transaction date in the transaction data, it is determined whether the transaction data satisfies the constraint condition in the date rule.
5. The method according to claim 1, characterized in that The updating of the transaction date in the transaction data according to the accounting cycle in the target date rule to obtain the accounting date corresponding to the transaction data includes: Determining the accounting period corresponding to the transaction data in the accounting date calculation rule in the target date rule; Date operations are performed on the accounting period and the transaction date in the transaction data to obtain the accounting date corresponding to the transaction data.
6. A data processing system, characterized in that: The system comprises: A terminal, for generating a target date rule group for a target business; A distributed system includes nodes, wherein the nodes are used to receive transaction data of a target business, and query a target date rule group corresponding to the target business according to a target business identifier in the transaction data; determine a target date rule matching the transaction data in the target date rule group based on the priority of each date rule in the target date rule group; and update a transaction date in the transaction data according to an accounting period in the target date rule to obtain an accounting date corresponding to the transaction data.
7. The system according to claim 6, characterized in that The target date rule group for generating the target business includes: In response to a request to establish a date rule of the target business, a date rule template is acquired; the date rule template includes a first date rule template and a second date rule template; generating a first date rule of a first type based on the first date rule template, and generating a second date rule of a second type based on the second date rule template; A target date rule group for the target business is constructed based on the first date rule and the second date rule.
8. The system according to claim 7, characterized in that The first date rule template includes a default constraint condition, a default accounting date calculation rule, and a default priority; the generating of the first date rule of the first type based on the first date rule template includes: Determine a first constraint condition based on a default transaction date, each default user identifier, each default scenario code, each default currency, and each default application system code in the default constraint condition; Determining a first accounting date calculation rule based on the default accounting date calculation rule, and determining a first priority based on the default priority; A first date rule of a first type is generated based on the first constraint, the first priority, and the first accounting date calculation rule.
9. A data processing device, characterized in that: The device comprises: A query module, used to receive transaction data of a target business, and query a target date rule group corresponding to the target business according to a target business identifier in the transaction data; a matching module, configured to determine a target date rule matching the transaction data in the target date rule group based on the priority of each date rule in the target date rule group; An updating module is used to update the transaction date in the transaction data according to the accounting period in the target date rule to obtain the accounting date corresponding to the transaction data.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.