CN115309536B - Data consistency method in high-concurrency lottery transaction scene - Google Patents

Data consistency method in high-concurrency lottery transaction scene Download PDF

Info

Publication number
CN115309536B
CN115309536B CN202211245219.9A CN202211245219A CN115309536B CN 115309536 B CN115309536 B CN 115309536B CN 202211245219 A CN202211245219 A CN 202211245219A CN 115309536 B CN115309536 B CN 115309536B
Authority
CN
China
Prior art keywords
state machine
state
rollback
flow
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211245219.9A
Other languages
Chinese (zh)
Other versions
CN115309536A (en
Inventor
王晓辉
房暾
张建翔
张道钰
刘晓疆
陈晓
刘青
战嘉馨
张新华
薛玲祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Civil Aviation Cares Co ltd
Original Assignee
Qingdao Civil Aviation Cares Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Civil Aviation Cares Co ltd filed Critical Qingdao Civil Aviation Cares Co ltd
Priority to CN202211245219.9A priority Critical patent/CN115309536B/en
Publication of CN115309536A publication Critical patent/CN115309536A/en
Application granted granted Critical
Publication of CN115309536B publication Critical patent/CN115309536B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/34Betting or bookmaking, e.g. Internet betting

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Primary Health Care (AREA)
  • Tourism & Hospitality (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Human Resources & Organizations (AREA)
  • General Health & Medical Sciences (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a data consistency method in a high-concurrency lottery transaction scene, and belongs to the technical field of computers. The method comprises the following steps: (1) Binding the state machine client to each service node, notifying the execution state of each service node to a state machine engine and receiving a scheduling command of the state machine engine; setting a rollback method in each link in the consistency flow, and scheduling by a state machine client according to the execution state of a state machine engine; (2) The state machine engine receives the execution state of the state machine client and is responsible for process management and state processing. The invention has the advantages that: the final state consistency of the data is realized. On the premise of ensuring the efficient operation of the lottery transaction process, the transaction data is consistent through reasonable task scheduling.

Description

Data consistency method in high-concurrency lottery transaction scene
Technical Field
The invention relates to a data consistency method in a high-concurrency lottery transaction scene, and belongs to the technical field of computers.
Background
The support of the information-based system for issuing and selling lottery tickets is that for a lottery ticket transaction system, the biggest difficulty is to ensure that the consistency of transaction data is kept on the premise of ensuring the high concurrency capability of the system, one transaction process needs to go through a plurality of links such as order generation, credit deduction, wind control processing, bill generation and the like, any link possibly has business or system level abnormity, so that the transaction cannot be normally completed, and for the transaction data in the intermediate states, a method is needed to enable the states of the transaction data to be consistent.
And (4) retrieval results:
1) Chinese patent publication No. CN110445837a discloses a high concurrency trunking system, a building method, a high concurrency request processing method, and a device, and the key point of this scheme is to provide a high concurrency trunking system, which realizes high concurrency requirements by setting a system file descriptor of an operating system, a system environment, and a configuration file of the reverse proxy server. The invention direction of the scheme only aims at high concurrency requirements, and fails to solve the problem of transaction consistency in a high concurrency scene.
2) Chinese patent publication No. CN106355734a discloses a lottery transaction system,
the key point of the scheme is to provide a lottery transaction system, which realizes the functions of outputting number selection information by a mobile terminal, identifying selected information by a lottery terminal and outputting identification code information. The invention only designs the number selection and identification of the terminal equipment, and does not relate to the background circulation process design of lottery transaction, and the scheme of the invention mainly focuses on the transaction flow design of a lottery system.
3) Chinese patent publication No. CN103838817a discloses data consistency management;
the focus of this approach is to provide a data consistency management system that enables queries against data tables managed by a NoSQL data repository or by an RDBMS. Aiming at consistency query on a plurality of databases, the scheme of the invention is mainly used for guaranteeing the consistency of transaction data in a lottery transaction process.
4) Search result overall analysis
The method is analyzed from the search results of the existing patents and other documents, and has related designs aiming at the lottery transaction system and the high-concurrency scene. But there is no data consistency scheme for high lottery concurrent transactions.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a method for data consistency in a high-concurrency lottery transaction scene, and the technical scheme of the invention is as follows:
a technical framework based on multi-link task scheduling is provided, which comprises a state machine client component and a state machine engine component.
The data consistency method in the high-concurrency lottery transaction scene comprises the following steps:
(1) Binding the state machine client to each service node, notifying the execution state of each service node to a state machine engine and receiving a scheduling command of the state machine engine; setting a rollback method in each link in the consistency flow, and scheduling by a state machine client according to the execution state of a state machine engine;
(2) The state machine engine receives the execution state of the state machine client and is responsible for process management and state processing.
The state machine client comprises a state monitoring step and a failure callback step, wherein the state monitoring step specifically comprises the following steps: aiming at the process starting method, a global process is registered in a state machine engine before execution, a global process ID is obtained and is stored in business data as a unique identifier of the current transaction process, and the identifier is simultaneously used as an identification identifier during abnormal rollback; aiming at the ending link, sending a completion notice to a state machine engine after the execution is successful, and indicating that the flow is successfully ended; the execution state is informed to the state machine engine through a message mechanism, and the state machine engine carries out subsequent scheduling according to the result.
The specific steps of the failure callback are as follows: when a certain link in the transaction flow is executed abnormally, the state machine engine initiates rollback scheduling on all executed links, after a rollback command is monitored by the failure callback module, the global flow ID is extracted, the rollback method of the current module is called, and executed services are recovered in the rollback method according to specified logic.
The state machine engine comprises a process management step and a process control step, wherein the process management step comprises the following steps: defining and configuring a consistency process, wherein for a current transaction scene, the process comprises four links of order creation, credit deduction, wind control processing and ticket drawing, configuring a service calling process through a state diagram, configuring compensation nodes and compensation paths of all the links according to scene requirements, designating nodes and a rollback sequence which need to be rolled back when the current nodes are abnormal, and rolling back the process according to a configured scheme when the process links are abnormal.
The process control method specifically comprises the following steps: providing a processing method aiming at the states of process starting, successful execution, failed execution and process completion, wherein the process starting is triggered by an entry method, the entry method is a ordering interface which is routed after a business control layer receives a transaction request, a controller generates global process data, and the state is marked as being executed; the successful execution is fed back by the state client, the controller acquires the flow and the sub-service information, and a sub-service execution success record is generated; the execution failure is fed back by the state machine client, the controller acquires the flow and sub-service information, judges whether a rollback flow and a rollback path are needed according to flow configuration, the flow state is marked to be rolled back, rollback notifications are respectively sent to the services needing to be rolled back, service rollback is carried out by a failure rollback dispatching rollback method of the state machine client, each sub-service is fed back after rollback is successful, and the flow state is marked to be rolled back after all sub-services are successful; the flow completion is triggered by the entry method, the flow state is marked as completed, and the flow is normally ended.
When the wind control link is abnormal, the rollback mechanism is specifically as follows:
(1) The service control layer receives the order request, routes the request to the order interface, calls the engine registration flow of the state machine before the order interface is executed, the engine of the state machine generates the flow record, marks the state as being executed, and returns the record mark to the service control layer;
(2) The service control layer executes the service logic for generating the order, successfully executes the service logic, and sends a message for successfully generating the order;
(3) The state machine engine receives the order success generation message, the successful processing interface processes the order success generation message, and a generated order success log is recorded;
(4) The service control layer continues to execute the service logic of deducting the amount, and sends a message of successful deduction of the amount after the execution is successful;
(5) The state machine engine receives the message of successful deduction of the quota, the message is processed by the successful processing interface, and a successful quota deduction log is recorded;
(6) The service control layer continues to execute the service logic for processing the wind control, fails to execute and sends a wind control failure message;
(7) The state machine engine receives the wind control failure message, the failure processing interface processes the message, inquires the flow configuration, obtains that the current node is abnormal and needs to roll back, and sends a back rolling message of deduction amount;
(8) The credit deduction service receives the rollback credit message, schedules the rollback method, and sends a rollback success message after the rollback success message is successfully executed;
(9) And the state machine engine receives the rollback success message, modifies the deduction amount success log state into a rolled back state, inquires all operation records needing to be rolled back in the current process, finishes rolling back all the operation records, and marks the process records as rolled back.
The flow state comprises an executing state, a to-be-rolled-back state, a rolled-back state and a finished state, wherein the rolled-back state and the finished state are final states, represent flow abnormity and are rolled back to be a consistent state or are normally finished; and for the process which is in a non-final state for a long time, explaining that the execution of the business process or the interaction with a state machine engine has a problem, and screening the abnormal process by adopting a timing polling mode and carrying out retry operation when the problem occurs.
The invention has the advantages that: and setting a backspacing operation method for restoring the data state of each link of the transaction flow besides the forward operation, wherein the execution condition of each link is managed by a state machine engine and is communicated through a message notification mechanism. If all links are successfully executed, the process is normally finished, if execution is abnormal, all the successfully executed links are informed by the state machine, and the rollback method is executed to realize the final state consistency of the data. On the premise of ensuring the efficient operation of the lottery transaction process, the transaction data is consistent through reasonable task scheduling.
Drawings
Fig. 1 is a general framework schematic of the present invention.
Fig. 2 is a block diagram of a state machine client in the present invention.
FIG. 3 is a schematic diagram of the management of the state machine engine process in the present invention.
FIG. 4 is a data flow diagram of the state machine engine of the present invention.
Detailed Description
The invention will be further described with reference to specific embodiments, and the advantages and features of the invention will become apparent as the description proceeds. These examples are illustrative only and do not limit the scope of the present invention in any way. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention, and that such changes and substitutions are intended to be within the scope of the invention.
The invention relates to a data consistency method in a high-concurrency lottery transaction scene, which comprises the following steps of:
(1) Binding the state machine client to each service node, and being responsible for informing the execution state of each service node to the state machine engine and receiving a scheduling command of the state machine engine; setting a rollback method in each link in the consistency flow, and scheduling by a state machine client according to the execution state of a state machine engine;
(2) The state machine engine receives the execution state of the state machine client and is responsible for process management and state processing.
The state machine client comprises a state monitoring step and a failure callback step, wherein the state monitoring step specifically comprises the following steps: aiming at the process starting method, a global process is registered in a state machine engine before execution, a global process ID is obtained and is stored in business data as a unique identifier of the current transaction process, and the identifier is simultaneously used as an identification identifier during abnormal rollback; aiming at the ending link, sending a completion notice to a state machine engine after the execution is successful, and indicating that the flow is successfully ended; the execution state is informed to the state machine engine through a message mechanism, and the state machine engine carries out subsequent scheduling according to the result.
The specific steps of the failure callback are as follows: when a certain link in the transaction flow is executed abnormally, the state machine engine initiates rollback scheduling on all executed links, after a rollback command is monitored by the failure callback module, the global flow ID is extracted, the rollback method of the current module is called, and executed services are recovered in the rollback method according to specified logic.
The state machine engine comprises a process management step and a process control step, wherein the process management step comprises the following steps: defining and configuring a consistency process, wherein for a current transaction scene, the process comprises four links of order creation, credit deduction, wind control processing and ticket drawing, configuring a service calling process through a state diagram, configuring compensation nodes and compensation paths of all the links according to scene requirements, designating nodes and a rollback sequence which need to be rolled back when the current nodes are abnormal, and rolling back the process according to a configured scheme when the process links are abnormal.
The process control method specifically comprises the following steps: providing a processing method aiming at the states of process starting, successful execution, failed execution and process completion, wherein the process starting is triggered by an entry method, the entry method is a ordering interface which is routed after a business control layer receives a transaction request, a controller generates global process data, and the state is marked as being executed; the successful execution is fed back by the state client, and the controller acquires the flow and the sub-service information to generate a sub-service execution success record; the execution failure is fed back by the state machine client, the controller acquires the flow and sub-service information, judges whether a rollback flow and a rollback path are needed according to flow configuration, the flow state is marked to be rolled back, rollback notifications are respectively sent to the services needing to be rolled back, service rollback is carried out by a failure rollback dispatching rollback method of the state machine client, each sub-service is fed back after rollback is successful, and the flow state is marked to be rolled back after all sub-services are successful; the flow completion is triggered by the entry method, the flow state is marked as completed, and the flow is normally ended.
When the wind control link is abnormal, the rollback mechanism is specifically as follows:
(1) The service control layer receives the order request, routes the request to the order interface, calls a state machine engine registration flow before the order interface is executed, the state machine engine generates a flow record, marks the state as being executed, and returns a record mark to the service control layer;
(2) The service control layer executes the service logic for generating the order, successfully executes the service logic, and sends a message for successfully generating the order;
(3) The state machine engine receives the order success generation message, the successful processing interface processes the order success generation message, and an order success log is recorded;
(4) The service control layer continues to execute the service logic for deducting the quota, and sends a quota deduction success message after the execution is successful;
(5) The state machine engine receives the message of successful deduction of the quota, the message is processed by the successful processing interface, and a successful quota deduction log is recorded;
(6) The service control layer continues to execute the service logic for processing the wind control, fails to execute and sends a wind control failure message;
(7) The state machine engine receives the wind control failure message, the failure processing interface processes the message, inquires the flow configuration, obtains that the current node is abnormal and needs to roll back, and sends a back rolling message of deduction amount;
(8) The credit deduction service receives the rollback credit message, schedules the rollback method, and sends a rollback success message after the rollback success message is successfully executed;
(9) And the state machine engine receives the rollback success message, modifies the deduction amount success log state into a rolled back state, inquires all operation records needing to be rolled back in the current process, finishes rolling back all the operation records, and marks the process records as rolled back.
The flow states comprise an in-execution state, a to-be-rolled-back state, a rolled-back state and a finished state, wherein the rolled-back and finished states are final states, represent abnormal flows and are rolled back to be a consistent state or are normally finished; and for the process which is in a non-final state for a long time, explaining that the execution of the business process or the interaction with a state machine engine has a problem, and screening the abnormal process by adopting a timing polling mode and carrying out retry operation when the problem occurs.
The lottery transaction function of the invention is developed by using JAVA language, MVC architecture is adopted, the business process is started by transaction controller layer code, and the service layer code realizes the business logic. The specific implementation process is as follows:
1. writing business logic code
The order interface of the trade controller is used as the entrance of trade function, and the order interface calls order service class, limit service class, wind control service class and order output classTicket service classThe business logics of order creation, credit deduction, wind control processing and ticket drawing are respectively executed, two methods of 'execution' and 'rollback' are defined in each service class, and the forward and rollback logics of the business operation are respectively processed, wherein the 'rollback' method is an unnecessary option, and the two methods are bound with the flow management configuration in a state machine engine and correspond to the 'execution' and 'rollback' operations in each link in the figure 3.
2. Implementing state machine clients
The client end of the state machine comprises two parts of state monitoring and failure callback, wherein the state monitoring is switched into an order placing method of the transaction controller class and an execution method in the service class code in a program slicing mode, the slice registers and reports the flow completion to the state machine engine at the execution start and end of the order placing method respectively, monitors the execution state of the execution method and reports the execution state of the execution method of each service class to the state machine engine.
The above-mentioned failure callback is realized by monitoring the failure queue message, receiving the failure message fed back by the state machine engine, obtaining the flow information and the belonged service class information from the failure message, calling the 'rollback' method of the corresponding service class, and executing the service logic rollback.
3. Implementing a state machine engine
The state machine engine comprises a process management part and a process control part, wherein the process management part defines a service process needing to be managed and a rollback path thereof, and the process comprises 4 service links of order creation, credit deduction, air control processing and ticket drawing aiming at a current transaction scene, wherein the order creation link fails without rollback, the credit deduction link fails without rollback order creation link, the air control processing link fails with credit deduction and order creation link, the ticket drawing link fails with rollback processing air control, credit deduction and order creation link, and the service links correspond to service classes monitored by a state machine client.
The process control is realized by monitoring a state reporting queue message, wherein the process control comprises 4 control branches, namely, process starting, execution success, execution failure and process ending, and when a process registration message is monitored, the process starting branch is executed to establish a main process; when monitoring the successful execution message, executing the successful execution branch and recording a successful log; when the execution failure message is monitored to be an execution failure branch, a flow and a rollback path defined in flow management are inquired, a rollback message is sent to the client, and after each node needing to be rolled back feeds back the rollback success message, the main flow is marked as rolled back and filed; when the flow completion message is monitored, a completion branch is executed, and the main flow is marked as completed and archived.
The invention designs a high-performance data consistency method aiming at a lottery transaction scene, and by the method, high concurrency requirements of the transaction scene can be met, and data consistency within a service tolerance time limit is realized. Through the implementation of the scheme, the performance and the reliability of the lottery transaction system can be greatly improved, and the development of lottery business is better supported.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.

Claims (5)

1. The data consistency method under the high-concurrency lottery transaction scene is characterized by comprising the following steps of:
(1) Binding the state machine client to each service node, notifying the execution state of each service node to a state machine engine and receiving a scheduling command of the state machine engine; setting a rollback method in each link in the consistency flow respectively, and scheduling by a state machine client according to the execution state of a state machine engine;
(2) The state machine engine receives the execution state of the state machine client and is responsible for process management and state processing;
the state machine engine comprises a process management step and a process control step, wherein the process management step comprises the following steps: defining and configuring a consistency process, wherein for a current transaction scene, the process comprises four links of order creation, credit deduction, wind control processing and ticket drawing, configuring a service calling process through a state diagram, configuring compensation nodes and compensation paths of all the links according to scene requirements, and rolling back the process according to a configured scheme when the process links are abnormal;
the process control method specifically comprises the following steps: providing a processing method aiming at the states of process starting, successful execution, failed execution and process completion, wherein the process starting is triggered by an entry method, the entry method is a ordering interface which is routed after a business control layer receives a transaction request, a controller generates global process data, and the state is marked as being executed; the successful execution is fed back by the state client, the controller acquires the flow and the sub-service information, and a sub-service execution success record is generated; the execution failure is fed back by the state machine client, the controller acquires the flow and sub-service information, judges whether a rollback flow and a rollback path are needed according to flow configuration, the flow state is marked to be rolled back, rollback notifications are respectively sent to the services needing to be rolled back, service rollback is carried out by a failure rollback dispatching rollback method of the state machine client, each sub-service is fed back after rollback is successful, and the flow state is marked to be rolled back after all sub-services are successful; the flow completion is triggered by the entry method, the flow state is marked as completed, and the flow is normally ended.
2. The method for data consistency in the highly concurrent lottery transaction scenario according to claim 1, wherein the state machine client comprises a state monitoring step and a failure callback step, and the state monitoring step specifically comprises: aiming at the process starting method, a global process is registered in a state machine engine before execution, a global process ID is obtained and is stored in business data as a unique identifier of the current transaction process, and the identifier is simultaneously used as an identification identifier during abnormal rollback; aiming at the ending link, sending a completion notice to a state machine engine after the execution is successful, and indicating that the flow is successfully ended; the execution state is informed to the state machine engine through a message mechanism, and the state machine engine carries out subsequent scheduling according to the result.
3. The method for data consistency in the scenario of highly concurrent lottery transactions according to claim 2, wherein the specific steps of the failed callback are as follows: when a certain link in the transaction flow is executed abnormally, the state machine engine initiates rollback scheduling on all executed links, after a rollback command is monitored by the failure callback module, the global flow ID is extracted, the rollback method of the current module is called, and executed services are recovered in the rollback method according to specified logic.
4. The method for data consistency in a highly concurrent lottery transaction scenario according to claim 1, wherein when the wind control link is abnormal, the rollback mechanism is specifically:
(1) The service control layer receives the order request, routes the request to the order interface, calls a state machine engine registration flow before the order interface is executed, the state machine engine generates a flow record, marks the state as being executed, and returns a record mark to the service control layer;
(2) The service control layer executes the service logic for generating the order, successfully executes the service logic and sends a message for successfully generating the order;
(3) The state machine engine receives the order success generation message, the successful processing interface processes the order success generation message, and a generated order success log is recorded;
(4) The service control layer continues to execute the service logic for deducting the quota, and sends a quota deduction success message after the execution is successful;
(5) The state machine engine receives the message of successful deduction of the quota, the message is processed by the successful processing interface, and a successful quota deduction log is recorded;
(6) The service control layer continues to execute the service logic for processing the wind control, fails to execute and sends a wind control failure message;
(7) The state machine engine receives the wind control failure message, the failure processing interface processes the message, inquires the flow configuration, and obtains that the current node is abnormal and needs to roll back, and sends the back rolling message of the reduced amount;
(8) The credit deduction service receives the rollback credit message, schedules the rollback method, and sends a rollback success message after the rollback success message is successfully executed;
(9) And the state machine engine receives the rollback success message, modifies the deduction amount success log state into a rolled back state, inquires all operation records needing rolling back in the current process, finishes rolling back all the operation records, and marks the process records as rolled back.
5. The method for data consistency in the scenario of highly concurrent lottery transactions according to claim 1, wherein the process status comprises an in-progress status, a to-be-rolled-back status, a rolled-back status and a completed status, wherein the rolled-back status and the completed status are final statuses, which represent abnormal process and the rolled-back status is a consistent status or a normal end; and for the process which is in a non-final state for a long time, explaining that the execution of the business process or the interaction with a state machine engine has a problem, and screening the abnormal process by adopting a timing polling mode and carrying out retry operation when the problem occurs.
CN202211245219.9A 2022-10-12 2022-10-12 Data consistency method in high-concurrency lottery transaction scene Active CN115309536B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211245219.9A CN115309536B (en) 2022-10-12 2022-10-12 Data consistency method in high-concurrency lottery transaction scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211245219.9A CN115309536B (en) 2022-10-12 2022-10-12 Data consistency method in high-concurrency lottery transaction scene

Publications (2)

Publication Number Publication Date
CN115309536A CN115309536A (en) 2022-11-08
CN115309536B true CN115309536B (en) 2023-01-24

Family

ID=83867837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211245219.9A Active CN115309536B (en) 2022-10-12 2022-10-12 Data consistency method in high-concurrency lottery transaction scene

Country Status (1)

Country Link
CN (1) CN115309536B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106357791A (en) * 2016-09-30 2017-01-25 华为技术有限公司 Method, device and system for processing services
CN107657419A (en) * 2016-07-25 2018-02-02 武汉票据交易中心有限公司 The processing method and relevant apparatus and server of a kind of operation flow
CN109634800A (en) * 2018-10-19 2019-04-16 深圳平安财富宝投资咨询有限公司 Data processing method, system, terminal and readable storage medium storing program for executing
CN111222881A (en) * 2019-12-31 2020-06-02 陕西医链区块链集团有限公司 Method for keeping consistency of block chain transaction state baseline
CN111475576A (en) * 2020-04-15 2020-07-31 中国工商银行股份有限公司 Block chain based distributed database storage method and system
CN112100001A (en) * 2020-11-16 2020-12-18 甬矽电子(宁波)股份有限公司 Data rollback method, device, server and readable storage medium
CN112700310A (en) * 2021-01-19 2021-04-23 汇通数科智能科技有限公司 Transaction order data optimization processing method based on E-commerce platform
CN113971075A (en) * 2021-10-29 2022-01-25 平安科技(深圳)有限公司 Method, device, equipment and storage medium for realizing consistency of transaction and message
CN114595074A (en) * 2020-12-04 2022-06-07 中盈优创资讯科技有限公司 Transaction failure rollback method and device in arrangement based on distributed scheduling
US11366802B1 (en) * 2019-09-27 2022-06-21 Amazon Technologies, Inc. Batch undo processing for transaction rollbacks in a multi-writer database

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9465648B2 (en) * 2012-07-31 2016-10-11 Hewlett Packard Enterprise Development Lp Distributed transaction processing through commit messages sent to a downstream neighbor
CN111190768B (en) * 2019-12-25 2020-10-16 中科驭数(北京)科技有限公司 Database execution error recovery method, database access method and device
US11531564B2 (en) * 2020-07-09 2022-12-20 Vmware, Inc. Executing multi-stage distributed computing operations with independent rollback workflow

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107657419A (en) * 2016-07-25 2018-02-02 武汉票据交易中心有限公司 The processing method and relevant apparatus and server of a kind of operation flow
CN106357791A (en) * 2016-09-30 2017-01-25 华为技术有限公司 Method, device and system for processing services
CN109634800A (en) * 2018-10-19 2019-04-16 深圳平安财富宝投资咨询有限公司 Data processing method, system, terminal and readable storage medium storing program for executing
US11366802B1 (en) * 2019-09-27 2022-06-21 Amazon Technologies, Inc. Batch undo processing for transaction rollbacks in a multi-writer database
CN111222881A (en) * 2019-12-31 2020-06-02 陕西医链区块链集团有限公司 Method for keeping consistency of block chain transaction state baseline
CN111475576A (en) * 2020-04-15 2020-07-31 中国工商银行股份有限公司 Block chain based distributed database storage method and system
CN112100001A (en) * 2020-11-16 2020-12-18 甬矽电子(宁波)股份有限公司 Data rollback method, device, server and readable storage medium
CN114595074A (en) * 2020-12-04 2022-06-07 中盈优创资讯科技有限公司 Transaction failure rollback method and device in arrangement based on distributed scheduling
CN112700310A (en) * 2021-01-19 2021-04-23 汇通数科智能科技有限公司 Transaction order data optimization processing method based on E-commerce platform
CN113971075A (en) * 2021-10-29 2022-01-25 平安科技(深圳)有限公司 Method, device, equipment and storage medium for realizing consistency of transaction and message

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种通用状态机引擎设计与应用;李林等;《实验科学与技术》;20121228(第06期);全文 *

Also Published As

Publication number Publication date
CN115309536A (en) 2022-11-08

Similar Documents

Publication Publication Date Title
EP1607860A2 (en) System and method for auditing a network
CN111274052A (en) Data distribution method, server, and computer-readable storage medium
US20070214161A1 (en) System and method for resource lock acquisition and reclamation in a network file system environment
CN109460841B (en) User account opening method, system and storage medium
TW200425692A (en) Methods, apparatus and computer programs for processing alerts and auditing in a publish/subscribe system
CN106156939A (en) Dispatching System based on job stream and application process
JP3916232B2 (en) Knowledge-type operation management system, method and program
CN101211361A (en) Information processing apparatus, information processing system, and information processing method
CN113672452A (en) Method and system for monitoring operation of data acquisition task
CN115309536B (en) Data consistency method in high-concurrency lottery transaction scene
CN111401837B (en) Event processing method and system, and computer readable storage medium
CN108241616B (en) Message pushing method and device
CN116719623A (en) Job scheduling method, job result processing method and device
CN115333942B (en) Event retry method and device, storage medium and electronic equipment
CN116303276A (en) Method for realizing file export by spring batch nested script
CN115525449A (en) Micro-service data transmission system, method and storage medium
CN111130955B (en) Distributed link monitoring method based on internet credit system
CN110347650B (en) Metadata acquisition method and device
CN114579406A (en) Method and device for realizing consistency of distributed transactions
CN112561264A (en) Service method, service system and storage medium for enterprise content
CN107102901A (en) A kind of task processing method and device
CN101364224A (en) Information management system and method
CN117411929B (en) Business process monitoring method, device, equipment and storage medium
CN113285855B (en) Server monitoring method and system
CN113392081B (en) Data processing system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant