Transaction data processing method and device

By using index identifiers in real-time transactions to determine whether the data has been stored and the server processes the data insertion, the problem of extended waiting time caused by database failures is solved, and rapid processing and cost savings are achieved in the event of transaction database failures.

CN119149554APending Publication Date: 2024-12-17ZIHEXIN NETWORK PAYMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411107323.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In real-time transactions, database failure or network failure causes data to wait for too long when inserted into the database, affecting the transaction time. The existing technology solves problems of time loss and overhead by adding multi-point link jumps.

Method used

By obtaining transaction data in real time and marking its corresponding index identifier, comparing the index identifier to determine whether the data has been stored in the database. If it has not been stored in the database, the server will insert the data according to the index identifier to avoid the extension of the response time caused by database failure and to trade in Save troubleshooting time and overhead when a database fails.

Benefits of technology

It realizes that when the transaction database fails, it does not affect real-time insertion data processing, saves fault repair time and overhead, and improves the efficiency and cost-effectiveness of transaction data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149554A_ABST
    Figure CN119149554A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data transaction, and discloses a transaction data processing method and a transaction data processing device. A first index identifier is generated based on the transaction record frequency of the current transaction of a user and the preset data length of target transaction data; the second index identifier is generated based on the total number of transaction records of all the stored transaction data and the preset data length of the target transaction data, so that the mobile terminal judges whether the target transaction data is stored in the transaction database or not by matching the first index identifier with the second index identifier in real time; according to the technical scheme, even if the transaction database fails, real-time insertion of the target transaction data is not affected, and in addition, when a certain link of the transaction database fails, the fault repair time of the transaction database and the repair time and overhead cost of automatic jumping to a normal link are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transaction, and in particular to a transaction data processing method and device. Background Art

[0002] In real-time transactions, saving transaction data to the database is a necessary process. Currently, due to the huge volume of real-time transactions, the requirements for transaction time are also very high, and the transaction time is compressed to milliseconds. This requires that in real-time transactions, each link must be processed quickly, among which data storage is the top priority. When the client inserts transaction data into the database in real time, it needs to wait for the database to return a response message. However, in actual application, database failures or network failures between the database system and the transaction system may occur. Due to the failure, data insertion into the database is blocked. Since real-time transactions have to wait for the return of data storage, the waiting time will be extended, causing the transaction time to exceed expectations.

[0003] In the related technology, the database failure problem is improved by adding multi-point links to the database. When a link in the database fails, it will automatically jump to the normal link to receive the storage request. However, this method still causes time loss and high overhead, which is not conducive to saving time costs. Summary of the invention

[0004] In view of this, the present invention provides a transaction data processing method and device to solve the problems of high time cost and high overhead.

[0005] According to a first aspect, an embodiment of the present disclosure provides a transaction data processing method for a mobile terminal, the method comprising:

[0006] Obtain the target transaction data generated by the user's current transaction in real time;

[0007] Marking the first index identifier corresponding to the target transaction data;

[0008] Acquire a second index identifier corresponding to all stored transaction data from the transaction database;

[0009] If the first index identifier is greater than the second index identifier, the target transaction data is sent to the server so that the server inserts the target transaction data into a corresponding position in the transaction database according to the first index identifier.

[0010] By executing the above implementation, by comparing the first index identifier and the second index identifier, it is determined whether the target transaction data has been stored in the transaction database. Even if a failure occurs in the transaction database, it will not affect the real-time insertion of the target transaction data. In addition, when a link in the transaction database fails, the transaction database failure repair time and the repair time and overhead cost of automatically jumping to the normal link are saved.

[0011] In an optional implementation, marking the first index identifier corresponding to the target transaction data includes:

[0012] Get the transaction record number of the user's current transaction;

[0013] According to the number of transaction records and the preset data length of the user's current transaction, a first index identifier corresponding to the target transaction data is marked in the target index data packet.

[0014] By executing the above implementation, the position of the target transaction data in the data structure can be marked.

[0015] In an optional implementation manner, the transaction data processing method in the embodiment of the present disclosure further includes:

[0016] Waiting to receive the processing result of the server inserting the target transaction data into the corresponding position of the transaction database according to the first index identifier.

[0017] By executing the above implementation, the processing result returned by the receiving server is waited for and does not need to be returned through the database, thereby avoiding the increase of response time due to database failure and affecting the processing of transaction data.

[0018] In an optional implementation manner, the transaction data processing method in the embodiment of the present disclosure further includes:

[0019] After receiving the processing result returned by the server indicating successful insertion of the target transaction data, the index identifier of the user's current transaction is updated in the transaction database according to the processing result;

[0020] Return to the step of obtaining the target transaction data generated by the user's current transaction in real time, and continue processing the target transaction data.

[0021] By executing the above implementation, the index identifier is modified in the transaction database accordingly, so that the user can query the second index identifier corresponding to all the transaction data stored in the database the next time the user conducts data transaction. After the mobile terminal updates the index identifier of the user's current transaction in the transaction database according to the processing result, it returns to the initial step, and can realize the processing of many batch transactions of the user.

[0022] In an optional implementation manner, the transaction data processing method in the embodiment of the present disclosure further includes:

[0023] If the first index identifier is the same as the second index identifier, it means that the target transaction data has not been generated currently.

[0024] By executing the above implementation, the mobile terminal is prompted to stop sending the target transaction data to the server.

[0025] In an optional implementation, obtaining the second index identifier corresponding to the stored transaction data from the transaction database includes:

[0026] Get the total number of transaction records of all transaction data stored in the database;

[0027] According to the total number of transaction records of all stored transaction data and the preset data length of the target transaction data generated by each transaction of the user, the second index identifier corresponding to the stored transaction data is obtained from the transaction database.

[0028] By executing the above implementation, the position information of the length of the data stored in the transaction database can be obtained.

[0029] In a second aspect, the present invention provides a transaction data processing device, the device comprising:

[0030] The transaction data acquisition module is used to obtain the target transaction data generated by the user's current transaction in real time;

[0031] A first index marking module, used to mark a first index identifier corresponding to the target transaction data;

[0032] A second index acquisition module, used to acquire a second index identifier corresponding to the stored transaction data from the transaction database;

[0033] If the first index identifier is inconsistent with the second index identifier, the transaction data sending module sends the target transaction data to the server, so that the server inserts the target transaction data into the corresponding position of the transaction database according to the first index identifier.

[0034] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the transaction data processing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0035] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the transaction data processing method of the first aspect or any corresponding embodiment thereof.

[0036] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the transaction data processing method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 is a flow chart of a transaction data processing method according to an embodiment of the present invention;

[0039] Figure 2 is a flow chart of another transaction data processing method according to an embodiment of the present invention;

[0040] Figure 3 is a schematic diagram of marking a first index mark according to an embodiment of the present invention;

[0041] Figure 4 is a schematic diagram of a mobile terminal sending target transaction data according to an embodiment of the present invention;

[0042] Figure 5 is a schematic diagram of a mobile terminal sending target transaction data to a server according to an embodiment of the present invention;

[0043] Figure 6 is a structural block diagram of a transaction data processing device according to an embodiment of the present invention;

[0044] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0046] According to an embodiment of the present invention, an embodiment of a transaction data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0047] In this embodiment, a transaction data processing method is provided, which can be used in mobile terminals, such as mobile phones, tablet computers, etc. Figure 1is a flow chart of a transaction data processing method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0048] Step S101, obtaining the target transaction data generated by the user's current transaction in real time.

[0049] Specifically, the target transaction data is real-time data generated by users using mobile terminals during transactions, for example, target transaction data generated by users using mobile terminals for online shopping. The number of transactions of the target transaction data is large, and the transaction data needs to be acquired in real time each time, and the target transaction data acquired each time can be stored in a to-be-processed folder, and the processing process corresponding to the target transaction data generated by each transaction of the user is the same.

[0050] Step S102: Mark the first index identifier corresponding to the target transaction data.

[0051] Specifically, the first index identifier represents the location information corresponding to the target transaction data. The first index identifier can be used to quickly locate a specific data row without having to scan the entire to-be-processed folder to which the target transaction data belongs. Figure 4 shown.

[0052] In a specific example, step S102, marking the first index identifier corresponding to the target transaction data, includes:

[0053] Step a1, obtain the transaction record number of the user's current transaction.

[0054] Step a2: marking a first index identifier corresponding to the target transaction data in the target index data packet according to the number of transaction records of the user's current transaction and the preset data length.

[0055] Specifically, the first index identifier = preset data length × number of transaction records. The first index identifier is obtained in this way, and the corresponding first index identifier is marked in the target index data packet. The first index identifier represents the location information of the target transaction data in the target index data packet.

[0056] Step S103, obtaining the second index identifier corresponding to all the stored transaction data from the transaction database.

[0057] Specifically, the second index identifier represents the position information of the accumulated data length of all the stored transaction data in the transaction database.

[0058] In a specific example, obtaining a second index identifier corresponding to the stored transaction data from a transaction database includes:

[0059] Step b1, obtaining the total number of transaction records of all transaction data stored in the database.

[0060] Step b2, according to the total number of transaction records of all stored transaction data and the preset data length of the target transaction data generated by each transaction of the user, obtain the second index identifier corresponding to the stored transaction data from the transaction database.

[0061] Specifically, the second index identifier=preset data length×total number of transaction records. The second index identifier is obtained in this way, and the second index identifier represents the location information of the target transaction data in the transaction database.

[0062] Step S104: if the first index identifier is greater than the second index identifier, the target transaction data is sent to the server, so that the server inserts the target transaction data into the corresponding position of the transaction database according to the first index identifier.

[0063] like Figure 3 FIG. 1 is another flow chart of the transaction data processing method in an embodiment of the present invention.

[0064] Specifically, the server in the embodiment of the present disclosure includes a main server and a backup server, so the target transaction data is sent to the main server and the backup server at the same time. Figure 5 shown.

[0065] Since the first index identifier is generated based on the number of transaction records of the user's current transaction and the preset data length of the target transaction data, and the second index identifier is generated based on the total number of transaction records of all transaction data that have been stored in the database and the preset data length of the target transaction data, the mobile terminal determines whether the target transaction data has been stored in the transaction database by matching the first index identifier with the second index identifier in real time. Even if a failure occurs in the transaction database, it will not affect the real-time insertion of the target transaction data. In addition, when a link in the transaction database fails, the fault repair time of the transaction database and the repair time and overhead cost of automatically jumping to the normal link are saved.

[0066] In this embodiment, a transaction data processing method is provided, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. Figure 2 is a flow chart of a transaction data processing method according to an embodiment of the present invention. Figure 2 As shown, after the step S104, if the first index identifier is greater than the second index identifier, sending the target transaction data to the server so that the server inserts the target transaction data into the corresponding position of the transaction database according to the first index identifier, the step further includes:

[0067] Step S105, waiting to receive the processing result of the server inserting the target transaction data into the corresponding position of the transaction database according to the first index identifier;

[0068] Step S106, after receiving the processing result returned by the server indicating that the target transaction data has been successfully inserted, the index identifier of the user's current transaction is updated in the transaction database according to the processing result;

[0069] Step S107, returning to the step of obtaining the target transaction data generated by the user's current transaction in real time, and continuing to process the target transaction data.

[0070] Specifically, after the mobile terminal Client sends the target transaction data through the above step S104, the server Server immediately receives the target transaction data and inserts the target transaction data into the transaction database according to the first index identifier. At the same time, the mobile terminal updates the index identifier of the user's current transaction in the transaction database. For example, if the stored target transaction data is successfully inserted into the transaction database, it is necessary to modify the index identifier in the transaction database accordingly so that the user can query the second index identifier corresponding to all stored transaction data next time when performing data transaction. After the mobile terminal updates the index identifier of the user's current transaction in the transaction database according to the processing result, it returns to the above step S101 to continue to process the target transaction data in real time. Therefore, the disclosed embodiment can realize the processing of many batch transactions of the user.

[0071] In an optional implementation, the method further includes: if the first index identifier is the same as the second index identifier, it indicates that the target transaction data is not currently generated. In this case, there is no need to send the target transaction data to the server.

[0072] In an optional implementation, the method further includes: if the first index identifier is smaller than the second index identifier, sending a fault alarm prompt message to the server to prompt the server to inform maintenance personnel to repair the transaction database.

[0073] In this embodiment, a transaction data processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0074] This embodiment provides a transaction data processing device, such as Figure 6 As shown, including:

[0075] The transaction data acquisition module 61 is used to acquire the target transaction data generated by the user's current transaction in real time;

[0076] A first index marking module 62, used to mark a first index identifier corresponding to the target transaction data;

[0077] A second index acquisition module 63, used to acquire a second index identifier corresponding to the stored transaction data from the transaction database;

[0078] The transaction data sending module 64 sends the target transaction data to the server if the first index identifier is inconsistent with the second index identifier, so that the server inserts the target transaction data into the corresponding position of the transaction database according to the first index identifier.

[0079] In an optional implementation, the first index marking module 62 includes:

[0080] The acquisition submodule is used to obtain the transaction record number of the user's current transaction;

[0081] The marking submodule is used to mark the first index identifier corresponding to the target transaction data in the target index data packet according to the number of transaction records of the user's current transaction and the preset data length.

[0082] In an optional implementation manner, the transaction data processing device further includes:

[0083] The data insertion module is used to wait for the receiving server to insert the target transaction data into the corresponding position of the transaction database according to the first index identifier.

[0084] In an optional implementation manner, the transaction data processing device further includes:

[0085] The index identifier updating module is used to update the index identifier of the user's current transaction in the transaction database according to the processing result after receiving the processing result returned by the server that the target transaction data is successfully inserted;

[0086] The transaction action return module is used to return the step of obtaining the target transaction data generated by the user's transaction in real time and continue to process the target transaction data.

[0087] In an optional implementation manner, the transaction data processing device further includes:

[0088] The transaction determination module is used to indicate that the target transaction data has not been generated currently if the first index identifier is the same as the second index identifier.

[0089] In an optional implementation, the second index acquisition module 63 includes:

[0090] The acquisition submodule is used to obtain the total number of transaction records of all transaction data that have been stored;

[0091] The marking submodule is used to obtain the second index identifier corresponding to the stored transaction data from the transaction database according to the total number of transaction records of all stored transaction data and the preset data length of the target transaction data generated by each transaction of the user.

[0092] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0093] The transaction data processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0094] An embodiment of the present invention further provides a computer device having the transaction data processing device described above.

[0095] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0096] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0097] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0098] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 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 optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device 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.

[0099] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0100] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0101] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0102] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0103] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A transaction data processing method, characterized in that: For a mobile terminal, the method comprises: Obtain the target transaction data generated by the user's current transaction in real time; Marking a first index identifier corresponding to the target transaction data; Acquire a second index identifier corresponding to all stored transaction data from the transaction database; If the first index identifier is greater than the second index identifier, the target transaction data is sent to the server, so that the server inserts the target transaction data into a corresponding position in the transaction database according to the first index identifier.

2. The method according to claim 1, characterized in that The marking of the first index identifier corresponding to the target transaction data includes: Get the transaction record number of the user's current transaction; According to the number of transaction records and the preset data length of the current transaction of the user, a first index identifier corresponding to the target transaction data is marked in the target index data packet.

3. The method according to claim 1, characterized in that Also includes: Waiting to receive a processing result of the server inserting the target transaction data into a corresponding position in a transaction database according to the first index identifier.

4. The method according to claim 3, characterized in that Also includes: After receiving the processing result returned by the server indicating that the target transaction data has been successfully inserted, updating the index identifier of the current transaction of the user in the transaction database according to the processing result; Return to the step of acquiring the target transaction data generated by the user's current transaction in real time, and continue processing the target transaction data.

5. The method according to claim 1, characterized in that Also includes: If the first index identifier is the same as the second index identifier, it means that the target transaction data has not been generated currently.

6. The method according to claim 1, characterized in that The acquiring, from the transaction database, a second index identifier corresponding to the stored transaction data includes: Get the total number of transaction records of all transaction data stored in the database; According to the total number of transaction records of all the stored transaction data and the preset data length of the target transaction data generated by each transaction of the user, a second index identifier corresponding to the stored transaction data is obtained from the transaction database.

7. A transaction data processing device, characterized in that: The device comprises: The transaction data acquisition module is used to obtain the target transaction data generated by the user's current transaction in real time; A first index marking module, used to mark a first index identifier corresponding to the target transaction data; A second index acquisition module, used to acquire a second index identifier corresponding to the stored transaction data from the transaction database; If the first index identifier is inconsistent with the second index identifier, the transaction data sending module sends the target transaction data to the server, so that the server inserts the target transaction data into the corresponding position of the transaction database according to the first index identifier.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the transaction data processing method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the transaction data processing method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the transaction data processing method according to any one of claims 1 to 6.