High-availability bookkeeping method and device based on orchestrability

By adopting an orchestable high-availability accounting method in the accounting system and using a two-way linked list model to execute the accounting process, the problems of fixed steps and high modification costs of existing accounting process are solved, and the flexibility and efficient development of the accounting process are achieved.

CN119557084APending Publication Date: 2025-03-04SHANGHAI PUDONG DEVELOPMENT BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411544388.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The steps of the existing accounting process are fixed when developing, difficult to expand, and the modification costs are high. The multi-accounting process development is large, time-consuming and labor-intensive, and maintenance costs are high.

Method used

Using a highly available accounting method based on orchestable, the source code of multiple accounting nodes is developed in advance, and the user configures the orchestration file, matches the orchestration file after receiving the accounting request, and generates a two-way linked list model to execute the accounting process.

Benefits of technology

It realizes dynamic arrangement of the accounting process, improves development efficiency, reduces development and maintenance costs, and simplifies the adjustment and expansion of the accounting process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557084A_ABST
    Figure CN119557084A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides a high-availability accounting method and device based on orchestration.The method comprises the steps that an orchestration file configured by a user according to a pre-developed accounting node is received and stored, and the orchestration file comprises an accounting process type, an accounting node list and accounting node attribute information; the bookkeeping node attribute information comprises an arrangement sequence of bookkeeping nodes, and source codes corresponding to the bookkeeping nodes are instantiated and loaded into a memory; receiving an accounting request, and matching an arrangement file associated with the accounting request from stored arrangement files; and generating a double linked list model according to the arrangement sequence of the accounting nodes in the matched arrangement file and the instances of the accounting nodes in the memory, and executing an accounting process according to the double linked list model. Dynamic arrangement of the bookkeeping process can be realized, the adjustment difficulty of the bookkeeping process is reduced, and the adjustment efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a programmable high-availability accounting method and device. Background Art

[0002] With the rapid development of the financial industry, accounting platforms / systems are continuously added, and the flexibility of accounting processes is increasingly required. However, the specific process steps of the existing accounting process are determined at the beginning of development, which makes it difficult to expand the steps later. Every time the accounting process is modified, it is necessary to modify the step function logic, maintain the execution order and priority relationship of the steps before and after, and improper modification will have the risk of affecting the original function. In serious cases, it will affect the system accounting and make it impossible to carry out business. In addition, multiple sets of processes need to be developed for different accounting processes, which has the problems of excessive development workload, time-consuming and labor-intensive, and high maintenance costs. Summary of the invention

[0003] The present invention is used to solve the problems in the prior art that the accounting process is fixed, has no expansion capability and has high modification cost, and when multiple accounting processes are involved, there are problems such as large development workload, time-consuming and labor-intensive, and high maintenance cost.

[0004] In order to solve the above technical problems, the first aspect of the present invention provides a programmable high-availability accounting method, comprising:

[0005] Receive and store the arrangement file configured by the user according to the pre-developed accounting node, wherein the arrangement file includes the accounting process type, the accounting node list and the accounting node attribute information, the accounting node attribute information includes the priority of the accounting node, and the source code corresponding to the accounting node has been instantiated and loaded into the memory;

[0006] receiving an accounting request, and matching an orchestration file associated with the accounting request from stored orchestration files;

[0007] A doubly linked list model is generated according to the arrangement order of the accounting nodes in the matched arrangement file and the instances of the accounting nodes in the memory, and the accounting process is executed according to the doubly linked list model.

[0008] As a further embodiment of the present invention, the accounting node attribute information further includes: a custom parameter of the accounting node, which is used to limit the execution mode of the accounting node;

[0009] The source code corresponding to the accounting node also includes reserved functions related to the custom parameters of the accounting node.

[0010] As a further embodiment of the present invention, the accounting node attribute information further includes: admission conditions of the accounting node and exit conditions of the accounting node;

[0011] The source code corresponding to the accounting node also includes a reserved function related to the admission condition of the accounting node and a reserved function related to the exit condition of the accounting node;

[0012] The reserved function related to the admission condition of the accounting node is used to determine whether the current state meets the admission condition of the accounting node before the method logic of the accounting node is executed;

[0013] The reserved function related to the egress condition of the accounting node is used to determine whether the current state meets the egress condition of the accounting node after the method logic of the accounting node is executed.

[0014] As a further embodiment of the present invention, a monitoring event logic is also provided in the source code corresponding to the accounting node, which is used to publish accounting node events before and after the method logic of the accounting node is executed.

[0015] As a further embodiment of the present invention, it also includes:

[0016] Monitor the execution process of the accounting node. When an error is detected in the current accounting node, roll back the data of the current accounting node.

[0017] After the abnormality is checked, the accounting request is re-initiated. When each accounting node is executed, it is determined whether the access conditions are met. If not, it enters the next accounting node. If so, the accounting node that meets the access conditions is determined as the interrupted accounting node, and the accounting process is executed starting from the interrupted accounting node.

[0018] As a further embodiment of the present invention, generating a bidirectional linked list model according to the priority of the accounting node in the matched arrangement file and the instance of the accounting node in the memory includes:

[0019] For the accounting nodes in the matching arrangement files, establish proxy nodes;

[0020] Embed the instance of the accounting node in the matching orchestration file in the memory into the proxy node of the accounting node in the matching orchestration file;

[0021] According to the arrangement order of the accounting nodes in the matched arrangement file, the proxy nodes of the relevant accounting nodes are assembled into a bidirectional linked list model.

[0022] As a further embodiment of the present invention, a plurality of functions are provided in the source code corresponding to the accounting node; the plurality of functions at least include a first function, a second function, a third function, a fourth function and a fifth function executed in sequence;

[0023] The first function is used to determine whether the accounting node is skipped;

[0024] The second function is used to verify the admission status and process direction of the accounting node;

[0025] The third function is used to perform data preprocessing operations;

[0026] The fourth function is used to execute core logic;

[0027] The fifth function is used to perform core logic post-processing operations.

[0028] A second aspect of the present invention provides a programmable high-availability accounting device, comprising:

[0029] A preprocessing unit, used to receive and store an arrangement file configured by a user according to a pre-developed accounting node, wherein the arrangement file includes an accounting process type, an accounting node list and accounting node attribute information, the accounting node attribute information includes an arrangement order of accounting nodes, and the source code corresponding to the accounting node has been instantiated and loaded into memory;

[0030] A process matching unit, configured to receive an accounting request and match an orchestration file associated with the accounting request from stored orchestration files;

[0031] The accounting response unit is used to generate a bidirectional linked list model according to the arrangement order of the accounting nodes in the matched arrangement file and the instances of the accounting nodes in the memory, and execute the accounting process according to the bidirectional linked list model.

[0032] A third aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any of the foregoing embodiments when executing the computer program.

[0033] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of a computer device, the method described in any of the above embodiments is implemented.

[0034] A fifth aspect of the present invention provides a computer program product, which includes a computer program. When the computer program is executed by a processor of a computer device, the method described in any of the above embodiments is implemented.

[0035] The high-availability accounting method and device based on programmability provided by the present invention develops the source code of multiple accounting nodes in advance, instantiates the source code of the accounting nodes and loads them into the memory; the user configures the program file according to the pre-developed accounting nodes; after receiving the accounting request, the program file associated with the accounting request is matched; a bidirectional linked list model is generated according to the program sequence of the accounting nodes in the matched program file and the accounting node instance in the memory, and the accounting process is executed according to the bidirectional linked list model, which can realize the dynamic program of the accounting process and achieve the effect of flexible change of the overall process. In the future, only the functions of the accounting nodes themselves need to be developed, and there is no need to consider the connection and sequence issues before and after, thereby improving development efficiency and reducing development and maintenance costs. When the accounting process needs to be changed, such as when the accounting nodes change, the accounting nodes are added, deleted, modified, or the time sequence of the accounting nodes is adjusted, or the custom attributes of the nodes are adjusted, only the program file needs to be adjusted, which can reduce the difficulty of adjusting the accounting process and improve the adjustment efficiency. When there is a new accounting scenario, it is only necessary to add a new accounting node and choreograph it with the existing accounting nodes to obtain a new accounting process. The present invention can also orchestrate multiple sets of accounting processes to run synchronously according to different accounting scenarios, thereby improving development efficiency and achieving high availability.

[0036] In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0038] Figure 1 A structural diagram of a programmable high-availability accounting system according to an embodiment of the present invention is shown;

[0039] Figure 2A A flow chart of a programmable high-availability accounting method according to an embodiment of the present invention is shown;

[0040] Figure 2B A schematic diagram of a bidirectional linked list model according to a specific embodiment of the present invention is shown;

[0041] Figure 3 A flow chart showing a process of generating a bidirectional linked list model according to an embodiment of the present invention is shown;

[0042] Figure 4 A schematic diagram of a bidirectional linked list model according to a specific embodiment of the present invention is shown;

[0043] Figure 5 A schematic diagram showing the accounting node structure of an embodiment of the present invention is shown;

[0044] Figure 6 shows a flow chart of the interrupt handling process in an embodiment of the present invention;

[0045] Figure 7 A structural diagram of a programmable high-availability accounting device according to an embodiment of the present invention is shown;

[0046] Figure 8 A structural diagram of a computer device according to an embodiment of the present invention is shown.

[0047] Description of the accompanying symbols:

[0048] 101. Design end;

[0049] 102. Server;

[0050] 103. Client;

[0051] 701, pre-processing unit;

[0052] 702, process matching unit;

[0053] 703, accounting response unit;

[0054] 802. Computer equipment;

[0055] 804, processor;

[0056] 806. Memory;

[0057] 808, driving mechanism;

[0058] 810, input / output module;

[0059] 812. Input device;

[0060] 814. Output device;

[0061] 816. Presentation equipment;

[0062] 818. Graphical user interface;

[0063] 820, network interface;

[0064] 822, communication link;

[0065] 824. Communication bus. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0068] This specification provides method operation steps as described in the embodiments or flow charts, but more or fewer operation steps may be included based on routine or non-creative work. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the system or device product is executed in practice, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel.

[0069] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0070] The specific steps of the accounting process in the prior art are fixed, and it is difficult to expand the steps later. Every time the accounting process is modified, it is necessary to modify the step function logic, maintain the execution order and priority relationship of the steps before and after, and improper modification will have the risk of affecting the original function. In serious cases, it will affect the system accounting and make the business unable to be carried out. When multiple accounting processes are involved, there are problems such as large development workload, time-consuming and labor-intensive, and high maintenance costs.

[0071] In order to solve the above technical problems, an embodiment of the present invention provides a high-availability accounting system based on programmability, such as Figure 1 As shown, it includes: a design end 101, a service end 102 and a client end 103.

[0072] The design end 101 is used for users to pre-develop the source code of the accounting nodes, and for users to configure and arrange files according to the pre-developed accounting nodes.

[0073] The user in this step is a developer. The accounting node and its source code developed by the developer are shared with authorized personnel. The source code of the accounting node is used to implement the logical functions of the accounting step.

[0074] When users develop accounting processes for accounting scenarios, they will develop the source code of accounting nodes according to the accounting process. If the source code of the accounting nodes required by the accounting process exists in the system, there is no need to develop the source code of the corresponding accounting nodes, and they can be directly reused. It should be noted that the existing accounting nodes in the system have participated in the arrangement of accounting processes.

[0075] When the accounting nodes developed in the database do not meet user needs, users can first develop the source code of the accounting nodes according to actual needs, and then configure the arrangement file on this basis. For example:

[0076] To add a new accounting scenario, you need to record off-balance sheet accounts, core accounts, accounting accounts, and generate entries. At this time, there are already off-balance sheet account nodes, core account nodes, and generate entry nodes used in other scenarios. Therefore, for the new accounting scenario, you only need to add an accounting account node and arrange the off-balance sheet account node, core account node, generate entry node, and accounting account node into a new accounting process.

[0077] The arrangement file includes the accounting process type, the accounting node list and the accounting node attribute information. The accounting process type is used to uniquely identify the accounting process. The accounting node attribute information includes the arrangement order of the accounting nodes. The arrangement order of the accounting nodes is used to determine the priority of the accounting nodes, that is, the accounting nodes arranged first have a high priority, and the accounting nodes arranged later have a low priority. The accounting nodes are steps in the accounting process. For example, a certain accounting process includes the following steps: instruction allocation, pre-settlement preparation, business balance accounting, instruction accounting, core accounting, off-balance sheet accounting, generating entries, payment, and verification. The accounting nodes developed by the design end 101 include each accounting node included in the entire accounting process, as well as the accounting nodes unique to the accounting process. In the subsequent embodiments, unless otherwise specified, nodes refer to accounting nodes.

[0078] The server 102 is used to instantiate the source code of the accounting node and load it into the memory, receive and store the arrangement file configured by the user according to the pre-developed accounting node; receive the accounting request sent by the client 103, match the arrangement file associated with the accounting request from the stored arrangement file; generate a bidirectional linked list model according to the priority of the accounting node in the matched arrangement file and the instance of the accounting node in the memory, and execute the accounting process according to the bidirectional linked list model.

[0079] In some embodiments of the present specification, the client 103 may be a desktop computer, a tablet computer, a laptop computer, a smart phone, a digital assistant, a smart wearable device, etc. Among them, the smart wearable device may include a smart bracelet, a smart watch, smart glasses, a smart helmet, etc. Of course, the client 103 is not limited to the above-mentioned electronic devices with a certain entity, and it can also be software running in the above-mentioned electronic devices.

[0080] In actual implementation, after the design end 101 uploads the source code of the accounting node, it will instantiate the source code of the accounting node and load it into the memory.

[0081] In some implementations, there are multiple accounting processes in the system, which supports matching different businesses with different accounting processes, supports matching different approvers with different accounting processes (which can be achieved by setting accounting process access permissions), supports matching different financial institutions (such as bank branches) with different accounting processes, etc., and supports accounting process matching in any dimension.

[0082] In some implementations, the accounting request includes a business type, and the business type is associated with an accounting process type (i.e., an accounting model), for example, "business A" is associated with "accounting model A", and "business B" is associated with "accounting model B". After receiving the accounting request, the server 102 first extracts the business type in the accounting request, matches the accounting process type associated with the accounting request from the mapping relationship between the business type and the accounting process type based on the extracted business type, and matches the orchestration file associated with the accounting request from the orchestration file repository according to the accounting process type associated with the accounting request.

[0083] In some implementations, the accounting request includes an accounting process type. After receiving the accounting request, the server 102 first extracts the accounting process type in the accounting request, and matches the orchestration file associated with the accounting request from the orchestration file repository according to the extracted accounting process type.

[0084] The bidirectional linked list model can determine the execution order and the relationship between the front and back of all accounting nodes to avoid the omission of node functions and the inability to carry out business. At the same time, the bidirectionality of the bidirectional linked list model also responds to the forward accounting / reverse erasure in actual scenarios, supports forward (Forward) and reverse (Backward) operations, and corresponds to the accounting (settle) and erasure (settleErase) in the accounting process to meet the business accounting requirements, and can perform multiple forward and reverse operations. The bidirectional linked list model can be regarded as a "bidirectional pointer". By setting the "front" and "back" relationship of the node through the data structure, the order between accounting nodes can be ensured. At the macro level, each accounting node is independent, and the front and back will point to the corresponding accounting node (except the first node and the tail node). At the micro level, all accounting nodes include rich "hook methods" to meet the logic requirements. Each accounting node sets "next" and "previous" to point to the next accounting node and the previous accounting node. The first node has no "previous" and the tail node has no "next".

[0085] When executing the forward operation, executing the accounting process according to the bidirectional linked list model includes: traversing each accounting node in the bidirectional linked list model, and each time a accounting node is traversed, obtaining and running the function of the accounting node from the memory.

[0086] This embodiment develops the source code of multiple accounting nodes in advance, instantiates the source code of the accounting nodes and loads them into the memory; the user configures the arrangement file according to the pre-developed accounting nodes; after receiving the accounting request, the arrangement file associated with the accounting request is matched; a bidirectional linked list model is generated according to the arrangement order of the accounting nodes in the matched arrangement file and the accounting node instance in the memory, and the accounting process is executed according to the bidirectional linked list model, which can realize the dynamic arrangement of the accounting process and achieve the effect of flexible change of the overall process. In the future, only the functions of the accounting nodes themselves need to be developed, and there is no need to consider the connection and sequence issues, which improves development efficiency and reduces development and maintenance costs. When the accounting process needs to be changed, such as when the accounting nodes change, add, delete, modify the accounting nodes, or adjust the time sequence of the accounting nodes, or adjust the custom attributes of the nodes, it is only necessary to adjust the arrangement file. When there is a new accounting scenario, it is only necessary to add a new accounting node and choreograph it together with the existing accounting nodes to obtain a new accounting process, which can reduce the difficulty of adjusting the accounting process and improve the adjustment efficiency. The present invention can also arrange multiple sets of accounting processes to run synchronously according to different accounting scenarios, thereby improving development efficiency and achieving high availability.

[0087] In one embodiment of the present invention, a high-availability accounting method based on programmability is also provided. Figure 2A As shown, including:

[0088] Step 201, receiving and storing an orchestration file configured by a user according to a pre-developed accounting node, wherein the orchestration file includes an accounting process type, an accounting node list, and accounting node attribute information, the accounting node attribute information includes an orchestration order of the accounting nodes, and the source code corresponding to the accounting node has been instantiated and loaded into the memory.

[0089] Node instances are used to implement the functional logic of the node. For example, the "core accounting" node implements the following functions: generating account numbers / querying account numbers, assembling accounting messages, calling accounting interfaces, and storing accounting end status. For another example, the "generate entry" node implements the following functions: obtaining accounting change data based on business conditions, generating full entry data based on accounting configuration and change data, and then generating final entry data through merging, filtering and other processes, and storing them.

[0090] When implementing this step, Spring is used to dynamically configure the instantiation step. Specifically, the accounting node is configured in Spring and the orchestration file is set in Spring. The orchestration file is recorded as applicationContext and is in XML format. When implementing it, the accounting nodes in the orchestration file are configured according to the current business needs. For example, if the current business involves three accounting nodes: instruction accounting, generating entries, and verifying, only these three nodes are described during the accounting orchestration.

[0091] The contents of the orchestration file are as follows:

[0092] <bean class=“XXXXXXX”>

[0093]

[0094] Among them, bean corresponds to the implementation class of the node.

[0095] Flowtype value is the accounting process type, which is used to distinguish accounting processes in multiple accounting scenarios. Specifically, when accounting occurs, the task engine matches the corresponding arrangement file according to the "value" value (i.e. NormalSpdsettle) corresponding to "flowType", and accounts according to the "value". The task engine is a module in the project. Its main purpose is to encapsulate the arranged accounting process into a "bidirectional linked list" structure that can be recognized by the program, that is, a bidirectional linked list model.

[0096] Bean class is a specific implementation class that executes the corresponding implementation class method.

[0097] List is a list of accounting nodes. The order of the accounting nodes indicates the arrangement order of the accounting nodes.

[0098] In this step, instantiation compiles and loads the corresponding class source code of all nodes into memory, and searches in memory according to the instance name when used later.

[0099] Step 202: Receive an accounting request, and match an orchestration file associated with the accounting request from the stored orchestration files.

[0100] When this step is implemented, the task engine "taskEngine" is enabled by Spring, and the task engine "taskEngine" matches the corresponding orchestration file according to the accounting flow type "flowType" in the accounting request.

[0101] Step 203: Generate a bidirectional linked list model according to the priority of the accounting node in the matched arrangement file and the instance of the accounting node in the memory, and execute the accounting process according to the bidirectional linked list model.

[0102] In a specific embodiment, the accounting nodes in the arrangement file include: instruction allocation nodes, handling nodes, core accounting nodes, payment call nodes and other nodes. The bidirectional linked list model constructed is as follows Figure 2B The accounting process is performed according to the flow of accounting nodes in the bidirectional linked list model. Figure 2B In the process, starting from the "instruction allocation node" and ending at the "quota processing node", all nodes are processed serially until the last node is executed. When the judgment node "next" points to empty, it indicates that there is no subsequent node, and the overall accounting process ends.

[0103] In specific implementation, for each accounting node in the matched arrangement file, a proxy node is established, and the accounting node instance in the memory is embedded into the corresponding proxy node. According to the arrangement order of the accounting nodes in the matched arrangement file, the proxy nodes of the relevant accounting node instances are assembled into a two-way linked list model. When accounting, the two-way linked list model is directly traversed, and the functions of each node are executed in sequence. If there is a problem after the accounting is completed, the "erase account" operation can be performed, which can be strictly executed in reverse order. For example, starting from the first proxy node: proxy node 1->previous node (previous) is "empty"; proxy node 1->next node (next) is "proxy node 2", proxy node 2->previous is "proxy node 1"; "proxy node 2"->next is "proxy node 3"; ...; "proxy node N"->previous is "proxy node N-1", "proxy node N"->next is "empty", so far, the two-way linked list model is assembled. Start execution from the first proxy node, and after execution, look for the "next" proxy node until the process ends when "next" is "empty".

[0104] The present invention can support dynamic arrangement of the accounting process, directly configure nodes in Spring, and adjust the priority according to the node position. In the future, only the node function itself needs to be developed without considering the connection and sequence issues. Multiple sets of processes can be run synchronously according to the differences in the accounting process and executed after accurate matching. This can not only improve development efficiency, but also achieve high availability.

[0105] In one embodiment of the present invention, the accounting node attribute information also includes: custom parameters of the accounting node, which are used to limit the execution mode of the accounting node; the source code corresponding to the accounting node is also provided with reserved functions related to the custom parameters of the accounting node. Among them, the custom parameters include but are not limited to parameters for determining whether to verify, whether to skip, whether to suspend the account, whether to support manual processing, etc. The present invention does not limit the number of custom parameters.

[0106] For example, in the arrangement file of the aforementioned embodiment, the PaymentTask payment node is configured with a verification custom parameter. When the "needHandCHeck" value is "1", the node can be verified in the subsequent logic.

[0107] In one embodiment of the present invention, the accounting node attribute information also includes: the admission conditions of the accounting node and the exit conditions of the accounting node.

[0108] The source code corresponding to the accounting node also includes a reserved function related to the admission condition of the accounting node and a reserved function related to the exit condition of the accounting node;

[0109] The reserved function related to the admission condition of the accounting node is used to determine whether the current state meets the admission condition of the accounting node before the method logic of the accounting node is executed, that is, whether the current state is the preset state completed by the previous accounting node;

[0110] The reserved function related to the quasi-exit condition of the accounting node is used to determine whether the current state meets the quasi-exit condition of the accounting node after the method logic of the accounting node is executed, that is, whether the current state is the completion state of the current node.

[0111] This embodiment can avoid the inability to identify the node execution status in the event of an interruption, perform entry and exit judgments on all nodes according to the current status, and cooperate with the bidirectional linked list characteristics to ensure that the nodes are executed strictly according to the orchestration mode, avoid node omission or repeated execution, and ensure that all nodes are executed correctly. The entire process forms a closed loop, avoiding unpredictable errors in advance.

[0112] In one embodiment of the present invention, the source code corresponding to the accounting node is also provided with a monitoring event logic, which is used to publish the accounting node event before and after the method logic of the accounting node is executed. In specific implementation, the monitoring event logic is provided at the entry and exit of the source code corresponding to the accounting node. For example, after the execution of the generated entry node, an event is published, and the general ledger event summary / detailed data is prepared to send data to the "general ledger system" in real time.

[0113] This embodiment can improve the scalability of accounting nodes.

[0114] In one embodiment of the present invention, Figure 2B As shown, the programmable high-availability accounting method also includes:

[0115] Monitor the execution process of the accounting node. When an error is detected in the current accounting node, roll back the data of the current accounting node and manually intervene to determine the abnormal situation.

[0116] After the abnormality is checked, the accounting request is re-initiated. When each accounting node is executed, it is determined whether the access conditions are met. If not, it enters the next accounting node. If so, the accounting node that meets the access conditions is determined as the interruption node, and the accounting process is executed from the interruption node.

[0117] This embodiment enables the accounting node to support error interruption and continue to execute functions from the problem node. When the accounting process is executed, if force majeure factors such as service downtime, power outage, or node logic abnormality error are encountered, the accounting process will be interrupted, and all node execution results will be stored in the library. At the same time, all nodes are independent of each other and will not affect each other. After manual intervention to solve the problem, the accounting process can be initiated again. Since the perfect preparation and exit conditions have been configured before, when accounting again, the nodes will be judged in order according to the current status. The nodes that have been executed will be skipped until the current state is the preset completion state of the previous node of the node. The node logic will be entered until all process executions are completed. This embodiment solves the problem of interruption and restart, or repeated execution or missed execution of nodes after interruption, and ensures the integrity of the business logic.

[0118] In one embodiment of the present invention, Figure 3 As shown, step 203 generates a bidirectional linked list model according to the arrangement order of the accounting nodes in the matched arrangement file and the instance of the accounting nodes in the memory, including:

[0119] Step 301: Create a proxy node for the accounting node in the matched arrangement file.

[0120] Step 302: embed the instance of the accounting node in the matched arrangement file in the memory into the proxy node of the accounting node in the matched arrangement file.

[0121] Step 303: According to the arrangement order of the accounting nodes in the matched arrangement file, the proxy nodes of the relevant accounting nodes are assembled into a bidirectional linked list model.

[0122] This embodiment wraps the instance of the accounting node through the proxy node, which can play an intermediary role and isolate the model from the real node.

[0123] During specific implementation, relevant processing logic can be added to the proxy node according to the custom attribute parameters of the accounting node, and monitoring logic for each node can be added to the proxy node, so that the previous functions can be expanded through the proxy node without modifying the node object.

[0124] In one embodiment of the present invention, a plurality of functions are provided in the source code corresponding to the accounting node; the plurality of functions at least include a first function, a second function, a third function, a fourth function and a fifth function executed in sequence;

[0125] The first function is used to determine whether the accounting node is skipped, which can be recorded as Ignore.

[0126] The second function is used to verify the admission status and process direction of the accounting node, which can be recorded as DoCheck.

[0127] The third function is used to perform data preprocessing operations and can be recorded as DoBefore.

[0128] The fourth function is used to execute core logic and can be recorded as DoWork.

[0129] The fifth function is used to perform post-core logic processing operations, which can be recorded as DoAfter.

[0130] In one embodiment of the present invention, the entire life cycle of the accounting process involves the instantiation of spring, event monitoring, and publishing. The proxy node uses the proxy design pattern, the task engine uses the singleton design pattern, the decorator pattern is used inside the node, and the assembly node uses the factory pattern. At the same time, it meets the transaction characteristics, can be freely arranged and configured, and can customize the process, etc., providing a good platform for business accounting.

[0131] In one embodiment of the present invention, a bidirectional linked list model is generated according to the arrangement order of the accounting nodes in the matched arrangement file and the instance of the accounting nodes in the memory. Figure 4 As shown, all nodes are arranged into an ordered bidirectional linked list model. Each node includes "nextNode" and "previousNode" attributes. The first node has no "previousNode" and the tail node has no "nextNode".

[0132] The "current status" runs through the entire accounting process, and each node has entry and exit judgments (entry, exit and other functions are implemented in the reserved functions of the specific logic of the node). For example, the "Generate Entry" node determines whether the "current status" is "core account completed". If it is "yes", the "Generate Entry" node is executed. If it is "no", it means that a node has not been executed or the current node is repeated, and an error prompt is reported according to the actual situation. Therefore, the "core account completion" status is the exit condition of the "core account" node, and it is also the entry condition of the "generate entry" node.

[0133] Transaction isolation between nodes: when a node reports an error, only the current node data is rolled back without affecting other nodes. Figure 4 In the "core accounting" node, when the node logic reports an error, only the node is rolled back. In specific implementation, the spring framework configuration and transaction-related annotations can be added to the implementation class to achieve only rolling back the current node data when a node reports an error.

[0134] For nodes, you can configure customized parameters for subsequent judgment. For the "payment" node, configure the "needHandCheck" value. When the subsequent node logic is executed, the "needHandCheck" parameter can be used to perform customized accounting for specific businesses.

[0135] The bidirectional linked list model supports "forward" and "reverse" operations. Since the specific front and back nodes have been determined when the model is constructed, for the account erasure process, all ordered nodes of the account recording process can be traced back and executed in reverse to ensure the correctness of the reverse operation. Figure 5 As shown, Figure 5 The schematic diagram of the accounting node structure of the embodiment of the present invention is shown. Specifically, each accounting node structure includes multiple reserved methods and end events, and each reserved method entry will perform a preparation state check. When the node starts to execute, the method logic is always executed in the order of Ignore->doCheck->doBefore->doWork_doAfter.

[0136] Ignore is used to specify whether a node should be skipped. DoCheck is used to specify node checking. DoBefore is used to specify the pre-processing of the core logic. DoWork is used to specify the core logic processing. DoAfter is used for the post-processing of the core logic.

[0137] The "current state" will be judged at the entrance of each reserved method, and the "process direction" will also be judged. "Forward" and "Backward" will take different processing branches. The "current state" and "process direction" ensure the correctness of node execution.

[0138] The reserved method is defined in the interface. All nodes implement the top-level interface. When the node is executed, it is dynamically mapped to the specific implementation method according to the entity class. The reserved method and its function are shown in Table 1:

[0139] Table 1

[0140]

[0141]

[0142] In one embodiment of the present invention, an error scenario is inevitable in the accounting / deletion process. The present invention supports continuing to execute functions from the error point after the process is interrupted due to an error. Taking the forward process as an example, the reverse process is processed in the same way. The specific process is as follows: Figure 6 shown.

[0143] An error occurred in the "Generate Entry" node. When the process was interrupted after the error, the accounting process was initiated again after manual intervention. The taskEngine engine compiled a bidirectional linked list model according to the accounting process again, and selected the starting point of the process based on the forward / reverse direction. Since each node has an access judgment, it starts from the first node to judge whether the "current state" meets the preparation conditions of the node. If the access is not met, it will continue to the next node until it loops to the interrupted node. At this time, the access conditions are met and the unfinished operations of the current node are continued. The execution process of each node can be seen in Figure 5 As shown, the process ends when all nodes are executed.

[0144] Based on the same inventive concept, the present invention also provides a programmable high-availability accounting device, as described in the following embodiments. Since the principle of solving the problem based on the programmable high-availability accounting device is similar to that based on the programmable high-availability accounting method, the implementation of the programmable high-availability accounting device can refer to the programmable high-availability accounting method, and the repeated parts will not be repeated.

[0145] Specifically, Figure 7 As shown, the programmable high-availability accounting device includes:

[0146] The preprocessing unit 701 is used to receive and store the arrangement file configured by the user according to the pre-developed accounting node, wherein the arrangement file includes the accounting process type, the accounting node list and the accounting node attribute information, the accounting node attribute information includes the arrangement order of the accounting nodes, and the source code corresponding to the accounting node has been instantiated and loaded into the memory;

[0147] A process matching unit 702, configured to receive an accounting request and match an orchestration file associated with the accounting request from stored orchestration files;

[0148] The accounting response unit 703 is used to generate a bidirectional linked list model according to the matching arrangement file of the accounting node in the arrangement file and the instance of the accounting node in the memory, and execute the accounting process according to the bidirectional linked list model.

[0149] The present invention develops the source code of multiple accounting nodes in advance, instantiates the source code of the accounting nodes and loads them into the memory; the user configures the arrangement file according to the pre-developed accounting nodes; after receiving the accounting request, the arrangement file associated with the accounting request is matched; a bidirectional linked list model is generated according to the accounting node priority in the matched arrangement file and the accounting node instance in the memory, and the accounting process is executed according to the bidirectional linked list model, which can realize the dynamic arrangement of the accounting process and achieve the effect of flexible change of the overall process. In the future, only the functions of the accounting nodes themselves need to be developed, and there is no need to consider the connection and sequence issues before and after, thereby improving development efficiency and reducing development and maintenance costs. When the accounting process needs to be changed, only the arrangement file needs to be adjusted, which can reduce the difficulty of adjusting the accounting process and improve the adjustment efficiency. When there is a new accounting scenario, only a new accounting node needs to be added, and a new accounting process can be obtained by arranging it together with the existing accounting nodes. The present invention can also arrange multiple sets of accounting processes to run synchronously according to different accounting scenarios, thereby improving development efficiency and achieving high availability.

[0150] In one embodiment of the present invention, a computer device is also provided, such as Figure 8 As shown, the computer device 802 may include one or more processors 804, such as one or more central processing units (CPUs), each of which may implement one or more hardware threads. The computer device 802 may also include any memory 806, which is used to store any kind of information such as code, settings, data, etc. Non-limitingly, for example, the memory 806 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 802. In one case, when the processor 804 executes an associated instruction stored in any memory or a combination of memories, the computer device 802 may perform any operation of the associated instruction. The computer device 802 also includes one or more drive mechanisms 808 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.

[0151] The computer device 802 may also include an input / output module 810 (I / O) for receiving various inputs (via input devices 812) and for providing various outputs (via output devices 814). A specific output mechanism may include a presentation device 816 and an associated graphical user interface 818 (GUI). In other embodiments, the input / output module 810 (I / O), input device 812, and output device 814 may not be included, and the computer device 802 may be used as a computer device in a network. The computer device 802 may also include one or more network interfaces 820 for exchanging data with other devices via one or more communication links 822. One or more communication buses 824 couple the components described above together.

[0152] The communication link 822 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 822 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.

[0153] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are executed.

[0154] An embodiment of the present invention further provides a computer-readable instruction, wherein when a processor executes the instruction, the program therein causes the processor to execute the steps of the above method.

[0155] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0156] It should also be understood that in the embodiments of the present invention, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects before and after are in an "or" relationship.

[0157] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0158] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0159] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.

[0160] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0161] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0162] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0163] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A programmable high-availability accounting method, characterized in that: include: Receive and store the arrangement file configured by the user according to the pre-developed accounting node, wherein the arrangement file includes the accounting process type, the accounting node list and the accounting node attribute information, the accounting node attribute information includes the arrangement order of the accounting nodes, and the source code corresponding to the accounting node has been instantiated and loaded into the memory; receiving an accounting request, and matching an orchestration file associated with the accounting request from stored orchestration files; A doubly linked list model is generated according to the arrangement order of the accounting nodes in the matched arrangement file and the instances of the accounting nodes in the memory, and the accounting process is executed according to the doubly linked list model.

2. The method according to claim 1, characterized in that The accounting node attribute information also includes: custom parameters of the accounting node, which are used to limit the execution mode of the accounting node; The source code corresponding to the accounting node also includes reserved functions related to the custom parameters of the accounting node.

3. The method according to claim 1, characterized in that The accounting node attribute information also includes: the admission conditions of the accounting node and the exit conditions of the accounting node; The source code corresponding to the accounting node also includes a reserved function related to the admission condition of the accounting node and a reserved function related to the exit condition of the accounting node; The reserved function related to the admission condition of the accounting node is used to determine whether the current state meets the admission condition of the accounting node before the method logic of the accounting node is executed; The reserved function related to the egress condition of the accounting node is used to determine whether the current state meets the egress condition of the accounting node after the method logic of the accounting node is executed.

4. The method according to claim 3, characterized in that The source code corresponding to the accounting node is also provided with a monitoring event logic for publishing accounting node events before and after the method logic of the accounting node is executed.

5. The method according to claim 3, characterized in that Also includes: Monitor the execution process of the accounting node. When an error is detected in the current accounting node, roll back the data of the current accounting node. After the abnormality is checked, the accounting request is re-initiated. When each accounting node is executed, it is determined whether the access conditions are met. If not, it enters the next accounting node. If so, the accounting node that meets the access conditions is determined as the interruption node, and the accounting process is executed from the interruption node.

6. The method according to claim 1, characterized in that The bidirectional linked list model is generated according to the arrangement order of the accounting nodes in the matched arrangement file and the instance of the accounting nodes in the memory, including: For the accounting nodes in the matching arrangement files, establish proxy nodes; Embed the instance of the accounting node in the matching orchestration file in the memory into the proxy node of the accounting node in the matching orchestration file; According to the arrangement order of the accounting nodes in the matched arrangement file, the proxy nodes of the relevant accounting nodes are assembled into a bidirectional linked list model.

7. The method according to claim 1, characterized in that A plurality of functions are provided in the source code corresponding to the accounting node; the plurality of functions at least include a first function, a second function, a third function, a fourth function and a fifth function executed in sequence; The first function is used to determine whether the accounting node is skipped; The second function is used to verify the admission status and process direction of the accounting node; The third function is used to perform data preprocessing operations; The fourth function is used to execute core logic; The fifth function is used to perform core logic post-processing operations.

8. A highly available accounting device based on programmability, characterized in that: include: A preprocessing unit, used to receive and store an arrangement file configured by a user according to a pre-developed accounting node, wherein the arrangement file includes an accounting process type, an accounting node list and accounting node attribute information, the accounting node attribute information includes an arrangement order of accounting nodes, and the source code corresponding to the accounting node has been instantiated and loaded into memory; A process matching unit, configured to receive an accounting request and match an orchestration file associated with the accounting request from stored orchestration files; The accounting response unit is used to generate a bidirectional linked list model according to the arrangement order of the accounting nodes in the matched arrangement file and the instances of the accounting nodes in the memory, and execute the accounting process according to the bidirectional linked list model.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor of a computer device, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product, comprising a computer program, characterized in that: When the computer program is executed by a processor of a computer device, the method according to any one of claims 1 to 7 is implemented.