A service execution method and device, electronic equipment and storage medium
By monitoring changes in the target database, acquiring change data for the target business, and constructing notification messages, the business process is executed in real time. This solves the timeliness and efficiency issues of settlement tasks in the payment system and enables rapid business execution.
Patent Information
- Application Number
- CN202111512345.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2041-12-07
AI Technical Summary
The timeliness of settlement tasks in the existing payment system is poor, and the steps between multiple systems are redundant, resulting in low task execution efficiency.
By monitoring changes in the target database's status, the system obtains the corresponding change data for the target business and constructs notification messages to execute business processes in real time, reducing the need for notifications to be routed between systems.
It improved the timeliness and efficiency of business processes, simplified processes, reduced redundant notifications between systems, and enabled rapid business execution.
Smart Images

Figure CN114296952B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of network technology, and in particular to a service execution method, apparatus, electronic device, and storage medium. Background Technology
[0002] In payment systems, settlement is an asynchronous process. It requires first deducting the seller's pending settlement amount from the accounting system, then transferring the funds through the corresponding channel (system). After the transfer is successful, the seller's cash account needs to be added back to the accounting system before a successful transaction is returned. These operations within the payment platform involve multiple system flows, currently driven entirely by scheduled tasks. It's easy to imagine that in settlement tasks with extremely high order volumes, the time required for the state transition to the final state is very long. In existing distributed system solutions, to ensure data consistency and timely settlement in asynchronous systems, callbacks—message queues or Remote Procedure Call Protocol (RPC)—are often used in conjunction with scheduled tasks as a fallback.
[0003] However, the above solution requires the implementation of scheduled tasks, queue message consumers (receiving messages), queue message producers (sending messages), or RPC tasks in each relevant distributed system. Therefore, the solution is complex to implement, with redundant steps between multiple systems, resulting in poor timeliness and low task execution efficiency for revenue sharing and settlement tasks. Summary of the Invention
[0004] This disclosure provides a service execution method, apparatus, electronic device, and storage medium, which can improve the timeliness and efficiency of service execution. The technical solution of this disclosure is as follows:
[0005] According to a first aspect of this disclosure, a business execution method is provided, the method comprising: monitoring state changes of a target database; the target database corresponding to multiple systems, the multiple systems being systems for executing target business; upon monitoring a change in a target data source in the target database, obtaining target change data corresponding to the target business based on log information generated by the target data source; constructing a notification message based on the target change data, and executing the pending business process corresponding to the target business based on the notification message.
[0006] As shown above, electronic devices can monitor changes in the target database's state. Upon detecting a change in the target data source within the database, they can retrieve the corresponding change data for the target business based on the log information generated by the target data source. A corresponding notification message is then constructed based on this change data, and the pending business process corresponding to the target business is executed according to the constructed notification message. This implementation method, by monitoring the target database's state changes in real time, allows for timely execution of the next pending business process based on the notification message when the target data source changes. This eliminates the need for multiple systems to send notifications about business process transitions when the target data source changes, enabling rapid execution of pending business processes and simplifying the business execution process, thereby improving the timeliness and efficiency of business process transitions.
[0007] Optionally, the above method of "obtaining target change data corresponding to the target business based on log information generated by the target data source when a change in the target data source in the target database is detected" specifically includes: after a change in the database state of the target database and log information generated by the target data source is detected, filtering the changed data in the target database based on the log information and the processing rules corresponding to the target business to obtain the target change data corresponding to the target business.
[0008] As can be seen from the above, after detecting a change in the database status of the target database and generating log information from the target data source, the changed data in the target database can be filtered according to the log information and the processing rules corresponding to the target business to obtain the target changed data corresponding to the target business. This implementation method can improve the accuracy of obtaining the target changed data.
[0009] Optionally, the above method of "constructing a notification message based on target change data and executing the pending business process corresponding to the target business based on the notification message" specifically includes: constructing a notification message based on the target change data and a configured preset message body; sending the notification message to the corresponding target system through a message queue, and executing the pending business process corresponding to the target business in the target system based on the notification message; the target system is a system in multiple systems.
[0010] As shown above, a notification message can be constructed based on the target change data and the configured preset message body, and then sent to the corresponding target system via a message queue. In the target system, the pending business process corresponding to the target business can be executed based on the notification message. This implementation method allows for rapid receipt of notification messages and the execution of the pending business process corresponding to the target business within the target system.
[0011] Optionally, the above method of "executing the business process to be executed corresponding to the target business in the target system according to the notification message" specifically includes: obtaining the notification message by listening to the message queue; determining the business process to be executed according to the field information in the notification message, and executing the business process to be executed; the field information is used to indicate the business process to be executed corresponding to the target business.
[0012] As can be seen from the above, electronic devices can obtain the required notification messages by listening to the message queue, and determine the business process to be executed based on the field information in the notification message that indicates the business process to be executed corresponding to the target business, so as to execute the business process to be executed. Through this implementation method, the target system can accurately obtain the notification message and accurately determine the business process to be executed.
[0013] Optionally, the method described above, which "filters the changed data in the target database according to the log information and the processing rules corresponding to the target business to obtain the target changed data corresponding to the target business," specifically includes: if the data operation type of the changed data corresponding to the log information is the target operation type, obtaining the regular expression corresponding to the target operation type; the target operation type is any one of the following: insert operation, revision operation; if the changed data corresponding to the log information matches the regular expression, then the changed data corresponding to the log information is determined as the target changed data corresponding to the target business.
[0014] As shown above, the electronic device can further determine whether the data operation type of the changed data corresponding to the log information is the target operation type. If the data operation type of the changed data corresponding to the log information is the target operation type, the device obtains the regular expression corresponding to the target operation type. If the changed data corresponding to the log information matches the regular expression, the changed data corresponding to the log information is identified as the target changed data corresponding to the target business. Through this implementation method, the target changed data corresponding to the target business can be accurately determined.
[0015] Optionally, before the above-mentioned "constructing a notification message based on the target change data and executing the business process to be executed corresponding to the target business based on the notification message", the method further includes: obtaining a first data expression corresponding to the target change data and compiling the first data expression into a first target script; the first data expression is used to express the target change data, the target change data is inserted data or revised data, and the first target script is used to compile the expression into an interpreted script that can be executed by a virtual machine; and the above-mentioned method of "constructing a notification message based on the target change data" specifically includes: constructing a notification message based on the target change data when the compiled first target script can be executed.
[0016] As shown above, when the target change data corresponds to the change data of the target service, the first data expression used to express the target change data can be compiled into an interpreted first target script that can be executed by the virtual machine. Then, if the compiled first target script can be executed, a notification message can be constructed based on the target change data. Through this implementation, the first data expression can be compiled into an interpreted first target script that can be executed by the virtual machine, thereby accurately determining whether to construct a notification message and improving the accuracy of electronic devices in executing services.
[0017] Optionally, before the above-mentioned "obtaining the first data expression corresponding to the target changed data and compiling the first data expression into a first target script", the method further includes: if the data operation type corresponding to the target changed data is a revision operation and a second data expression exists, compiling the second data expression into a second target script, and determining whether the second target script can be executed; the second data expression is the data before the target changed data was revised; and the above-mentioned method of "obtaining the first data expression corresponding to the target changed data and compiling the first data expression into a first target script" specifically includes: if the second target script can be executed, obtaining the first data expression corresponding to the target changed data and compiling the first data expression into a first target script.
[0018] As shown above, when the data operation type corresponding to the target changed data is a revision operation and a second data expression exists, the second data expression needs to be compiled into a second target script first, and it needs to be determined whether the second target script can be executed. If the second target script can be executed, and the target changed data is the changed data corresponding to the target business, then the first data expression is compiled into a first target script. Through this implementation method, it is possible to accurately determine whether to compile the first data expression into the first target script.
[0019] Optionally, before the above "monitoring the state changes of the target database", the method further includes: adding processing rules corresponding to the target business, so as to filter the changed data corresponding to the log information in the target database when accessing the target business, and obtain the target changed data corresponding to the target business.
[0020] As shown above, electronic devices need to pre-add processing rules corresponding to the target service. These rules are used to filter the changed data in the target database's logs when accessing the target service, thus obtaining the target changed data. Therefore, when the electronic device executes the target service, it can do so according to the pre-added processing rules.
[0021] According to a second aspect of this disclosure, a business execution apparatus is provided, comprising: a monitoring unit, an acquisition unit, a processing unit, and an execution unit; the monitoring unit is configured to monitor state changes of a target database; the target database corresponds to multiple systems, and the multiple systems are systems that execute target business; the acquisition unit is configured to, upon monitoring changes in the target data source in the target database, acquire target change data corresponding to the target business based on log information generated by the target data source; the processing unit is configured to construct a notification message based on the target change data; and the execution unit is configured to execute the pending business process corresponding to the target business based on the notification message.
[0022] Optionally, the processing unit is configured to perform a filter on the changed data in the target database after the database state of the target database changes and log information is detected from the target data source, based on the log information and the processing rules corresponding to the target business, to obtain the target changed data corresponding to the target business.
[0023] Optionally, the processing unit is configured to construct a notification message based on the target change data and a preset message body; the sending unit is configured to send the notification message to the corresponding target system through a message queue; and the execution unit is configured to execute the pending business process corresponding to the target business in the target system based on the notification message; the target system can be a system in multiple systems.
[0024] Optionally, the acquisition unit is configured to acquire a notification message by listening to the message queue; the execution unit is configured to determine the business process to be executed based on the field information in the notification message and execute the business process to be executed; the field information is used to indicate the business process to be executed corresponding to the target business.
[0025] Optionally, the acquisition unit is configured to acquire the regular expression corresponding to the target operation type when the data operation type of the changed data corresponding to the log information is the target operation type; the target operation type is any one of the following: insert operation, revision operation; the determination unit is configured to determine the changed data corresponding to the log information as the target changed data corresponding to the target business if the changed data corresponding to the log information matches the regular expression.
[0026] Optionally, the acquisition unit is configured to execute a first data expression corresponding to the target changed data; the processing unit is configured to compile the first data expression into a first target script; the first data expression is used to express the target changed data, which is inserted data or revised data, and the first target script is used to compile the expression into an interpreted script that can be executed by a virtual machine; the processing unit is configured to construct a notification message based on the target changed data if the compiled first target script can be executed.
[0027] Optionally, the processing unit is configured to, when the data operation type corresponding to the target changed data is a revision operation and the second data expression exists, compile the second data expression into a second target script and determine whether the second target script can be executed; the second data expression is the data before the target changed data is revised; the acquisition unit is configured to, when the second target script can be executed, acquire the first data expression corresponding to the target changed data; the processing unit is configured to, compile the first data expression into a first target script.
[0028] Optionally, the processing unit is configured to execute the processing rules corresponding to the target service, so as to filter the change data corresponding to the log information in the target database when accessing the target service, and obtain the target change data corresponding to the target service.
[0029] According to a third aspect of this disclosure, an electronic device is provided, comprising:
[0030] Processor. Memory for storing processor-executable instructions. The processor is configured to execute instructions to implement any of the optional business execution methods described in the first aspect above.
[0031] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided, on which instructions are stored, such that when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is able to perform any of the optional business execution methods of the first aspect described above.
[0032] According to a fifth aspect of this disclosure, a computer program product is provided, comprising instructions that, when run on a computer, cause the computer to perform any of the optional business execution methods of the first aspect.
[0033] According to a sixth aspect of this disclosure, this disclosure provides a chip including a processor and a communication interface coupled to the processor, the processor being configured to run computer programs or instructions to implement the business execution methods described in the first aspect and any possible implementation thereof.
[0034] The technical solution provided in this disclosure brings at least the following beneficial effects:
[0035] Based on any of the above aspects, in this disclosure, electronic devices can monitor changes in the state of a target database. Upon detecting a change in the target data source within the target database, they can obtain the target change data corresponding to the target business based on log information generated by the target data source. A corresponding notification message is then constructed based on this change data, and the pending business process corresponding to the target business is executed according to the constructed notification message. This implementation method, by monitoring the state changes of the target database in real time, allows for timely execution of the next pending business process based on the notification message when the target data source changes. This eliminates the need for multiple systems to send notifications about business process transitions when the target data source changes, enabling rapid execution of pending business processes corresponding to the target business. This simplifies the business execution process and improves the timeliness and efficiency of business process transitions.
[0036] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0037] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0038] Figure 1 This is a flowchart of the existing business execution system;
[0039] Figure 2 This is a schematic diagram of a business execution system according to an embodiment of the present disclosure;
[0040] Figure 3 This is a flowchart illustrating a business execution method according to an embodiment of the present disclosure;
[0041] Figure 4 This is a schematic diagram of an asynchronous driving process corresponding to a business execution method according to an embodiment of the present disclosure;
[0042] Figure 5 This is a flowchart illustrating another business execution method according to an embodiment of the present disclosure;
[0043] Figure 6 This is a flowchart illustrating yet another business execution method according to an embodiment of the present disclosure;
[0044] Figure 7This is a flowchart illustrating yet another business execution method according to an embodiment of the present disclosure;
[0045] Figure 8 This is a flowchart illustrating yet another business execution method according to an embodiment of the present disclosure;
[0046] Figure 9 This is a schematic diagram of a data filtering process corresponding to a business execution method according to an embodiment of the present disclosure;
[0047] Figure 10 This is a flowchart illustrating yet another business execution method according to an embodiment of the present disclosure;
[0048] Figure 11 This is a flowchart illustrating yet another business execution method according to an embodiment of the present disclosure;
[0049] Figure 12 This is a schematic diagram of a revenue-sharing and settlement business process according to an embodiment of this disclosure;
[0050] Figure 13 This is a schematic diagram of the structure of a service execution device according to an embodiment of the present disclosure;
[0051] Figure 14 This is a schematic diagram of another business execution device according to an embodiment of the present disclosure. Detailed Implementation
[0052] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0053] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0054] First, the application scenarios of this disclosure embodiment are introduced. In existing technical solutions, when executing a split settlement task, it is necessary to first deduct the seller's pending settlement amount in the accounting system, then transfer the actual funds through a channel, and after success, add the seller's cash account amount to the accounting system before returning a business success message. These operations require at least four systems to pass through within the payment platform, and the current process is entirely driven by scheduled tasks. It is conceivable that the time required for the state transition to the final state in split settlement with a large volume of transactions is very long. This highlights the increasing demands for settlement timeliness from the business side and the irrationality of using scheduled tasks to drive state transitions in the design. Combined with... Figure 1 As shown, in existing distributed system design solutions, to ensure data consistency and timeliness in asynchronous systems, a backup solution of callbacks and scheduled tasks is often used. However, this approach requires the implementation of scheduled tasks, queue message consumers, queue message producers, or RPC in each relevant distributed microservice. While this effectively solves the aforementioned problems, it is complex to implement and has high maintenance costs.
[0055] To address the aforementioned issues, this disclosure provides a business execution method. An electronic device can monitor changes in the status of a target database. Upon detecting a change in the target data source within the target database, it obtains the target change data corresponding to the target business based on log information generated by the target data source. A corresponding notification message is then constructed based on this change data, and the pending business process corresponding to the target business is executed according to the constructed notification message. This implementation method, by monitoring the target database's status changes in real time, allows for timely execution of the next pending business process based on the notification message when the target data source changes. This eliminates the need for multiple systems to send notifications about business process transitions when the target data source changes, enabling rapid execution of pending business processes and simplifying the business execution process. This improves the timeliness and efficiency of business process transitions during execution.
[0056] The content display method provided in this disclosure is illustrated below with reference to the accompanying drawings:
[0057] Figure 2 This is a schematic diagram of a business execution system provided in an embodiment of this disclosure, such as... Figure 2 As shown, the business execution system may include server 11 and client 12. Figure 2This specification only provides an example of one client 12, but in specific implementations there may be more clients, a data bus 13, and a database 14. Communication connections can be established between the server 11, client 12, data bus 13, and database 14. The server 11, client 12, data bus 13, and database 14 can be connected via wired or wireless means; this disclosure does not limit the specific connection method.
[0058] Server 11 is used to receive and store real-time data information sent by client 12 in database 14. For example, server 11 receives billing information, payment information, etc. sent by client 12 and stores this data information for server 11 to perform business operations.
[0059] Client 12 is used to generate real-time data information and send it to server 11. For example, client 12 generates billing information, payment information, etc. in real time based on user operations, and sends this data information to server 11 to be stored in database 14 for use in business operations.
[0060] Data bus 13 is used to monitor the data status in database 14, and to construct and send a notification message when the data status in database 14 changes.
[0061] Database 14 is used to store data information corresponding to multiple systems and to update the corresponding data information in a timely manner when the data information changes.
[0062] In one feasible implementation, server 11 can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center. Server 11 may include a processor, memory, and network interfaces, etc.
[0063] In one feasible implementation, client 12 is used to provide voice and / or data connectivity services to a user. Client 12 may have different names, such as UE terminal, terminal unit, terminal station, mobile station, mobile station, remote station, remote terminal, mobile device, wireless communication device, vehicle user equipment, terminal agent, or terminal device, etc.
[0064] Optionally, the client 12 can be various handheld devices, in-vehicle devices, wearable devices, or computers with communication functions, and this disclosure does not limit this in any way. For example, the handheld device can be a smartphone. The in-vehicle device can be an in-vehicle navigation system. The wearable device can be a smart bracelet. The computer can be a personal digital assistant (PDA) computer, a tablet computer, or a laptop computer.
[0065] The business execution method provided in this disclosure can be applied to the foregoing. Figure 2 The business execution system shown includes a server 11, a client 12, a data bus 13, and a database 14. The electronic device involved in this disclosure can be either the server 11 or the client 12. Taking the application of the business execution method of this disclosure to a server during the execution of business processes as an example, the business execution method provided by the embodiments of this disclosure will be described in detail below.
[0066] After introducing the application scenarios and business execution system of the embodiments of this disclosure, the following will be combined with... Figure 2 The business execution system shown herein provides a detailed description of the business execution method provided in the embodiments of this disclosure.
[0067] like Figure 3 The diagram illustrates a service execution method according to an exemplary embodiment. The service execution method may include steps S201-S203.
[0068] S201. Monitor the status changes of the target database.
[0069] The target database corresponds to multiple systems, and these systems are the systems that execute the target business.
[0070] Optionally, electronic devices can monitor the status changes of the target database corresponding to the target business being executed via the data bus, so as to respond promptly when the status of the target database changes.
[0071] Optionally, the target business being executed by the electronic device may involve multiple systems, each of which corresponds to the target database; or, the target database may include multiple sub-databases, with each system in the multiple systems corresponding to one sub-database.
[0072] It should be noted that monitoring database status changes can be understood as monitoring whether the data in the database has changed, i.e., whether the data in the database has been modified, whether new data has been added to the database, whether data has been deleted from the database, etc.
[0073] For example, in combination Figure 4 As shown, in non-core main links, and in a series of operations based on database state changes, such as main process driven, callbacks, and reconciliation with strong business logic, asynchronous process driving is achieved by relying on data bus technology (e.g., using K-BUS data bus technology) to improve business execution efficiency.
[0074] Optionally, the data bus can be any of the following: K-BUS data bus technology, Canal data bus technology, or LinkedIn Databus data bus technology.
[0075] Among them, K-BUS data bus technology allows businesses to implement only the event processing interface during business development. The scalability of K-BUS data bus technology includes: linear expansion of the client and linear expansion of processing capacity. The availability of K-BUS data bus technology includes: if the client fails, the bootstrap will continue to pull changes; the client can be configured with multiple relays, and relay failures will trigger a switchover.
[0076] When developing business applications, Canal data bus technology requires additional handling of ACK / rollback. The scalability of Canal data bus technology includes: the client cannot be extended; the availability of Canal data bus technology includes: client failure will block the server from pulling changes, and client recovery will cause the server to instantly pull a large number of changes from the database.
[0077] LinkedIn Databus technology allows businesses to implement only the processing interface during business development. Its scalability includes linear expansion of both the client and processing capacity. Its availability includes decoupling between the client and server via message queues (MQ), ensuring that client failures do not affect the server.
[0078] S202. When a change in the target data source in the target database is detected, the target change data corresponding to the target business is obtained based on the log information generated by the target data source.
[0079] Optionally, the above log information is used to indicate at least one of the following: the state of the target database has changed, or the data information included in the target data source has changed.
[0080] Optionally, when the data source in the database changes, corresponding log information can be generated to indicate that the data source has changed and to provide specific details of the change.
[0081] Optionally, when a database state change occurs during the execution of a business request by an electronic device, log information generated by the corresponding data source in the database is monitored through data bus technology. This allows the data bus client to retrieve the target change data corresponding to the target business from the target database by reading the configuration in the configuration management center (e.g., using KCONF).
[0082] S203. Construct a notification message based on the target change data, and execute the pending business process corresponding to the target business based on the notification message.
[0083] Optionally, electronic devices can determine the pending business process corresponding to the target business based on the target change data, and then trigger the execution of the pending business process corresponding to the target business through a notification message.
[0084] The technical solution provided by the above embodiments brings at least the following beneficial effects: Electronic devices can monitor changes in the status of the target database. Upon detecting a change in the target data source within the target database, they can obtain the target change data corresponding to the target business based on the log information generated by the target data source, and construct a corresponding notification message based on this data. Then, based on the constructed notification message, they can execute the pending business process corresponding to the target business. Through this implementation, real-time monitoring of the target database's status changes allows for timely execution of the next pending business process based on the notification message when the target data source changes. This eliminates the need for multiple systems to send notifications about business process transitions when the target data source changes, enabling rapid execution of pending business processes corresponding to the target business. This simplifies the business execution process and improves the timeliness and efficiency of business process transitions during execution.
[0085] In a feasible manner, combining Figure 3 ,like Figure 5 As shown, the method in S202 above may specifically include S2021.
[0086] S2021. After the database status of the target database changes and log information generated by the target data source is detected through the data bus, the changed data in the target database is filtered according to the log information and the processing rules corresponding to the target business to obtain the target changed data corresponding to the target business.
[0087] Optionally, when the database state of the target database changes, the target database can generate corresponding log information, that is, log information corresponding to the changed data, so that the electronic device can determine the corresponding changed data based on the log information.
[0088] Optionally, after listening to the log information generated by the target data source (i.e., the changed data) through the data bus, the electronic device can obtain the processing rules corresponding to the target business being executed, and determine the changed data (i.e., the target changed data) corresponding to the target business from all the changed data based on the log information of the processing rules.
[0089] The technical solution provided by the above embodiments brings at least the following beneficial effects: after detecting a change in the database status of the target database and generating log information from the target data source, the changed data in the target database can be filtered according to the log information and the processing rules corresponding to the target business to obtain the target changed data corresponding to the target business. This implementation method can improve the accuracy of obtaining the target changed data.
[0090] In a feasible manner, combining Figure 5 ,like Figure 6 As shown, the method in S203 above may specifically include S301-S302.
[0091] S301. Construct a notification message based on the target change data and the preset message body of the configuration.
[0092] Optionally, after the electronic device determines the target change data corresponding to the target business from all the change data, it can construct a notification message corresponding to the target change data based on the target change data and the corresponding preset message body, so as to notify the corresponding system (i.e. the target system) to execute the next business process through the notification message.
[0093] Optionally, after filtering out the required target change data, the notification message required by the target business can be constructed through the preset message body configured in the configuration center, and then the event notification action of the relevant business can be completed through the message queue configured in the business (for example, the message queue can use the RocketMQ system or the Kafka system).
[0094] RocketMQ is a Java-based system with a single-machine throughput of 100,000 requests, millisecond-level timeliness, and a distributed architecture. Its features include comprehensive MQ functionality and good scalability. Kafka, on the other hand, is a Scala-based system with a single-machine throughput of 100,000 requests, millisecond-level timeliness, and a distributed architecture. Its features include support for only the main MQ functions, with some message query and message backtracking functions not provided.
[0095] S302. Send the notification message to the corresponding target system through the message queue, and execute the business process to be executed corresponding to the target business in the target system according to the notification message.
[0096] The target system is a system within a larger system.
[0097] Optionally, after obtaining the target change data, the electronic device can construct a corresponding notification message based on the target change data and send the notification message to the corresponding target system to notify the target system to proceed with the next business process. The target system is the system corresponding to the business process to be executed in the process of executing the target business.
[0098] For example, during the process of electronic devices processing billing and settlement business, after system A (e.g., the system corresponding to the user) creates a shopping order, the database state corresponding to system A will change. When the data bus detects that the database state corresponding to system A has changed, it can construct a notification message based on the changed data, so as to notify system B (e.g., the system corresponding to the merchant) that a new shopping order has been generated, and promptly process the business process corresponding to the shopping order.
[0099] Optionally, the electronic device can add the notification message to a message queue to send the constructed notification message to the target system via the message queue.
[0100] Optionally, the notification message may include identification information corresponding to the target system, so that the target system can accurately receive the notification message. This identification information may be the target system's location information, account information, etc.
[0101] Optionally, after the target system receives the notification message, the target system can promptly execute the pending business process corresponding to the target business based on the notification message.
[0102] For example, after receiving the notification message sent by the data bus, system B (such as the system corresponding to the merchant) can promptly determine the shopping order created by system A and promptly process the corresponding business process after the shopping order is created by system A. It should be noted that the business process of system A creating a shopping order and system B processing the shopping order constitutes a complete business process.
[0103] The technical solution provided by the above embodiments brings at least the following beneficial effects: A notification message can be constructed based on target change data and a pre-configured message body, and sent to the corresponding target system via a message queue. In the target system, the pending business process corresponding to the target business can be executed based on the notification message. Through this implementation, notification messages can be obtained quickly, and the pending business process corresponding to the target business can be executed specifically within the target system.
[0104] In a feasible manner, combining Figure 6 ,like Figure 7 As shown, the method in S302 above may specifically include S401-S402.
[0105] S401. Obtain notification messages by listening to the message queue.
[0106] Optionally, the target system can monitor the message queue in real time. When it receives a notification message that includes the identification information corresponding to the target system, it can determine that the notification message is a notification message.
[0107] Optionally, the business can listen to the message queue, read the configured notification message, and determine the business process to be executed next based on the fields in the message body.
[0108] S402. Determine the business process to be executed based on the field information in the notification message, and execute the business process to be executed.
[0109] The field information is used to indicate the business process to be executed corresponding to the target business.
[0110] Optionally, the target system can parse and process the notification message to obtain the field information in the notification message, thereby determining the business process to be executed based on the field information in the notification message, and executing the business process to be executed.
[0111] The technical solution provided by the above embodiments brings at least the following beneficial effects: electronic devices can obtain the required notification messages by listening to the message queue, and determine the business process to be executed based on the field information in the notification message that indicates the business process to be executed corresponding to the target business, so as to execute the business process to be executed. Through this implementation method, the target system can accurately obtain the notification messages and accurately determine the business process to be executed.
[0112] In a feasible manner, combining Figure 5 ,like Figure 8 As shown, the phrase "based on log information and the processing rules corresponding to the target business, filter the changed data in the target database to obtain the target changed data corresponding to the target business" in S2021 above can specifically include S501-S502.
[0113] S501. If the data operation type of the changed data corresponding to the log information is the target operation type, obtain the regular expression corresponding to the target operation type.
[0114] The target operation type is any one of the following: insert operation or revision operation.
[0115] Optionally, when the electronic device determines that the data operation type of the changed data corresponding to the log information is the target operation type, it can obtain the regular expression corresponding to the target operation type to determine the target changed data corresponding to the target business through the regular expression corresponding to the target operation type.
[0116] S502. If the changed data corresponding to the log information matches the regular expression, then the changed data corresponding to the log information is determined as the target changed data corresponding to the target business.
[0117] For example, such as Figure 9 As shown, when monitoring data source log changes via the data bus, all changed data in the database is first obtained. Then, based on the corresponding processing rules, the changed data corresponding to the target business is further identified from all the changed data. Furthermore, it is determined whether the data operation type of the changed data is an insert or revision operation. If the data operation type is not an insert or revision operation, the process quickly returns (ends the business process).
[0118] Optionally, since the database is partitioned, regular expressions are needed to filter whether the monitored data changes are data changes corresponding to the target business. By configuring regular expressions for table names in the configuration center, the filtering conditions can be made more flexible and universal.
[0119] For example, the regular expression for table name can be:
[0120]
[0121] The technical solution provided by the above embodiments brings at least the following beneficial effects: The electronic device can further determine whether the data operation type of the changed data corresponding to the log information is the target operation type. If the data operation type of the changed data corresponding to the log information is the target operation type, a regular expression corresponding to the target operation type is obtained. If the changed data corresponding to the log information matches the regular expression, the changed data corresponding to the log information is determined as the target changed data corresponding to the target business. Through this implementation, the target changed data corresponding to the target business can be accurately determined.
[0122] In a feasible manner, combining Figure 3 ,like Figure 10 As shown, before S203 above, the method also includes S503; and the "constructing a notification message based on target change data" in S203 above can specifically include S504.
[0123] S503. Obtain the first data expression corresponding to the target change data, and compile the first data expression into the first target script.
[0124] The first data expression is used to express the target changed data, which is either the inserted data or the revised data. The first target script is used to compile the expression into an interpreted script that can be executed by the virtual machine.
[0125] Optionally, if the target changed data is the data corresponding to the target business, and if the data change detected by the data bus this time is an insertion operation, the string type afterAffectRow (i.e., the changed data expression) configured in the configuration center needs to be compiled into an Aviator script (i.e., the first target script; Aviator is a high-performance, lightweight Java expression evaluation engine, mainly used for dynamic evaluation of various expressions. Aviator directly compiles expressions into Java bytecode and hands it over to the JVM for execution).
[0126] S504. If the compiled first target script can be executed, construct a notification message based on the target change data.
[0127] Optionally, before constructing the notification message, it is necessary to determine whether the compiled first target script can be executed. Only if the compiled first target script can be executed should the notification message be constructed based on the target change data.
[0128] The technical solution provided by the above embodiments brings at least the following beneficial effects: when the target change data is change data corresponding to the target service, the first data expression used to express the target change data can be compiled into an interpreted first target script that can be executed by a virtual machine; and when the compiled first target script can be executed, a notification message can be constructed based on the target change data. Through this implementation, the first data expression can be compiled into an interpreted first target script that can be executed by a virtual machine, thereby accurately determining whether to construct a notification message through the first target script, improving the accuracy of the electronic device in executing services.
[0129] In a feasible manner, combining Figure 10 ,like Figure 11 As shown, before S503, the method further includes S601; and S503 may specifically include S5031.
[0130] S601. If the data operation type corresponding to the target changed data is a revision operation and a second data expression exists, compile the second data expression into a second target script and determine whether the second target script can be executed.
[0131] The second data expression is the data before the target change data was revised.
[0132] Optionally, if the data change detected by the data bus is a revision operation, it is first necessary to determine whether the beforeAffectRow (i.e., the second data expression) exists in the configuration center. If it exists, it is necessary to determine whether the Aviator script (i.e., the second target script) compiled from it can be executed. If it fails, it should return quickly (i.e., end the process). If it succeeds, it should determine whether the Aviator script compiled from afterAffectRow can be executed. If it can be executed, it should return quickly. If it cannot be executed, it should send a notification message.
[0133] S5031. If the second target script can be executed, obtain the first data expression corresponding to the target change data, and compile the first data expression into the first target script.
[0134] Optionally, if the data change can execute the compiled second target script, then the first data expression is further compiled into the first target script, and the changed data is constructed into a custom message queue message body configured in the configuration center, and then sent to the configured configuration center.
[0135] Optionally, if the compiled first target script can be executed after this data change, then proceed to the next business process, construct a notification message based on the target change data, and send the notification message to the corresponding target system.
[0136] In one feasible approach, the target business is any of the following: main process driven business, callback business, or revenue sharing and settlement business; the logic of the target business is greater than or equal to a preset strength; the first target script and the second target script are obtained through any of the following expression evaluation engines: Aviator expression evaluation engine, Groovy expression evaluation engine, or JRuby expression evaluation engine.
[0137] It's important to note that Aviator is designed for lightweight and high performance. Compared to the bulky Groovy and JRuby, Aviator is very small. Its implementation differs significantly from other lightweight evaluators. While other evaluators typically run through interpretation, Aviator directly compiles expressions into Java bytecode for execution by the JVM. However, its syntax is limited, supporting only logical expressions, arithmetic expressions, ternary expressions, and regular expression matching.
[0138] The Aviator expression evaluation engine works by compiling into Java bytecode and then executing it via the JVM. Its advantages include simple syntax, lower learning curve than Groovy, high performance, and lightweight nature. Its disadvantage is that its semantic expressiveness is less than Groovy's. The Groovy expression evaluation engine, on the other hand, compiles into Java bytecode and then executes it via the JVM. Its advantages include a very rich syntax, seamless compatibility with Java source code, numerous functional libraries, and high performance. Its disadvantages are a high learning curve and poor code readability.
[0139] The technical solution provided by the above embodiments brings at least the following beneficial effects: When the data operation type corresponding to the target changed data is a revision operation and a second data expression exists, it is necessary to first compile the second data expression into a second target script and determine whether the second target script can be executed; if the second target script can be executed and the target changed data is the changed data corresponding to the target business, the first data expression is compiled into a first target script. Through this implementation method, it is possible to accurately determine whether to compile the first data expression into a first target script.
[0140] In one implementable manner, the method further includes S701 prior to S201 described above.
[0141] S701. Add processing rules corresponding to the target business to filter the changed data corresponding to the log information in the target database when accessing the target business, so as to obtain the target changed data corresponding to the target business.
[0142] It is understandable that before executing the target business, it is necessary to add the corresponding processing rules in advance. Then, when it is determined that the accessed business is the target business, the change data corresponding to the log information in the target database can be filtered through the corresponding processing rules to obtain the target change data corresponding to the target business.
[0143] It should be noted that the aforementioned target service can be any service; that is, processing rules corresponding to each service can be added in advance before execution. This means that multiple processing rules for different services can be pre-added to an electronic device so that the corresponding processing rules can be retrieved when the service is executed.
[0144] The technical solution provided by the above embodiments brings at least the following beneficial effects: Electronic devices need to pre-add processing rules corresponding to the target service so that when accessing the target service, they can filter the changed data corresponding to the log information in the target database to obtain the target changed data corresponding to the target service. Therefore, when the electronic device executes the target service, the service can be executed through the pre-added processing rules.
[0145] For example, such as Figure 12 The diagram illustrates a process using revenue sharing and settlement as an example. The asynchronous processes between multiple services no longer heavily rely on table scanning tasks, improving timeliness. This achieves decoupling of code logic. Other businesses using the same data source (payment / refund / withdrawal / recharge) that want to implement asynchronous event-driven processing through database changes can simply add a configuration to the configuration center and implement the corresponding creation message for message notification. However, other systems using different data sources need to implement an additional abstract class, specifying the data source and the new configuration center address before use.
[0146] Combination Figure 12 As shown, during the settlement process, the order system creates an order and applies for a settlement process from the core system. Upon receiving the settlement application from the order system, the core system verifies parameters and generates a settlement statement and a posting statement, and saves the corresponding data in the core database. Further, the core system initiates a settlement posting process to the account system. The account system returns a successful posting notification to the core system, allowing the core system to send an instruction to update the database. The core database then returns confirmation information to the core system.
[0147] In the asynchronous event service log listening process, the core database initiates a listening request for log messages from the data source to the asynchronous event server. The asynchronous event server filters the required data through the configuration center and sends messages with different topics to the message queue. The message queue pulls messages with the topic "revenue sharing" from the core system. In the successful accounting application process, the core system determines that the next driving logic is to call a channel and requests revenue sharing from the channel system. The channel system processes the revenue sharing and returns a revenue sharing acceptance success message to the core system. In the channel working logic process, the channel system queries the third-party channel for the revenue sharing results. The third-party channel can return a revenue sharing success message to the channel system, allowing the channel system to send an update message to the channel database to show the revenue sharing status as successful and to send a callback to the core system to show the core revenue sharing status, so that the core system can send an update message to the core database to show the revenue sharing data as successful.
[0148] In another asynchronous event service log listening process, the core database sends log messages from the data source to the asynchronous event server. The asynchronous event server filters out the required data through the configuration center and sends messages with different topics to the message queue. The message queue pulls messages with the topic of "revenue sharing" from the order system, enabling the order system to determine that the next driving logic is a callback transaction and generate a message indicating whether the revenue sharing is successful or failed. This completes a full accounting and settlement business process.
[0149] As illustrated by the examples above, this disclosure designs a general-purpose driving method. It uses a data bus to monitor database state changes, filters out necessary events for notification through configurable filtering conditions, and then sends configurable custom message notifications to a configurable message queue. This drives the flow of target business processes across various systems, improving the timeliness of target business execution, reducing reliance on scheduled tasks (reducing the execution interval of scheduled tasks and reducing the printing of invalid logs), and decoupling system logic. It is easily extensible; if other businesses want to receive corresponding event notifications based on database state changes, they can simply add the corresponding configuration parameters. New businesses can be quickly integrated, reducing development costs.
[0150] It is understood that the above methods can be implemented by a service execution device. To achieve the above functions, the service execution device includes the corresponding hardware structure and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, the embodiments of this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure.
[0151] This disclosure embodiment can divide the above-mentioned business execution device into functional modules according to the above method example. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this disclosure embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0152] Figure 13 This is a schematic diagram illustrating the structure of a service execution apparatus according to an exemplary embodiment. (Refer to...) Figure 13 The service execution device 130 may include: a listening unit 1301, an acquisition unit 1302, a processing unit 1303, and an execution unit 1304.
[0153] Listening unit 1301 is configured to monitor state changes of the target database; the target database corresponds to multiple systems, and these systems are systems that execute target business logic; for example, listening unit 1301 can be used to execute... Figure 3 Step 201 in the process.
[0154] The acquisition unit 1302 is configured to, upon detecting a change in the target data source in the target database, retrieve the target change data corresponding to the target business based on the log information generated by the target data source; for example, the acquisition unit 1302 can be used to execute... Figure 3 Step 202 in the process.
[0155] Processing unit 1303 is configured to construct a notification message based on target change data; for example, processing unit 1303 may be used to execute... Figure 3 Step 203 in the process.
[0156] Execution unit 1304 is configured to execute the pending business process corresponding to the target business based on the notification message. For example, execution unit 1304 can be used to execute... Figure 3 Step 203 in the process.
[0157] Optionally, processing unit 1303 is configured to, upon detecting a change in the database state of the target database and listening for log information generated by the target data source, filter the changed data in the target database according to the log information and the processing rules corresponding to the target business, to obtain the target changed data corresponding to the target business. For example, processing unit 1303 can be used to execute... Figure 5 The steps in 2021.
[0158] Optionally, the processing unit 1303 is configured to construct a notification message based on a preset message body according to the target change data and configuration; for example, the processing unit 1303 may be used to execute... Figure 6 The steps in step 301.
[0159] Reference Figure 13 The service execution device 130 may further include a sending unit 1305. The sending unit 1305 is configured to send a notification message to the corresponding target system via a message queue. For example, the sending unit 1305 may be used to perform... Figure 6 Step 302 in the process.
[0160] Execution unit 1304 is configured to execute the pending business process corresponding to the target business in the target system based on the notification message; the target system can be a system within multiple systems. For example, execution unit 1304 can be used to execute... Figure 6 Step 302 in the process.
[0161] Optionally, the acquisition unit 1302 is configured to acquire a notification message by listening to a message queue; for example, the acquisition unit 1302 can be used to perform... Figure 7 The steps in step 401.
[0162] Execution unit 1304 is configured to execute a business process determined based on field information in a notification message; the field information indicates the business process to be executed corresponding to the target business. For example, execution unit 1304 can be used to execute... Figure 7 Step 402 in the process.
[0163] Optionally, the acquisition unit 1302 is configured to acquire the regular expression corresponding to the target operation type when the data operation type of the changed data corresponding to the log information is the target operation type; the target operation type is any one of the following: insert operation, revision operation; for example, the acquisition unit 1302 can be used to execute Figure 8 The steps in step 501.
[0164] Reference Figure 13 The service execution device 130 may further include a determining unit 1306. The determining unit 1306 is configured to determine the changed data corresponding to the log information as the target changed data corresponding to the target service if the changed data matches a regular expression; for example, the determining unit 1306 may be used to execute... Figure 8 The steps in step 502.
[0165] Optionally, the acquisition unit 1302 is configured to execute a first data expression corresponding to the target changed data; for example, the acquisition unit 1302 can be used to execute... Figure 10 The steps in step 503.
[0166] Processing unit 1303 is configured to compile a first data expression into a first target script; the first data expression represents target changed data, which may be inserted or revised data; the first target script compiles the expression into an interpreted script executable by a virtual machine. For example, processing unit 1303 may be used to execute... Figure 10 The steps in step 503.
[0167] Processing unit 1303 is configured to construct a notification message based on target change data, provided that the compiled first target script can be executed. For example, processing unit 1303 can be used to execute... Figure 10 The steps in step 504.
[0168] Optionally, the processing unit 1303 is configured to, when the data operation type corresponding to the target changed data is a revision operation and a second data expression exists, compile the second data expression into a second target script and determine whether the second target script can be executed; the second data expression is the data before the target changed data is revised; for example, the processing unit 1303 can be used to execute... Figure 11 The steps in step 601.
[0169] The acquisition unit 1302 is configured to acquire the first data expression corresponding to the target change data when the second target script can be executed; for example, the acquisition unit 1302 can be used to execute... Figure 11 The steps in step 5031.
[0170] Processing unit 1303 is configured to compile a first data expression into a first target script. For example, processing unit 1303 can be used to execute... Figure 11 The steps in step 5031.
[0171] Optionally, the processing unit 1303 is configured to execute the processing rules corresponding to the target service, so as to filter the change data corresponding to the log information in the target database when accessing the target service, and obtain the target change data corresponding to the target service.
[0172] As described above, the embodiments of this disclosure can divide the electronic device into functional modules according to the above method examples. The integrated modules can be implemented in hardware or as software functional modules. Furthermore, it should be noted that the module division in these embodiments is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into a single processing module.
[0173] Regarding the business execution apparatus in the above embodiments, the specific methods by which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0174] Figure 14 This is a schematic diagram of the structure of a business execution device 60 provided in this disclosure. For example... Figure 14 The service execution apparatus 60 may include at least one processor 601 and a memory 603 for storing executable instructions of the processor 601. The processor 601 is configured to execute the instructions in the memory 603 to implement the service execution method described in the above embodiments.
[0175] In addition, the service execution device 60 may also include a communication bus 602 and at least one communication interface 604.
[0176] The processor 601 may be a GPU, a microprocessor unit, an ASIC, or one or more integrated circuits for controlling the execution of programs according to the present disclosure.
[0177] The communication bus 602 may include a path for transmitting information between the aforementioned components.
[0178] Communication interface 604 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
[0179] Memory 603 may be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory may exist independently and be connected to the processing unit via a bus. Memory may also be integrated with the processing unit as a volatile storage medium within the GPU.
[0180] The memory 603 stores instructions for executing the present invention, and the processor 601 controls the execution of these instructions. The processor 601 executes the instructions stored in the memory 603 to implement the functions of the method disclosed herein.
[0181] In a specific implementation, as one example, the processor 601 may include one or more GPUs, for example... Figure 14 GPU0 and GPU1 in the dataset.
[0182] In a specific implementation, as one example, the service execution device 60 may include multiple processors, such as... Figure 14Processors 601 and 607 are described herein. Each of these processors may be a single-core (CPU) processor or a multi-core (GPU) processor. A processor here may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0183] In a specific implementation, as one embodiment, the service execution device 60 may further include an output device 605 and an input device 606. The output device 605 communicates with the processor 601 and can display information in various ways. For example, the output device 605 may be a liquid crystal display (LCD), a light-emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device 606 communicates with the processor 601 and can accept user input in various ways. For example, the input device 606 may be a mouse, keyboard, touchscreen device, or sensing device, etc.
[0184] Those skilled in the art will understand that Figure 14 The structure shown does not constitute a limitation on the business execution device 60, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0185] This disclosure also provides a computer-readable storage medium storing instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the group communication method provided in the embodiments of this disclosure described above.
[0186] This disclosure also provides a computer program product containing instructions that, when run on an electronic device, cause the electronic device to execute the business execution method provided in the above-described embodiments of this disclosure.
[0187] This disclosure also provides a communication system, such as... Figure 2 As shown, the system includes a server 11, a client 12, a data bus 13, and a database 14. The server 11, client 12, data bus 13, and database 14 are respectively used to execute the corresponding steps in the above embodiments of this disclosure, thereby enabling the communication system to solve the technical problems solved by the embodiments of this disclosure and achieve the technical effects achieved by the embodiments of this disclosure, which will not be elaborated further here.
[0188] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0189] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A business execution method, characterized in that, The method includes: Monitor the status changes of the target database; the target database corresponds to multiple systems, and the multiple systems are systems that execute the target business. If a change is detected in the target data source in the target database, the target change data corresponding to the target business is obtained based on the log information generated by the target data source. Obtain the first data expression corresponding to the target changed data, and compile the first data expression into a first target script; the first data expression is used to express the target changed data, the target changed data being inserted data or revised data, and the first target script is used to compile the expression into an interpreted script executed by a virtual machine; A notification message is constructed based on the target change data, and the business process to be executed corresponding to the target business is executed based on the notification message. The step of constructing a notification message based on the target change data includes: If the compiled first target script can be executed, a notification message is constructed based on the target change data.
2. The method according to claim 1, characterized in that, When a change in the target data source in the target database is detected, the step of obtaining the target change data corresponding to the target service based on the log information generated by the target data source includes: After the database state of the target database changes and the log information generated by the target data source is detected, the changed data in the target database is filtered according to the log information and the processing rules corresponding to the target business to obtain the target changed data corresponding to the target business.
3. The method according to claim 2, characterized in that, The step of constructing a notification message based on the target change data and executing the pending business process corresponding to the target business based on the notification message includes: The notification message is constructed based on the target change data and the configured preset message body; The notification message is sent to the corresponding target system via a message queue, and the target system executes the pending business process corresponding to the target business according to the notification message; the target system is a system among the multiple systems.
4. The method according to claim 3, characterized in that, The step of executing the pending business process corresponding to the target business in the target system according to the notification message includes: The notification message is obtained by listening to the message queue; The business process to be executed is determined based on the field information in the notification message, and the business process to be executed is executed; the field information is used to indicate the business process to be executed corresponding to the target business.
5. The method according to claim 2, characterized in that, The step of filtering the changed data in the target database according to the log information and the processing rules corresponding to the target service to obtain the target changed data corresponding to the target service includes: If the data operation type of the changed data corresponding to the log information is the target operation type, obtain the regular expression corresponding to the target operation type; the target operation type is any one of the following: insert operation, revision operation; If the changed data corresponding to the log information matches the regular expression, then the changed data corresponding to the log information is determined as the target changed data corresponding to the target business.
6. The method according to claim 5, characterized in that, Before obtaining the first data expression corresponding to the target change data and compiling the first data expression into a first target script, the method further includes: If the data operation type corresponding to the target changed data is the revision operation and the second data expression exists, the second data expression is compiled into a second target script, and it is determined whether the second target script can be executed; the second data expression is the data before the target changed data is revised. The step of obtaining the first data expression corresponding to the target change data and compiling the first data expression into a first target script includes: If the second target script can be executed, obtain the first data expression corresponding to the target change data, and compile the first data expression into the first target script.
7. The method according to claim 1, characterized in that, Before monitoring the state changes of the target database, the method further includes: Add processing rules corresponding to the target service so that when accessing the target service, the changed data corresponding to the log information in the target database can be filtered to obtain the target changed data corresponding to the target service.
8. A business execution device, characterized in that, include: The monitoring unit is configured to monitor state changes in the target database. The target database corresponds to multiple systems, and these multiple systems are systems that execute the target business. The acquisition unit is configured to, when a change in the target data source in the target database is detected, acquire the target change data corresponding to the target business based on the log information generated by the target data source. The acquisition unit is configured to execute a first data expression corresponding to the target change data; The processing unit is configured to execute the compilation of the first data expression into a first target script; The first data expression is used to express the target changed data, which is inserted data or revised data, and the first target script is used to compile the expression into an interpreted script executed by a virtual machine; The processing unit is configured to execute the construction of a notification message based on the target change data; The execution unit is configured to execute the pending business process corresponding to the target business according to the notification message; The processing unit is specifically configured to construct a notification message based on the target change data when the compiled first target script can be executed.
9. The business execution apparatus according to claim 8, characterized in that, The processing unit is configured to, upon a change in the database state of the target database and upon detecting the log information generated by the target data source, filter the changed data in the target database according to the log information and the processing rules corresponding to the target service, to obtain the target changed data corresponding to the target service.
10. The business execution apparatus according to claim 9, characterized in that, The processing unit is configured to execute the construction of the notification message based on the target change data and the configured preset message body; The sending unit is configured to send the notification message to the corresponding target system via a message queue; The execution unit is configured to execute the pending business process corresponding to the target business in the target system according to the notification message; The target system is one of the systems in the plurality of systems.
11. The business execution apparatus according to claim 10, characterized in that, The acquisition unit is configured to acquire the notification message by listening to the message queue; The execution unit is configured to execute the business process to be executed, which is determined based on the field information in the notification message; The field information is used to indicate the business process to be executed corresponding to the target business.
12. The business execution apparatus according to claim 9, characterized in that, The acquisition unit is configured to acquire a regular expression corresponding to the target operation type when the data operation type of the changed data corresponding to the log information is the target operation type; the target operation type is any one of the following: insert operation, revision operation; The determining unit is configured to determine the changed data corresponding to the log information as the target changed data corresponding to the target service if the changed data corresponding to the log information matches the regular expression.
13. The business execution apparatus according to claim 12, characterized in that, The processing unit is configured to, when the data operation type corresponding to the target changed data is the revision operation and the second data expression exists, compile the second data expression into a second target script and determine whether the second target script can be executed. The second data expression is the data before the target change data was revised; The acquisition unit is configured to acquire the first data expression corresponding to the target change data when the second target script can be executed. The processing unit is configured to compile the first data expression into the first target script.
14. The business execution apparatus according to claim 8, characterized in that, The processing unit is configured to execute the processing rules corresponding to the target service, so as to filter the change data corresponding to the log information in the target database when accessing the target service, and obtain the target change data corresponding to the target service.
15. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the business execution method as described in any one of claims 1-7.
16. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the service execution method as described in any one of claims 1-7.
17. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the business execution method as described in any one of claims 1-7.
Citation Information
Patent Citations
Event message asynchronous notification method and device, electronic equipment and storage medium
CN110968438A