Data processing method and apparatus, and electronic device
By introducing cumulative dimension identifier columns and attribute identifier columns into the data table, and using the longest attribute identifier to store multi-dimensional data, the problems of poor scalability and high operation and maintenance costs in the existing technology are solved, achieving efficient data processing and dynamic adjustment, and reducing operating costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ADVANCED NOVA TECH (SINGAPORE) PTE LTD
- Filing Date
- 2023-03-23
- Publication Date
- 2026-08-04
AI Technical Summary
Existing technologies suffer from poor scalability, high maintenance costs, cumbersome operation, and low efficiency when processing multi-dimensional business data, failing to meet the needs of business scenarios with high timeliness requirements.
The data table structure includes a cumulative dimension identifier column and an attribute identifier column. The data to be accumulated is stored by the longest attribute identifier. The attribute identifiers of the data table are dynamically adjusted to realize the automatic dimensional accumulation of multi-dimensional data without modifying the database table structure.
It improves data processing efficiency, reduces development and operation costs, has strong scalability, and can dynamically adjust the attribute identifiers of data tables according to business data needs.
Smart Images

Figure CN116340580B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, specifically to a data processing method and apparatus, and an electronic device. Background Technology
[0002] Currently, applications are widely used in people's lives and work. More and more users are using applications installed on their devices to conduct online transactions, such as online shopping and online payments.
[0003] While applications bring great convenience to people, they also generate a large amount of business data. How to store this massive amount of business data becomes a problem that needs to be solved during data processing. Summary of the Invention
[0004] In view of this, embodiments of this specification provide a data processing method, apparatus, and electronic device.
[0005] In a first aspect, an embodiment of this specification provides a data processing method, comprising: obtaining a data table, the data table including a cumulative dimension identifier column and an attribute identifier column, the cumulative dimension identifier column being used to identify different cumulative attributes, and the attribute identifier column being used to identify the type of cumulative attributes; obtaining the cumulative data to be accumulated for a target business; if there is a cumulative record for the target business in the data table, then storing the cumulative data to be accumulated into the data table based on the longest attribute identifier in the attribute identifier column of the cumulative record.
[0006] Secondly, one embodiment of this specification provides a data processing method, including: obtaining a business field and a cumulative attribute to be queried from a data query request; querying a data table based on the business field to determine the longest attribute identifier corresponding to the business field, wherein the data table includes a cumulative dimension identifier column and an attribute identifier column, the cumulative dimension identifier column being used to identify different cumulative attributes, and the attribute identifier column being used to identify the type of the cumulative attribute; and querying the data table based on the longest attribute identifier and the cumulative attribute to be queried to obtain the cumulative value corresponding to the cumulative attribute to be queried.
[0007] Thirdly, one embodiment of this specification provides a data processing apparatus, comprising: a first acquisition module for acquiring a data table, the data table including a cumulative dimension identifier column and an attribute identifier column, the cumulative dimension identifier column being used to identify different cumulative attributes, and the attribute identifier column being used to identify the type of the cumulative attribute; a second acquisition module for acquiring the cumulative data to be accumulated for a target business; and a storage module for storing the cumulative data to be accumulated into the data table based on the longest attribute identifier in the attribute identifier column of the cumulative record if a cumulative record of the target business exists in the data table.
[0008] Fourthly, one embodiment of this specification provides a data processing apparatus, comprising: an acquisition module, configured to acquire a business field and a cumulative attribute to be queried in a data query request; a determination module, configured to query a data table based on the business field to determine the longest attribute identifier corresponding to the business field, the data table including a cumulative dimension identifier column and an attribute identifier column, the cumulative dimension identifier column being used to identify different cumulative attributes, and the attribute identifier column being used to identify the type of the cumulative attribute; and a query module, configured to query the data table based on the longest attribute identifier and the cumulative attribute to be queried to obtain the cumulative value corresponding to the cumulative attribute to be queried.
[0009] Fifthly, one embodiment of this specification provides a computer-readable storage medium storing a computer program for performing the methods mentioned in the first and second aspects.
[0010] In a sixth aspect, one embodiment of this specification provides an electronic device comprising: a processor; a memory for storing processor-executable instructions; and the processor for performing the methods mentioned in the first and second aspects.
[0011] In a seventh aspect, one embodiment of this specification provides a computer program product including instructions that, when executed, can implement the methods mentioned in the first and second aspects above.
[0012] The technical solutions provided in the embodiments of this specification can have the following beneficial effects.
[0013] On the one hand, when it is determined that there are cumulative records for the target business in the data table, the data to be accumulated for the target business can be stored in the data table based on the longest attribute identifier in the attribute identifier column of the cumulative record. In other words, it can flexibly store cumulative data for various businesses, especially multi-dimensional data, thereby achieving automated dimensional cumulative accumulation and greatly improving data processing efficiency. On the other hand, when it is necessary to add or remove data dimensions, there is no need to modify the database table structure. The attribute identifiers of the data table can be dynamically adjusted according to business data requirements. The operation is simple and highly scalable, saving development and operation costs. Attached Figure Description
[0014] The above and other objects, features, and advantages of this specification will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to offer a further understanding of the embodiments thereof and form part of this specification. They are used together with the embodiments thereof to interpret this specification and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same parts or steps.
[0015] Figure 1The diagram shown is a system architecture diagram of an application scenario provided by an exemplary embodiment of this specification.
[0016] Figure 2 The diagram shown is a scenario in which the data processing method provided in the embodiments of this specification is applicable.
[0017] Figure 3 The diagram shown is a flowchart illustrating a data processing method provided in an exemplary embodiment of this specification.
[0018] Figure 4 The diagram shown is a schematic representation of the structure of a data table provided in an exemplary embodiment of this specification.
[0019] Figure 5 The diagram shown is a flowchart illustrating a data processing method provided in another exemplary embodiment of this specification.
[0020] Figure 6 The diagram shown is a flowchart illustrating a data processing method provided in another exemplary embodiment of this specification.
[0021] Figure 7 The diagram shown is a flowchart illustrating a data processing method provided in another exemplary embodiment of this specification.
[0022] Figure 8 The diagram shown is a schematic representation of the structure of a data table provided in another exemplary embodiment of this specification.
[0023] Figure 9 The diagram shown is a schematic representation of the structure of a data table provided in another exemplary embodiment of this specification.
[0024] Figure 10 The diagram shown is a schematic representation of the structure of a data table provided in another exemplary embodiment of this specification.
[0025] Figure 11 The diagram shown is a schematic representation of the structure of a data table provided in another exemplary embodiment of this specification.
[0026] Figure 12 The diagram shown is a flowchart illustrating a data processing method provided in another exemplary embodiment of this specification.
[0027] Figure 13 The diagram shown is a schematic representation of the structure of a data processing apparatus provided in an exemplary embodiment of this specification.
[0028] Figure 14 The diagram shown is a structural schematic of a data processing apparatus provided in another exemplary embodiment of this specification.
[0029] Figure 15 The diagram shown is a structural schematic of an electronic device provided in one embodiment of this specification. Detailed Implementation
[0030] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.
[0031] Application Overview
[0032] The volume of online financial and payment transactions is increasing daily, generating a large amount of business data. Typically, the relevant systems in the online financial and payment chain will aggregate a user's payment data over a period of time according to multiple dimensions.
[0033] In related solutions, data dimensions are typically fixed in database tables. When N data dimensions are added, N corresponding columns are added to the table, and user payment data is accumulated into different rows of the table according to the values corresponding to different attributes, where N is a positive integer. While this solution can achieve multi-dimensional data storage, the meaning of different columns in the table is bound to the column names and cannot be dynamically specified. Therefore, when adding data dimensions, specific columns must be added, resulting in poor scalability. Furthermore, each modification to a data dimension requires corresponding modifications to the data table, leading to high maintenance costs, cumbersome operations, and risks. Moreover, when adding or removing data dimensions, this solution suffers from low operational efficiency, cumbersome operations, and poor scalability, failing to meet the needs of business scenarios with high timeliness requirements.
[0034] To address the aforementioned issues, embodiments of this specification provide a data processing method involving a data table. This data table includes a cumulative dimension identifier column and an attribute identifier column. The cumulative dimension identifier column can identify different cumulative attributes, and the attribute identifier column can identify the type of the cumulative attribute.
[0035] The data processing method described in the embodiments of this specification, when it is determined that there are cumulative records for the target business in the data table, can store the data to be accumulated for the target business into the data table based on the longest attribute identifier in the attribute identifier column of the cumulative record, thereby achieving the purpose of storing multi-dimensional data. When it is necessary to add or remove data dimensions, the method provided in the embodiments of this specification does not require modification of the database table structure, and can dynamically adjust the attribute identifiers of the data table according to business data requirements. It is simple to operate, highly scalable, and saves a lot of personnel development and operation costs.
[0036] Figure 1The diagram shown is a system architecture schematic of an application scenario provided by an exemplary embodiment of this specification. Figure 1 As shown, this application scenario involves a user terminal 110 and a database system 120 that is communicatively connected to the user terminal 110. The user terminal 110 is used to send the pending data of the target service to the database system 120, and the database system 120 is used to execute the data processing method provided in the embodiments of this specification.
[0037] In actual use, the user generates the target service's pending accumulation data on the user terminal 110 and sends it to the database system 120. The database system 120 can obtain the data table and the target service's pending accumulation data; if it is determined that the target service's accumulation record exists in the data table, the pending accumulation data is stored in the data table based on the longest attribute identifier in the attribute identifier column of the accumulation record.
[0038] The data processing methods provided in this manual can flexibly store various business data to be accumulated, especially multi-dimensional data, enabling automated dimensional accumulation, which greatly improves data processing efficiency and saves development and operation costs. Furthermore, the data processing methods provided in this manual can also dynamically adjust the attribute identifiers of data tables according to business data requirements, offering strong scalability.
[0039] For example, user terminal 110 can be a mobile phone, tablet computer, or desktop computer. Database system 120 includes multiple servers, which can be physical servers, cloud servers, or backend servers for a specific business, such as the backend server of a website (e.g., an online shopping website or a payment application). In the above scenario, the carriers involved in user payment can include Near Field Communication (NFC), Wi-Fi, 3G / 4G / 5G, POS machine card swiping technology, QR code scanning technology, barcode scanning technology, Bluetooth, infrared, Short Message Service (SMS), Multimedia Message Service (MMS), etc.
[0040] Exemplary scenario
[0041] Users can pay directly through online payment platforms. These platforms can connect with multiple service providers, allowing users to select their preferred provider for payment. An online payment platform is a platform or service that supports online payment operations (such as online payment collection). Currently, common online payment platforms include social networking platforms and online shopping platforms. These third-party payment platforms typically partner with banks and other financial institutions to provide functions such as bank transfers. Online payment platforms can also include platforms or services provided by banks or other financial institutions that offer online payment or online transfer capabilities.
[0042] Figure 2 The diagram shown illustrates a scenario to which the data processing method provided in the embodiments of this specification applies. Figure 2 As shown in the embodiments of this specification, the application scenario mentioned is a billing scenario.
[0043] Specifically, a transaction made by a user through the online payment platform 200 can be considered a target transaction. This transaction involves the flow of funds; for example, the user pays a fee to a merchant via online payment. The transaction identifier, transaction amount, payment method, and other information generated during this transaction can be used as data to be accumulated. The online payment platform 200 sends the data to be accumulated (i.e., transaction data) to the billing system 210, which in turn sends it to the database system 220. The database system 220 retrieves the data and determines whether a record for the target transaction exists in its data table. If a record exists, the data to be accumulated is stored in the data table based on the longest attribute identifier in the attribute identifier column of the accumulated record.
[0044] In addition to the aforementioned billing scenarios, the data processing method provided in the embodiments of this specification can also be applied to a credit limit center platform. Specifically, a credit limit center platform typically sets a free credit limit. When a user's payment amount is within the free credit limit, no service fee is charged. When the user's payment amount exceeds the free credit limit, a corresponding service fee is charged. The data processing method provided in the embodiments of this specification can obtain the current user's accumulated credit value based on the accumulated credit attribute in order to match the user's free credit limit.
[0045] Furthermore, the data processing method provided in the embodiments of this specification can also be applied to the tiered fee rate for decision-making users. The tiered fee rate represents a rule for calculating settlement fees according to different preset percentages corresponding to the fee range after determining the fee range to which the deducted fee belongs. To better provide merchants with high-quality financial services, financial institutions determine a fee-free transaction limit based on the merchant's deposit amount; transactions exceeding this limit will be charged according to a preset percentage standard. The data processing method provided in the embodiments of this specification can obtain the current user's cumulative value based on the cumulative attribute to determine the user's tiered fee rate.
[0046] Exemplary methods
[0047] Figure 3 The diagram shown is a schematic flowchart of a data processing method provided in an exemplary embodiment of this specification. Figure 3 As shown in the embodiments of this specification, the data processing method includes the following steps.
[0048] Step S300: Obtain the data table.
[0049] A data table is a table set up in a data source for querying and / or storing data. The data table mentioned in the embodiments of this specification includes a cumulative dimension identifier column and an attribute identifier column. The cumulative dimension identifier column is used to identify different cumulative attributes, and the attribute identifier column is used to identify the type of the cumulative attribute.
[0050] The data table may include P1 to P N There are N cumulative dimension identifier columns, used to identify different cumulative attributes, with each column representing one cumulative attribute. These column identifiers act as placeholders and can be dynamically assigned different meanings based on actual business needs. A cumulative attribute can be understood as the cumulative dimension when accumulating business data by dimension; it can be an attribute composed of multiple dimensions of information included in the target business. For example, payment method and payment currency can both be used as cumulative attributes.
[0051] The attribute identifier column contains attribute identifiers. Attribute identifiers in the attribute identifier column can be represented by propsDef, and are used to identify P1 to P2. N Each represents the type of cumulative attribute. For example, the cumulative dimension identifier columns of the data table include columns P1 and P2, propsDef = {"Payment Method":"1", "Payment Currency":"2"}, where P1 represents the "Payment Method" dimension and P2 represents the "Payment Currency" dimension.
[0052] Step S320: Obtain the pending accumulation data of the target business.
[0053] Data to be accumulated refers to data that needs to be added to a data table. This data can be any business data, such as transaction data in payment transactions or reconciliation data in financial transactions. Different target businesses may correspond to different amounts of data to be accumulated. When transactions such as transfers and payments occur in a business system, corresponding business data is generated, such as payment amount and payment method. This business data can all be called data to be accumulated. To ensure that this business data is statistically analyzed in a timely manner, the business system generates data update requests to update the data in the data table. For example, when user A pays merchant B 10 yuan online, user A's payment amount and payment method need to be stored in the data table.
[0054] Typically, the data to be accumulated is multi-dimensional. Multi-dimensional data means data from multiple perspectives, such as payment method and payment currency.
[0055] Step S340: Determine if there is a cumulative record for the target business in the data table. If yes, proceed to step S360; otherwise, proceed to step S380.
[0056] For example, a cumulative record refers to a historical data record in a data table.
[0057] Step S360: Based on the longest attribute identifier in the attribute identifier column of the accumulated record, store the data to be accumulated into the data table.
[0058] Specifically, the data table is searched to determine the multiple attribute identifiers corresponding to the cumulative records of the target business. The longest attribute identifier among these is then identified as the longest attribute identifier. Based on the longest attribute identifier, the data to be accumulated is stored in the data table according to its dimensions.
[0059] Step S380: Insert the data to be accumulated as a new accumulated record into the data table.
[0060] If it is determined that there is no cumulative record for the target business in the data table, the data to be accumulated will be directly inserted into the data table as a new data row.
[0061] In the embodiments described in this specification, data tables can be used to flexibly store data to be accumulated for various business operations, especially multi-dimensional data, thereby achieving automated dimensional accumulation, which greatly improves data processing efficiency and saves a significant amount of personnel development and operation costs. Furthermore, the attribute identifiers of the data table can be dynamically adjusted according to the needs of business data, thus possessing a strong scalability advantage.
[0062] In some embodiments of this specification, before acquiring the target service's accumulated data, the method further includes: initializing a data table. Figure 4The diagram shown is a schematic representation of the structure of a data table provided in an exemplary embodiment of this specification. Before data processing, the data table in the database is initialized to obtain the following... Figure 4 The table structure shown.
[0063] like Figure 4 As shown, the initialized data table includes columns for business fields, values to be accumulated, dimension identifiers for accumulated values, and attribute identifiers. Specifically, business fields and values to be accumulated are added to the data table, and a dimension N is defined according to business requirements. P1 to P2 are then added to the data table accordingly. N There are N cumulative dimension identifier columns to identify different cumulative attributes. An additional attribute identifier (propsDef) column is added to identify P1 to P... N This represents the cumulative attribute type. The attribute identifier format can be {"cumulative attribute 1":"1", "cumulative attribute 2":"2"}. Attribute identifiers can be mapped to a Map structure, where the key is the cumulative attribute and the value is the corresponding cumulative dimension identifier column P. i The subscript.
[0064] Initializing a data table facilitates subsequent data storage and / or query operations, offering advantages such as fast processing speed and ease of operation. Furthermore, it improves data import efficiency and shortens import time. The embodiments in this specification, based on attribute identifiers, enable dynamic scaling. Values in the attribute identifiers are defined according to actual business needs, thereby achieving dynamic expansion and contraction across dimensions.
[0065] Figure 5 The diagram shown is a flowchart illustrating a data processing method provided in another exemplary embodiment of this specification. Figure 3 Extending from the illustrated embodiment Figure 5 The illustrated embodiment will be described in detail below. Figure 5 The illustrated embodiments and Figure 3 The differences and similarities between the embodiments shown will not be repeated.
[0066] like Figure 5 As shown in the embodiments of this specification, the data to be accumulated includes a set of attributes to be accumulated. Based on the longest attribute identifier in the attribute identifier column of the accumulated record, the data to be accumulated is stored in a data table, including the following steps.
[0067] Step S500: Determine whether there is an accumulation attribute in the set of attributes to be accumulated that is not included by the longest attribute identifier. If yes, proceed to steps S520 to S560; otherwise, proceed to step S580.
[0068] Step S520: Determine the new cumulative volume attribute corresponding to the target business.
[0069] For example, the cumulative attributes in the set of attributes to be accumulated that are not included by the longest attribute identifier are identified as the new cumulative attributes corresponding to the target business.
[0070] Step S540: Add the newly added cumulative attribute to the longest attribute identifier.
[0071] The specific implementation of adding the new cumulative attribute to the longest attribute identifier can be to add a dimension field to the longest attribute identifier.
[0072] Step S560: Based on the longest attribute identifier, store the data to be accumulated into the data table.
[0073] Step S580: Store the data to be accumulated into a data table in the data format of the target business's accumulated data record.
[0074] For example, if the attribute to be accumulated L1 = {"Payment Method", "Payment Currency"}, and the longest attribute identifier = {"Payment Method":"1"}, and the longest attribute identifier does not contain the "Payment Currency" attribute from the set of attributes to be accumulated, then it is concatenated into the longest attribute identifier in order, and the concatenated string is used as the new longest attribute identifier. The concatenated longest attribute identifier is {"Payment Method":"1", "Payment Currency":"2"}.
[0075] This embodiment of the specification, after determining the new cumulative attribute corresponding to the target business, simply adds the new cumulative attribute to the longest attribute identifier. This achieves the goal of dynamically specifying the meaning of dimension columns in the data table using attribute identifiers, avoiding the need to modify the data table each time. This not only reduces operational costs but is also simple to operate and risk-free. Furthermore, it can automatically identify new cumulative attributes and correspondingly change the attribute identifier, achieving the goal of dynamically specifying attribute identifier columns without requiring manual modification of the table structure, saving significant manpower costs.
[0076] Figure 6 The diagram shown is a flowchart illustrating a data processing method provided in another exemplary embodiment of this specification. Figure 5 Extending from the illustrated embodiment Figure 6 The illustrated embodiment will be described in detail below. Figure 6 The illustrated embodiments and Figure 5 The differences and similarities between the embodiments shown will not be repeated.
[0077] like Figure 6 As shown in the embodiments of this specification, the data to be accumulated includes a business field identifier and a value to be accumulated. The step of storing the data to be accumulated into a data table based on the longest attribute identifier includes the following steps.
[0078] Step S600: Based on the longest attribute identifier, determine the query set corresponding to the data to be accumulated.
[0079] For example, the query set contains the cumulative attribute values of the data to be accumulated, as well as the corresponding columns of the cumulative attribute values. The cumulative attribute values can represent the specific meaning of the cumulative dimension. For example, the attribute values corresponding to payment methods include bank card payment, Alipay payment, etc.; the attribute values corresponding to payment currency include RMB, USD, etc.
[0080] Step S620: Query the data table based on the business field identifier, the longest attribute identifier, and the query set.
[0081] For example, the business field identifier is used to identify the business scenario of the data to be accumulated. For instance, if the data is accumulated by merchant, the business field identifier is the merchant identification document (ID); if the data is accumulated by billing period, the business field is the billing period ID.
[0082] Step S640: Determine if there is a matching cumulative record in the data table. If yes, proceed to step S660; otherwise, proceed to step S680.
[0083] Step S660: The value to be accumulated is added to the accumulation record that matches the data to be accumulated.
[0084] Step S680: Insert the data to be accumulated as a new accumulated record into the data table.
[0085] In other words, if a matching accumulation record exists in the data table, the accumulation value of the data to be accumulated is directly added to the matching accumulation record. If no matching accumulation record exists in the data table, a new accumulation record is created, and the data to be accumulated is stored in the data table.
[0086] In the embodiments described in this specification, based on the business field identifier, the longest attribute identifier, and the query set, the data table is queried. If a matching accumulation record exists in the data table, the accumulation value of the data to be accumulated is directly added to the matching accumulation record. This direct accumulation of the value to be accumulated onto the existing accumulation attribute prevents meaningless expansion of the accumulation dimension. If no matching accumulation record exists in the data table, a new accumulation record is created, and the data to be accumulated is stored in the data table, achieving automated dimension-based accumulation.
[0087] In some embodiments of this specification, the data to be accumulated includes a set of attribute values to be accumulated corresponding to a set of attribute sets to be accumulated. Determining the query set corresponding to the data to be accumulated based on the longest attribute identifier includes: determining the column of the accumulation attribute in the data table based on the longest attribute identifier; and assembling the accumulation attribute values in the set of attribute values to be accumulated according to the order of the columns of the accumulation attribute in the data table to obtain the query set corresponding to the data to be accumulated.
[0088] For example, given a set of attribute values to be accumulated, K1 = {"bank card", "RMB"}, find the corresponding columns for each attribute value in K1, i.e., bank card corresponds to column P1, RMB corresponds to column P2, and assemble them into a query set, i.e., query set M, according to the order of the corresponding columns in the data table. S ={"P1":"Bank Card","P2":"RMB"}.
[0089] The embodiments in this specification assemble the cumulative attribute values in the set of cumulative attribute values to be accumulated according to the column order of the cumulative attributes in the data table to obtain the query set corresponding to the data to be accumulated. This provides the prerequisite for querying the cumulative records that match the data to be accumulated in the data table, which is conducive to realizing multi-dimensional accumulation.
[0090] Figure 7 The diagram shown is a flowchart illustrating a data processing method provided in another exemplary embodiment of this specification. Figure 7 As shown in the embodiments of this specification, the data processing method includes the following steps.
[0091] Step S700: Obtain the data to be accumulated.
[0092] Specifically, the data to be accumulated in the accumulation request is extracted. This data includes the business field B, the value to be accumulated V, the attribute set L1 to be accumulated, and its attribute value set K1, where B = 100001, V = 100, the attribute set L1 = {"Payment Method", "Payment Currency"}, and the attribute value set K1 = {"Bank Card", "RMB"}. The entity sending the accumulation request can be any system that needs to accumulate data, such as a billing system.
[0093] Step S702: Query the data table based on the business fields.
[0094] Step S704: Determine if the data table is empty. If yes, it means the cumulative record for business field B = 100001 is empty, then proceed to step S706. If no, it means the cumulative record is not empty, then proceed to step S708.
[0095] Step S706: Insert a new row of data into the data table.
[0096] Specifically, the data to be accumulated is inserted as a new data row into the data table, resulting in, for example: Figure 8 The data table structure shown is as follows. Figure 8 As shown, the attribute identifiers correspond to the order of columns P1 and P2, with column P1 corresponding to the payment method and column P2 corresponding to the payment currency.
[0097] Step S708: Find the longest propsDef value in the historical cumulative records under this business field.
[0098] For example, the attribute identifier is defined as propsDef, and the longest attribute identifier is the longest propsDef value. For instance, if the data table already contains data such as... Figure 9 As shown, the longest propsDef value in the historical cumulative record is {"Payment Method":"1"}.
[0099] Step S710: Determine whether the longest propsDef value contains all the attributes to be accumulated. If yes, proceed to step S712; otherwise, proceed to step S714.
[0100] In step S712, propsDef remains unchanged.
[0101] If the propsDef value contains all the attributes to be accumulated, it means that propsDef contains all the attributes of the accumulated request, and propsDef will not be changed.
[0102] Step S714: Add the new cumulative property to propsDef.
[0103] The system retrieves the accumulated attributes from the set of attributes to be accumulated, L1 = {"Payment Method", "Payment Currency"}. The longest propsDef value is {"Payment Method":"1"}. If the accumulated attribute in the set of attributes to be accumulated, L1, does not exist in the longest propsDef value, then a new accumulated attribute is determined. In this embodiment, the newly added accumulated attribute L2 = {Payment Currency} is appended to propsDef in sequence, and the appended string is used as the new propsDef. In this embodiment, the appended propsDef = {"Payment Method":"1", "Payment Currency":"2"}.
[0104] Step S716: Based on propsDef, find the corresponding column of the attribute value in the set of attribute values to be accumulated, and sort them according to P1 to P... N The items are assembled into a query set in the order listed.
[0105] In the embodiments of this specification, the set of attribute values to be accumulated is K1 = {"bank card", "RMB"}, and the query set is M. S ={"P1":"Bank Card","P2":"RMB"}.
[0106] Step S718: Query the data table based on the business fields, propsDef, and query set.
[0107] Step S720: Determine if the query result is empty. If yes, proceed to step S706; otherwise, proceed to step S722.
[0108] Step S722: Add a new cumulative value to the query results.
[0109] Specifically, the data table is queried. If the accumulated value record exists, the accumulated value is incremented by V, where V = 100. If the accumulated value record does not exist, a new record with an accumulated value of V is created. In this embodiment, the data table status after the accumulation is complete is as follows: Figure 10 As shown.
[0110] The dynamic scaling and scaling dimensional accumulation scheme provided in this manual allows users to automate dimensional accumulation without altering the table structure, significantly improving data processing efficiency and saving substantial development and operational costs. It also allows for dynamic adjustment of table attribute identifiers based on business data needs, offering strong scalability. Furthermore, this method is universally applicable to various scenarios involving dimensional data accumulation.
[0111] In some embodiments, the accumulation process without adding / reducing accumulation attributes is generally the same as the accumulation process with adding accumulation attributes, and will not be elaborated further. The difference lies in this scenario: if the longest propsDef value in the historical accumulation record is determined to be {"Payment Method":"1", "Payment Currency":"2"}, and the data to be accumulated includes business field B = 100001, the value to be accumulated V = 50, the set of attributes to be accumulated L1 = {"Payment Currency"}, and the set of attribute values to be accumulated K1 = {"USD"}, and the longest propsDef value already includes "Payment Currency" in the attributes to be accumulated, then propsDef can remain unchanged and continue to be based on... Figure 10 The data status continues to accumulate, and the final accumulated result is as follows: Figure 11 As shown.
[0112] Figure 12 The diagram shown is a flowchart illustrating a data processing method provided in another exemplary embodiment of this specification. Figure 12 As shown in the embodiments of this specification, the data processing method includes the following steps.
[0113] Step S1202: Obtain the business fields and the cumulative data attributes to be queried from the data query request.
[0114] Step S1204: Query the data table based on the business field to determine the longest attribute identifier corresponding to the business field.
[0115] The data table includes a cumulative dimension identifier column and an attribute identifier column. The cumulative dimension identifier column is used to identify different cumulative attributes, and the attribute identifier column is used to identify the type of cumulative attribute.
[0116] Step S1206: Based on the longest attribute identifier and the cumulative value of the attribute to be queried, query the data table to obtain the cumulative value corresponding to the cumulative value of the attribute to be queried.
[0117] Specifically, based on the longest attribute identifier, the index i corresponding to the cumulative attribute to be queried is found in the data table, and the correspondence between the cumulative attribute to be queried and the cumulative dimension identifier column is obtained. The data table is then queried according to the business field and the cumulative attribute value of the cumulative attribute to be queried.
[0118] Step S1208: Determine whether the retrieved results contain multiple rows of data. If yes, proceed to step S1210; otherwise, proceed to step S1212.
[0119] Step S1210: Sum the cumulative values of multiple rows of data and use the sum as the query result.
[0120] Step S1212: Use the cumulative value of a single row as the query result.
[0121] In the embodiments of this specification, the data table is queried based on the longest attribute identifier and the cumulative attribute to be queried to obtain the cumulative value corresponding to the cumulative attribute to be queried, and the query result corresponding to the business field is determined so as to be used for subsequent decision-making on user tiered rates, matching user free quotas, etc.
[0122] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0123] Exemplary device
[0124] The above text combined Figures 3 to 12 The method embodiments described in this specification are described in detail below, in conjunction with... Figures 13 to 15 This specification provides a detailed description of the apparatus embodiments. It should be understood that the various embodiments in this specification are described in a progressive manner, and similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system embodiments, since they are fundamentally similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions of the method embodiments.
[0125] Figure 13 The diagram shown is a structural schematic of a data processing apparatus provided in an exemplary embodiment of this specification. Figure 13As shown, the data processing apparatus 1300 provided in this embodiment includes:
[0126] The first acquisition module 1310 is used to acquire a data table, which includes a cumulative dimension identifier column and an attribute identifier column. The cumulative dimension identifier column is used to identify different cumulative attributes, and the attribute identifier column is used to identify the type of the cumulative attribute.
[0127] The second acquisition module 1320 is used to acquire the pending accumulation data of the target business;
[0128] Storage module 1330 is used to store the data to be accumulated into the data table based on the longest attribute identifier in the attribute identifier column of the accumulated record if there is an accumulated record of the target business in the data table.
[0129] In one embodiment of this specification, the storage module 1330 is further configured to: if there is a cumulative attribute in the set of attributes to be accumulated that is not included by the longest attribute identifier, determine the new cumulative attribute corresponding to the target service; add the new cumulative attribute to the longest attribute identifier; and store the data to be accumulated in the data table based on the longest attribute identifier.
[0130] In one embodiment of this specification, the storage module 1330 is further configured to: determine the query set corresponding to the data to be accumulated based on the longest attribute identifier; query the data table based on the business field identifier, the longest attribute identifier, and the query set; and if it is determined that there is an accumulation record in the data table that matches the data to be accumulated, then add the value to be accumulated to the accumulation record that matches the data to be accumulated.
[0131] In one embodiment of this specification, the storage module 1330 is further configured to insert the data to be accumulated as a new accumulation record into the data table if it is determined that there is no accumulation record in the data table that matches the data to be accumulated.
[0132] In one embodiment of this specification, the storage module 1330 is further configured to: determine the column of the accumulating attribute in the set of accumulating attributes in the data table based on the longest attribute identifier; and assemble the accumulating attribute values in the set of accumulating attribute values in the data table according to the order of the accumulating attribute in the set of accumulating attributes in the data table to obtain the query set corresponding to the accumulating data.
[0133] In one embodiment of this specification, the storage module 1330 is further configured to determine the cumulative attributes in the set of attributes to be accumulated that are not included by the longest attribute identifier as the new cumulative attributes corresponding to the target service.
[0134] In one embodiment of this specification, the storage module 1330 is further configured to, if the longest attribute identifier contains an accumulation attribute in the set of attributes to be accumulated, store the data to be accumulated in the data table in the form of the accumulation record of the target business.
[0135] Figure 14 The diagram shown is a structural schematic of a data processing apparatus provided in another exemplary embodiment of this specification. Figure 14 As shown in the embodiments of this specification, the environmental signal includes an optical signal, and the data processing device 1400 includes:
[0136] The acquisition module 1410 is used to acquire the business fields and the cumulative attributes to be queried in the data query request.
[0137] The determination module 1420 is used to query the data table based on the business field and determine the longest attribute identifier corresponding to the business field. The data table includes a cumulative dimension identifier column and an attribute identifier column. The cumulative dimension identifier column is used to identify different cumulative attributes, and the attribute identifier column is used to identify the type of the cumulative attribute.
[0138] The query module 1430 is used to query the data table based on the longest attribute identifier and the cumulative attribute to be queried, and obtain the cumulative value corresponding to the cumulative attribute to be queried.
[0139] Below, for reference Figure 15 This specification describes an electronic device according to embodiments thereof. Figure 15 The diagram shown is a schematic representation of the structure of an electronic device provided in an exemplary embodiment of this specification.
[0140] like Figure 15 As shown, the electronic device 1500 includes one or more processors 1501 and memory 1502.
[0141] The processor 1501 may be another form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 1500 to perform desired functions.
[0142] The memory 1502 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 1501 may execute the program instructions to implement the methods of the various embodiments described above and / or other desired functions. Various content, such as pending data of target services, may also be stored in the computer-readable storage medium.
[0143] In one example, the electronic device 1500 may also include an input device 1503 and an output device 1504, which are interconnected via a bus 1505 and / or other forms of connection mechanism (not shown).
[0144] The input device 1503 may include, for example, a keyboard, a mouse, etc.
[0145] The output device 1504 can output various information to the outside, including the cumulative record of the target service, the longest attribute identifier, etc. The output device 1504 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0146] Of course, for the sake of simplicity, Figure 15 Only some of the components of the electronic device 1500 relevant to this specification are shown in this specification; components such as buses, input / output interfaces, etc., are omitted. In addition, the electronic device 1500 may include any other suitable components depending on the specific application.
[0147] In addition to the methods and apparatus described above, embodiments of this specification may also be computer program products comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps of the methods described above according to various embodiments of this specification.
[0148] The computer program product described herein can be written in any combination of one or more programming languages to perform the operations of the embodiments described herein. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0149] Furthermore, embodiments of this specification may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps of the methods described above according to various embodiments of this specification.
[0150] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0151] The basic principles of this specification have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this specification are merely examples and not limitations, and should not be considered as essential features of the various embodiments of this specification. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this specification to the necessity of employing the aforementioned specific details for implementation.
[0152] The block diagrams of devices, apparatuses, devices, and systems described in this specification are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0153] It should also be noted that in the apparatus, equipment, and methods described in this specification, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions to this specification.
[0154] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this specification. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this specification. Therefore, this specification is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0155] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this specification to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A data processing method, comprising: Obtain a data table, which includes a cumulative dimension identifier column and an attribute identifier column. The cumulative dimension identifier column is used to identify different cumulative attributes, and the attribute identifier column is used to identify the type of the cumulative attribute. Obtain the pending accumulation data for the target business; If the data table contains a cumulative record for the target service, then the data to be accumulated is stored in the data table based on the longest attribute identifier in the attribute identifier column of the cumulative record. The data to be accumulated includes a set of attributes to be accumulated, a business field identifier, and a value to be accumulated. The step of storing the data to be accumulated into the data table based on the longest attribute identifier in the attribute identifier column of the accumulated records includes: If there is a cumulative attribute in the set of attributes to be accumulated that is not included by the longest attribute identifier, then the new cumulative attribute corresponding to the target service is determined. Add the newly added cumulative attribute to the longest attribute identifier; Based on the longest attribute identifier, determine the query set corresponding to the data to be accumulated; Based on the business field identifier, the longest attribute identifier, and the query set, query the data table; If it is determined that there is a matching accumulation record in the data table, then the value to be accumulated is added to the matching accumulation record.
2. The method according to claim 1, further comprising: If it is determined that there is no matching accumulation record for the data to be accumulated in the data table, then the data to be accumulated is inserted into the data table as a new accumulation record.
3. The method according to claim 1, wherein the data to be accumulated includes a set of attribute values corresponding to the set of attributes to be accumulated, and determining the query set corresponding to the data to be accumulated based on the longest attribute identifier includes: Based on the longest attribute identifier, determine the column of the accumulation attribute in the data table in the set of attributes to be accumulated; The cumulative attribute values in the set of cumulative attribute values to be accumulated are assembled according to the order of the cumulative attributes in the data table to obtain the query set corresponding to the data to be accumulated.
4. The method according to claim 1, wherein determining the new cumulative volume attribute corresponding to the target service includes: The accumulation attributes in the set of attributes to be accumulated that are not included by the longest attribute identifier are identified as the new accumulation attributes corresponding to the target service.
5. The method according to any one of claims 1 to 4, wherein storing the data to be accumulated into the data table based on the longest attribute identifier in the attribute identifier column of the accumulated record comprises: If the longest attribute identifier contains the accumulation attribute in the set of attributes to be accumulated, then the data to be accumulated is stored in the data table in the form of the accumulation record of the target service.
6. A data processing method, comprising: Retrieve the business fields and the cumulative attributes to be queried from the data query request; Based on the business field, query the data table to determine the longest attribute identifier corresponding to the business field. The data table includes a cumulative dimension identifier column and an attribute identifier column. The cumulative dimension identifier column is used to identify different cumulative attributes, and the attribute identifier column is used to identify the type of the cumulative attribute. Based on the longest attribute identifier and the cumulative value to be queried, the data table is queried to obtain the cumulative value corresponding to the cumulative value to be queried.
7. A data processing apparatus, comprising: The first acquisition module is used to acquire a data table, which includes a cumulative dimension identifier column and an attribute identifier column. The cumulative dimension identifier column is used to identify different cumulative attributes, and the attribute identifier column is used to identify the type of the cumulative attribute. The second acquisition module is used to acquire the data to be accumulated for the target business. The storage module is used to store the data to be accumulated into the data table based on the longest attribute identifier in the attribute identifier column of the accumulated record if there is an accumulated record of the target business in the data table. The data to be accumulated includes a set of attributes to be accumulated, a business field identifier, and a value to be accumulated. The step of storing the data to be accumulated into the data table based on the longest attribute identifier in the attribute identifier column of the accumulated records includes: If there is a cumulative attribute in the set of attributes to be accumulated that is not included by the longest attribute identifier, then the new cumulative attribute corresponding to the target service is determined. Add the newly added cumulative attribute to the longest attribute identifier; Based on the longest attribute identifier, determine the query set corresponding to the data to be accumulated; Based on the business field identifier, the longest attribute identifier, and the query set, query the data table; If it is determined that there is a matching accumulation record in the data table, then the value to be accumulated is added to the matching accumulation record.
8. A data processing apparatus, comprising: The acquisition module is used to acquire the business fields and the cumulative attributes to be queried in the data query request; The determination module is used to query a data table based on the business field to determine the longest attribute identifier corresponding to the business field. The data table includes a cumulative dimension identifier column and an attribute identifier column. The cumulative dimension identifier column is used to identify different cumulative attributes, and the attribute identifier column is used to identify the type of the cumulative attribute. The query module is used to query the data table based on the longest attribute identifier and the cumulative value to be queried, so as to obtain the cumulative value corresponding to the cumulative value to be queried.
9. An electronic device, comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to perform the method described in any one of claims 1 to 6.