Business execution method, device, and storage medium

By parsing and distributing financial business instructions to multiple slave servers for execution in the main server controller, the problems of long processing time and low efficiency in single business systems are solved, and efficient processing of distributed business systems is achieved.

CN116302436BActive Publication Date: 2025-11-25INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310312178.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-27
Publication Date
2025-11-25
Estimated Expiration
2043-03-27

AI Technical Summary

Technical Problem

Single-business system architectures are time-consuming, have low efficiency in handling complex financial transactions, and lack scalability.

Method used

The main server receives user command information from the controller, parses and distributes it to multiple slave servers for parallel execution, obtains and synthesizes the total execution result, and realizes a distributed business system.

Benefits of technology

It improved the speed and efficiency of business processing and reduced the processing time of a single business system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116302436B_ABST
    Figure CN116302436B_ABST
Patent Text Reader

Abstract

The application discloses a business execution method and device and a storage medium. It relates to the field of big data. The method comprises the following steps: receiving user instruction information through a controller in a main server in a target application, wherein the user instruction information is sent by a receiver in the main server; analyzing the user instruction information through the controller to obtain instruction content, determining M business contents indicated by the instruction content, and determining M slave servers for executing each business content from N slave servers to obtain M slave servers; sending each business content to the corresponding slave server and receiving an execution result returned by each slave server to obtain M sub execution results; determining a total execution result of the user instruction according to the M sub execution results, and sending the total execution result to the receiver. Through the application, the problem of long time consumption and low efficiency of business handling in the related art by using a single business system is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of big data, in particular, to a business execution method and device, and a storage medium. BACKGROUND

[0002] In the early development of financial services, due to the less business content, the single business system architecture can meet the requirements of business processing. However, with the rapid development of financial services, the system access volume and business complexity are rapidly growing, and the single business system architecture gradually becomes a bottleneck for business development. Due to the high coupling and poor scalability of the single business architecture, it takes a long time to execute complex businesses, and the business processing efficiency is low.

[0003] For the problem of long time consumption and low business processing efficiency in related technologies, an effective solution has not been proposed. SUMMARY

[0004] The present application provides a business execution method and device, and a storage medium to solve the problem of long time consumption and low business processing efficiency in related technologies.

[0005] According to an aspect of the present application, a business execution method is provided. The method comprises: receiving user instruction information by a controller in a master service end in a target application, wherein the user instruction information is sent by a receiver in the master service end; analyzing the user instruction information by the controller to obtain instruction content, determining M business contents indicated by the instruction content, and determining M slave service ends for executing each business content from N slave service ends to obtain M slave service ends; sending each business content to the corresponding slave service end, and receiving the execution result returned by each slave service end to obtain M sub execution results; determining the total execution result of the user instruction according to the M sub execution results, and sending the total execution result to the receiver.

[0006] Optionally, before receiving the user instruction information by the controller in the master service end in the target application, the method further comprises: determining the master service end in the target application, and adding a first identifier in the master service end; determining the remaining service ends in the target application except the master service end to obtain M slave service ends, and adding a second identifier in each slave service end; in the case that the target application receives the user instruction information, sending the user instruction information to the receiver of the service end carrying the first identifier.

[0007] Optionally, sending each service content to the corresponding slave server includes: obtaining the name of the slave server indicated by the service content to obtain M first names; synchronously sending the service content to the corresponding M slave servers according to the M first names, and recording the steps executed when executing the service content in each slave server to obtain the execution step sequence of each slave server; determining the server associated with each slave server according to the preset reference relationship to obtain M sets of associated servers, and storing the execution step sequence of each slave server in the slave server and its corresponding associated server.

[0008] Optionally, before obtaining the name of the slave server indicated by the business content and obtaining M first names, the method further includes: obtaining the application serial number of the target application to obtain a first serial number; obtaining the device ID and serial number of each server, and generating a serial number of each server based on the device ID and serial number using a preset algorithm to obtain N+1 second serial numbers, wherein the server includes one master server and N slave servers; and combining each second serial number with the first serial number to obtain the name of each server.

[0009] Optionally, after storing the execution step sequence of each slave server in the slave server and its corresponding associated server, the method further includes: receiving a rollback instruction sent by the receiver; determining the server indicated by the rollback instruction, obtaining the target server, and acquiring the execution step sequence in the target server; executing the steps in the execution step sequence in reverse according to the rollback instruction, and sending the execution result to the receiver.

[0010] Optionally, before determining each server associated with a server based on a preset reference relationship, the method further includes: determining the business content executed by each server; determining the execution flow between business content based on the reference relationship between business content to obtain the business execution flow of the target application; and determining the reference relationship between N+1 servers based on the business execution flow to obtain the preset reference relationship.

[0011] Optionally, determining the overall execution result of the user instruction based on the M sub-execution results includes: obtaining the execution start time of each sub-execution result to obtain M execution start times, and calculating the time difference between the M execution start times to obtain P target time differences; determining whether there is a time difference greater than a preset time difference among the P target time differences; if there is a time difference greater than the preset time difference among the P target time differences, determining the overall execution result as an execution exception; if there is no time difference greater than the preset time difference among the P target time differences, determining whether there is a sub-execution result indicating execution failure among the M sub-execution results; if there is a sub-execution result indicating execution failure among the M sub-execution results, determining the overall execution result as an execution exception; if there is no sub-execution result indicating execution failure among the M sub-execution results, determining the overall execution result as a normal exception.

[0012] Optionally, after determining the M service contents indicated by the instruction content, the method further includes: determining whether the server executing the M service contents is the main server; if the server executing the M service contents is the main server, executing the M service contents through the main server; if the server executing the M service contents is not the main server, determining the server executing each service content to obtain M slave servers.

[0013] According to another aspect of this application, a service execution apparatus is provided. The apparatus includes: a first receiving unit, configured to receive user instruction information via a controller in a main server of a target application, wherein the user instruction information is sent by a receiver in the main server; a parsing unit, configured to parse the user instruction information via the controller to obtain instruction content, determine M service contents indicated by the instruction content, and determine the slave server executing each service content from N slave servers, thus obtaining M slave servers; a first sending unit, configured to send each service content to the corresponding slave server and receive the execution result returned by each slave server, thus obtaining M sub-execution results; and a first determining unit, configured to determine the total execution result of the user instruction based on the M sub-execution results and send the total execution result to the receiver.

[0014] According to another aspect of the present invention, a computer storage medium is also provided for storing a program, wherein the program, when running, controls the device where the computer storage medium is located to execute a service execution method.

[0015] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is configured to execute the computer-readable instructions, wherein the computer-readable instructions, when executed, perform a service execution method.

[0016] This application employs the following steps: User instruction information is received by the controller in the main server of the target application, where the user instruction information is sent by the receiver in the main server; the controller parses the user instruction information to obtain the instruction content, determines the M business contents indicated by the instruction content, and selects the slave server to execute each business content from N slave servers, resulting in M ​​slave servers; each business content is sent to the corresponding slave server, and the execution result returned by each slave server is received, resulting in M ​​sub-execution results; the total execution result of the user instruction is determined based on the M sub-execution results, and the total execution result is sent to the receiver. This solves the problems of long processing time and low efficiency in processing business using a single business system in related technologies. It provides a receiver integrated in the main service to receive instruction information, which is then sent to the controller in the main service. The controller parses the instructions and sends the parsed business contents to slave services associated with the main service for processing, enabling different business processes to be executed synchronously by different slave services, transforming a single business system into a distributed business system, thereby improving the speed and efficiency of business processing. Attached Figure Description

[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 This is a schematic diagram of a service execution system provided according to an embodiment of this application;

[0019] Figure 2 This is a flowchart of a service execution method provided according to an embodiment of this application;

[0020] Figure 3 This is a schematic diagram illustrating the optional preset reference relationships provided according to embodiments of this application;

[0021] Figure 4 This is a schematic diagram of a service execution device provided according to an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0023] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application 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 for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.

[0027] It should be noted that the execution methods, apparatuses, and storage media of the business as defined in this disclosure can be used in the field of big data, or in any field other than big data. The application fields of the execution methods, apparatuses, and storage media of the business as defined in this disclosure are not limited.

[0028] In this embodiment, Figure 1 This is a schematic diagram of the service execution system provided according to the embodiments of this application, such as... Figure 1 As shown, the aforementioned service execution method is executed using an optional service execution system, which includes at least: a receiver 101, a controller 102, and an actuator 103.

[0029] The controller 102 and receiver 101 are located in the main service, and the actuator 103 is located in the main service and multiple slave services.

[0030] Controller 102 can be a TC (Transaction Coordinator), which is used to maintain the running state of global transactions and is responsible for coordinating and driving the commit or rollback of global transactions.

[0031] Receiver 101 can be a TM (Transaction Manager), responsible for initiating a global transaction and ultimately making a decision on global commit or global rollback.

[0032] Executor 103 can be an RM (Resource Manager) that controls branch transactions, is responsible for branch registration and status reporting, and receives instructions from the transaction coordinator to drive the commit and rollback of branch transactions.

[0033] After receiving the global transaction, receiver 101 sends it to controller 102. Controller 102 then determines the execution status of executor 103 and the transaction allocation based on the global transaction. After coordination, it sends the transaction to executor 103 for execution, thus completing the execution of the global transaction by coordinating and running transactions in parallel. Since both executor 103 and receiver 101 need to interact with controller 102, both controller 102 and receiver 103 are located in the main service. Controller 102 internally consists of a main transaction coordinator and a sub-transaction coordinator. Only the sub-transaction coordinator is exposed through a microservice for executor 103 to call, while the main transaction coordinator and executor 103 in the main service make in-process calls. This improves the interaction efficiency between controller 102 and receiver 101, as well as the interaction efficiency between executor 103 in the main service and controller 102.

[0034] According to an embodiment of this application, a method for performing a service is provided.

[0035] Figure 2 This is a flowchart of a service execution method provided according to an embodiment of this application. For example... Figure 2 As shown, the method includes the following steps:

[0036] Step S201: Receive user instruction information through the controller in the main server of the target application, wherein the user instruction information is sent by the receiver in the main server.

[0037] Specifically, the main server and M slave servers are deployed in the same application or the same system. After the receiver in the main server of the application or system receives the instruction information sent by the user, it needs to send the instruction information to the control terminal, so that the control terminal can parse and execute the instruction information.

[0038] Step S202: The controller parses the user instruction information to obtain the instruction content, determines the M business contents indicated by the instruction content, and determines the slave server that executes each business content from the N slave servers, thus obtaining M slave servers.

[0039] Specifically, after the controller receives the instruction information, it needs to parse the instruction information to obtain the instruction content, determine the business content to be executed indicated by the instruction content, and determine the server to be used to execute each business content, thereby obtaining the M slave servers required to execute this user instruction.

[0040] For example, if a user's instruction is to conduct a certain financial transaction, after parsing the instruction, the instruction content is "conduct transaction A". At this time, it is necessary to determine the business content required to conduct transaction A, which may include: transaction content verification, payment operation, and account posting operation. Based on the above three business contents, the required secondary services can be determined as the secondary services corresponding to transaction content verification, payment operation, and account posting operation, respectively, thus obtaining three secondary services.

[0041] Step S203: Send each business content to the corresponding slave server and receive the execution result returned by each slave server to obtain M sub-execution results.

[0042] Specifically, after identifying multiple slave services, the controller can send the business content corresponding to each slave service to each slave service, so that multiple slave services can execute the business content in parallel, and then, after completing the execution, each slave service will report the sub-execution result to the controller.

[0043] Step S204: Determine the total execution result of the user instruction based on the M sub-execution results, and send the total execution result to the receiver.

[0044] Specifically, after obtaining the results of M sub-executions, the total execution result of the user instruction can be determined based on the results of the M sub-executions, thereby determining whether the user instruction was successfully executed.

[0045] The service execution method provided in this application embodiment receives user instruction information through a controller in the main server of the target application. The user instruction information is sent by a receiver in the main server. The controller parses the user instruction information to obtain the instruction content, determines M service contents indicated by the instruction content, and selects a slave server from N slave servers to execute each service content, resulting in M ​​slave servers. Each service content is sent to the corresponding slave server, and the execution result returned by each slave server is received, resulting in M ​​sub-execution results. The total execution result of the user instruction is determined based on the M sub-execution results and sent to the receiver. This solves the problems of long processing time and low efficiency in processing services using a single service system in related technologies. It provides a receiver integrated in the main service to receive instruction information, which is then sent to the controller in the main service. The controller parses the instructions and sends the parsed service content to slave services associated with the main service for processing. This allows different business processes to be executed synchronously by different slave services, transforming a single service system into a distributed service system, thereby improving the speed and efficiency of service processing.

[0046] Optionally, in the service execution method provided in the embodiments of this application, after determining the M service contents indicated by the instruction content, the method further includes: determining whether the server executing the M service contents is the main server; if the server executing the M service contents is the main server, executing the M service contents through the main server; if the server executing the M service contents is not the main server, determining the server executing each service content to obtain M slave servers.

[0047] Specifically, after obtaining M business items, we can first determine whether the M business items can be executed by the main service. If they can be executed by the main service, the controller in the main service can directly send the M business items to the executor in the main service for execution, thereby improving the execution efficiency of the business items.

[0048] Optionally, in the service execution method provided in the embodiments of this application, before receiving user instruction information through the controller in the main server of the target application, the method further includes: determining the main server in the target application and adding a first identifier to the main server; determining the other servers in the target application besides the main server to obtain M slave servers, and adding a second identifier to each slave server; and when the target application receives user instruction information, sending the user instruction information to the receiver of the server carrying the first identifier.

[0049] Specifically, when a user sends a command to the target application, the command is input in the client of the target application. After the client receives the command, it needs to determine the master server from N+1 servers and send the command to the master server. This can be done by identifying the master server using an identifier. That is, while traversing each server, the identifier of each server is obtained, and when the server with the first identifier is encountered, the command is sent to the server with that first identifier, i.e., the master server. Therefore, before receiving user command information through the controller in the master server of the target application, the master server needs to be determined from N+1 servers, and the master server and slave servers can be distinguished using the first and second identifiers, thus achieving accurate determination of the master server.

[0050] Optionally, in the service execution method provided in this application embodiment, sending each service content to the corresponding slave server includes: obtaining the name of the slave server indicated by the service content to obtain M first names; synchronously sending the service content to the corresponding M slave servers according to the M first names, and recording the steps executed when executing the service content in each slave server to obtain the execution step sequence of each slave server; determining the server associated with each slave server according to a preset reference relationship to obtain M sets of associated servers, and storing the execution step sequence of each slave server in the slave server and its corresponding associated server.

[0051] Specifically, after obtaining M business content items, and determining the corresponding slave server for each business content item, the name of each slave server is determined, and the business content is sent to the corresponding slave server according to the name. This allows the slave server to execute the business content after receiving it, and to record the steps of executing the business content during execution. This results in an execution step sequence for each slave server, which includes the steps for executing the business content and the execution flow relationship between the steps. This allows for the recording of execution steps on each slave server.

[0052] Furthermore, after determining the execution step sequence for each slave server, it is also necessary to determine the associated server for each slave server based on the preset reference relationship, so that the execution step sequence is also stored in the associated server.

[0053] To accurately determine the preset reference relationships, optionally, in the service execution method provided in the embodiments of this application, before determining each server associated with a server based on the preset reference relationships, the method further includes: determining the service content executed by each server; determining the execution flow between service content based on the reference relationships between service content to obtain the service execution flow of the target application; and determining the reference relationships between N+1 servers based on the service execution flow to obtain the preset reference relationships.

[0054] Specifically, when determining the preset reference relationships, the reference relationships between N+1 servers can be determined based on the execution flow between business content. For example, if the target application can complete the transfer operation, the business execution flow involved in the transfer operation is: transfer content verification, payment operation, and receipt operation. Since there is no relationship between the three operations, the servers corresponding to the three operations are directly associated with the main server. In the transfer content verification, there are two more operations: transferor verification and transferee verification. When these two business contents need to be executed by two slave servers, the server associated with the slave server where these two business contents are located is the slave server where the transfer content verification is located.

[0055] Figure 3 This is a schematic diagram illustrating the optional preset reference relationships provided in the embodiments of this application, such as... Figure 3 As shown, A is the master server, BE is the slave server, A is associated with B, C, and D, and B is associated with E. After determining the server associated with each slave server according to the preset reference relationship, the execution step sequence in B, C, and D can be stored in A, and the execution step sequence in E can be stored in B, thereby completing the backup operation of the execution step sequence according to the preset reference relationship.

[0056] Optionally, in the service execution method provided in the embodiments of this application, after storing the execution step sequence of each slave server in the slave server and its corresponding associated server, the method further includes: receiving a rollback instruction sent by the receiver; determining the server indicated by the rollback instruction, obtaining the target server, and obtaining the execution step sequence in the target server; executing the steps in the execution step sequence in reverse according to the rollback instruction, and sending the execution result to the receiver.

[0057] Specifically, after the receiver receives the rollback instruction, it sends the rollback instruction to the controller. The controller parses the rollback instruction to determine the server indicated by the rollback instruction. The server can be a master server or a slave server. After determining the server, the controller controls each server to execute the steps in the execution step sequence in reverse according to the rollback instruction, thereby completing the rollback operation.

[0058] For example, each server can have a table recording the execution process. Upon receiving a rollback instruction, if the rollback instruction instructs servers A and B to roll back the previous execution step, the most recently executed step can be retrieved from the table and executed in reverse order to complete the rollback operation.

[0059] Figure 3 This is a schematic diagram illustrating the optional preset reference relationships provided in the embodiments of this application, such as... Figure 3 As shown, service A is the main service; services B, C, D, and E are sub-services.

[0060] Since A is the main service, the necessary log tables `tx_at_main_event`, `tx_at_sub_event`, and `lock_table` need to be created for the fully automated mode. B is the outermost nested sub-service, so the `tx_at_sub_event` table needs to be created to record the operation information of service E. Then, A, B, C, D, and E all need to create an `undo_log` table to record before and after mirroring, used for rollback operations.

[0061] Service A records the main service information and status in `tx_at_main_event`, and updates the main service status here subsequently. Then it records the information of sub-services B, C, and D in `tx_at_sub_event`. Since E is not a service directly called by A, A does not need to record it. B records E's information in `tx_at_sub_event`.

[0062] The undo log records the main service ID, sub-service ID, binary rollback information, etc. Since each sub-service has its own undo log, it's handled by the Resource Manager (RM). Because JDBC operations proceed sequentially through DataSource→Connection→Statement, the fully automated service needs to establish DataSourceProxy→ConnectionProxy→StatementProxy, adding proxies and enhanced logic to the entire process. The StatementProxy, in particular, requires SQL parsing logic. Leveraging the characteristics of local services, updates to business data and the writing of undo log records are committed within the same local service. This ensures that the database layer stores a corresponding modification image for every change, guaranteeing that any committed business data has a corresponding rollback log.

[0063] When rolling back the global service, the rollback log is committed, and the data operations to compensate for the rollback are automatically generated and executed using the information in the undo_log.

[0064] Optionally, in the service execution method provided in the embodiments of this application, before obtaining the name of the slave server indicated by the service content and obtaining M first names, the method further includes: obtaining the application serial number of the target application and obtaining a first serial number; obtaining the device ID and serial number of each server, and generating a serial number of each server according to the device ID and serial number using a preset algorithm to obtain N+1 second serial numbers, wherein the server includes one master server and N slave servers; and combining each second serial number with the first serial number to obtain the name of each server.

[0065] Specifically, before obtaining the name of each server, it is necessary to determine the name of each server first. When determining the server name, since there are multiple applications, and each application has a controller, if a random name generation method is used, the same name may be generated in different applications, resulting in N+1 servers with the same name. This could cause anomalies when managing and controlling multiple applications as a whole. Therefore, when generating the name of each server in the target application, the application sequence number of the target application can be determined first. Then, based on the server's device ID and serial number, a preset calculation method, such as a hash algorithm or random permutation method, is used to obtain the sequence number of each server. The server sequence number is then combined with the application sequence number, for example, by combining the last two digits together or by inserting numbers, to obtain the name of each server, ensuring that the name is unique and will not be the same as any other server.

[0066] For example, both the main service ID and the sub-service ID mentioned above can be generated using the snowflake algorithm. The snowflake algorithm uses 64 bits to generate a Long type ID, containing timestamp, machine ID, and sequence number information. Traditional snowflake algorithms require a unique generator, which may need to be provided by the controller. However, there is a risk of duplicate IDs appearing across different applications, and it cannot filter out service IDs other than the target application. Therefore, an 8-bit application ID is provided for each application and participates in the snowflake algorithm concatenation. This ID is then concatenated with the ID of each service to obtain a unique ID. Since the expanded ID exceeds the length of a Long string, it is finally converted to a string.

[0067] Optionally, in the service execution method provided in this application embodiment, determining the total execution result of the user instruction based on M sub-execution results includes: obtaining the execution start time in each sub-execution result to obtain M execution start times, and calculating the time difference between the M execution start times to obtain P target time differences; determining whether there is a time difference greater than a preset time difference among the P target time differences; if there is a time difference greater than the preset time difference among the P target time differences, determining the total execution result as an execution anomaly; if there is no time difference greater than the preset time difference among the P target time differences, determining whether there is a sub-execution result representing execution failure among the M sub-execution results; if there is a sub-execution result representing execution failure among the M sub-execution results, determining the total execution result as an execution anomaly; if there is no sub-execution result representing execution failure among the M sub-execution results, determining the total execution result as a normal anomaly.

[0068] It should be noted that since there are M execution start times, when calculating the time difference between any two start times, the value of P for the P target time differences that need to be calculated is M(M-1) / 2.

[0069] Specifically, after each server completes the execution of the sub-execution result, since M slave servers need to execute the corresponding business content simultaneously, it is necessary to determine the execution start time of each sub-execution result, determine the time difference between the set of execution start times with the largest difference among the M execution start times, and determine whether the time difference is greater than the preset time difference. If the time difference is greater than the preset time difference, it indicates that there is a long execution time interval between two servers, and therefore the execution operation is abnormal.

[0070] Furthermore, if the time difference is less than or equal to the preset time difference, the overall execution result can be determined by judging whether there are abnormal results in each sub-execution result. Only when all sub-execution results are normal can the overall execution result be considered normal, thereby ensuring the accurate execution of the instruction information.

[0071] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0072] This application also provides a service execution apparatus. It should be noted that the service execution apparatus of this application can be used to execute the service execution method provided in this application. The service execution apparatus provided in this application is described below.

[0073] Figure 4This is a schematic diagram of a service execution device provided according to an embodiment of this application. For example... Figure 4 As shown, the device includes: a first receiving unit 41, a parsing unit 42, a first sending unit 43, and a first determining unit 44.

[0074] The first receiving unit 41 is used to receive user instruction information through the controller in the main server of the target application, wherein the user instruction information is sent by the receiver in the main server.

[0075] The parsing unit 42 is used to parse user instruction information through the controller, obtain instruction content, determine the M service contents indicated by the instruction content, and determine the slave server that executes each service content from N slave servers, thus obtaining M slave servers.

[0076] The first sending unit 43 is used to send each service content to the corresponding slave server and receive the execution result returned by each slave server to obtain M sub-execution results.

[0077] The first determining unit 44 is used to determine the total execution result of the user instruction based on the M sub-execution results, and send the total execution result to the receiver.

[0078] The service execution device provided in this application embodiment receives user instruction information through a first receiving unit 41 via a controller in the main server of the target application, wherein the user instruction information is sent by a receiver in the main server; a parsing unit 42 parses the user instruction information through the controller to obtain the instruction content, determines the M service contents indicated by the instruction content, and determines the slave server to execute each service content from N slave servers, thus obtaining M slave servers; a first sending unit 43 sends each service content to the corresponding slave server and receives the execution result returned by each slave server, thus obtaining M sub-execution results; a first determining unit 44 determines the total execution result of the user instruction based on the M sub-execution results and sends the total execution result to the receiver. This solves the problems of long processing time and low efficiency of processing services using a single service system in related technologies. The system provides a receiver integrated into the main service to receive instruction information. The receiver then sends the information to the controller within the main service. The controller parses the instructions and sends the parsed business content to the slave service associated with the main service for processing. This allows different business processes to be executed synchronously by different slave services, transforming the system from a single business system to a distributed business system, thereby improving the speed and efficiency of business processing.

[0079] Optionally, in the service execution apparatus provided in the embodiments of this application, the apparatus further includes: a second determining unit, configured to determine the main server in the target application and add a first identifier to the main server; a third determining unit, configured to determine the other servers in the target application besides the main server, obtain M slave servers, and add a second identifier to each slave server; and a second sending unit, configured to send the user instruction information to the receiver of the server carrying the first identifier when the target application receives user instruction information.

[0080] Optionally, in the service execution apparatus provided in this application embodiment, the first sending unit 43 includes: a first acquisition module, configured to acquire the name of the slave server indicated by the service content, and obtain M first names; a sending module, configured to synchronously send the service content to the corresponding M slave servers according to the M first names, and record the steps executed when executing the service content in each slave server, and obtain the execution step sequence of each slave server; and a first determination module, configured to determine the server associated with each slave server according to a preset reference relationship, obtain M sets of associated servers, and store the execution step sequence of each slave server in the slave server and its corresponding associated server.

[0081] Optionally, in the service execution apparatus provided in the embodiments of this application, the apparatus further includes: a first acquisition unit, configured to acquire the application serial number of the target application to obtain a first serial number; a second acquisition unit, configured to acquire the device ID and serial number of each server, and generate a serial number of each server according to the device ID and serial number using a preset algorithm to obtain N+1 second serial numbers, wherein the server includes one master server and N slave servers; and a combination unit, configured to combine each second serial number with the first serial number to obtain the name of each server.

[0082] Optionally, in the service execution apparatus provided in the embodiments of this application, the apparatus further includes: a second receiving unit, configured to receive a rollback instruction sent by a receiver; a third obtaining unit, configured to determine the server indicated by the rollback instruction, obtain the target server, and obtain the execution step sequence in the target server; and a first execution unit, configured to reverse the execution steps in the execution step sequence according to the rollback instruction, and send the execution result to the receiver.

[0083] Optionally, in the service execution apparatus provided in the embodiments of this application, the apparatus further includes: a fourth determining unit, configured to determine the service content executed by each server; a fifth determining unit, configured to determine the execution flow between service content based on the reference relationship between service content, thereby obtaining the service execution flow of the target application; and a sixth determining unit, configured to determine the reference relationship between N+1 servers based on the service execution flow, thereby obtaining a preset reference relationship.

[0084] Optionally, in the execution device for the service provided in this application embodiment, the first determining unit 44 includes: a second obtaining module, used to obtain the execution start time in each sub-execution result to obtain M execution start times, and calculate the time difference between the M execution start times to obtain P target time differences; a judging module, used to judge whether there is a time difference greater than a preset time difference among the P target time differences, and if there is a time difference greater than the preset time difference among the P target time differences, determine that the total execution result is an execution anomaly; a second determining module, used to determine whether there is a sub-execution result representing execution failure among the M sub-execution results if there is a sub-execution result representing execution failure among the M sub-execution results; a third determining module, used to determine that the total execution result is an execution anomaly if there is a sub-execution result representing execution failure among the M sub-execution results; and a fourth determining module, used to determine that the total execution result is a normal anomaly if there is no sub-execution result representing execution failure among the M sub-execution results.

[0085] Optionally, in the service execution apparatus provided in the embodiments of this application, the apparatus further includes: a judgment unit, configured to determine whether the server executing M service contents is the main server; a second execution unit, configured to execute the M service contents through the main server when the server executing the M service contents is the main server; and a third execution unit, configured to perform the step of determining the server executing each service content to obtain M slave servers when the server executing the M service contents is not the main server.

[0086] The execution device for the above-mentioned services includes a processor and a memory. The first receiving unit 41, parsing unit 42, first sending unit 43, first determining unit 44, etc., are all stored in the memory as program units. The processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.

[0087] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured; by adjusting kernel parameters, the problems of long processing times and low efficiency in single-service systems used in related technologies can be solved.

[0088] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0089] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements a method for executing the aforementioned service.

[0090] This invention provides a processor for running a program, wherein the program executes a method for performing the business logic during runtime.

[0091] like Figure 5 As shown, this embodiment of the invention provides an electronic device 50, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: receiving user instruction information through a controller in the main server of a target application, wherein the user instruction information is sent by a receiver in the main server; parsing the user instruction information through the controller to obtain the instruction content, determining M service contents indicated by the instruction content, and determining the slave server executing each service content from N slave servers, resulting in M ​​slave servers; sending each service content to the corresponding slave server and receiving the execution result returned by each slave server, resulting in M ​​sub-execution results; determining the total execution result of the user instruction based on the M sub-execution results, and sending the total execution result to the receiver. The device in this document can be a server, PC, PAD, mobile phone, etc.

[0092] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: receiving user instruction information through a controller in the main server of the target application, wherein the user instruction information is sent by a receiver in the main server; parsing the user instruction information through the controller to obtain the instruction content, determining M business contents indicated by the instruction content, and determining the slave server to execute each business content from N slave servers, thus obtaining M slave servers; sending each business content to the corresponding slave server, and receiving the execution result returned by each slave server, thus obtaining M sub-execution results; determining the total execution result of the user instruction based on the M sub-execution results, and sending the total execution result to the receiver.

[0093] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0094] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0095] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0096] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0097] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0098] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0099] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0100] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0101] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for executing a business operation, characterized in that, include: User instruction information is received through the controller in the main server of the target application, wherein the user instruction information is sent by the receiver in the main server; The controller parses the user instruction information to obtain the instruction content, determines the M service contents indicated by the instruction content, and selects the slave server that executes each service content from N slave servers to obtain M slave servers, where N is greater than or equal to M and M is a positive integer greater than or equal to 1; Each business content is sent to the corresponding slave server, and the execution result returned by each slave server is received to obtain M sub-execution results. The steps executed when executing the business content are recorded in each slave server to obtain the execution step sequence of each slave server. The associated server of each slave server is determined according to the preset reference relationship to obtain M groups of associated servers. The execution step sequence of each slave server is stored in the slave server and its corresponding associated server. Each group of associated servers contains at least one associated server. The execution step sequence is used for server rollback. The total execution result of the user instruction is determined based on the M sub-execution results, and the total execution result is sent to the receiver; Determining the overall execution result of the user instruction based on the M sub-execution results includes: Obtain the execution start time from each sub-execution result to get M execution start times, and calculate the time difference between the M execution start times to get P target time differences; Determine whether there is a time difference greater than a preset time difference among the P target time differences. If there is a time difference greater than the preset time difference among the P target time differences, determine that the overall execution result is an execution exception.

2. The method according to claim 1, characterized in that, Before receiving user instruction information through the controller in the main server of the target application, the method further includes: Identify the main server in the target application and add a first identifier to the main server; Identify the other servers in the target application besides the main server to obtain the N slave servers, and add a second identifier to each slave server; When the target application receives the user instruction information, it sends the user instruction information to the receiver of the server carrying the first identifier.

3. The method according to claim 1, characterized in that, Sending each business message to the corresponding slave server includes: Obtain the name of the service content indicated by the server to get M first names; The service content is synchronously sent to the corresponding M slave servers according to the M first names.

4. The method according to claim 3, characterized in that, Before obtaining the name of the service content indicated by the server and obtaining M first names, the method further includes: Obtain the application serial number of the target application to obtain the first serial number; Obtain the device ID and serial number of each server, and generate a serial number for each server based on the device ID and serial number using a preset algorithm, resulting in N+1 second serial numbers. The server includes one master server and the N slave servers. Each second sequence number is combined with the first sequence number to obtain the name of each server.

5. The method according to claim 3, characterized in that, After storing the sequence of execution steps for each slave server in the slave server and its corresponding associated server, the method further includes: Receive the rollback command sent by the receiver; Determine the server indicated by the rollback instruction, obtain the target server, and acquire the sequence of execution steps in the target server; The execution steps in the sequence of execution steps are executed in reverse order according to the rollback instruction, and the execution result is sent to the receiver.

6. The method according to claim 3, characterized in that, Before determining each server associated with a server based on a preset reference relationship, the method further includes: Determine the business logic to be executed by each server; Based on the reference relationships between the business contents, the execution flow between the business contents is determined, and the business execution flow of the target application is obtained. The reference relationships between N+1 servers are determined according to the business execution process to obtain the preset reference relationships, wherein the servers include a master server and the N slave servers.

7. The method according to claim 1, characterized in that, Determining the overall execution result of the user instruction based on the M sub-execution results includes: If none of the P target time differences is greater than a preset time difference, determine whether there is a sub-execution result representing execution failure among the M sub-execution results; If among the M sub-execution results there is a sub-execution result indicating execution failure, the overall execution result is determined to be an execution exception; If none of the M sub-execution results represent execution failure, the overall execution result is determined to be normal or abnormal.

8. The method according to claim 1, characterized in that, After determining the M service contents indicated by the instruction content, the method further includes: Determine whether the server executing the M business functions is the main server; When the server executing the M business functions is the main server, the M business functions are executed through the main server. If the server executing the M business functions is not the primary server, the step of determining the server executing each business function is executed to obtain M secondary servers.

9. A business execution device, characterized in that, include: The first receiving unit is configured to receive user instruction information through the controller in the main server of the target application, wherein the user instruction information is sent by the receiver in the main server. The parsing unit is used to parse the user instruction information through the controller to obtain the instruction content, determine the M service contents indicated by the instruction content, and determine the slave server that executes each service content from N slave servers to obtain M slave servers; The first sending unit is used to send each service content to the corresponding slave server and receive the execution result returned by each slave server to obtain M sub-execution results. In each slave server, the steps executed when executing the service content are recorded to obtain the execution step sequence of each slave server. The server associated with each slave server is determined according to the preset reference relationship to obtain M groups of associated servers. The execution step sequence of each slave server is stored in the slave server and its corresponding associated server. Each group of associated servers contains at least one associated server. The execution step sequence is used for server rollback. The first determining unit is configured to determine the total execution result of the user instruction based on the M sub-execution results, and send the total execution result to the receiver; The first determining unit also includes: The second acquisition module is used to acquire the execution start time in each sub-execution result, obtain M execution start times, and calculate the time difference between the M execution start times to obtain P target time differences; The judgment module is used to determine whether there is a time difference greater than a preset time difference among the P target time differences. If there is a time difference greater than the preset time difference among the P target time differences, the overall execution result is determined to be an execution exception.

10. A computer storage medium, characterized in that, The computer storage medium is used to store a program, wherein the program, when running, controls the device where the computer storage medium is located to execute the service execution method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and device for processing reversal transaction, electronic equipment and computer readable medium

    CN111626858A