Search

CN-122022997-A - Transaction state updating method and device and electronic equipment

CN122022997ACN 122022997 ACN122022997 ACN 122022997ACN-122022997-A

Abstract

The application discloses a transaction state updating method and device and electronic equipment. The method comprises the steps of determining a target transaction indicated by a state update instruction and determining the current transaction state of the target transaction under the condition that the state update instruction is received, obtaining state configuration information of the target transaction, judging whether the state update instruction is wrong according to the state configuration information, keeping the current transaction state of the target transaction unchanged under the condition that the state update instruction is wrong, and changing the current transaction state of the target transaction according to the state update instruction under the condition that the state update instruction is correct. The application solves the problem of lower accuracy of updating the transaction state in the related technology.

Inventors

  • WANG CHUNYANG

Assignees

  • 中国工商银行股份有限公司

Dates

Publication Date
20260512
Application Date
20260113

Claims (10)

  1. 1. A method for updating a transaction state, comprising: under the condition that a state update instruction is received, determining a target transaction indicated by the state update instruction, and determining the current transaction state of the target transaction; acquiring state configuration information of the target transaction, and judging whether the state updating instruction is wrong or not according to the state configuration information; Under the condition that the state updating instruction is wrong, keeping the current transaction state of the target transaction unchanged; and under the condition that the state updating instruction is correct, changing the current transaction state of the target transaction according to the state updating instruction.
  2. 2. The method of claim 1, wherein the state configuration information is configured by: Obtaining transaction states of the target transaction in each transaction execution stage to obtain M initial transaction states, wherein M is a positive integer; generating a transaction state node diagram according to the connection relation between the initial transaction states, wherein the transaction state node diagram comprises M nodes and a plurality of directed edges, each node corresponds to one initial transaction state, and each directed edge is used for representing the state change direction between two initial transaction states; and determining the transaction state node diagram as state configuration information of the target transaction.
  3. 3. The method of claim 1, wherein determining whether the status update instruction is erroneous based on the status configuration information comprises: acquiring a target transaction state indicated by the state updating instruction; Judging whether to allow the transaction state of the target transaction to be changed from the current transaction state to the target transaction state according to the state configuration information; Determining that the status update instruction is correct in a case where the transaction status of the target transaction is allowed to change from the current transaction status to the target transaction status; and determining that the state updating instruction is wrong under the condition that the transaction state of the target transaction is not allowed to be changed from the current transaction state to the target transaction state.
  4. 4. The method of claim 1, wherein prior to determining whether the status update instruction is erroneous based on the status configuration information, the method further comprises: acquiring an original transaction state indicated by the state update instruction; Judging whether the original transaction state is the same as the current transaction state; executing the step of judging whether the state updating instruction is wrong according to the state configuration information under the condition that the original transaction state is the same as the current transaction state; And determining that the state updating instruction is wrong when the original transaction state is different from the current transaction state.
  5. 5. The method of claim 1, wherein altering the current transaction state of the target transaction according to the state update instruction comprises: acquiring a target transaction state and a state change moment indicated by the state update instruction, and determining a storage space for storing state information of the target transaction; And when the state change time is reached, changing the stored information in the storage space from the current transaction state to the target transaction state.
  6. 6. The method of claim 1, wherein after altering the current transaction state of the target transaction in accordance with the state update instruction, the method further comprises: And acquiring triggering information corresponding to the changed transaction state, and executing triggering operation indicated by the triggering information.
  7. 7. The method of claim 1, wherein in the event a status update instruction is received, the method further comprises: judging whether target transactions indicated by a plurality of sub-instructions are the same or not under the condition that the number of the sub-instructions carried in the state updating instruction is more than 1; under the condition that target transactions indicated by the plurality of sub-instructions are different, each sub-instruction is used as the state update instruction to execute update operation of transaction states; And under the condition that the target transactions indicated by the plurality of sub-instructions are the same, generating a target update instruction according to the plurality of sub-instructions, and modifying the state update instruction into the target update instruction.
  8. 8. The method of claim 7, wherein generating a target update instruction from the plurality of sub-instructions comprises: Judging whether the target transaction states indicated by the plurality of sub-instructions are the same or not; under the condition that the target transaction states indicated by the plurality of sub-instructions are the same, determining any one sub-instruction as the target updating instruction; judging whether the plurality of sub-instructions have time differences or not under the condition that the target transaction states indicated by the plurality of sub-instructions are different; generating a serial instruction link according to the sequence of the plurality of sub-instructions under the condition that the time difference exists among the plurality of sub-instructions, and determining the serial instruction link as the target updating instruction; and determining that the state update instruction is wrong in the case that the time difference does not exist in the plurality of sub-instructions.
  9. 9. A transaction state updating apparatus, comprising: a first determining unit, configured to determine, when a status update instruction is received, a target transaction indicated by the status update instruction, and determine a current transaction status of the target transaction; The first judging unit is used for acquiring the state configuration information of the target transaction and judging whether the state updating instruction is wrong or not according to the state configuration information; the first processing unit is used for keeping the current transaction state of the target transaction unchanged under the condition that the state updating instruction is wrong; And the second processing unit is used for changing the current transaction state of the target transaction according to the state updating instruction under the condition that the state updating instruction is correct.
  10. 10. An electronic device, comprising: A memory storing an executable program; a processor for running the program, wherein the program runs to perform the transaction state updating method according to any one of claims 1 to 8.

Description

Transaction state updating method and device and electronic equipment Technical Field The application relates to the field of financial science and technology, in particular to a transaction state updating method and device and electronic equipment. Background In a financial transaction, the detailed information of each transaction may be recorded using a database table, and the transaction state of one transaction may be determined by a state field in the database table, for example, the transaction state may be "not started", "in process", "success", "failure", etc., and the current execution state of the transaction may be determined by recording through a specific field in the database table. However, when the transaction state is changed, due to abnormal conditions such as improper concurrent update operation or network system failure, the state information is wrongly recorded, so that the transaction state recorded in the database table is wrong, and the accuracy of the transaction state is affected. Aiming at the problem of lower accuracy of updating the transaction state in the related technology, no effective solution is proposed at present. Disclosure of Invention The application mainly aims to provide a transaction state updating method, a transaction state updating device and electronic equipment, so as to solve the problem of low accuracy of updating the transaction state in the related technology. In order to achieve the above object, according to one aspect of the present application, there is provided a transaction status updating method. The method comprises the steps of determining a target transaction indicated by a state update instruction and determining the current transaction state of the target transaction under the condition that the state update instruction is received, obtaining state configuration information of the target transaction, judging whether the state update instruction is wrong according to the state configuration information, keeping the current transaction state of the target transaction unchanged under the condition that the state update instruction is wrong, and changing the current transaction state of the target transaction according to the state update instruction under the condition that the state update instruction is correct. Optionally, the state configuration information is configured in a manner that the transaction states of the target transaction in each transaction execution stage are obtained to obtain M initial transaction states, wherein M is a positive integer, a transaction state node diagram is generated according to the connection relation between the initial transaction states, the transaction state node diagram comprises M nodes and a plurality of directed edges, each node corresponds to one initial transaction state, each directed edge is used for representing the state change direction between the two initial transaction states, and the transaction state node diagram is determined to be the state configuration information of the target transaction. Optionally, judging whether the state updating instruction is wrong according to the state configuration information comprises obtaining a target transaction state indicated by the state updating instruction, judging whether the transaction state of the target transaction is allowed to be changed from the current transaction state to the target transaction state according to the state configuration information, determining that the state updating instruction is correct when the transaction state of the target transaction is allowed to be changed from the current transaction state to the target transaction state, and determining that the state updating instruction is wrong when the transaction state of the target transaction is not allowed to be changed from the current transaction state to the target transaction state. Optionally, before judging whether the state updating instruction is wrong according to the state configuration information, the method further comprises the steps of obtaining an original transaction state indicated by the state updating instruction, judging whether the original transaction state is the same as the current transaction state, executing the step of judging whether the state updating instruction is wrong according to the state configuration information when the original transaction state is the same as the current transaction state, and determining that the state updating instruction is wrong when the original transaction state is different from the current transaction state. Optionally, changing the current transaction state of the target transaction according to the state update instruction includes obtaining a target transaction state indicated by the state update instruction and a state change time, determining a storage space storing state information of the target transaction, and changing the storage information in the storage space from the current transaction