CN115375134A - Service processing method and system based on state machine - Google Patents
Service processing method and system based on state machine Download PDFInfo
- Publication number
- CN115375134A CN115375134A CN202210999598.4A CN202210999598A CN115375134A CN 115375134 A CN115375134 A CN 115375134A CN 202210999598 A CN202210999598 A CN 202210999598A CN 115375134 A CN115375134 A CN 115375134A
- Authority
- CN
- China
- Prior art keywords
- state machine
- service
- state
- management
- type
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0631—Resource planning, allocation, distributing or scheduling for enterprises or organisations
- G06Q10/06311—Scheduling, planning or task assignment for a person or group
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0633—Workflow analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q10/00—Administration; Management
- G06Q10/10—Office automation; Time management
- G06Q10/103—Workflow collaboration or project management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/0601—Electronic shopping [e-shopping]
- G06Q30/0633—Lists, e.g. purchase orders, compilation or processing
- G06Q30/0635—Processing of requisition or of purchase orders
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Business, Economics & Management (AREA)
- Human Resources & Organizations (AREA)
- Engineering & Computer Science (AREA)
- Strategic Management (AREA)
- Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Development Economics (AREA)
- Finance (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Game Theory and Decision Science (AREA)
- Educational Administration (AREA)
- Data Mining & Analysis (AREA)
- Technology Law (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention relates to a service processing method and a system based on a state machine, wherein the method comprises the following steps: acquiring operation information input by a user; determining the type of a service, the current service state and a received event based on the operation information input by the user; determining a state machine configuration file based on the type of the service, the current service state and the received event; calling a corresponding state machine based on the state machine configuration file; the state machine is established based on service information and a preset general order establishing template; the state machine is one of the following: the system comprises an order management type state machine, a claim complaint examination and approval management type state machine and a payment management type state machine; and managing corresponding services based on the state machine. Based on the method, the simplification of the service management service of the whole process is realized, the smooth operation of the service is ensured, and the maintenance is convenient.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and a system for processing a service based on a state machine.
Background
At present, the used-car trading channel is mainly divided into an offline traditional channel and an online channel. The traditional offline channel mainly comprises independent second-hand car dealers, 4S (automobile dealers) and direct transactions among individuals, and the online channel mainly comprises an Internet platform, an online auction and other modes. As consumption concepts change, more and more young people begin to choose to purchase used cars. At present, with the reform of policies in the field of circulation of used cars, the used car industry is confronted with historical development opportunities. Therefore, a platform is needed that can provide full-flow management services. However, as the number of systems increases with the increase of services, many service processes have many commonalities, but due to the limitation of design, repeated development is caused, and many technical bottlenecks are generated for realizing service flow between systems.
Therefore, how to realize the management service of the whole process and ensure the smooth operation of the business, and the maintenance is convenient, is a research direction at present.
Disclosure of Invention
The invention provides a service processing method and a system based on a state machine, which are used for solving the problems of difficult realization and difficult maintenance caused by complicated service processing flow in the prior art, realizing simplification of service management service of the whole flow, ensuring smooth operation of the service and facilitating maintenance.
A service processing method based on a state machine, the method comprises: acquiring operation information input by a user; determining the type of a service, the current service state and a received event based on the operation information input by the user; determining a state machine configuration file based on the type of the service, the current service state and the received event; calling a corresponding state machine based on the state machine configuration file; the state machine is established based on service information and a preset general order establishing template; the state machine is one of the following: the system comprises an order management type state machine, a claim complaint examination and approval management type state machine and a payment management type state machine; and managing corresponding services based on the state machine.
In one embodiment, the process of creating a template creation state machine based on the service information and the preset general order includes: establishing a state machine corresponding to the service based on the service information, the universal node, the universal event and the expansion method; the service information is determined based on each circulation node and circulation information in the order management service, the claim complaint approval management service and the payment management service.
In one embodiment, the creating a template based on the service information and a preset general order creating state machine includes: and establishing a state machine of the type of the claim complaint approval management based on the preset general order establishing template and the claim complaint approval management process.
In one embodiment, the creating a template based on the service information and a preset general order creating state machine includes: and establishing a state machine of a payment management type based on a preset general order establishing template and a payment management process.
In one embodiment, the managing the corresponding service based on the state machine includes: and under the condition that the next node of the state machine is a payment node, after determining that the corresponding payment event is a non-repeated payment event through the idempotent check, jumping to the payment node.
In one embodiment, the expansion method includes: checking, supplementing context, checking context, saving context, and completing creation.
In one embodiment, after the obtaining of the operation information input by the user, the method further includes: and carrying out irreversible encryption processing on sensitive information in the operation information input by the user.
A state machine based transaction system, the state machine based transaction system comprising: the acquisition module is used for acquiring operation information input by a user; the first determining module is used for determining the type of the service, the current service state and the received event based on the operation information input by the user; a second determining module, configured to determine a state machine configuration file based on the type of the service, the current service state, and the received event; the calling module is used for calling the corresponding state machine based on the state machine configuration file; the state machine is established based on service information and a preset general order establishing template; the state machine is one of the following: the system comprises an order management type state machine, a claim complaint examination and approval management type state machine and a payment management type state machine; and the management module is used for managing the corresponding service based on the state machine.
In one embodiment, the system further comprises:
the system comprises a creating module, a state machine and a service processing module, wherein the creating module is used for creating a state machine corresponding to a service based on service information, a universal node, a universal event and an expansion method; the service information is determined based on each circulation node and circulation information in the order management service, the claim claiming approval management service and the payment management service.
In one embodiment, the creating module includes:
and the first creating unit is used for creating a state machine of the type of the claim complaint approval management based on the preset general order creating template and the claim complaint approval management process.
In one embodiment, the creating module further comprises:
and the second creating unit is used for creating a state machine of the payment management type based on a preset general order creating template and a payment management process.
In one embodiment, the management module comprises:
and the skipping unit is used for skipping to the payment node after determining that the corresponding payment event is a non-repeated payment event through the idempotent check under the condition that the next node of the state machine is the payment node.
In one embodiment, the expansion method includes:
checking, supplementing context, checking context, saving context, and completing creation.
In one embodiment, after the obtaining of the operation information input by the user, the method further includes:
and carrying out irreversible encryption processing on sensitive information in the operation information input by the user.
A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions which, when executed by the processor, cause the processor to perform the steps of the state machine based traffic processing method described above.
A storage medium storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the state machine based traffic processing method described above.
According to the service processing method and system based on the state machine, the state machine is introduced, the management of single service circulation is realized, a mature framework is used, the control of the state circulation is simplified, hard codes are reduced, and the state circulation can be flexibly adjusted. And because the link of creating the state machine is created based on the service information and the preset general order creating template, the state machine has strong expansibility, can be flexibly suitable for various scenes, can be suitable for service processing of various services, and is easy to maintain, thereby solving the problems that the service processing flow is complicated and difficult to realize and maintain, realizing the simplification of the service management service of the whole flow, ensuring the smooth operation of the service, and being convenient to maintain.
Drawings
FIG. 1 is a flowchart illustrating a method for processing a service based on a state machine in an embodiment;
FIG. 2 is a schematic flow chart illustrating the process of claim complaint approval management according to one embodiment;
FIG. 3 is a block diagram of a state machine based business processing system in one embodiment;
FIG. 4 is a schematic diagram of an electronic device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It is to be noted that technical terms or scientific terms used in the embodiments of the present disclosure should have a general meaning as understood by those having ordinary skill in the art to which the present disclosure belongs, unless otherwise defined. The use of "first," "second," and similar terms in the embodiments of the disclosure is not intended to indicate any order, quantity, or importance, but rather to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
For the sake of easy understanding, the technical terms related to the present invention are first explained.
(1) State machine
The state machine is the tool that manages the order state logic. The state machine can be classified into 3 elements, namely, present state, action state and secondary state. Wherein, the current state refers to the current state; after the action is executed, the mobile terminal can be transferred to a new state and can still keep the original state; the secondary state is a new state to which the action is to be migrated after being satisfied, the secondary state is relative to the current state, and the secondary state is converted into a new current state once activated.
(2) Idempotent check
Idempotent is a mathematical and computer-based concept, which is commonly found in abstract algebra. An idempotent operation is characterized in that the influence of any multiple times of execution is the same as the influence of one time of execution. An idempotent function, or idempotent method, refers to a function that can be repeatedly performed using the same parameters and achieve the same result. These functions do not affect the system state and there is no concern that repeated execution may cause changes to the system. Idempotent checking, which is a popular way to say, is an interface, and the same request is initiated many times, so that it must be ensured that the operation can only be executed once.
It can be understood that when the business process management is performed, when the business process needs to be transferred from one business node flow to the next node, the business process management may be performed by cross-department and cross-system cooperation, such as a team specially responsible for payment, a team responsible for approval flow, a team responsible for commodity management, and the like. Therefore, it is a great challenge to the system design to develop system docking according to a complete service closed loop. In addition, in a general case, the order of the e-commerce system has more nodes due to the order, and the state flow between the nodes is more flexible, for example, after the order is delivered, for some physical articles, the transaction completion node can be reached through the nodes such as the transporting or delivering and receiving confirmation node, and for some articles which do not need to be delivered, such as an electronic book, after the order is delivered, the transaction completion node can be reached directly without passing through the nodes such as the transporting or delivering and receiving confirmation node. In addition, the application can be carried out only on a refund node, and the application of a return node and the like can also be carried out. And some trade corresponding orders have various types of orders according to different business requirements, such as service inquiry orders, car purchasing orders and purchasing member orders. Different types of order status nodes, there are the same node and different nodes. In the prior art, a management process is constructed for different order types, so that the process is too complex and difficult to expand, or an order process is constructed for each type of order, so that more repeated nodes are provided and the maintenance is not good.
Therefore, it is a great challenge to system design to develop system docking according to a complete service closed loop, and therefore, a service processing method is urgently needed to process an intricate and complex processing flow, ensure stable operation of services, and facilitate maintenance.
The following describes a service processing method and system based on a state machine according to the present invention with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a service processing method based on a state machine according to the present invention. It is understood that the method for processing services based on a state machine provided in fig. 1 can be implemented by a system for processing services based on a state machine. As shown in fig. 1, the service processing method based on a state machine provided by the present invention includes the following steps:
and step 110, acquiring operation information input by a user.
The input operation of the user may be an operation of the user on a service processing engine, and may be an operation of a service, a claims approval service, and a payment service. For example, if the user wants to purchase a used vehicle, the user may query the business processing engine for information about the used vehicle, or if the user wants to claim a claim after the transaction occurs, the user may initiate the claim on the business processing engine. Correspondingly, the business processing system based on the state machine can obtain the operation information input by the user from the business processing engine.
It is to be understood that, in one embodiment, after the operation information input by the user is acquired, the method further includes: and performing irreversible encryption processing on sensitive information in the operation information input by the user. The sensitive information is information which is not easy to know by other people, such as personal privacy information of a user. And irreversible encryption transmission and storage are carried out on the sensitive data, so that the leakage of user information can be prevented.
The type of service, the current service state, and the received event are determined based on the operation information input by the user, step 120.
The order type is used for distinguishing the business and the service type of the order. The order type can be, for example, a query service type in the service, a claim and claim service type in a claim and claim examination and approval service, or a payment service type in a payment service. And if the current service state is the node where the current service is located, namely the node where the target order of the target user is located, for example, the user enters a node to be paid after inquiring and joining a shopping cart, and the current service state is the node to be paid. The received event may be an action by the user, such as an action of entering a shopping cart or payment.
Step 130, determining a state machine configuration file based on the type of the service, the current service state and the received event.
Wherein the state machine configuration file is used to determine the state machine. And determining a state machine configuration file according to the type of the service, the current service state and the received event.
It can be understood that the state machine includes 3 elements, i.e. a present state, an action, and a next state, for reflecting the node flow of the service, the current service state may correspond to the "present state" in the state machine, the received event may correspond to the "action" in the state machine, and then the "next state" in the state machine may be determined by combining the types of the service. For example, if the current service state is "to be paid", the received event is "to pay", and if the type of the corresponding service is an entity commodity order, for example, "purchase used cart order", the corresponding "next state" may be determined as "to be delivered"; if the type of the corresponding service is "query service order", the corresponding "inferior state" may be determined as "query in progress", and if the type of the corresponding service is a virtual commodity order, for example, "purchase member order", the corresponding "inferior state" may be determined as "transaction complete".
In summary, the state machine configuration file may be determined according to the type of the service, the current service state, and the received event, and the corresponding state machine may be called according to the state machine configuration file.
It can be understood that, since the services corresponding to the second-hand car transaction are relatively complex, and may include an order management type service, a claim complaint examination and approval management type service, and a payment management type service, the node circulation processes corresponding to different types of services are different, and therefore the corresponding state machines are different. And all types of services are represented and stored through the state machine, so that the orders with different types and state nodes can be compatible, the generation of a plurality of order systems is avoided, and the smooth circulation of the order nodes under the conditions that the orders of the second-hand vehicle transaction platform are various in types, numerous in nodes, complex in flow and the like can be met.
Wherein the universal order creation template is a universal template for creating a state machine.
In some embodiments, the process of creating a template creation state machine based on the service information and the preset general order includes: establishing a state machine corresponding to the service based on the service information, the universal node, the universal event and the expansion method; the service information is determined based on each circulation node and circulation information in the order management service, the claim claiming approval management service and the payment management service.
The general nodes are some common process nodes in the business processing process, and may be nodes for querying, waiting for payment, waiting for goods receiving, and completing transactions, for example. Common events are events that trigger node flow in the business process flow, and may include, for example, creating an order, canceling an order, paying, completing, and changing status.
In some embodiments, the expanding method comprises: checking, supplementing context, checking context, saving context, and completing creation. Wherein, the check is used for checking the node and the circulation state of the existing state machine; the supplement context, check context, save context, and complete creation are used to supplement, check, save, and complete creation, respectively, for some unusual process nodes in the business process flow when creating the state machine.
It can be understood that by defining some common nodes, common events and extension methods, developers can directly input the circulation process and nodes corresponding to each service in the service processing engine by combining service information, common nodes, common events and extension methods, or add corresponding nodes through interfaces of extension methods such as context supplementation, context examination, context preservation and the like, so that the service processing engine generates a corresponding state machine, and thus, under the condition of adding an order type, only one state machine needs to be newly created without modifying the original code, customized events and nodes are added, and corresponding logics are realized. And because different types of state machines, state nodes and events have strong independence, the multi-user independent maintenance can be realized. Under the condition that a certain section of logic needs to be modified or expanded, only the corresponding state node needs to be modified, and other nodes cannot be influenced.
It can also be understood that by defining some standard input and output interfaces, such as interfaces corresponding to a universal node, a universal event, and an expansion method, the development cost is reduced, the reusability of the service module is improved, and the process management can be accessed without independently developing the function module in each service direction.
And 150, managing the corresponding service based on the state machine.
As described above, the state machine can reflect the flow process of the service, and therefore, the node to which the service corresponding to the order is to be skipped next can be determined based on the state machine, and therefore, after the state machine corresponding to the service is called, the corresponding service can be managed based on the state machine.
The service processing method based on the state machine provided by the invention has the advantages that the state machine is introduced, the management of single service circulation is realized, a mature framework is used, the control of the state circulation is simplified, the hard coding is reduced, and the state circulation can be flexibly adjusted. And because the link of creating the state machine is created based on the service information and the preset general order creating template, the state machine has strong expansibility, can be flexibly suitable for various scenes, can be suitable for service processing of various services, and is easy to maintain, thereby solving the problems that the service processing flow is complicated and difficult to realize and maintain, realizing the simplification of the service management service of the whole flow, ensuring the smooth operation of the service, and being convenient to maintain.
In one embodiment, the creating a template based on the service information and the preset general order creating state machine comprises:
and creating an order management type state machine based on a preset universal order creation template and the state flow of the order.
It can be understood that for a common order service, the corresponding service information is the state flow of the order. The state flow of the order is used for reflecting the nodes contained in the order and the flow conditions among the nodes. Illustratively, as shown in Table 1, the status flow process for an order is schematically illustrated.
TABLE 1
Based on the present state, the action and the next state in table 1, at least one state machine of the order management type can be determined, for example, for a common state machine of order processing, the corresponding circulation node is to be paid, shipped, paid, trade completed, after-sales and trade closed. Wherein the triggering event for the flow of the pending payment to the pending shipment is the completion of the payment for the order. Similarly, state machines corresponding to other order processing flows can be obtained, and are not described one by one here.
In one embodiment, the creating a template based on the service information and the preset general order creating state machine includes:
and establishing a state machine of the type of the claim complaint approval management based on a preset general order establishing template and the flow of the claim complaint approval management.
The process of the claims application and approval management is a process for carrying out the approval management on the claims application proposed by the user. Specifically, as shown in fig. 2, the process of managing the claims complaint examination and approval may include the following steps:
in step 210, the buyer issues a complaint claim to the seller, and the seller enters an arbitration process for preliminary examination if the seller does not agree with the complaint claim.
In step 230, the arbitration pre-audit will perform a pre-audit on the pre-audit material. It is first determined whether the buyer and seller are required to continue replenishing the material. If the materials need to be supplemented, the materials are fed back to the buyer and the seller, and the buyer and the seller supplement the data and submit the data; if no supplemental material is needed, a first review opinion is formed.
And 240, if the buyer and the seller do not agree with the initial review opinions, the arbitration is finished, and compensation is carried out according to the arbitration result.
And step 250, if the initial review fails, entering a review, and supplementing review materials by the buyer and the seller.
And step 260, arbitrating that the primary audit can carry out audit on the reexamination material, determining the final result of the primary audit/the reexamination, submitting financial audit, and having the financial department responsible for withdrawing the repayment.
For the convenience of understanding, the process of creating a state machine of the claim application approval management type based on the preset general order creation template and the claim application approval management flow is exemplarily described in conjunction with the above related description. Exemplarily, it is assumed that the established generic nodes have nodes of "initiate claiming claim", "enter arbitration pending approval process", "perform initial approval" and "pass through initial approval", and the established generic events have nodes of "seller disagreeing claim", "submit initial approval material" and "buyer and seller agree to initial approval", so that the nodes of "initiate claiming claim", "enter arbitration pending approval process", "perform initial approval" and "pass through initial approval" can be sequentially confirmed as the circulation nodes of the state machine corresponding to the claims claiming approval management process, and the "seller disagreeing claim" is used as the trigger event of "entering arbitration pending initial approval process", the "submit initial approval material" is used as the trigger event of "perform initial approval", and the "buyer and seller agree to initial approval" is used as the trigger event of "pass through initial approval". Moreover, the interface of the expanding method such as context supplementation, context checking, context saving and the like can be used for increasing the nodes which are not contained in the general nodes, such as 'entering into the review', 'conducting the review', 'financial review' and 'withdrawing the compensation', and the events which are not contained in the general events, such as 'buyer and seller disagree with the review', 'submitting the review data', 'determining the claim', so as to increase a new state machine to realize the expanded business process. Therefore, only one state machine needs to be newly established when a new business processing flow is added, a user-defined event and a node are added, corresponding logic is realized, the previous business processing logic cannot be influenced when the new type of business processing flow is added, and the expansibility of the business processing flow is ensured.
Based on the above description, it can be seen that the corresponding claims examination and approval management processes involve multi-party interaction, but because the management of the processes in the invention establishes corresponding state machines according to the nodes and the corresponding trigger events involved in the circulation process, the claims examination and approval management processes can be only related to the nodes and the corresponding trigger events involved in the circulation process, and are not influenced by other factors, such as different departments, so that the cross-department process management is simplified; and for some new business processes, the new business processes can be realized by adding new state machines, so that the previous business processing logic cannot be influenced when the new type of business processing processes are added, and the expansibility of the business processing processes is ensured.
In one embodiment, the creating a template based on the service information and the preset general order creating state machine includes:
and establishing a state machine of a payment management type based on a preset general order establishing template and a payment management process.
The payment management process is used for managing the payment process. Specifically, the payment management process may include the following processes:
and in the process 1, after the user places an order, a WeChat payment process is initiated, and the payment process is managed through a background payment list. The system background can perform operations such as initiating refund, initiating payment reconciliation, closing payment and the like.
And 2, when the user initiates the car purchasing transaction, performing security authentication, performing real-name authentication on the information of the user, creating a payment and receipt account of the user, and entering the transaction fund of the buyer and the seller into a third-party fund monitoring system.
And 3, when the user initiates a claim settlement complaint, paying the public account to a user bank card through an enterprise, and initiating payment through a UnionPay payment channel.
It can be understood that in the above flow, irreversible encryption transmission and warehousing are performed on the related sensitive data, risk behavior early warning is performed, claims settlement and payment are initiated for blacklist IP and account management, and system downtime caused by network attack behavior is avoided.
It is further understood that a state machine may be constructed for each of the above processes, and the process of "creating a state machine of a payment management type based on the preset general order creation template and the payment management process" is similar to the process of "creating a state machine of a claim approval management type based on the preset general order creation template and the claim approval management process" for the sake of brevity, and is not described herein again.
In one embodiment, in the case that the next node of the state machine is a payment node, after determining that the corresponding payment event is a non-duplicate payment event by an idempotent check, a jump is made to the payment node.
It can be understood that the idempotent verification is added before the payment is called, the same operation can be only initiated once for the same user, the same order and the same flow, the concurrency lock is released after the operation is successful, the repeated calling of the payment is avoided, and useless requests among systems are reduced.
The following describes the state machine based service processing system provided by the present invention, and the state machine based service processing system described below and the state machine based service processing method described above may be referred to correspondingly.
As shown in fig. 3, in an embodiment, a state machine based service processing system is provided, which may specifically include an obtaining module 310, a first determining module 320, a second determining module 330, a calling module 340, and a managing module 350, wherein,
an obtaining module 310, configured to obtain operation information input by a user;
a first determining module 320, configured to determine a type of a service, a current service state, and a received event based on the operation information input by the user;
a second determining module 330, configured to determine a state machine configuration file based on the type of the service, a current service state, and a received event;
a calling module 340, configured to call a corresponding state machine based on the state machine configuration file; the state machine is established based on service information and a preset general order establishing template; the state machine is one of the following: the system comprises an order management type state machine, a claim complaint examination and approval management type state machine and a payment management type state machine;
a management module 350, configured to manage the corresponding service based on the state machine.
The service processing system based on the state machine provided by the invention has the advantages that the state machine is introduced, the management of single service circulation is realized, a mature framework is used, the control of the state circulation is simplified, the hard coding is reduced, and the state circulation can be flexibly adjusted. And because the link of creating the state machine is created based on the service information and the preset general order creating template, the state machine has strong expansibility, can be flexibly suitable for various scenes, can be suitable for service processing of various services, and is easy to maintain, thereby solving the problems that the service processing flow is complicated and difficult to realize and maintain, realizing the simplification of the service management service of the whole flow, ensuring the smooth operation of the service, and being convenient to maintain.
In one embodiment, the system further comprises:
the system comprises a creating module, a state machine and a service processing module, wherein the creating module is used for creating a state machine corresponding to the service based on the service information, the universal node, the universal event and the expansion method; the service information is determined based on each circulation node and circulation information in the order management service, the claim claiming approval management service and the payment management service.
In one embodiment, the creating module comprises:
and the first creating unit is used for creating a state machine of the type of the claim complaint approval management based on the preset general order creating template and the claim complaint approval management process.
In one embodiment, the creating module further comprises:
and the second creating unit is used for creating a state machine of the payment management type based on a preset general order creating template and a payment management process.
In one embodiment, the management module 350 comprises:
and the skipping unit is used for skipping to the payment node after determining that the corresponding payment event is a non-repeated payment event through the idempotent check under the condition that the next node of the state machine is the payment node.
In one embodiment, the expanding method comprises the following steps:
checking, supplementing context, checking context, saving context, and completing creation.
In one embodiment, after the obtaining of the operation information input by the user, the method further includes:
and carrying out irreversible encryption processing on sensitive information in the operation information input by the user.
Fig. 4 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 4: a processor (processor) 410, a communication interface (communications interface) 420, a memory (memory) 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 are communicated with each other through the communication bus 440. The processor 410 may invoke logic instructions in the memory 430 to perform a state machine based business process method comprising: acquiring a change method keyword input by a user; acquiring a calling relation graph of the change method based on the change method keywords input by the user; the calling relation graph of the modified method is obtained through the hook script and comprises information of a method interface which is easy to make an error after the method is modified; and displaying the calling relation graph of the change method.
In addition, the logic instructions in the memory 430 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the state machine based service processing method provided by the present invention, the method comprising: acquiring operation information input by a user; determining the type of a service, the current service state and a received event based on the operation information input by the user; determining a state machine configuration file based on the type of the service, the current service state and the received event; calling a corresponding state machine based on the state machine configuration file; the state machine is established based on service information and a preset general order establishing template; the state machine is one of the following: the system comprises an order management type state machine, a claim complaint examination and approval management type state machine and a payment management type state machine; and managing corresponding services based on the state machine.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the state machine-based service processing method provided by the present invention, the method including: acquiring operation information input by a user; determining the type of a service, the current service state and a received event based on the operation information input by the user; determining a state machine configuration file based on the type of the service, the current service state and the received event; calling a corresponding state machine based on the state machine configuration file; the state machine is established based on service information and a preset general order establishing template; the state machine is one of the following: the system comprises an order management type state machine, a claim complaint examination and approval management type state machine and a payment management type state machine; and managing corresponding services based on the state machine.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
It should be understood that the above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A service processing method based on a state machine is characterized in that the method comprises the following steps:
acquiring operation information input by a user;
determining the type of a service, the current service state and a received event based on the operation information input by the user;
determining a state machine configuration file based on the type of the service, the current service state and the received event;
calling a corresponding state machine based on the state machine configuration file; the state machine is established based on service information and a preset general order establishing template; the state machine is one of the following: the system comprises an order management type state machine, a claim complaint examination and approval management type state machine and a payment management type state machine;
and managing corresponding services based on the state machine.
2. The state machine based service processing method as claimed in claim 1, wherein the process of creating the state machine based on the service information and the preset generic order creation template comprises:
establishing a state machine corresponding to the service based on the service information, the universal node, the universal event and the expansion method; the service information is determined based on each circulation node and circulation information in the order management service, the claim claiming approval management service and the payment management service.
3. The state-machine-based service processing method of claim 2, wherein creating the state machine based on the service information and a preset generic order creation template comprises:
and establishing a state machine of the type of the claim complaint approval management based on the preset general order establishing template and the claim complaint approval management process.
4. The state-machine-based service processing method according to claim 2, wherein the creating a state machine based on the service information and a preset generic order creation template comprises:
and establishing a state machine of a payment management type based on a preset general order establishing template and a payment management process.
5. The method for processing services based on a state machine according to claim 1, wherein the managing corresponding services based on the state machine comprises:
and under the condition that the next node of the state machine is a payment node, jumping to the payment node after determining that the corresponding payment event is a non-repeated payment event through idempotent verification.
6. The state-machine based transaction processing method of claim 2, wherein the propagation method comprises:
checking, supplementing context, checking context, saving context, and completing creation.
7. The state-machine based service processing method of claim 1, wherein after the obtaining of the operation information input by the user, the method further comprises:
and carrying out irreversible encryption processing on sensitive information in the operation information input by the user.
8. A state machine based transaction system, comprising:
the acquisition module is used for acquiring operation information input by a user;
the first determining module is used for determining the type of the service, the current service state and the received event based on the operation information input by the user;
the second determining module is used for determining a state machine configuration file based on the type of the service, the current service state and the received event;
the calling module is used for calling the corresponding state machine based on the state machine configuration file; the state machine is established based on service information and a preset general order establishing template; the state machine is one of the following: the system comprises an order management type state machine, a claim complaint examination and approval management type state machine and a payment management type state machine;
and the management module is used for managing the corresponding service based on the state machine.
9. A computer device comprising a memory and a processor, wherein computer readable instructions are stored in the memory, which computer readable instructions, when executed by the processor, cause the processor to perform the steps of the state machine based traffic processing method according to any of the claims 1 to 7.
10. A storage medium having stored thereon computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the state machine based traffic processing method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210999598.4A CN115375134A (en) | 2022-08-19 | 2022-08-19 | Service processing method and system based on state machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210999598.4A CN115375134A (en) | 2022-08-19 | 2022-08-19 | Service processing method and system based on state machine |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115375134A true CN115375134A (en) | 2022-11-22 |
Family
ID=84065989
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210999598.4A Pending CN115375134A (en) | 2022-08-19 | 2022-08-19 | Service processing method and system based on state machine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115375134A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116009935A (en) * | 2023-03-20 | 2023-04-25 | 成都数之联科技股份有限公司 | JS state management method, device, equipment and medium |
CN116977048A (en) * | 2023-09-25 | 2023-10-31 | 天津金城银行股份有限公司 | State machine system, transaction state management method and bank transaction system |
CN117993905A (en) * | 2024-02-06 | 2024-05-07 | 易方达基金管理有限公司 | Instruction state machine-based repainting method and device |
-
2022
- 2022-08-19 CN CN202210999598.4A patent/CN115375134A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116009935A (en) * | 2023-03-20 | 2023-04-25 | 成都数之联科技股份有限公司 | JS state management method, device, equipment and medium |
CN116009935B (en) * | 2023-03-20 | 2023-06-27 | 成都数之联科技股份有限公司 | JS state management method, device, equipment and medium |
CN116977048A (en) * | 2023-09-25 | 2023-10-31 | 天津金城银行股份有限公司 | State machine system, transaction state management method and bank transaction system |
CN117993905A (en) * | 2024-02-06 | 2024-05-07 | 易方达基金管理有限公司 | Instruction state machine-based repainting method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115375134A (en) | Service processing method and system based on state machine | |
US8438072B2 (en) | Online exchange system and method with reverse auction | |
US7240026B2 (en) | Method, apparatus, and computer-readable medium for integration of online and offline commerce | |
CN110599276B (en) | Bill reimbursement method, device and equipment and computer storage medium | |
WO2019152545A1 (en) | System and method for verifying retail returns using blockchain | |
US20140032392A1 (en) | Financing systems integration | |
US11687943B2 (en) | Electronic transaction data processing systems and methods | |
US20120089480A1 (en) | Online purchasing system and methods with buyer's agency | |
CN101192287B (en) | Method and system for automatically sending dummy resource | |
KR20190114396A (en) | Method, apparatus and computer-readable medium for providing transaction service based on blockchain | |
CN112348642A (en) | E-commerce transaction big data cloud platform | |
CN115456622A (en) | Processing method for B2C e-commerce order combined payment based on third-party payment channel | |
CN108876320A (en) | Enterprises service system | |
JP2023521215A (en) | Method, device and system for outbound control | |
CN108337213A (en) | A kind of method and device of account management | |
EP2249294A2 (en) | Using abstraction layers to facilitate communication between systems | |
CN109310916B (en) | System and method for resolving conflicts in ordering data products | |
CN112036855A (en) | Data interaction processing method, device, equipment and storage medium | |
CN111242753A (en) | Cross-platform operation control method and system | |
CN112785220A (en) | Inventory information processing method and device | |
KR102612583B1 (en) | System and method for representing licenses for export and computer program for the same | |
US11501351B2 (en) | Servers, systems, and methods for single sign-on of an automotive commerce exchange | |
US20220180360A1 (en) | Methods and systems of implementing a token transfer feature | |
US20230334467A1 (en) | Autofilling payment card and card verification data utilizing a virtual card exchange | |
US20220188907A1 (en) | Ecommerce marketplace with custom purchase order |
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 |