Business data write-back method and related device
By obtaining business scenario labels of business certificates and determining the business attributes of business data, combined with the pre-set target data writeback strategy, the problem of low accuracy of business data writeback in the existing technology is solved, and more efficient and accurate Data writeback.
Patent Information
- Application Number
- CN202411531570.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-11
AI Technical Summary
When writing back multi-source and multi-dimensional business data in the prior art, the accuracy is not high, and it is difficult to carry out targeted writing back based on the source and dimension of the data.
By obtaining the business scenario tags of the business certificates, the business attributes of the business data are determined, and the business data is written back to the preset database according to the preset target data write-back strategy. The method includes matching the correspondence between the business scenario label and the configuration table, obtaining the corresponding data writeback strategy, and selecting a suitable writeback method according to the data type.
The accuracy and effectiveness of data writeback are improved, so that different target data writeback strategies can be adopted for business data with different business attributes, avoiding repeated writebacks and resource waste.
Smart Images

Figure CN119415586A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a business data write-back method and related devices. Background Art
[0002] For large enterprises, the sources of business data are complex. For example, actual cash flow, commission data, capital data, etc. The data sources may come from different databases, that is, multiple sources, and there may also be multi-dimensional data. At present, most of the data is synchronized to a database and then written back during the storage process. Since the business data is diverse, the accuracy of the write-back is not high.
[0003] Therefore, how to certify business data based on different sources and dimensions and then write it back, and ensure that the written-back data and corresponding fields are accurate, has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a business data write-back method and related devices, aiming to improve the accuracy of data write-back.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a service data write-back method, the method comprising:
[0006] In some embodiments, business data is processed for certification to obtain business credentials.
[0007] In some embodiments, a business scenario tag of the business credential is obtained, where the business scenario tag is used to characterize a business scenario corresponding to the business credential.
[0008] In some embodiments, the business attributes of the business data are determined based on the business scenario tags, wherein the business attributes are used to characterize the source and / or dimension of the business data.
[0009] In some embodiments, a target data write-back policy preset for a business attribute of the business data is obtained.
[0010] In some embodiments, based on the target data write-back strategy, the business data is written back to a preset database.
[0011] In conjunction with the first aspect, in a possible implementation manner, the step of obtaining a target data write-back strategy preset for a business attribute of the business data includes:
[0012] Acquire a plurality of configuration tables pre-set for different business attributes, each of which is configured with a correspondence between different business scenario tags and data write-back strategies;
[0013] Matching the business scenario tags of the business voucher with the business scenario tags of the multiple configuration tables respectively, and determining a target configuration table that successfully matches the business scenario tags of the business voucher;
[0014] A target data write-back strategy corresponding to the business scenario tag of the business voucher is determined in the target configuration table.
[0015] In combination with the first aspect, in a possible implementation manner, the matching the business scenario tags of the business voucher with the business scenario tags in the multiple configuration tables respectively to determine the target configuration table that successfully matches the business scenario tag of the business voucher includes:
[0016] Obtaining a preset matching order of the multiple configuration tables;
[0017] Matching the business scenario tags of the business voucher with the business scenario tags in the multiple configuration tables in sequence according to the preset matching order;
[0018] When the business scenario tag of the business voucher successfully matches with the business scenario tags in the multiple configuration tables for the first time, the configuration table corresponding to the first successful match is determined as the target configuration table.
[0019] In combination with the first aspect, in a possible implementation manner, the multiple configuration tables include a first configuration table, a second configuration table, and a third configuration table that are sequentially arranged, the business scenario tag included in the first configuration table is a first business scenario tag, and the first business scenario tag is used to characterize the business scenario corresponding to the business data only from the preset database; the business scenario tag included in the second configuration table is a second business scenario tag, and the second business scenario tag is used to characterize the business scenario corresponding to the multi-dimensional business data; the business scenario tag included in the third configuration table is a third business scenario tag, and the third business scenario tag is used to characterize the business scenario corresponding to the business data from a database other than the preset database;
[0020] The matching the business scenario tags of the business voucher with the business scenario tags in the multiple configuration tables in sequence includes:
[0021] Matching the business scenario tag of the business voucher with the first business scenario tag in the first configuration table; if the first business scenario tag that successfully matches the business scenario tag of the business voucher exists in the first configuration table, then the business scenario tag of the business voucher successfully matches the first business scenario tag in the first configuration table;
[0022] If there is no first business scenario tag in the first configuration table that successfully matches the business scenario tag of the business voucher, then the business scenario tag of the business voucher is matched with the second business scenario tag in the second configuration table; if there is a second business scenario tag in the second configuration table that successfully matches the business scenario tag of the business voucher, then the business scenario tag of the business voucher is successfully matched with the second business scenario tag in the second configuration table;
[0023] If there is no second business scenario tag in the second configuration table that successfully matches the business scenario tag of the business voucher, the business scenario tag of the business voucher successfully matches the third business scenario tag in the third configuration table.
[0024] In combination with the first aspect, in a possible implementation manner, sequentially matching the business scenario tags of the business voucher with the business scenario tags in the multiple configuration tables includes:
[0025] When the business scenario tag of the business voucher successfully matches the business scenario tag in the matched configuration table, obtaining a write-back status tag of the matched configuration table, wherein the matched configuration table is any one of the multiple configuration tables;
[0026] If the write-back status tag indicates that the write-back status of the matched configuration table is on, determining that the business scenario tag of the business voucher and the business scenario tags in the multiple configuration tables are successfully matched for the first time;
[0027] If the write-back status tag indicates that the write-back status of the matched configuration table is closed, the business scenario tag of the business voucher continues to be matched with the business scenario tag in a configuration table subsequent to the matched configuration table.
[0028] In combination with the first aspect, in a possible implementation manner, writing back the business data to a preset database based on the target data write-back strategy includes:
[0029] Determine the data type of the business data, the data type including detailed data or summary data;
[0030] Obtaining a target write-back method for performing write-back processing on the data type in the target data write-back strategy;
[0031] The business data is written back to a preset database using the target write-back method.
[0032] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0033] If writing the business data back to the preset database fails, re-execute the step of writing the business data back to the preset database based on the target data write-back strategy;
[0034] If the number of times the step of writing the business data back to the preset database based on the target data write-back strategy is repeated reaches a preset number of times, the business data is rewritten back.
[0035] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a service data write-back device, the device comprising:
[0036] Certificate making module: used to make certificates for business data and obtain business vouchers.
[0037] The tag acquisition module is used to acquire the business scenario tag of the business voucher, where the business scenario tag is used to characterize the business scenario corresponding to the business voucher.
[0038] Attribute determination module: used to determine the business attributes of the business data based on the business scenario label, wherein the business attributes are used to characterize the source and / or dimension of the business data.
[0039] The write-back strategy acquisition module is used to acquire a target data write-back strategy preset for the business attributes of the business data.
[0040] Write-back module: used to write the business data back to the preset database based on the target data write-back strategy.
[0041] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes a computer device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.
[0042] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0043] To achieve the above-mentioned purpose, the fifth aspect of the embodiments of the present application proposes a computer program product, which stores a computer program. When the computer program is executed by a processor, the method described in the first aspect is implemented.
[0044] A business data write-back method proposed in this application 、Devices, computer equipment, storage media and computer program products obtain business scenario labels of business credentials, determine business attributes of business data based on the business scenario labels, obtain target data write-back policies pre-set for the business attributes of the business data, and write the business data back to a preset database based on the target data write-back policies, so that different target data write-back policies can be used for business data with different business attributes, thereby achieving more targeted write-back of business data to improve the effectiveness of write-back. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flowchart of a method for writing back business data provided by an embodiment of the present application;
[0046] Figure 2 yes Figure 1 Flow chart of step S104 in FIG.
[0047] Figure 3 yes Figure 2 Flow chart of step S202 in FIG.
[0048] Figure 4 yes Figure 3 A first example flow chart of step S302 in FIG. 1 ;
[0049] Figure 5 yes Figure 3 A second example flow chart of step S302 in FIG. 1 ;
[0050] Figure 6 yes Figure 2 Flow chart of step S204 in FIG.
[0051] Figure 7 yes Figure 1 Flow chart of step S105 in FIG.
[0052] Figure 8 It is a structural diagram of a business data write-back device provided in an embodiment of the present application;
[0053] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0054] 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.
[0055] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0057] The embodiments of the present application provide a business data write-back method, a computer device, a storage medium, and a computer program product, aiming to improve the accuracy of data write-back.
[0058] A business data write-back method, computer device, storage medium and computer program product provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the business data write-back method in the embodiments of the present application is described.
[0059] The business data write-back method provided in the embodiment of the present application relates to the field of data processing technology. The business data write-back method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the business data write-back method, etc., but is not limited to the above forms.
[0060] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0061] Figure 1 is an optional flowchart of the service data write-back method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S105.
[0062] Step S101, process the business data to obtain a business certificate.
[0063] Step S102: Acquire a business scenario tag of the business voucher, where the business scenario tag is used to characterize the business scenario corresponding to the business voucher.
[0064] Step S103: determining a business attribute of the business data based on the business scenario tag, wherein the business attribute is used to characterize a source and / or dimension of the business data.
[0065] Step S104: obtaining a target data write-back policy preset for the business attributes of the business data.
[0066] Step S105: Based on the target data write-back strategy, the business data is written back to a preset database.
[0067] The above business data can be understood as various types of data contained in business vouchers. Specifically, the business data can be data of business in scenarios such as insurance and financial management. Business vouchers record the occurrence or completion of economic business, such as unit, name, accounting date, expenditure items and expenditure amount, etc.
[0068] When the business voucher is completed, the business data needs to be written back. Data writing can be understood as affixing financial-related labels to the data and storing it in a preset database. For example, the specific numerical data corresponding to the expenditure amount is affixed with the financial label of "expenditure amount", and the specific date corresponding to the accounting date is affixed with a label such as "accounting date", etc.
[0069] The main execution steps for writing back the business data are step S102 to step S105.
[0070] The above business scenario labels are used to represent the business scenarios corresponding to the business vouchers. Business scenarios are the products or services that enterprises and merchants need to provide consumers with the products or services that they may need and are related to in a certain link of the user. Business scenario labels can be understood as identity IDs, which are not limited to any form of identification symbols. Any symbols that can be used for distinction can be used, such as numbers and letters, such as 6L, special symbols and letters, such as #L, numbers and special symbols, such as @16, etc.
[0071] Each business voucher has a corresponding business scenario, each business scenario has a corresponding business scenario label, and each business voucher has a corresponding batch label, business scenario label and business table name.
[0072] The above business attributes are used to characterize the source and / or dimension of business data, and the business attributes are divided into only from the preset database, from a database other than the preset database, and the data dimension is multi-dimensional. Among them, in a possible implementation, the preset database can be a local database.
[0073] In step S103, a correspondence between the business attributes of the business data and the business scenario tags may be established, and the business attributes of the business data may be determined based on the business scenario tags by acquiring the business attributes corresponding to the business scenario tags.
[0074] The target data write-back policy is a write-back policy for writing back the current business data to be written back, and the write-back policy is a method for writing back business data. In this step S104, after obtaining the business attributes of the business data, the data write-back policy pre-set for the business attributes of the business data is obtained to obtain the target data write-back policy.
[0075] In this step S105, the business data is processed using the target data write-back strategy, and the business data is written back to the preset database.
[0076] Steps S101 to S105 shown in the embodiment of the present application are to obtain business credentials by processing business data, obtain business scenario tags of business credentials, determine business attributes of business data based on business scenario tags, obtain target data write-back strategies pre-set for business attributes of business data, and write business data back to a preset database based on the target data write-back strategies. The corresponding target data write-back strategies are determined by the business attributes of the business data to be written back, so that different target data write-back strategies can be used for business data with different business attributes, so that more targeted write-back of business data can be achieved to improve the effectiveness of write-back.
[0077] See also Figure 2 In some embodiments, step S104 may include but is not limited to steps S201 to S203:
[0078] Step S201, obtaining a plurality of configuration tables pre-set for different business attributes, each of which is configured with a corresponding relationship between a different business scenario tag and a data write-back strategy.
[0079] Step S202 , respectively matching the business scenario tag of the business voucher with the business scenario tags in the multiple configuration tables, and determining a target configuration table that successfully matches the business scenario tag of the business voucher.
[0080] Step S203, determining in the target configuration table a target data write-back strategy that has a corresponding relationship with the business scenario tag of the business voucher.
[0081] The above configuration table is used to obtain the target data write-back strategy under different business scenario tags. Different configuration tables correspond to different business attributes, and the configuration table contains multiple business scenario tags.
[0082] In step S201 of some embodiments, the multiple configuration tables include a first configuration table, a second configuration table, and a third configuration table, and the business attributes corresponding to the first configuration table, the second configuration table, and the third configuration table are respectively derived only from a preset database, the data dimension is multidimensional, and the business attributes are derived from a database other than the preset database.
[0083] The business scenario tag contained in the first configuration table is a first business scenario tag, which is used to characterize the business scenario corresponding to the business data only from the preset database. The business scenario tag contained in the second configuration table is a second business scenario tag, which is used to characterize the business scenario corresponding to the multi-dimensional business data. The business scenario tag contained in the third configuration table is a third business scenario tag, which is used to characterize the business scenario corresponding to the business data from a database other than the preset database.
[0084] The above target configuration table is a configuration table that successfully matches the business scenario tag of the business voucher.
[0085] In step S202 of some embodiments, since the configuration table includes a business scenario tag, matching can be performed by identifying whether the business scenario tag of the business voucher is consistent with the business scenario tag in the configuration table. If the business scenario tag of the business voucher is consistent with the business scenario tag in the configuration table, the match is successful. If the business scenario tag of the business voucher is inconsistent with the business scenario tag in the configuration table, the match fails. For example, if the business scenario tags included in the first configuration table are 6L, 16L, and 18L, then if the business scenario tag of a certain business data is 6L and 6L exists in the first configuration table, the match is successful, and the target configuration table is the first configuration table.
[0086] In step S203 of some embodiments, a target configuration table is obtained, and then a data write-back policy corresponding to a business scenario tag of a business credential in the target configuration table may be obtained to obtain a target data write-back policy.
[0087] It should be noted that if the configuration table for which the business attributes are only derived from the preset database setting is the first configuration table, and the business scenario labels contained in the configuration table are 6L, 16L, and 18L, then if the business scenario label of a certain business data is 6L, and 6L happens to be in the first configuration table, it can be determined that the business attributes of the business data are only derived from the preset database.
[0088] Each configuration table is configured with the correspondence between different business scenario tags and data write-back policies. Based on the business scenario tag of the business credential, the configuration table containing the business scenario tag can be determined from multiple configuration tables. The business attributes of the business data can be determined by obtaining the configuration table containing the business scenario tag. Because the configuration table is configured with the correspondence between different business scenario tags and data write-back policies, the corresponding data write-back policy can be obtained based on the business scenario tag, that is, the target data write-back policy pre-set for the business attributes of the business data can be finally obtained. By pre-setting multiple configuration tables for different business attributes, corresponding data write-back policies are set for different business scenarios in each configuration table. The corresponding data write-back policy can be effectively and quickly determined based on the business scenario tag of the business credential.
[0089] See also Figure 3 In some embodiments, step S202 may include but is not limited to steps S301 to S303:
[0090] Step S301, obtaining a preset matching order of the multiple configuration tables.
[0091] Step S302: Match the business scenario tags of the business voucher with the business scenario tags in the multiple configuration tables in sequence according to the preset matching order.
[0092] Step S303, when the business scenario tag of the business voucher successfully matches with the business scenario tags in the multiple configuration tables for the first time, the configuration table corresponding to the first successful match is determined as the target configuration table.
[0093] Since the business data corresponding to a business scenario tag may have multiple business attributes, for example, the business scenario tag 16L can exist in both the first configuration table and the second configuration table, a business scenario tag may be successfully matched with multiple configuration tables. At this time, multiple data write-back strategies can be determined. If multiple data write-back strategies are used for data write-back, the business data will be repeatedly written back, which will waste resources and storage space. In order to avoid the above situation, this embodiment can use the business scenario tags of the business vouchers to match the business scenario tags in multiple configuration tables in turn.
[0094] In step S301 of some embodiments, the preset matching order can be arranged according to the business attributes. For example, the configuration tables are arranged corresponding to the first business attribute, the second business attribute, and the third business attribute. The first business attribute is used to characterize that the business data only comes from the preset database, the second business attribute is used to characterize that the business data is multidimensional data, and the third business attribute is used to characterize that the business data comes from a database other than the preset database. If the configuration tables corresponding to the first business attribute, the second business attribute, and the third business attribute are the first configuration table, the second configuration table, and the third configuration table, then the preset matching order is the first configuration table, the second configuration table, and the third configuration table.
[0095] In step S302 of some embodiments, first, the business scenario tag of the business voucher is matched with the business scenario tag in the i-th configuration table in the preset matching order, and the initial value of i is 1. If the match fails, i=i+1 is set, and the step of matching the business scenario tag of the business voucher with the business scenario tag in the i-th configuration table in the preset matching order is re-executed. For example, if the preset matching order is the first configuration table, the second configuration table, and the third configuration table, the business scenario tag of the business voucher is first matched with the business scenario tag in the first configuration table. If the match fails, the business scenario tag of the business voucher is matched with the business scenario tag in the second configuration table, and so on.
[0096] In step S303 of some embodiments, if the business scenario tag of the business voucher is matched with the business scenario tag in the i-th configuration table in the preset matching order, the initial value of i is 1, and the match is successful. Then the i-th configuration table in the preset matching order is determined as the target configuration table, and the business scenario tag in the i+1-th configuration table is no longer matched.
[0097] For example, the preset matching order is the first configuration table, the second configuration table, and the third configuration table. The business scenario tag of the business voucher is matched with the first business scenario tag in the first configuration table. If there is a first business scenario tag in the first configuration table that successfully matches the business scenario tag of the business voucher, then the business scenario tag of the business voucher is successfully matched with the first business scenario tag in the first configuration table, and the first configuration table is determined as the target configuration table. If there is no first business scenario tag in the first configuration table that successfully matches the business scenario tag of the business voucher, then the business scenario tag of the business voucher is matched with the second business scenario tag in the second configuration table. If there is a second business scenario tag in the second configuration table that successfully matches the business scenario tag of the business voucher, then the business scenario tag of the business voucher is successfully matched with the second business scenario tag in the second configuration table, and the second configuration table is determined as the target configuration table.
[0098] By matching multiple configuration tables in sequence, the configuration table corresponding to the first successful match is determined as the target configuration table, and a unique target configuration table can be obtained, avoiding matching multiple configuration tables and causing repeated writing back of business data to waste resources and storage space.
[0099] Specifically, see Figure 4 In some embodiments, step S302 may include but is not limited to steps S401 to S403:
[0100] Step S401, matching the business scenario tag of the business voucher with the first business scenario tag in the first configuration table; if there is a first business scenario tag in the first configuration table that successfully matches the business scenario tag of the business voucher, then the business scenario tag of the business voucher successfully matches the first business scenario tag in the first configuration table.
[0101] Step S402: if there is no first business scenario tag in the first configuration table that successfully matches the business scenario tag of the business credential, the business scenario tag of the business credential is matched with the second business scenario tag in the second configuration table; if there is a second business scenario tag in the second configuration table that successfully matches the business scenario tag of the business credential, the business scenario tag of the business credential is successfully matched with the second business scenario tag in the second configuration table.
[0102] Step S403: If there is no second business scenario tag in the second configuration table that successfully matches the business scenario tag of the business voucher, the business scenario tag of the business voucher successfully matches the third business scenario tag in the third configuration table.
[0103] Steps S401 to S402 are mentioned as examples in the description of steps S301 to S303, and can be referred to the description of steps S301 to S303, and steps S401 to S402 are not described one by one here.
[0104] In step S403 of some embodiments, since there are three configuration tables in total, if no match is successful in the first two configuration tables, a match will definitely be successful in the third configuration table. In order to improve the matching efficiency, in this embodiment, if there is no second business scenario tag in the second configuration table that successfully matches the business scenario tag of the business credential, the business scenario tag of the default business credential successfully matches the third business scenario tag in the third configuration table.
[0105] See also Figure 5 In some embodiments, step S302 may include but is not limited to steps S501 to S503:
[0106] Step S501, when the business scenario tag of the business voucher successfully matches the business scenario tag in the matched configuration table, obtain the write-back status tag of the matched configuration table, and the matched configuration table is any configuration table among the multiple configuration tables.
[0107] Step S502: If the write-back status tag indicates that the write-back status of the matched configuration table is on, it is determined that the business scenario tag of the business voucher is successfully matched with the business scenario tags in the multiple configuration tables for the first time.
[0108] Step S503: If the write-back status tag indicates that the write-back status of the matched configuration table is closed, continue to match the business scenario tag of the business voucher with the business scenario tag in a configuration table subsequent to the matched configuration table.
[0109] In this embodiment, if the business data under the business scenario label has been written back, there is no need to write the data back again. In order to avoid repeated writing of the data, the configuration table also includes the correspondence between the business scenario label and the write-back status label. The write-back status label is used to characterize the write-back status. The write-back status is divided into closed and open. When the business data under the business scenario label has been written back, the write-back status is closed. Otherwise, the write-back status is open.
[0110] The above-mentioned matched configuration table may be a configuration table in which the business scenario tag has been successfully matched. In step S501 of some embodiments, the write-back status tag corresponding to the business scenario tag of the business credential in the matched configuration table is obtained.
[0111] For example, the configuration table that successfully matches the business scenario tag of the business credential is the first configuration table, then the first configuration table is the matched configuration table, and when the business scenario tag of the business credential successfully matches the business scenario tag in the first configuration table, the write-back status tag corresponding to the business scenario tag of the business credential in the first configuration table is further obtained.
[0112] In step S502 of some embodiments, the business scenario tag of the business credential is considered to be successfully matched with the matched configuration table only when the business scenario tag of the business credential is successfully matched and the write-back status tag indicates that the write-back status of the matched configuration table is turned on, and the current matched configuration table is determined as the target configuration table.
[0113] For example, the write-back status tag is represented by Y and N, Y is used to indicate that the write-back status is enabled, and N is used to indicate that the write-back status is disabled. If the write-back status tag is Y, it is determined that the business scenario tag of the business voucher and the business scenario tags in multiple configuration tables are matched successfully for the first time.
[0114] In step S503 of some embodiments, if the write-back status tag indicates that the write-back status of the matched configuration table is closed, it is deemed that the business scenario tag of the business voucher fails to match the matched configuration table, and the step of matching the business scenario tag of the business voucher with the business scenario tags in multiple configuration tables in sequence is continued.
[0115] For example, the write-back status tag is represented by Y and N, Y is used to indicate that the write-back status is enabled, and N is used to indicate that the write-back status is disabled. If the write-back status tag is N, the business scenario tag of the business voucher is continued to be matched with the business scenario tag in the configuration table after the matched configuration table.
[0116] In this embodiment, if the write-back status tag indicates closed, it means that the business data under the business scenario tag has been written back and there is no need to write the data back repeatedly. Therefore, further judging the write-back status based on the successful matching of the business scenario tag can avoid repeated writing of the business data.
[0117] See also Figure 6 In some embodiments, step S204 may also include but is not limited to steps S601 to S603:
[0118] Step S601: determine the data type of the business data.
[0119] The data type includes detailed data or summary data.
[0120] Step S602, obtaining a target write-back mode for performing write-back processing on the data type in the target data write-back strategy.
[0121] Step S603: write the business data back to a preset database using the target write-back method.
[0122] In this embodiment, different write-back methods are further set for detailed data and summary data, that is, the target data write-back strategy includes a first write-back method and a second write-back method. The first write-back method is used to write back the detailed data, and the second write-back method is used to write back the summary data. The first write-back method and the second write-back method are different in different data write-back strategies.
[0123] In step S601 of some embodiments, the data type includes detailed data or summary data, and whether the business data is detailed data or summary data can be determined based on data characteristics, such as by using an attribution module or a fuzzy match of a table name.
[0124] In step S602 of some embodiments, for detailed data, a method for writing back the detailed data is obtained, and for summary data, a method for writing back the summary data is obtained. For example, if the business data is detailed data, the first writing back method in the target data writing back strategy is obtained, and if the business data is summary data, the second writing back method in the target data writing back strategy is obtained.
[0125] In step S603 of some embodiments, for detailed data, the detailed data is written back using a write-back processing method for detailed data, and for summary data, the summary data is written back using a write-back processing method for summary data. For example, if the business data is detailed data, the business data is written back to the preset database using a first write-back method, and if the business data is summary data, the business data is written back to the preset database using a second write-back method.
[0126] In this embodiment, if the target configuration table is the first configuration table, the first write-back method is to execute a specific detail branch and combine the merge i nto business table method to write the business credential data back to the preset database, and the second write-back method is to execute a summary branch and combine the merge i nto business table method to write the business credential data back to the preset database.
[0127] In this embodiment, if the target configuration table is the second configuration table, the second configuration table also includes a to-be-written-back field, and there is a corresponding relationship between the to-be-written-back field and the business scenario label. The first write-back method is to read the to-be-written-back field corresponding to the business scenario label of the business voucher in the target configuration table, and assemble the parameters corresponding to the detailed data, assemble the write-back and execute SQL, so as to write back the data corresponding to the to-be-written-back field in the business voucher data to the preset database. The second write-back method is to read the to-be-written-back field corresponding to the business scenario label of the business voucher in the target configuration table, and assemble the parameters corresponding to the summary data, assemble the write-back and execute SQL, so as to write back the data corresponding to the to-be-written-back field in the business voucher data to the preset database.
[0128] In this embodiment, if the target configuration table is the third configuration table, the third configuration table also includes a to-be-written-back field, and there is a corresponding relationship between the to-be-written-back field and the business scenario label. The first write-back method is to read the to-be-written-back field corresponding to the business scenario label of the business credential in the target configuration table, and write the data corresponding to the to-be-written-back field in the business credential data back to the preset database by assembling the parameters corresponding to the detailed data and sending an MQ message. The second write-back method is to read the to-be-written-back field corresponding to the business scenario label of the business credential in the target configuration table, and write the data corresponding to the to-be-written-back field in the business credential data back to the preset database by assembling the parameters corresponding to the summary data and sending an MQ message.
[0129] It should be noted that the preset databases corresponding to different configuration tables for writing back may be different. For example, the preset database corresponding to the first configuration table may be database A, the preset database corresponding to the second configuration table may be database B, and the preset database corresponding to the third configuration table may be database C.
[0130] By further dividing the detailed data and summary data into different write-back methods and setting more targeted write-back methods, the efficiency of write-back can be improved.
[0131] See also Figure 7 In some embodiments, step S105 in the service data write-back method further includes but is not limited to steps S701 to S702:
[0132] Step S701: if writing the business data back to the preset database fails, re-execute the step of writing the business data back to the preset database based on the target data write-back strategy.
[0133] Step S702: If the number of times of repeatedly executing the step of writing the business data back to the preset database based on the target data write-back strategy reaches a preset number, the business data is rewritten back.
[0134] In step S701 of some embodiments, when writing back the business data based on the first write-back method / the second write-back method fails, the business data is written back again based on the first write-back method / the second write-back method.
[0135] In step S702 of some embodiments, if the number of repetitions of the write-back reaches a preset number, the business data is rewritten back. For example, the preset number is 3, when the business data is written back based on the first write-back method, if the write-back fails, the business data is rewritten back based on the first write-back method, and if the write-back fails after three repetitions, the business data is rewritten back.
[0136] The specific steps of the make-up write-back are as follows: if the write-back still fails after repeated write-back for the preset number of times, the relevant parameters of this write-back will be directly sent to the log table. The log table records the relevant parameters, which may include business data, write-back failure data, etc. You can check the data recorded in the log table and make-up write-back for the business data.
[0137] In order to ensure the successful write-back of business data, when the target data write-back strategy fails to write back the business data, a supplementary write-back method is used to ensure the successful write-back of business data to ensure the success rate. In addition, the failed write-back data is recorded in the log to facilitate the follow-up of the failed write-back problem.
[0138] The embodiment of the present application determines the corresponding target data write-back strategy through the business attributes of the business data to be written back, so that different target data write-back strategies can be adopted for business data with different business attributes, which can achieve more targeted write-back of business data to improve the effectiveness of write-back. In addition, multiple configuration tables are pre-set for different business attributes, and corresponding data write-back strategies are set for different business scenarios in each configuration table. The corresponding data write-back strategy can be effectively and quickly determined based on the business scenario label of the business credential. And by matching with multiple configuration tables in sequence, the configuration table corresponding to the first successful match is determined as the target configuration table, and a unique target configuration table can be obtained, avoiding matching multiple configuration tables and causing repeated write-back of business data, which wastes resources and storage space.
[0139] See also Figure 8 The embodiment of the present application also provides a business data write-back device, which can implement the above-mentioned business data write-back method, and the device includes:
[0140] Certificate making module 801: used to make certificates for business data and obtain business vouchers.
[0141] The tag acquisition module 802 is used to acquire the business scenario tag of the business voucher, where the business scenario tag is used to characterize the business scenario corresponding to the business voucher.
[0142] Attribute determination module 803: used to determine the business attributes of the business data based on the business scenario label, wherein the business attributes are used to characterize the source and / or dimension of the business data.
[0143] The write-back policy acquisition module 804 is used to acquire a target data write-back policy preset for the business attributes of the business data.
[0144] The write-back module 805 is used to write the business data back to a preset database based on the target data write-back strategy.
[0145] The specific implementation of the business data write-back device is basically the same as the specific implementation of the above-mentioned business data write-back method, and will not be repeated here.
[0146] The embodiment of the present application also provides a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned business data write-back method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0147] See also Fig. 9 , Fig. 9 The hardware structure of a computer device according to another embodiment is shown, and the computer device includes:
[0148] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0149] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the business data write-back method of the embodiment of this application;
[0150] Input / output interface 903, used to implement information input and output;
[0151] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.);
[0152] A bus 905 that transmits information between the various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0153] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0154] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned business data write-back method is implemented.
[0155] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0156] An embodiment of the present application also provides a computer program product, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned business data write-back method is implemented.
[0157] The business data write-back method, business data write-back device, computer equipment, storage medium and computer program product provided in the embodiments of the present application obtain the business scenario label of the business credential, determine the business attributes of the business data based on the business scenario label, obtain the target data write-back policy pre-set for the business attributes of the business data, and write the business data back to a preset database based on the target data write-back policy, so that different target data write-back policies can be adopted for business data with different business attributes, so as to achieve more targeted write-back of business data and improve the effectiveness of write-back.
[0158] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0159] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0160] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0161] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0162] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0163] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0164] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0165] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0166] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0167] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0168] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for writing back business data, characterized in that: include: Process the business data to obtain business vouchers; Obtaining a business scenario tag of the business voucher, where the business scenario tag is used to characterize the business scenario corresponding to the business voucher; Determining a business attribute of the business data based on the business scenario tag, wherein the business attribute is used to characterize a source and / or dimension of the business data; Acquire a target data write-back policy pre-set for the business attributes of the business data; Based on the target data write-back strategy, the business data is written back to a preset database.
2. The method according to claim 1, characterized in that The obtaining of a target data write-back strategy preset for a business attribute of the business data includes: Acquire a plurality of configuration tables pre-set for different business attributes, each of which is configured with a correspondence between different business scenario tags and data write-back strategies; Matching the business scenario tags of the business voucher with the business scenario tags of the multiple configuration tables respectively, and determining a target configuration table that successfully matches the business scenario tags of the business voucher; A target data write-back strategy corresponding to the business scenario tag of the business voucher is determined in the target configuration table.
3. The method according to claim 2, characterized in that The matching of the business scenario tags of the business voucher with the business scenario tags of the multiple configuration tables respectively to determine the target configuration table that successfully matches the business scenario tags of the business voucher includes: Obtaining a preset matching order of the multiple configuration tables; Matching the business scenario tags of the business voucher with the business scenario tags in the multiple configuration tables in sequence according to the preset matching order; When the business scenario tag of the business voucher successfully matches with the business scenario tags in the multiple configuration tables for the first time, the configuration table corresponding to the first successful match is determined as the target configuration table.
4. The method according to claim 3, characterized in that The multiple configuration tables include a first configuration table, a second configuration table, and a third configuration table which are sequentially arranged. The business scenario tag included in the first configuration table is a first business scenario tag, which is used to characterize the business scenario corresponding to the business data only from the preset database; the business scenario tag included in the second configuration table is a second business scenario tag, which is used to characterize the business scenario corresponding to the multi-dimensional business data; the business scenario tag included in the third configuration table is a third business scenario tag, which is used to characterize the business scenario corresponding to the business data from a database other than the preset database; The matching the business scenario tags of the business voucher with the business scenario tags in the multiple configuration tables in sequence includes: Matching the business scenario tag of the business voucher with the first business scenario tag in the first configuration table; if the first business scenario tag that successfully matches the business scenario tag of the business voucher exists in the first configuration table, then the business scenario tag of the business voucher successfully matches the first business scenario tag in the first configuration table; If there is no first business scenario tag in the first configuration table that successfully matches the business scenario tag of the business voucher, then the business scenario tag of the business voucher is matched with the second business scenario tag in the second configuration table; if there is a second business scenario tag in the second configuration table that successfully matches the business scenario tag of the business voucher, then the business scenario tag of the business voucher is successfully matched with the second business scenario tag in the second configuration table; If there is no second business scenario tag in the second configuration table that successfully matches the business scenario tag of the business voucher, the business scenario tag of the business voucher successfully matches the third business scenario tag in the third configuration table.
5. The method according to claim 3, characterized in that: The matching the business scenario tags of the business voucher with the business scenario tags in the multiple configuration tables in sequence includes: When the business scenario tag of the business voucher successfully matches the business scenario tag in the matched configuration table, obtaining a write-back status tag of the matched configuration table, wherein the matched configuration table is any one of the multiple configuration tables; If the write-back status tag indicates that the write-back status of the matched configuration table is on, determining that the business scenario tag of the business voucher and the business scenario tags in the multiple configuration tables are successfully matched for the first time; If the write-back status tag indicates that the write-back status of the matched configuration table is closed, the business scenario tag of the business voucher continues to be matched with the business scenario tag in a configuration table subsequent to the matched configuration table.
6. The method according to claim 2, characterized in that The step of writing back the business data to a preset database based on the target data write-back strategy includes: Determine the data type of the business data, the data type including detailed data or summary data; Obtaining a target write-back method for performing write-back processing on the data type in the target data write-back strategy; The business data is written back to a preset database using the target write-back method.
7. The method according to claim 1, characterized in that The method further comprises: If writing the business data back to the preset database fails, re-execute the step of writing the business data back to the preset database based on the target data write-back strategy; If the number of times the step of writing the business data back to the preset database based on the target data write-back strategy is repeated reaches a preset number of times, the business data is rewritten back.
8. A computer device, characterized in that: The computer device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the business data write-back method as described in any one of claims 1-7 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the business data write-back method according to any one of claims 1 to 7 is implemented.
10. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of a computer device, the electronic device executes the business data write-back method as described in any one of claims 1 to 7.