Data storage method and device, electronic equipment and computer program product

By determining the processing unit according to the customer-compiled fields in the bank transaction processing environment and storing the processing data, the problem of database storage pressure and data processing difficulty increased by the data synchronization mechanism is solved, and efficient data storage and query are achieved.

CN119829578APending Publication Date: 2025-04-15INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411887859.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the bank transaction processing environment, the data synchronization mechanism increases the storage pressure of databases, and in specific scenarios (such as anti-transaction scenarios), it is impossible to conduct reverse link queries based on the data stored in an independent database, which increases the difficulty of data processing.

Method used

By determining the target processing unit according to the guest field carried by the current transaction request and determining the actual processing unit from the processing data, when the actual and target processing units are inconsistent, the processing data is stored to the target data source corresponding to the target processing unit.

Benefits of technology

This solution does not require an independent database, which alleviates the pressure of database storage and provides a clear and verifiable data link, which facilitates accurate and rapid restoration of transaction data in specific transaction scenarios, reducing the difficulty of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829578A_ABST
    Figure CN119829578A_ABST
Patent Text Reader

Abstract

The invention discloses a data storage method and device, electronic equipment and a computer program product, and relates to the distributed technology, and the method comprises the steps: determining a target processing unit according to a customer compiled field carried by a current transaction request; receiving processing data obtained after processing the current transaction request, and determining an actual processing unit according to the processing data; and when the actual processing unit is inconsistent with the target processing unit, storing the processing data to a target data source corresponding to the target processing unit. By storing the processing data to the target data source corresponding to the target processing unit, an independent database does not need to be established, and the storage pressure of the database can be relieved; and meanwhile, the transaction data generated by the current transaction request can be queried in the target data source only by calculating the target processing unit through the customer compiled field, so that a data query basis is provided for a specific transaction scene, the transaction data can be conveniently, accurately and quickly restored, and the data processing difficulty in the specific transaction scene is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of distributed technology, and in particular to a data storage method, device, electronic device and computer program product. Background Art

[0002] In the transaction processing environment of the banking sector, with the continuous innovation and expansion of financial services, transaction types are becoming increasingly diverse and the scale of business is growing continuously. In order to cope with the efficient processing and storage of massive transaction data, distributed architecture has become the mainstream choice for building banking transaction systems.

[0003] In one scenario, there may be an abnormality in a processing node. In order not to affect the user's trading experience, one solution is to send the transaction requests that cannot be processed by the abnormal node to the reserved public node for processing. However, in order to ensure the closed loop of transaction data and the availability of transaction data, the processing results of the public node are generally synchronized to an independent database through a data synchronization mechanism to solve the problem of the closed loop of transaction data.

[0004] The above data synchronization mechanism not only increases the storage pressure of the database, but also in certain scenarios (such as anti-transaction scenarios), it is impossible to perform reverse link queries based on the data stored in the independent database, which increases the difficulty of data processing. Summary of the invention

[0005] The present application provides a data storage method, device, electronic device and computer program product, which can reduce the difficulty of data processing in specific transaction scenarios and alleviate database storage pressure.

[0006] In a first aspect, the present application provides a data storage method, comprising:

[0007] Determine the target processing unit according to the customer code field carried in the current transaction request;

[0008] receiving processing data obtained after processing the current transaction request, and determining an actual processing unit according to the processing data;

[0009] When the actual processing unit and the target processing unit are inconsistent, the processing data is stored in a target data source corresponding to the target processing unit.

[0010] In a second aspect, the present application provides a data storage device, the device comprising:

[0011] A unit determination module, used to determine a target processing unit according to a customer code field carried in the current transaction request;

[0012] A data receiving module, used for receiving processing data obtained after processing the current transaction request, and determining an actual processing unit according to the processing data;

[0013] The data storage module is used to store the processing data in a target data source corresponding to the target processing unit when the actual processing unit and the target processing unit are inconsistent.

[0014] In a third aspect, the present application further provides an electronic device, the electronic device comprising:

[0015] at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data storage method described in any embodiment of the present application.

[0018] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data storage method described in any embodiment of the present application when executed.

[0019] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the data storage method described in any embodiment of the present application.

[0020] The data storage solution provided in the embodiment of the present application first determines the target processing unit corresponding to the current transaction request through the customer-edited field; then determines the actual processing unit from the processing data corresponding to the current transaction request; when the actual processing unit and the target processing unit are inconsistent, the processing data is stored in the target data source corresponding to the target processing unit; the solution provided in the present embodiment stores the processing data in the target data source corresponding to the target processing unit, without the need to establish an independent database, which helps to alleviate the database storage pressure; at the same time, a clear and traceable data link is provided, that is, only the target processing unit needs to be calculated through the customer-edited field, and the transaction data generated by the current transaction request can be queried in the target data source, which provides a data query basis for specific transaction scenarios, facilitates accurate and rapid restoration of transaction data, and reduces the difficulty of data processing in specific transaction scenarios.

[0021] It should be noted that the above computer instructions may be stored in whole or in part on a computer-readable storage medium, wherein the computer-readable storage medium may be packaged together with the processor of the data storage device, or may be packaged separately from the processor of the data storage device, which is not limited in this application.

[0022] The description of the second, third, fourth and fifth aspects of the present application can refer to the detailed description of the first aspect; and the beneficial effects of the description of the second, third, fourth and fifth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.

[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description.

[0024] It is understandable that before using the technical solutions disclosed in the embodiments of this application, the type, scope of use, and usage scenarios of the personal information involved in this application should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 This is a flow chart of a data storage method provided by an embodiment of the present application;

[0027] Figure 2 is another flow chart of the data storage method provided in an embodiment of the present application;

[0028] Figure 3 is a structural schematic diagram of a data storage device provided in an embodiment of the present application;

[0029] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the present application will be clearly and completely described below in conjunction with the drawings in the present embodiment. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims 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 variations thereof 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.

[0032] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.

[0033] Figure 1 A flow chart of a data storage method provided in an embodiment of the present application. This embodiment can be applied to storing transaction data in the banking field to facilitate data query. The method can be executed by a data storage device, which can be implemented in the form of hardware and / or software and integrated in an electronic device that executes the method. Preferably, the electronic device in the embodiment of the present application can be a server, or a computer device, etc.

[0034] refer to Figure 1 The data storage method of this embodiment includes but is not limited to the following steps:

[0035] S110. Determine a target processing unit according to the customer code field carried in the current transaction request.

[0036] The current transaction request refers to the request initiated by the user from the terminal. For example, in the electronic payment scenario, the user initiates a payment request for a certain business (such as daily bill payment), which contains key information related to the transaction, such as the transaction amount, transaction object, and transaction type.

[0037] Processing data refers to the data results generated after a series of operations are performed on the transaction request according to established rules, algorithms, business logic, etc. For example, in a payment transaction request, after the payment system calculates the payment amount, verifies the legitimacy of the payment account, checks the payment password, etc., the processing data obtained may include: whether the payment is successful, the transaction serial number, the actual deduction amount, and the account balance after the deduction, etc., which reflect the transaction processing status.

[0038] The customer code field is the customer number field, which is a code used to uniquely identify each customer. In the enterprise's customer relationship management system or transaction system, each customer is assigned a unique number. This number is like the customer's ID number in the system, through which the customer's identity can be quickly identified, and the customer's historical transaction records, credit status and other information can be queried. For example, in a bank system, the customer code field can be used to find a customer's account balance, loan record, etc.

[0039] The target processing unit refers to a functional module, server or software component in the entire transaction processing system that is responsible for processing a specific transaction request. The customer code field is uniformly sent when the product application is called, and the entire payment link is transparently transmitted throughout the entire process. The customer code field can be used to calculate the unit that processes the current transaction request. Specifically, a mapping relationship between the customer code field and the target processing unit can be pre-established in the system. This mapping relationship can be stored in a database table, a configuration file, or a data structure in memory (such as a hash table). For example, in a simple mapping relationship table, there may be two columns, one for the customer code field range (which can be a single customer code or a customer code interval), and the other for the corresponding target processing unit identifier. Assume that for customers whose customer code starts with C0, their transaction requests are all processed by the target processing unit PU1; for customers whose customer code starts with C1, their transaction requests are processed by the target processing unit PU2, etc.; and then the target processing unit that processes the current transaction request can be determined through the customer code field.

[0040] S120: Receive processing data obtained after processing the current transaction request, and determine an actual processing unit according to the processing data.

[0041] The method of receiving the processed data obtained after processing the current transaction request can be: based on a pre-set corresponding interface or data transmission channel to obtain the processed data generated after processing the transaction request. This interface can be built based on a network communication protocol and is used to receive data sent from a server, middleware or other processing module that processes the transaction request. For example, in a distributed e-commerce transaction system, after the order processing module completes the relevant operations on the transaction request, it sends the processed data to the next-level unit module that subsequently pays attention to this data through a message queue, and the receiver listens to the corresponding message queue according to the established configuration to obtain the processed data from it.

[0042] The reason for determining the actual processing unit according to the processing data in this embodiment is that the transaction is completed in the whole link in different partition units under the unitized architecture, and the partition units have the ability to take over each other. Exemplarily, the partition units include park A and park B, where park A includes unit 1 and unit 2; park B includes unit 3 and unit 4; to avoid failure in the same park, the business processing cannot be carried out. Here, unit 1 and unit 3 are set to take over, and unit 2 and unit 4 are set to take over. When a partition takeover occurs, it will be called an unknown transaction because the system cannot determine the final state of a transaction. For example, when unit 1 fails and the business request is taken over by unit 3, some transactions may have been started in a certain link of unit 1, but all operations have not been completed. The detailed processing progress and status of these transactions are unclear to the unit 3 that takes over, so they are called unknown transactions; and from the beginning to the end of a transaction, it will go through multiple links. When all links are successfully completed, the transaction is considered closed. In the case of partition takeover, due to the failure of a certain unit, some transactions may be forced to interrupt before all business links are completed in the original unit. After these transactions are taken over, if they are not specially processed, they will be in an unclosed loop state. For example, a bank transfer transaction needs to go through multiple steps such as account verification, fund freezing, transfer operation, and fund unfreezing. If the original unit fails after the funds are frozen, the transaction does not complete the complete transfer process, and it is an unclosed-loop transaction for the system. In an application scenario, the original transaction needs to be reversed, which is called a reverse transaction. For example, in a banking system, the reverse transaction of a deposit transaction is a withdrawal transaction, and its amount should be the same as the original deposit amount; the reverse transaction of a transfer transaction may be to transfer the transfer amount back to the original account. When the reverse transaction has a dependent demand on the original transaction, it means that the execution of the reverse transaction needs to refer to the specific information of the original transaction, such as transaction status, transaction amount, transaction time and other details.

[0043] In the partition takeover scenario under the unitized architecture, although the unknown transactions can be synchronized to the independent database through the data synchronization mechanism to solve the unclosed transactions during the takeover, this synchronization method may not completely retain all the original transaction dependency information required for the reverse transaction. When the partition unit fails and takes over, the data synchronization process may not be able to synchronize all the details of the original transaction to the takeover unit in real time and accurately. For example, the original transaction may be updating some status information at the moment of failure, and this information is lost or inconsistent when it is synchronized to the independent database of the takeover unit. For the reverse transaction that relies on this information, it is impossible to accurately obtain the required data to perform the reverse operation. Due to the change in the business processing environment caused by the partition takeover, the logical coherence between the original transaction and the reverse transaction is broken. Assuming that the original transaction performs a part of the operation on a specific application node in unit 1, this part of the operation may affect the local state of the application node (such as cache information, temporary data, etc.), and this local state information may not be correctly restored in unit 3 (takeover unit) after the partition takeover. Therefore, when the reverse transaction needs to rely on these damaged system logic and state information, it cannot be performed.

[0044] Based on the above problems, after receiving the processing data obtained after processing the current transaction request, the application needs to further determine the actual processing unit based on the processing data. Among them, the actual processing unit is a module, component or part of the system that is responsible for specifically executing transaction-related operation tasks. The reason for determining the actual processing unit is that it is necessary to clarify whether the unit that processes the current transaction request is the target unit or the takeover unit, or whether the transaction request is mistakenly sent to other units that do not process the current business due to link errors, etc.

[0045] S130: When the actual processing unit and the target processing unit are inconsistent, the processed data is stored in a target data source corresponding to the target processing unit.

[0046] When the actual processing unit is determined to be PU1 in step S110, and the target processing unit is determined to be PU2 in step S120, it indicates that the current transaction request is taken over, that is, the current business request may not be processed due to PU2 abnormalities and other reasons, and PU1 has taken over the processing. Therefore, in the current scenario, the processing data is stored in the target data source corresponding to PU2. The advantage of such storage is that it provides a clear and traceable data link, that is, only by calculating the target processing unit through the customer edit field, the transaction data generated by the current transaction request can be queried in the target data source, which provides a data query basis for specific transaction scenarios, facilitates accurate and rapid restoration of transaction data, and reduces the difficulty of data processing in specific transaction scenarios.

[0047] Specifically, when applied to anti-transaction scenario queries, since the processed data will be stored in the target data source corresponding to the target processing unit according to the established rules, in the anti-transaction scenario, relevant personnel can obtain a complete data set containing key information of all aspects of the transaction from the target data source, without data missing or gaps. For example, for a payment transaction that needs to be revoked, not only basic information such as the payment amount and payment time can be found from the target data source, but also the verification information, risk assessment results and other processing data involved in the actual processing unit when processing the payment. These complete data can ensure that the anti-transaction operations (such as accurate refunds, restoration of related account status, etc.) can be executed smoothly and correctly, avoiding operational errors or inability to process due to incomplete data.

[0048] The data storage technical method provided by the present embodiment first determines the target processing unit corresponding to the current transaction request through the customer-edited field; then determines the actual processing unit from the processing data corresponding to the current transaction request; when the actual processing unit and the target processing unit are inconsistent, the processing data is stored in the target data source corresponding to the target processing unit; the solution provided by the present embodiment stores the processing data in the target data source corresponding to the target processing unit, without the need to establish an independent database, which helps to alleviate the database storage pressure; at the same time, it provides a clear and traceable data link, that is, only the target processing unit needs to be calculated through the customer-edited field, and the transaction data generated by the current transaction request can be queried in the target data source, which provides a data query basis for specific transaction scenarios, facilitates accurate and rapid restoration of transaction data, and reduces the difficulty of data processing in specific transaction scenarios.

[0049] Figure 2 It is another flow chart of the data storage method provided in an embodiment of the present application. The embodiment of the present application is optimized on the basis of the above-mentioned embodiments, and is specifically optimized as a detailed explanation of the implementation process of "determining the target processing unit according to the customer-coded field carried by the current transaction request".

[0050] See also Figure 2 The data storage method of this embodiment includes but is not limited to the following steps:

[0051] S210: Obtain the customer code field carried in the current transaction request.

[0052] Generally, transaction requests can be transmitted in a variety of data formats, such as extensible markup language, key-value pairs, or a custom binary format, etc. The specific data transmission format used is not limited here.

[0053] In a preferred implementation, the solution provided in this embodiment obtains the customer code field carried by the current transaction request, including: obtaining the message format corresponding to the current transaction request; and determining the customer code field according to a preset identifier in the message format. This method of determining the customer code field helps to accurately obtain the content of the customer code field, avoiding misjudgment or extraction errors that may occur due to complex data structures and numerous fields.

[0054] Since the corresponding message formats are different when using different data formats, this embodiment sets a preset identifier corresponding to the customer-edited field during the corresponding message transmission, thereby obtaining the customer-edited field according to the content stored in the preset identifier, so as to achieve the purpose of quickly locating the customer-edited field.

[0055] S211. Determine a target hash value corresponding to the customer edit field based on a hash function.

[0056] Set the hash function value space to [0, 2 63 -1], using the total of the corresponding customer code field as the key value, calculate the hash value of the customer code field of the route through the hash function, and then divide it by (the maximum hash value + 1) (i.e. 2 63 ), you can get a numerical value, which is the target hash value corresponding to the customer edit field.

[0057] S212: Obtain the hash interval value corresponding to each partition unit, and determine the target interval value from each hash interval value according to the target hash value.

[0058] Taking the example that the partition units include four units 1 to 4, the hash interval values ​​corresponding to units 1 to 4 can be determined in advance, such as the hash interval value of unit 1 is [1,32], the hash interval value of unit 2 is [33,64], the hash interval value of unit 3 is [65,96], the hash interval value of unit 4 is [97,128], etc.

[0059] The target interval value is then determined by the target hash value. Taking the value 22 obtained by calculating the target hash value as an example, the corresponding target interval value is [1,32].

[0060] S213: Determine the partition unit corresponding to the target interval value as the target processing unit.

[0061] Accordingly, it can be determined that the unit 1 corresponding to [1,32] is the target processing unit required to process the current transaction request.

[0062] The solution provided in this embodiment converts the customer code field into a target hash value through a hash function, and then determines the target processing unit based on the hash interval value corresponding to each partition unit. This method can distribute the transaction requests of different customers relatively evenly to each partition unit, ensuring that each partition unit undertakes a relatively balanced processing task, thereby improving the efficiency of the entire system in processing transaction requests and making full use of system resources.

[0063] S220: Determine the unit status of the target processing unit.

[0064] Due to the complexity of the network status, there may be abnormal unit status of the target processing unit. Therefore, in order to ensure service efficiency, it is necessary to determine the unit status of the target processing unit to ensure that the current transaction request is sent to the target processing unit for processing when the unit status of the target processing unit is normal.

[0065] A preferred embodiment, in this embodiment, the target processing unit includes multiple processing nodes; then, the unit state of the target processing unit can be determined in the following manner: sending a node signal to each processing node respectively, and determining the node state according to the node information fed back by each processing node based on the node signal; when the number of nodes in a normal state is lower than a preset threshold, determining the unit state of the target processing unit is an abnormal state; when the number of nodes in a normal state is not lower than a preset threshold, determining the unit state of the target processing unit is a normal state. The advantage of doing this is that by actively sending signals to each processing node and obtaining feedback to judge the state, it is possible to understand the operation status of each processing node and the target processing unit as a whole in real time and periodically, and timely discover possible faults, performance degradation and other problems.

[0066] The node signal sent to each processing node may be periodically sent to each processing node; the node information fed back by the processing node based on the node signal may be a heartbeat signal fed back by each processing node based on the received heartbeat information, and the node state of the current processing node is determined to be a normal state or an abnormal state by determining the duration of the heartbeat signal fed back by each processing node. For example, if the heartbeat signal of a node is not received for 15 consecutive seconds, the node is marked as an abnormal state.

[0067] Further, when the number of nodes in the normal state is lower than a preset threshold, the unit state of the target processing unit is determined to be an abnormal state. The current preset threshold may be 3, so that when the number of nodes in the normal state in the target unit is less than 3, the unit state of the target processing unit is determined to be an abnormal state.

[0068] S221. When the unit state is abnormal, determine the takeover processing unit according to the hierarchical parameters, and send the current transaction request to the takeover processing unit.

[0069] Hierarchical parameters are parameters predefined in the system that have a takeover relationship between units. For example, in unit 1, the corresponding hierarchical parameters can be set as the corresponding parameters of unit 3, indicating that when unit 1 is abnormal, unit 3 is determined as the takeover processing unit to forward the request originally belonging to unit 1 to unit 3 for processing. The advantage of this is that the transaction request sent by the user can be processed in a timely manner without rigidly testing the user experience.

[0070] A preferred embodiment, the solution provided by this embodiment, after sending the current transaction request to the takeover processing unit, also includes: obtaining an initial field value corresponding to a preset message field according to the message format of the current transaction request, the initial field value being a target unit identifier corresponding to the target processing unit; after the takeover processing unit processes the current transaction request, updating the initial field value based on the takeover unit identifier corresponding to the takeover processing unit to obtain an updated field value.

[0071] The current preset message field is used to store the field value corresponding to the processing unit identifier. The initial field value is the field corresponding to the initial processing of the current transaction request, that is, the target unit identifier corresponding to the target processing unit. However, when the target processing exception cannot process the current transaction request, the current transaction request will be processed by the takeover processing unit, and then after the takeover processing unit processes it, the field value corresponding to the preset message field is updated to the takeover unit identifier corresponding to the takeover processing unit, so that the updated takeover unit identifier is used as the updated field value.

[0072] A special identification field is added to the relevant data structure of the request, for example, the preset message field is named "processing unit identification". When the request is initially created and pre-assigned to unit A, the field is marked as "A"; once unit A fails and is transferred to unit B for processing, unit B updates the identification field to "B" after processing. In this way, after obtaining the processing result, by checking the value of this identification field, it can be clearly determined which unit processed the request.

[0073] The solution provided in this embodiment can clearly show which processing units the transaction request has passed through in the entire processing flow by recording the change process of the identifier corresponding to the target processing unit from the initial value to the updated value, so as to clarify the flow of transaction requests between different processing units, and further help to determine the actual processing unit that processes the current transaction request in subsequent steps according to the field value corresponding to the preset message field carried in the processing data.

[0074] S230: Receive processing data obtained after processing the current transaction request, and determine an actual processing unit according to the processing data.

[0075] Based on the description of step S220 above, the method of determining the actual processing unit according to the processing data in the current step can be: obtaining an identification unit association table, in which the field identifier in the identification unit association table corresponds to a processing unit; determining the actual processing unit from the identification unit association table according to the updated field value corresponding to the preset message field. This scheme establishes a mapping association table by pre-field identification and processing unit to determine the actual processing unit, and accurately finds the corresponding processing unit according to the updated field value of the message field, ensuring the close connection and consistency between the data in the transaction request (reflected by the message field) and the unit that actually performs the processing task. Each transaction request can find the correct processing unit for processing according to the established mapping rules, avoiding the situation where the data is out of touch with the processing flow, and helping to ensure the stable operation of the entire transaction processing system and the accuracy of the data.

[0076] Then, when the processing data is received, the actual processing unit can be identified by simply obtaining the update field value corresponding to the preset message field in the processing data. In a special case, when no abnormality occurs in the target processing unit, the current transaction request is processed by the target processing unit, and accordingly, the update field value corresponding to the preset message field is the initial field value, and no update operation is required.

[0077] S240: Obtain an actual unit identifier corresponding to the actual processing unit.

[0078] If the system is attacked or other external factors occur, the actual processing unit may not necessarily be the target processing unit or the taken-over processing unit. Therefore, to ensure the authenticity and availability of the processed data, the purpose of obtaining the actual unit identifier in the current step is to verify the actual processing unit.

[0079] S241. Verify whether the actual unit ID is the takeover unit ID.

[0080] The takeover unit identifier is an identifier corresponding to the takeover processing unit.

[0081] If yes, execute step S250; if no, execute step S260.

[0082] S250: Store the processed data into a target data source corresponding to the target processing unit.

[0083] S260: Reject the current transaction request.

[0084] That is, the actual processing unit is the takeover processing unit of the target processing unit that has been approved in advance. In order to ensure the authenticity of the processing data, the current transaction request is rejected.

[0085] The data storage technical method provided by the present embodiment first determines the target processing unit corresponding to the current transaction request through the customer-edited field; then determines the actual processing unit from the processing data corresponding to the current transaction request; when the actual processing unit and the target processing unit are inconsistent, the processing data is stored in the target data source corresponding to the target processing unit; the solution provided by the present embodiment stores the processing data in the target data source corresponding to the target processing unit, without the need to establish an independent database, which helps to alleviate the database storage pressure; at the same time, it provides a clear and traceable data link, that is, only the target processing unit needs to be calculated through the customer-edited field, and the transaction data generated by the current transaction request can be queried in the target data source, which provides a data query basis for specific transaction scenarios, facilitates accurate and rapid restoration of transaction data, and reduces the difficulty of data processing in specific transaction scenarios.

[0086] Figure 3 is a schematic diagram of a structure of a data storage device provided in an embodiment of the present application, and the device is suitable for executing the data storage method provided in an embodiment of the present application. Figure 3 As shown, the device may specifically include: a unit determination module 310, a data receiving module 320 and a data storage module 330, wherein:

[0087] The unit determination module 310 is used to determine the target processing unit according to the customer code field carried in the current transaction request;

[0088] A data receiving module 320, configured to receive the processing data obtained after processing the current transaction request, and determine the actual processing unit according to the processing data;

[0089] The data storage module 330 is used to store the processing data in a target data source corresponding to the target processing unit when the actual processing unit and the target processing unit are inconsistent.

[0090] The data storage device provided in the embodiment of the present application first determines the target processing unit corresponding to the current transaction request through the customer-edited field; then determines the actual processing unit from the processing data corresponding to the current transaction request; when the actual processing unit and the target processing unit are inconsistent, the processing data is stored in the target data source corresponding to the target processing unit; the solution provided in the present embodiment stores the processing data in the target data source corresponding to the target processing unit, without the need to establish an independent database, which helps to alleviate the database storage pressure; at the same time, a clear and traceable data link is provided, that is, only the target processing unit needs to be calculated through the customer-edited field, and the transaction data generated by the current transaction request can be queried in the target data source, which provides a data query basis for specific transaction scenarios, facilitates accurate and rapid restoration of transaction data, and reduces the difficulty of data processing in specific transaction scenarios.

[0091] In one embodiment, the unit determination module 310 is specifically used to obtain the customer code field carried by the current transaction request; determine the target hash value corresponding to the customer code field based on a hash function; obtain the hash interval value corresponding to each partition unit, and determine the target interval value from each hash interval value according to the target hash value; and determine that the partition unit corresponding to the target interval value is the target processing unit.

[0092] In one embodiment, the unit determination module 310 is further configured to obtain a message format corresponding to the current transaction request; and determine the customer code field according to a preset identifier in the message format.

[0093] In one embodiment, the device further includes a state determination module and a request sending module, wherein:

[0094] A state determination module, used to determine the unit state of the target processing unit;

[0095] The request sending module is used to determine the takeover processing unit according to the hierarchical parameters when the unit state is an abnormal state, and send the current transaction request to the takeover processing unit.

[0096] In one embodiment, the device further includes an identification acquisition module and an identification verification module, wherein:

[0097] An identification acquisition module, used to acquire an actual unit identification corresponding to the actual processing unit;

[0098] An identification verification module is used to verify whether the actual unit identification is a takeover unit identification, and the takeover unit identification is an identification corresponding to the takeover processing unit; if so, an operation of storing the processed data to a target data source corresponding to the target processing unit is performed; if not, the current transaction request is rejected.

[0099] In one embodiment, the target processing unit includes a plurality of processing nodes;

[0100] The state determination module is specifically used to send a node signal to each of the processing nodes respectively, and determine the node state according to the node information fed back by each of the processing nodes based on the node signal; when the number of nodes in the normal state is lower than a preset threshold, determine that the unit state of the target processing unit is an abnormal state; when the number of nodes in the normal state is not lower than a preset threshold, determine that the unit state of the target processing unit is a normal state.

[0101] In one embodiment, the device further comprises: a field determination module and a field update module, wherein:

[0102] A field determination module, configured to obtain an initial field value corresponding to a preset message field according to a message format of the current transaction request, wherein the initial field value is a target unit identifier corresponding to the target processing unit;

[0103] A field updating module, configured to update the initial field value based on the takeover unit identifier corresponding to the takeover processing unit to obtain an updated field value after the takeover processing unit processes the current transaction request;

[0104] The data receiving module includes an acquisition unit and a processing unit, wherein:

[0105] An acquisition unit, used to acquire an identification unit association table, wherein a field identifier in the identification unit association table corresponds to a processing unit;

[0106] A processing unit is used to determine the actual processing unit from the identification unit association table according to the update field value corresponding to the preset message field.

[0107] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0108] An embodiment of the present application also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data storage method described in any embodiment of the present application.

[0109] An embodiment of the present application further provides a computer-readable medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data storage method described in any embodiment of the present application when executed.

[0110] Reference below Figure 4 , Figure 4 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and shows a schematic diagram of the structure of a computer system 500 suitable for implementing the electronic device in an embodiment of the present application. Figure 4 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0111] like Figure 4 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0112] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0113] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present application are executed.

[0114] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, etc., or any suitable combination of the above.

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

[0116] The modules and / or units involved in the embodiments described in the present application may be implemented by software or hardware. The modules and / or units described may also be set in a processor, for example, it may be described as: a processor includes a data receiving module, a unit determination module, and a data storage module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0117] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: determining a target processing unit according to the customer code field carried by the current transaction request; receiving processing data obtained after processing the current transaction request, and determining an actual processing unit according to the processing data; when the actual processing unit and the target processing unit are inconsistent, storing the processing data in the target data source corresponding to the target processing unit.

[0118] According to the technical solution of this embodiment, by storing the processed data in the target data source corresponding to the target processing unit, there is no need to establish an independent database, which helps to alleviate the database storage pressure; at the same time, a clear and traceable data link is provided, that is, only by calculating the target processing unit through the customer-edited field, the transaction data generated by the current transaction request can be queried in the target data source, which provides a data query basis for specific transaction scenarios, facilitates accurate and rapid restoration of transaction data, and reduces the difficulty of data processing in specific transaction scenarios.

[0119] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A data storage method, characterized in that: include: Determine the target processing unit according to the customer code field carried in the current transaction request; receiving processing data obtained after processing the current transaction request, and determining an actual processing unit according to the processing data; When the actual processing unit and the target processing unit are inconsistent, the processing data is stored in a target data source corresponding to the target processing unit.

2. The data storage method according to claim 1, characterized in that: The step of determining the target processing unit according to the customer code field carried in the current transaction request includes: Obtain the customer code field carried by the current transaction request; Determine a target hash value corresponding to the customer edit field based on a hash function; Obtaining a hash interval value corresponding to each partition unit, and determining a target interval value from each of the hash interval values ​​according to the target hash value; A partition unit corresponding to the target interval value is determined as the target processing unit.

3. The data storage method according to claim 2, characterized in that: The step of obtaining the customer code field carried by the current transaction request includes: Obtaining the message format corresponding to the current transaction request; The customer code field is determined according to a preset identifier in the message format.

4. The data storage method according to claim 1, characterized in that: After determining the target processing unit according to the customer code field carried in the current transaction request, the following steps are also included: determining a unit state of the target processing unit; When the unit state is an abnormal state, a takeover processing unit is determined according to the hierarchical parameters, and the current transaction request is sent to the takeover processing unit.

5. The data storage method according to claim 4, characterized in that: After determining the actual processing unit according to the processing data, the method further includes: Obtaining an actual unit identifier corresponding to the actual processing unit; Verify whether the actual unit identifier is a takeover unit identifier, where the takeover unit identifier is an identifier corresponding to the takeover processing unit; If yes, then executing the operation of storing the processed data to the target data source corresponding to the target processing unit; If not, the current transaction request is rejected.

6. The data storage method according to claim 4, characterized in that: The target processing unit includes a plurality of processing nodes; The determining the unit state of the target processing unit includes: Sending a node signal to each of the processing nodes respectively, and determining a node state according to node information fed back by each of the processing nodes based on the node signal respectively; When the number of nodes whose node status is in a normal state is lower than a preset threshold, determining that the unit status of the target processing unit is in an abnormal state; When the number of nodes whose node status is in the normal state is not less than a preset threshold, it is determined that the unit status of the target processing unit is in the normal state.

7. The data storage method according to claim 4, characterized in that: After sending the current transaction request to the takeover processing unit, the method further includes: Acquire an initial field value corresponding to a preset message field according to the message format of the current transaction request, wherein the initial field value is a target unit identifier corresponding to the target processing unit; After the takeover processing unit processes the current transaction request, the initial field value is updated based on the takeover unit identifier corresponding to the takeover processing unit to obtain an updated field value; Accordingly, determining the actual processing unit according to the processing data includes: Obtain an identification unit association table, wherein a field identifier in the identification unit association table corresponds to a processing unit; The actual processing unit is determined from the identification unit association table according to the update field value corresponding to the preset message field.

8. A data storage device, characterized in that: include: A unit determination module, used to determine a target processing unit according to a customer code field carried in the current transaction request; A data receiving module, used for receiving processing data obtained after processing the current transaction request, and determining an actual processing unit according to the processing data; The data storage module is used to store the processing data in a target data source corresponding to the target processing unit when the actual processing unit and the target processing unit are inconsistent.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the data storage method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the data storage method according to any one of claims 1 to 7.