Business processing method and apparatus
Patent Information
- Application Number
- CN202210469310.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-04-28
AI Technical Summary
[0004]本申请实施例提供的业务处理方法及装置,用于解决现有技术中存在的上述问题,能够解决由于网络问题导致部分报文消息丢失,对应各参与方业务系统接收不到需要的报文消息,无法进行正常业务逻辑处理,导致在各参与方业务系统之间出现数据不一致问题,保障各参与方业务系统之间数据的一致性
[0039]本申请实施例提供的业务处理方法及装置,能够解决由于网络问题导致部分报文消息丢失,对应各参与方业务系统接收不到需要的报文消息,无法进行正常业务逻辑处理,导致在各参与方业务系统之间出现数据不一致问题,保障各参与方业务系统之间数据的一致性。
Smart Images

Figure CN117014454B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a service processing method and apparatus. Background Technology
[0002] In the business support domain, business data exchanged via asynchronous message interfaces refers to the digitized representation of customer subscriptions / cancellations of business products and functions exchanged between multiple participants, including external customer support systems, business platform systems, and provincial systems (such as operator provincial systems), through standardized HTTP interfaces. Currently, related data exchange is achieved through three main categories of asynchronous message exchanges via HTTP interfaces: subscription / cancellation request and response messages between the external customer support system and the business platform system; subscription / cancellation request and completion messages between the business platform system and the corresponding provincial system; and completion and response messages between the business platform system and the external customer support system.
[0003] Whether the data is consistent between the systems of all participating parties can only be discovered after the monthly settlement and reconciliation. The reconciliation process requires a lot of manpower and time to compare data, which is inefficient. Due to network problems, some message messages are lost, and the corresponding business systems of each participating party cannot receive the required message messages, thus failing to perform normal business logic processing, resulting in data inconsistency between the business systems of each participating party. Summary of the Invention
[0004] The business processing method and apparatus provided in this application are used to solve the above-mentioned problems existing in the prior art. They can solve the problem that some message messages are lost due to network problems, and the corresponding participating party business systems cannot receive the required message messages and cannot perform normal business logic processing, resulting in data inconsistency between the participating party business systems, and ensure the consistency of data between the participating party business systems.
[0005] In a first aspect, an embodiment of this application provides a business processing method, including:
[0006] Send the target service-related message of type 1 to the blockchain, and send the target service-related message of type 2 to the cache or the blockchain;
[0007] Retrieve the next message from the cache, send the next message to the blockchain, and delete the corresponding message from the cache;
[0008] Based on the target business status on the blockchain, send target business status data to the business systems of each participating party;
[0009] The target service-related message is determined based on the target service-related message received from the business systems of each participating party;
[0010] The target service status is determined based on the message messages of the target service associated with the blockchain.
[0011] In one embodiment, according to a business processing method provided in this application, sending the target business-related message of type two to the cache or the blockchain includes:
[0012] Extract the associated fields of the second type of message and determine whether there is corresponding transaction information on the blockchain;
[0013] If not, the message of the second type will be sent to the buffer;
[0014] If so, then query whether the previous message on the blockchain has been processed;
[0015] If the previous message has not been processed, the second type of message is sent to the cache;
[0016] If the previous message has been processed, the second type of message is sent to the blockchain.
[0017] In one embodiment, a business processing method provided according to an embodiment of this application...
[0018] The step of sending target business status data to the business systems of each participating party based on the target business status on the blockchain includes:
[0019] If the target business status is successful, the smart contract on the blockchain is triggered to send the success data of the target business result to the business systems of each participating party.
[0020] If the target business status is a failure status, the smart contract on the blockchain is triggered to send the failure data of the target business result to the business systems of each participating party.
[0021] The target service status data includes target service result success data and target service result failure data;
[0022] The business systems of each participating party include external customer support systems, business platform systems, and business logic processing systems.
[0023] In one embodiment, according to a business processing method provided in this application, the target business state on the blockchain is determined in the following manner:
[0024] If all message messages associated with the target business on the blockchain are in a successful state, or if all message messages not associated with the target business are in a successful state but it is determined that the key message messages in the second type of message messages associated on the blockchain are in a successful state, then the target business is determined to be in a successful state.
[0025] If all message messages associated with the target business on the blockchain are in a failed state, or if all message messages not associated with the target business are determined to be in a failed state, or if all message messages not associated with the target business are determined to be in a successful state, and the difference between the current time and the time of the most recent update of the data storage structure is greater than a preset threshold, then the target business is determined to be in a failed state.
[0026] In one embodiment, a business processing method provided according to an embodiment of this application further includes: associating all message messages of the target business according to the data storage structure on the blockchain composed of preset association fields.
[0027] In one embodiment, according to a business processing method provided by an embodiment of this application, the preset association field includes at least the following association fields:
[0028] The message ID, request time, version number, time of the most recent update of the data storage structure, message field value, number associated with the message, business type associated with the message, final status of the business associated with the message, content information corresponding to the message, intermediate status of the business, and sequence string of associated fields of the currently processed message.
[0029] Secondly, embodiments of this application also provide a business processing apparatus, including: a message storage module, a message processing module, and a data synchronization module;
[0030] The message storage module is used to send target business-related message messages of type 1 to the blockchain, and to send target business-related message messages of type 2 to the cache or the blockchain;
[0031] The message processing module is used to retrieve the next message from the cache, send the next message to the blockchain, and delete the corresponding message from the cache.
[0032] The data synchronization module is used to send target business status data to the business systems of each participating party based on the target business status on the blockchain.
[0033] The target service-related message is determined based on the target service-related message received from the business systems of each participating party;
[0034] The target service status is determined based on the message messages of the target service associated with the blockchain.
[0035] In one embodiment, a business processing apparatus according to an embodiment of this application includes, wherein the business systems of each participating party include:
[0036] External customer support system, business platform system, and business logic processing system.
[0037] Thirdly, embodiments of this application also provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the program to implement the method described in the first aspect.
[0038] Fourthly, embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0039] The business processing method and apparatus provided in this application can solve the problem of data inconsistency between participating business systems caused by the loss of some message messages due to network problems, resulting in the inability of each participating business system to receive the required message messages and perform normal business logic processing, thus ensuring the consistency of data between participating business systems. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a schematic diagram of the business system architecture of each participant in the message interaction provided in the embodiments of this application;
[0042] Figure 2 This is one of the flowcharts illustrating the business processing method provided in the embodiments of this application;
[0043] Figure 3 This is a schematic diagram of a business processing system architecture for implementing business processing methods provided in an embodiment of this application;
[0044] Figure 4 This is a second schematic flowchart of the business processing method provided in the embodiments of this application;
[0045] Figure 5 This is a schematic diagram of the structure of the business processing device provided in the embodiments of this application;
[0046] Figure 6 This is a schematic diagram of the physical structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the embodiments of this application.
[0048] The technical problem to be solved by the embodiments of this application lies in the complete business process as follows: Figure 1 As shown, the process involves six steps: an external customer support system request (m1), a business platform system response (m2), the business platform system forwarding the request to a business logic processing system such as the provincial system (m3), the provincial system submitting a completion request (m4), the business platform system forwarding the completion request to the external customer support system (m5), and the external customer support system responding (m6). The technical problem to be solved is that a single target business transaction, such as a subscription / cancellation transaction, requires six asynchronous message exchanges. Due to network issues, some critical messages are lost in the middle, preventing the corresponding business systems from receiving the necessary messages and thus hindering normal business logic processing. This leads to data inconsistencies among multiple participants. For example, in the scenario where the provincial system's completion request message is lost, the provincial system internally considers the subscription / cancellation transaction complete, but the business platform system, not receiving the completion message, considers the transaction failed and forwards a failure message to the external customer support system. This results in data inconsistencies among the three parties involved in the subscription / cancellation transaction, requiring subsequent reconciliation to resolve the inconsistencies. The specific implementation is as follows:
[0049] Figure 2 This is one of the flowcharts illustrating the business processing method provided in the embodiments of this application, such as... Figure 2 As shown, the method includes:
[0050] Step 100: Send the target business-related message of type 1 to the blockchain, and send the target business-related message of type 2 to the cache or the blockchain;
[0051] Step 200: Retrieve the next message from the cache, send the next message to the blockchain, and delete the corresponding message from the cache;
[0052] Step 300: Based on the target business status on the blockchain, send the target business status data to the business systems of each participating party;
[0053] Among them, the target business-related message is determined based on the target business-related message received from the business systems of each participating party;
[0054] The target business status is determined based on the message messages associated with the target business on the blockchain.
[0055] It should be noted that the subject executing the above method can be a computer device, or something else such as... Figure 3 The business processing system shown.
[0056] The following is based on Figure 3 The business processing system shown executes the above method to provide a detailed description of the business processing method provided in the embodiments of this application:
[0057] Optionally, based on the target service-related message messages received from the business systems of each participating party, the target service-related message messages are obtained, specifically:
[0058] The external customer support system receives business requests from external customers, assembles business messages, and sends a target business such as a subscription / cancellation request message (hereinafter referred to as m1) to the business platform system. Then, m1 is forwarded to the preprocessing system to form am1.
[0059] The business platform system receives message m1, verifies the message, processes it internally, and then sends a response message (hereinafter referred to as m2) to the external customer support system. Finally, m2 is forwarded to the preprocessing system to form am2.
[0060] The business platform system forwards the subscription / cancellation request message (hereinafter referred to as m3) to the provincial system, and then forwards m3 to the preprocessing system to form am3;
[0061] After processing by the provincial system through internal business logic, it reports the completion message (hereinafter referred to as m4) to the business platform system, and then forwards it to the preprocessing system to form am4;
[0062] The business platform system forwards the completion message (hereinafter referred to as m5) to the external customer support system, and then forwards it to the preprocessing system to form am5;
[0063] The external customer support system responds to the business platform system with a message (hereinafter referred to as m6), which is then forwarded to the preprocessing system to form am6.
[0064] It should be noted that the target business-related messages specifically include messages am1 to am6 forwarded by the business systems of each participating party to the preprocessing system. Among them, the business systems of each participating party specifically include the external customer support system, the business platform system, and the provincial system.
[0065] It should be noted that the message transmission between the above-mentioned participating business systems is all asynchronous message transmission (a way for one application to indirectly send a message to another application without waiting for a response from the other party).
[0066] Message: A data unit exchanged and transmitted in a network, that is, a data block that a station sends at one time. A message contains complete data information to be sent according to a set rule. Its length varies greatly, and its length is unlimited and variable.
[0067] Completion Reporting: This refers to the operation where one system reports the result of the business process to another system.
[0068] The preprocessing system determines the type of the received target business-related message and sends the message of type 1 (such as am1) to the blockchain for on-chain storage to complete the association of message of type. The system also sends the message of type 2 (such as am2-am6) to the cache or to the blockchain for on-chain storage.
[0069] The cache can specifically refer to a cache register, such as Redis.
[0070] The preprocessing system retrieves the next message from the cache, performs the on-chain operation, and then deletes the corresponding message stored in the cache to achieve on-chain storage of message messages related to the target business.
[0071] Based on the message of the target business ultimately associated on the blockchain, the status of the target business (e.g., failure or success) is determined, and the target business status data is sent to the business systems of the aforementioned participating parties to achieve data synchronization between the business systems of the participating parties.
[0072] The business processing method provided in this application can solve the problem of data inconsistency between participating business systems caused by the loss of some message messages due to network problems, resulting in the inability of the corresponding participating business systems to receive the required message messages and perform normal business logic processing, thus ensuring the consistency of data between participating business systems.
[0073] Furthermore, in one embodiment, step 100 may specifically include:
[0074] Step 1001: Extract the associated fields of the second type of message and determine whether there is corresponding transaction information on the blockchain;
[0075] Step 1002: If not, send the second type of message to the buffer;
[0076] Step 1003: If yes, then query whether the previous message on the blockchain has been processed;
[0077] Step 1004: If the previous message has not been processed, send the second type of message to the buffer;
[0078] Step 1005: If the previous message has been processed, the second type of message is sent to the blockchain.
[0079] Optionally, the preprocessing system receives forwarded target business message messages from external customer support systems, business platform systems, and provincial systems. It classifies these messages using predetermined business rules, identifying them as am1 / am2 / am3 / am4 / am5 / am6, with am1 classified as the first type and am2-am6 as the second type. When am1 is received, the system directly calls the blockchain platform interface to store it on the blockchain. When a message other than am1 is received, the system extracts related fields (such as MessageID_1, MsessageID_2, and MessageID_3) from messages am2-am6, retrieves MessageID_1 from the cache, and uses MessageID_1 to call the blockchain platform query interface to check if a corresponding transaction exists on the blockchain.
[0080] In step 1002, if MessageID_1 cannot be obtained or no corresponding transaction information is found on the block, the message is cached, and the associated field is extracted from the message as the key and the message content as the value according to the message type.
[0081] In step 1003, if the message can already be found on the blockchain, the system determines whether the previous message of the current message has been processed based on the query result.
[0082] If the previous message has not been processed, then this message is cached in the cache register.
[0083] If the previous message has been processed, it is sent to the blockchain for on-chain storage based on the associated fields extracted from the current message.
[0084] The business processing method provided in this application embodiment achieves complete association on the process data chain by extracting related fields from the message, thus solving the problem of reduced data processing efficiency and secondary data inconsistency caused by the need for each participating party's business system to reprocess the association relationship when the data on the chain is not associated.
[0085] Furthermore, in one embodiment, step 300 may specifically include:
[0086] Step 3001: If the target business status is successful, the smart contract on the blockchain is triggered to send the success data of the target business result to the business systems of each participating party.
[0087] Step 3002: If the target business status is a failure status, the smart contract on the blockchain is triggered to send the failure data of the target business result to the business systems of each participating party.
[0088] The target business status data includes both successful and unsuccessful target business results.
[0089] The business systems of each participating party include external customer support systems, business platform systems, and business logic processing systems.
[0090] Furthermore, in one embodiment, the target business state on the blockchain in step 300 is determined in the following way:
[0091] If all message messages associated with the target business on the blockchain are in a successful state, or if all message messages not associated with the target business are in a successful state but key message messages of the second type of message messages associated on the blockchain are in a successful state, then the target business state is determined to be successful.
[0092] If all messages associated with the target business on the blockchain are in a failed state, or if all messages not associated with the target business are in a failed state but the key messages associated with the blockchain are in a failed state, or if all messages not associated with the target business are in a successful state but the key messages associated with the blockchain are in a successful state, and the difference between the current time and the time of the most recent update of the data storage structure is greater than a preset threshold, then the target business is determined to be in a failed state.
[0093] Optionally, each participating system in the business sends a business-related message to the preprocessing system. The preprocessing system determines the message type. If the message is of type 1 (am1), it is directly sent to the blockchain for on-chain storage. If it is of type 2 (am2-am6), the system extracts the related fields and checks the blockchain to see if the previous message has been updated. If it has been processed, the current message is updated to the blockchain, and the system queries the cache for the next message to process, until no next message can be found. If the previous message has not been processed, the current message is cached and will be searched and processed when processing subsequent messages.
[0094] To determine whether the message messages associated with the target business on the blockchain can determine whether the target business is in a successful or failed state, if all message messages with the associated target business have been updated on the blockchain and are all in a successful state, or if all message messages not associated with the target business are in a successful state but the key message messages in the second type of message messages associated on the blockchain are all in a successful state (e.g., am2 and am4 are both in a successful state), then the target business can be determined to be in a successful state.
[0095] If all message messages associated with the target business on the blockchain are in a failed state, or if all message messages not associated with the target business are in a failed state but it is determined that all key message messages associated with the blockchain are in a failed state (e.g., am2 and am4 are both in a failed state), or if all message messages not associated with the target business are in a successful state but it is determined that all key message messages associated with the blockchain are in a successful state (e.g., am2 and am4 are both in a successful state), then the target business is determined to be in a failed state by determining that the difference between the current time when the current message is received and the time of the most recent update of the data storage structure is greater than a preset threshold (e.g., 300ms).
[0096] After determining whether the target business is successful or failed, a smart contract is triggered to synchronize data with various external customer support systems, business platform systems, and business logic processing systems such as provincial systems to achieve business data consistency. Specifically, if the target business is successful, a smart contract on the blockchain is triggered to send the successful result data of the target business to the business systems of each participating party; if the target business is failed, a smart contract on the blockchain is triggered to send the failed result data of the target business to the business systems of each participating party.
[0097] The business processing method provided in this application embodiment solves the problem that multiple asynchronous messages are transmitted over the network in an out-of-order manner due to network latency, which in turn causes various business systems to be unable to obtain consistent data in the first time.
[0098] Furthermore, in one embodiment, the method further includes:
[0099] Based on the data storage structure on the blockchain, which consists of preset association fields, the association of all message messages for the target business is completed.
[0100] Furthermore, in one embodiment, the preset association fields include at least the following association fields:
[0101] The message ID, request time, version number, time of the most recent update of the data storage structure, message field value, number associated with the message, business type associated with the message, final status of the business associated with the message, content information corresponding to the message, intermediate status of the business, and sequence string of associated fields of the currently processed message.
[0102] Optionally, the preprocessing system receives the message messages am1-am6 from the target business, sends them to the blockchain system for on-chain operation, and stores the message messages am1-am6 on the blockchain according to the data storage structure on the blockchain composed of preset association fields, thus completing the association of am1-am6.
[0103] See Figure 4 Step 1: Existing business systems of all participating parties (external customer support system, business platform system, provincial system) should follow their original business processes (e.g., Figure 1 As shown, it completes the interaction of 6 asynchronous messages from m1 to m6, and at the same time forwards the message messages sent by the business systems of each participating party to the preprocessing system.
[0104] Step 2: The preprocessing system receives asynchronous message forwarding from external customer support systems, business platform systems, and provincial systems. It uses established business rules to process the message (identified as am1 / am2 / am3 / am4 / am5 / am6). For am1, the MessageID_1 field can be extracted; for am2, the MessageID_1 and MessageID_2 fields can be extracted; for am3, the MessageID_2 and MessageID_3 fields can be extracted; for am4, the MessageID_3 field can be extracted; for am5, the MessageID_2 and MessageID_4 fields can be extracted; and for am6, the MessageID_4 field can be extracted.
[0105] Step 3: When receiving message am1, directly call the blockchain interface to upload the message to the chain, update the values of "MessageID_1", "MSISDN", "DocType", "Data" and "MsgKey" in the data storage structure, where "MsgKey" is the currently processed message and the current field string value is {"seq1":["specific MessageID_1 value"]}, and update the UpdateTime field value to the current time.
[0106] Step 4: If the received message is not am1, extract the associated fields (MessageID_1, MsessageID_2, MessageID_3) from the message, obtain MessageID_1 from the cache register, and call the blockchain query interface based on MessageID_1 to check whether there is already a corresponding transaction information on the blockchain.
[0107] Step 5: If MessageID_1 cannot be obtained or no corresponding transaction information is found on the block, cache the message and extract the associated fields from the message as the key and the message content as the value according to the message type.
[0108] Step 6: If the message can be found on the chain, determine whether the previous message has been processed based on the query result. For example, if the current message is am2, check if the MsgKey field contains {"seq1":["specific MessageID_1 value"]}. If it does, it means the previous message has been processed; otherwise, it means the previous message has not been processed.
[0109] Step 7: If the previous message has not been processed, then cache this message in the register.
[0110] Step 8: If the previous message has been processed, update the field value with the same name as the associated field in the query result of Step 6 according to the associated field extracted from the current message. Update OrderState (if the current message is am2 or am4, the value of this field is "success" if the RspCode field value is "0000", otherwise the value of this field is "fail" if the RspCode field value is other values; this field is not updated for other types of messages) and Status (if the current message is am2, the value of this field is "1" if the RspCode field value is "0000", otherwise "0"; if the current message is am4, the value of this field is "2" if the RspCode field value is "0000", otherwise "3"; if the current message is am6, the value of this field is "4" if the RetCode field value is "0000", otherwise "5") according to the processing result field in the current message. Update the MsgKey field value by appending the associated field value of the current message, and update the UpdateTime field value to the current time.
[0111] Step 9: Then search for the next message in the buffer register. For example, if the current message is am2, after updating the OrderState, Status, and MsgKey fields, search for the key consisting of MessageID_2 and MessageID_3, where MessageID_2 is the value of the MessageID_2 field in the am2 message.
[0112] Step 10: If found, continue processing the current message according to Step 8; if not found, end processing the current message.
[0113] Step 11: Determine whether the MsgKey field value of the current query result contains the associated fields of all 6 message messages. If all are contained, trigger the smart contract to synchronize the corresponding target business result success data to the external customer support system, business platform system, and provincial system, and delete the data record with the corresponding key as the associated field value from the cache register. If not all are contained, continue to receive subsequent message messages.
[0114] Step 12: If the MsgKey field value of the current query result does not contain the associated fields of all 6 message messages and the OrderState field value is fail, then the smart contract is triggered to synchronize the corresponding target business result failure data to the business systems of each participating party, and delete the data record with the corresponding key as the associated field value from the cache register.
[0115] Step 13: If the MsgKey field value of the current query result does not contain the associated fields of all 6 message messages and the OrderState field value is success, then when it is determined that the difference between the current time when the current message message is received and the UpdateTime field value is greater than 300 seconds, the smart contract is triggered to synchronize the corresponding target business result failure data to the business systems of each participating party, and the data record with the corresponding key as the associated field value is deleted from the cache register.
[0116] It should be noted that the preset associated fields include at least the fields shown in Table 1:
[0117] Table 1
[0118]
[0119]
[0120] The business processing method provided in this application embodiment can avoid the problem of low data synchronization efficiency caused by the client requesting data from the blockchain system and having to go through complex authentication. This is achieved by triggering a smart contract to synchronize data with the business systems of each participating party.
[0121] The following describes the service processing apparatus provided in the embodiments of this application. The service processing apparatus described below can be referred to in correspondence with the service processing method described above.
[0122] Figure 5 This is a schematic diagram of the structure of the service processing device provided in the embodiments of this application, such as... Figure 5 As shown, it includes:
[0123] The system comprises a message storage module 510, a message processing module 511, and a data synchronization module 512.
[0124] The message storage module 510 is used to send target business-related message messages of type 1 to the blockchain, and to send target business-related message messages of type 2 to the cache or the blockchain;
[0125] The message processing module 511 is used to retrieve the next message from the cache, send the next message to the blockchain, and delete the corresponding message from the cache.
[0126] The data synchronization module 512 is used to send target business status data to the business systems of each participating party according to the target business status on the blockchain.
[0127] Among them, the target business-related message is determined based on the target business-related message received from the business systems of each participating party;
[0128] The target business status is determined based on the message information of the target business associated on the blockchain;
[0129] The business systems of each participating party can specifically include:
[0130] External customer support system, business platform system, and business logic processing system.
[0131] The business processing apparatus provided in this application embodiment can solve the problem of data inconsistency between participating business systems caused by the loss of some message messages due to network problems, resulting in the inability of each participating business system to receive the required message messages and perform normal business logic processing, thus ensuring the consistency of data between participating business systems.
[0132] Furthermore, in one embodiment, the message storage module 510 may also be specifically used for:
[0133] Extract the associated fields of the second type of message and determine whether there is corresponding transaction information on the blockchain;
[0134] If not, the second type of message is sent to the buffer;
[0135] If so, check whether the previous message on the blockchain has been processed;
[0136] If the previous message has not been processed, the second type of message will be sent to the buffer.
[0137] If the previous message has been processed, the second type of message is sent to the blockchain.
[0138] The business processing apparatus provided in this application embodiment achieves complete association on the process data chain by extracting associated fields from message messages, thus solving the problems of reduced data processing efficiency and secondary data inconsistency caused by the need for each participating party's business system to reprocess the association relationship when the data on the chain is not associated.
[0139] Furthermore, in one embodiment, the data synchronization module 512 can also be specifically used for:
[0140] If the target business status is successful, the smart contract on the blockchain is triggered to send the success data of the target business result to the business systems of each participating party.
[0141] If the target business status is a failure, the smart contract on the blockchain is triggered to send the failure data of the target business result to the business systems of each participating party.
[0142] The target business status data includes both successful and unsuccessful target business results.
[0143] The target business status on the blockchain is determined in the following way:
[0144] If all message messages associated with the target business on the blockchain are in a successful state, or if all message messages not associated with the target business are in a successful state but key message messages of the second type of message messages associated on the blockchain are in a successful state, then the target business state is determined to be successful.
[0145] If all message messages associated with the target business on the blockchain are in a failed state, or if all message messages not associated with the target business are determined to be in a failed state but the key message messages associated with the blockchain are determined to be in a failed state, or if all message messages not associated with the target business are determined to be in a successful state but the key message messages associated with the blockchain are determined to be in a successful state, and the difference between the current time and the time of the most recent update of the data storage structure is greater than a preset threshold, then the target business is determined to be in a failed state.
[0146] The business processing device provided in this application embodiment solves the problem that multiple asynchronous messages are transmitted over the network in an out-of-order manner due to network latency, which in turn causes various business systems to be unable to obtain consistent data in the first time.
[0147] Furthermore, in one embodiment, the apparatus may further include:
[0148] The data association module 513 is used to associate all message messages of the target business according to the data storage structure on the blockchain composed of preset association fields.
[0149] The preset associated fields include at least the following associated fields:
[0150] The message ID, request time, version number, time of the most recent update of the data storage structure, message field value, number associated with the message, business type associated with the message, final status of the business associated with the message, content information corresponding to the message, intermediate status of the business, and sequence string of associated fields of the currently processed message.
[0151] The business processing device provided in this application embodiment can avoid the problem of low data synchronization efficiency caused by the client requesting data from the blockchain system and having to go through complex authentication. This is achieved by triggering a smart contract to synchronize data with the business systems of each participating party.
[0152] Figure 6 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this application, such as... Figure 6As shown, the electronic device may include a processor 610, a communication interface 611, a memory 612, and a bus 613. The processor 610, communication interface 611, and memory 612 communicate with each other via the bus 613. The processor 610 can call logical instructions from the memory 612 to execute the following methods:
[0153] Send target business-related message messages of type 1 to the blockchain, and send target business-related message messages of type 2 to the cache or the blockchain;
[0154] Retrieve the next message from the cache, send the next message to the blockchain, and delete the corresponding message from the cache;
[0155] Based on the target business status on the blockchain, send the target business status data to the business systems of each participating party;
[0156] Among them, the target business-related message is determined based on the target business-related message received from the business systems of each participating party;
[0157] The target business status is determined based on the message messages associated with the target business on the blockchain.
[0158] Furthermore, when the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of this application embodiment, essentially, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer power supply (which may be a personal computer, server, or network power supply, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0159] Furthermore, this application discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can perform the business processing methods provided in the above-described method embodiments, such as including:
[0160] Send target business-related message messages of type 1 to the blockchain, and send target business-related message messages of type 2 to the cache or the blockchain;
[0161] Retrieve the next message from the cache, send the next message to the blockchain, and delete the corresponding message from the cache;
[0162] Based on the target business status on the blockchain, send the target business status data to the business systems of each participating party;
[0163] Among them, the target business-related message is determined based on the target business-related message received from the business systems of each participating party;
[0164] The target business status is determined based on the message messages associated with the target business on the blockchain.
[0165] On the other hand, embodiments of this application also provide a processor-readable storage medium storing a computer program for causing the processor to execute the methods provided in the above embodiments, such as including...
[0166] Send target business-related message messages of type 1 to the blockchain, and send target business-related message messages of type 2 to the cache or the blockchain;
[0167] Retrieve the next message from the cache, send the next message to the blockchain, and delete the corresponding message from the cache;
[0168] Based on the target business status on the blockchain, send the target business status data to the business systems of each participating party;
[0169] Among them, the target business-related message is determined based on the target business-related message received from the business systems of each participating party;
[0170] The target business status is determined based on the message messages associated with the target business on the blockchain.
[0171] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0172] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer power supply (which may be a personal computer, server, or network power supply, etc.) to execute the methods described in various embodiments or some parts of the embodiments.
[0173] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of this application, and are not intended to limit them; although the embodiments of this application have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A business processing method, characterized in that, include: Messages of type 1 related to the target business are sent to the blockchain, and messages of type 2 related to the target business are sent to the cache or the blockchain; wherein, the messages are classified according to predetermined business rules and identified as am1 / am2 / am3 / am4 / am5 / am6, with am1 as the first type of message and am2-am6 as the second type of message; when message am1 is received, the blockchain platform interface is directly called to store it on the chain; Sending the target service-related message of type two to the cache or the blockchain includes: Extract the associated fields of the second type of message and determine whether there is corresponding transaction information on the blockchain; If not, the message of the second type will be sent to the buffer; If so, then query whether the previous message on the blockchain has been processed; If the previous message has not been processed, the second type of message is sent to the cache; If the previous message has been processed, the second type of message is sent to the blockchain; Retrieve the next message from the cache, send the next message to the blockchain, and delete the corresponding message from the cache; Based on the target business status on the blockchain, send the target business status data to the business systems of each participating party; The target service-related message is determined based on the target service-related message received from the business systems of each participating party; The target service status is determined based on the message messages of the target service associated with the blockchain; Also includes: Based on the data storage structure on the blockchain, which consists of preset association fields, the association of all message messages of the target business is completed. The preset association fields include at least the following association fields: The message ID, request time, version number, time of the most recent update of the data storage structure, message field value, number associated with the message, business type associated with the message, final status of the business associated with the message, content information corresponding to the message, intermediate status of the business, and sequence string of associated fields of the currently processed message.
2. The business processing method according to claim 1, characterized in that, The step of sending target business status data to the business systems of each participating party based on the target business status on the blockchain includes: If the target business status is successful, the smart contract on the blockchain is triggered to send the success data of the target business result to the business systems of each participating party. If the target business status is a failure status, the smart contract on the blockchain is triggered to send the failure data of the target business result to the business systems of each participating party. The target service status data includes target service result success data and target service result failure data; The business systems of each participating party include external customer support systems, business platform systems, and business logic processing systems.
3. The business processing method according to claim 2, characterized in that, The target business status on the blockchain is determined in the following way: If all message messages associated with the target business on the blockchain are in a successful state, or if all message messages not associated with the target business are in a successful state but it is determined that the key message messages in the second type of message messages associated on the blockchain are in a successful state, then the target business is determined to be in a successful state. If all message messages associated with the target business on the blockchain are in a failed state, or if all message messages not associated with the target business are determined to be in a failed state, or if all message messages not associated with the target business are determined to be in a successful state, and the difference between the current time and the time of the most recent update of the data storage structure is greater than a preset threshold, then the target business is determined to be in a failed state.
4. A business processing device, characterized in that, include: The system includes a message storage module, a message processing module, and a data synchronization module. The message storage module is used to send target business-related message messages of type 1 to the blockchain, and to send target business-related message messages of type 2 to the cache or the blockchain; wherein, the message messages are classified according to predetermined business rules and identified as am1 / am2 / am3 / am4 / am5 / am6, with am1 as the message message of type 1 and am2-am6 as the message message of type 2; when message message am1 is received, the blockchain platform interface is directly called to store it on the chain; The message storage module is also used for: Extract the associated fields of the second type of message and determine whether there is corresponding transaction information on the blockchain; If not, the message of the second type will be sent to the buffer; If so, then query whether the previous message on the blockchain has been processed; If the previous message has not been processed, the second type of message is sent to the cache; If the previous message has been processed, the second type of message is sent to the blockchain; The message processing module is used to retrieve the next message from the cache, send the next message to the blockchain, and delete the corresponding message from the cache. The data synchronization module is used to send target business status data to the business systems of each participating party according to the target business status on the blockchain. The target service-related message is determined based on the target service-related message received from the business systems of each participating party; The target service status is determined based on the message messages of the target service associated with the blockchain; The message storage module is also used for: Based on the data storage structure on the blockchain, which consists of preset association fields, the association of all message messages of the target business is completed. The preset association fields include at least the following association fields: The message ID, request time, version number, time of the most recent update of the data storage structure, message field value, number associated with the message, business type associated with the message, final status of the business associated with the message, content information corresponding to the message, intermediate status of the business, and sequence string of associated fields of the currently processed message.
5. The business processing apparatus according to claim 4, characterized in that, The business systems of each participating party include: External customer support system, business platform system, and business logic processing system.
6. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the business processing method according to any one of claims 1 to 3.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the business processing method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Data storage method and device, computer readable storage medium and computer device
CN110543788A