Information processing method, device and distributed system
By introducing delay instructions on the second node of the distributed system to delay the execution of the second task, the problem of participants locking the data source for too long in the two-stage submission protocol is solved, and the system's response time and throughput are improved.
Patent Information
- Application Number
- CN202210459538.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-27
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-04-27
AI Technical Summary
In a distributed system, the two-stage submission protocol causes participants to lock the data source for too long, affecting the system's response time and throughput.
By introducing delay instructions on the second node, the second node is caused to perform the second task after waiting for the second task to delay, thereby reducing the lock time to the data source.
By delaying execution of the second task, the lock time of the second task to the data source is reduced, and the response time and throughput of the distributed system are improved.
Smart Images

Figure CN114911583B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to information processing technology, and in particular to an information processing method, device, distributed system, electronic device and storage medium. Background Art
[0002] Two-phase commit is an important solution for distributed transactions. In a distributed system, in order for each node to be aware of the transaction execution status of other nodes, a central node needs to be introduced to uniformly handle the execution logic of all nodes. This central node is called a coordinator, and other business nodes scheduled by the central node are called participants. Figure 1 As shown in the figure, TM (Transaction Manager) acts as a coordinator and RM (Resource Manager) acts as a participant. Two-phase commit provides strong consistency guarantee, and all participants must fail or succeed at the same time. Therefore, in the first phase, all participants must return before entering the second phase, and then decide whether to commit or roll back the global transaction in the second phase.
[0003] Taking the shopping scenario as an example, the operation of placing an order in TM requires calling the inventory application of RM1 to complete the inventory reduction operation and the account application of RM2 to complete the account balance reduction operation at the same time. At this time, distributed transactions are involved. The two-phase commit requires that the data must be locked from the moment the branch transaction is opened until the end of the global transaction, otherwise time inconsistency will inevitably occur. Lock time analysis is as follows: Figure 2 As shown in the figure, inventory reduction RM1 has always locked the inventory-related data from "registering branch GTX: A" to receiving the "commit" command from TM; account balance RM2 has always locked the account-related data from "registering branch GTX: B" to receiving the "commit" command from TM; from the analysis of execution time, the application of inventory reduction RM1 took a lot of time to complete the first stage, while the account application RM2 can complete the first stage quickly; TM can decide to initiate commit (or rollback) only after receiving feedback from all branch transactions; participants will execute their own commit operations and release locks after receiving the commit operation; if this account is a "hot account", such as a company account. Since locking the account will prevent other applications from operating the account, it will affect the response time and throughput of the entire system. Summary of the invention
[0004] Embodiments of the present disclosure provide a method, apparatus, distributed system, electronic device, and storage medium for information processing.
[0005] In a first aspect, the present disclosure provides an information processing method, comprising:
[0006] In response to receiving the first-stage task instruction information, determining the first task and the second task according to the first-stage task instruction information;
[0007] Determining a delay duration of the second task according to the first task and the second task, wherein the execution duration of the first task is greater than the execution duration of the second task;
[0008] Determine a first task instruction, a second task instruction, and a second task delay instruction according to the first task and the second task;
[0009] Sending the first task instruction to the first node, and sending the second task instruction and the second task delay instruction to the second node;
[0010] The first task instruction is used for the first node to execute the first task in response to receiving the first task instruction;
[0011] The second task instruction and the second task delay instruction are used by the second node to execute the second task after waiting for the second task delay time in response to receiving the second task instruction and the second task delay instruction.
[0012] In some optional embodiments, the method further comprises:
[0013] In response to receiving the first task registration information sent by the first node, the first data source corresponding to the first task is locked until the second-stage task instruction information is received.
[0014] In some optional embodiments, the method further comprises:
[0015] In response to receiving the second task registration information sent by the second node, locking the second data source corresponding to the second task until receiving the second-stage task instruction information.
[0016] In some optional implementations, determining the delay duration of the second task according to the first task and the second task includes:
[0017] The execution duration of the first task and the execution duration of the second task are obtained, and the difference between the execution duration of the first task and the execution duration of the second task is determined as the delay duration of the second task.
[0018] In some optional embodiments, the method further comprises:
[0019] Receive first task completion information sent by the first node and second task completion information sent by the second node, wherein the time difference between the first task completion time point corresponding to the first task completion information and the second task completion time point corresponding to the second task completion information is less than a preset time difference range.
[0020] In a second aspect, the present disclosure provides an information processing device, including:
[0021] a control unit configured to, in response to receiving the first-stage task instruction information, determine the first task and the second task according to the first-stage task instruction information;
[0022] a configuration unit, determining a delay duration of the second task according to the first task and the second task, wherein the execution duration of the first task is greater than the execution duration of the second task;
[0023] A processing unit, determining a first task instruction, a second task instruction, and a second task delay instruction according to the first task and the second task;
[0024] A sending unit, sending the first task instruction to the first node, and sending the second task instruction and the second task delay instruction to the second node;
[0025] The first task instruction is used for the first node to execute the first task in response to receiving the first task instruction;
[0026] The second task instruction and the second task delay instruction are used by the second node to execute the second task after waiting for the second task delay time in response to receiving the second task instruction and the second task delay instruction.
[0027] In a third aspect, the present disclosure provides a distributed system, including: a central node, a first node, and a second node; wherein:
[0028] The central node is configured to, in response to receiving the first-stage task instruction information, determine the first task and the second task according to the first-stage task instruction information; determine the delay duration of the second task according to the first task and the second task, wherein the execution duration of the first task is greater than the execution duration of the second task; determine the first task instruction, the second task instruction, and the second task delay instruction according to the first task and the second task; send the first task instruction to the first node, and send the second task instruction and the second task delay instruction to the second node;
[0029] The first node is configured to, in response to receiving the first task instruction, perform the first task;
[0030] The second node is configured to execute the second task after waiting for the second task delay time in response to receiving the second task instruction and the second task delay instruction.
[0031] In some optional implementations, the first node sends first task registration information to the central node when starting to execute the first task;
[0032] In response to receiving the first task registration information, the central node locks the first data source corresponding to the first task until receiving the second-stage task instruction information;
[0033] When the second node starts to execute the second task, the central node sends the second task registration information;
[0034] In response to receiving the second task registration information, the central node locks the second data source corresponding to the second task until receiving the second-stage task instruction information.
[0035] In a fourth aspect, the present disclosure provides an electronic device, including:
[0036] one or more processors;
[0037] A storage device having one or more programs stored thereon, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the method as described in any embodiment of the first aspect.
[0038] In a fifth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by one or more processors, implements the method as described in any one of the embodiments of the first aspect.
[0039] The information processing method, device, distributed system, electronic device and storage medium provided by the embodiments of the present disclosure determine the first task and the second task according to the first stage task instruction information in response to receiving the first stage task instruction information; determine the delay time of the second task according to the first task and the second task, wherein the execution time of the first task is greater than the execution time of the second task; determine the first task instruction, the second task instruction and the second task delay instruction according to the first task and the second task; send the first task instruction to the first node, and send the second task instruction and the second task delay instruction to the second node; wherein the first task instruction is used for the first node to execute the first task in response to receiving the first task instruction; the second task instruction and the second task delay instruction are used for the second node to execute the second task after waiting for the second task delay time in response to receiving the second task instruction and the second task delay instruction; by sending the second task delay instruction to the second node, the second node executes the second task after waiting for the second task delay time, so that the time period for the second node to execute the second task is delayed, thereby reducing the lock time length of the data source corresponding to the second task, thereby improving the response time and throughput of the distributed system. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The drawings illustrate generally, by way of example and not limitation, various embodiments discussed herein.
[0041] Figure 1 It is a schematic diagram of the interaction process of a distributed system model in the prior art;
[0042] Figure 2 A schematic diagram of an interactive process of a distributed system application scenario in the prior art;
[0043] Figure 3 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;
[0044] Figure 4 is a flowchart of an embodiment of an information processing method according to the present disclosure;
[0045] Figure 5 is a schematic structural diagram of an embodiment of an information processing device according to the present disclosure;
[0046] Figure 6 It is a schematic diagram of an interactive process of a distributed system application scenario applicable to the information processing method of an embodiment of the present disclosure;
[0047] Figure 7 It is a structural diagram of a computer system of a terminal device or a server suitable for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION
[0048] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
[0049] It should be noted that the terms "first\second\third" involved in the embodiments of the present application are merely used to distinguish similar objects and do not represent a specific ordering of objects. It is understandable that "first\second\third" can be interchanged with a specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second\third" can be interchanged where appropriate, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In the absence of conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
[0050] Figure 3 An exemplary system architecture 100 is shown to which embodiments of the information processing method or information processing apparatus of the present disclosure can be applied.
[0051] like Figure 3 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0052] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as distributed interactive applications, file transfer applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0053] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens and supporting sound acquisition and / or video acquisition, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) players, laptop computers and desktop computers, etc. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0054] The server 105 may be a server that provides various services, such as a background server that provides support for file transfer applications displayed on the terminal devices 101, 102, and 103. The background server may analyze and process the received data such as a transmission request for transferring a source file from a source node to a target node, and feed back the processing result (such as an information processing strategy, etc.) to the terminal device.
[0055] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server 105 is software, it can be implemented as multiple software or software modules (for example, for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0056] It should be noted that, in some cases, the information processing method provided by the present disclosure may be executed by the server 105, or by the terminal devices 101, 102, 103, or by the server 105 and the terminal devices 101, 102, 103. Accordingly, the information processing device may be arranged in the server 105, or in the terminal devices 101, 102, 103, or may be arranged partially in the server 105 and partially in the terminal devices 101, 102, 103. And accordingly, the system architecture 100 may include only the server 105, or only the terminal devices 101, 102, 103, or may include the terminal devices 101, 102, 103, the network 104 and the server 105. The present disclosure does not limit this.
[0057] It should be understood that Figure 3 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0058] It is understandable that the information processing method and device of the present disclosure can be used in a distributed system, and the distributed system may include a central node, a first node, and a second node. Here, the central node is the coordinator in the distributed system, such as a TM, and the first node and the second node are participants in the distributed system, such as RM. For example, the first node may be RM1, and the second node may be RM2.
[0059] Continue to refer Figure 4 , which shows a process 400 of an embodiment of an information processing method according to the present disclosure. The information processing method may include the following steps:
[0060] Step 401, in response to receiving first-stage task instruction information, determining a first task and a second task according to the first-stage task instruction information.
[0061] Here, the first-stage task instruction information is a task instruction issued to the distributed system. For example, in some application scenarios, an order instruction operation can be performed on the central node. Correspondingly, the first task and the second task are tasks that the central node coordinates the first node and the second node to perform. In some application scenarios, for example, the first task can be to reduce inventory, and the second task can be to adjust the account balance.
[0062] In the embodiment of the present disclosure, the task relationship between the participants in the distributed system corresponding to the first-stage task may be preset in the distributed system. After receiving the first-stage task indication information, the central node determines the corresponding first task and second task in the preset distributed system task configuration file according to the first-stage task type corresponding to the first-stage task indication information.
[0063] Step 402: Determine the delay duration of the second task according to the first task and the second task.
[0064] The execution time of the first task is longer than the execution time of the second task.
[0065] In some optional implementations, determining the delay duration of the second task based on the first task and the second task may include: obtaining the execution duration of the first task and the execution duration of the second task, and determining the difference between the execution duration of the first task and the execution duration of the second task as the delay duration of the second task.
[0066] The second task delay duration may be used as the delay time length for the second node to delay execution of the second task.
[0067] Since there are multiple call relationships in the system, we need to distinguish each call relationship and set a different delay time for each call relationship. The delay execution time is an empirical value and does not need to be calculated for each call. This time can be observed in the actual production environment for a period of time and an average value can be taken. At the same time, the delay time is written into the configuration file of each application through configuration, and a delay time is configured for each call relationship.
[0068] Here, the delay time can be calculated by statistically calculating the call chain, and can also be configured directly in the application. For important applications, a longer delay time can be configured.
[0069] Step 403: Determine a first task instruction, a second task instruction, and a second task delay instruction according to the first task and the second task.
[0070] In some optional implementations, the TM may carry the first task instruction, the second task instruction, and the second task delay instruction by opening a global transaction and requesting.
[0071] Step 404: Send the first task instruction to the first node, and send the second task instruction and the second task delay instruction to the second node.
[0072] The first task instruction is used by the first node to execute the first task in response to receiving the first task instruction.
[0073] The second task instruction and the second task delay instruction are used for the second node to respond to receiving the second task instruction and the second task delay instruction and wait for the second task delay time to execute the second task.
[0074] By sending a second task delay instruction to the second node, the second node is made to execute the second task after waiting for the second task delay time, so that the time period for the second node to execute the second task is delayed, thereby reducing the lock time length of the data source corresponding to the second task, and improving the response time and throughput of the distributed system.
[0075] In some embodiments, Figure 4 As shown, the above method flow 400 may also include:
[0076] Step 405 , in response to receiving the first task registration information sent by the first node, locking the first data source corresponding to the first task until receiving the second stage task instruction information.
[0077] Here, the first task registration information is the registration information sent by the first node to the central node when the first node starts to execute the first task. After receiving the first task registration information, the central node locks the first data source corresponding to the first task until the central node receives the second stage task instruction information.
[0078] Here, the second stage task is the next stage task corresponding to the first stage task, and the central node starts the second stage task in response to receiving the second stage task instruction information.
[0079] In some embodiments, Figure 4 As shown, the above method flow 400 may also include:
[0080] Step 406 , in response to receiving the second task registration information sent by the second node, locking the second data source corresponding to the second task until receiving the second stage task instruction information.
[0081] Here, the second task registration information is the registration information sent by the central node when the second node starts to execute the second task. After receiving the second task registration information, the central node locks the second data source corresponding to the second task until the central node receives the second stage task instruction information.
[0082] In some embodiments, Figure 4 As shown, the above method flow 400 may also include:
[0083] Step 407: Receive first task completion information sent by the first node and second task completion information sent by the second node.
[0084] Among them, the time difference between the first task completion time point corresponding to the first task completion information and the second task completion time point corresponding to the second task completion information is less than the preset time difference range. Here, the preset time difference range can be set according to actual needs. In the present disclosure, the preset time difference range can be used to determine that the first task completion time point is the same or approximately the same as the second task completion time point.
[0085] In the disclosed embodiment, the execution time of the first task is greater than the execution time of the second task. The second node executes the second task by waiting for a delay period of the second task, thereby delaying the execution time of the second task so that the completion time of the second task is the same or approximately the same as the completion time of the first task.
[0086] The disclosed embodiment allows the second node to delay the execution of the second task so that the second task and the first task are completed and fed back at the same or approximately the same time point, thereby reducing the time the TM waits for feedback on the completion of the first task and reducing the locking time of the second data source corresponding to the second task, thereby improving the response time and throughput of the entire distributed system.
[0087] The above-mentioned embodiment of the present disclosure proposes an optimization solution to solve the problem that the applications of some participants in the two-stage distributed system lock data for too long.
[0088] Further references Figure 5 As an implementation of the above information processing method, the present disclosure provides an information processing device 500. Figure 4 Corresponding to the method embodiment shown, the information processing device 500 can be applied to various electronic devices.
[0089] like Figure 5 As shown, the information processing device 500 of this embodiment may include: a control unit 501, a configuration unit 502, a processing unit 503 and a sending unit 504. The control unit 501 is configured to determine the first task and the second task according to the first stage task instruction information in response to receiving the first stage task instruction information; the configuration unit 502 determines the delay duration of the second task according to the first task and the second task, wherein the execution duration of the first task is greater than the execution duration of the second task; the processing unit 503 determines the first task instruction, the second task instruction and the second task delay instruction according to the first task and the second task; the sending unit 504 sends the first task instruction to the first node, and sends the second task instruction and the second task delay instruction to the second node.
[0090] Among them, the first task instruction is used for the first node to execute the first task in response to receiving the first task instruction; the second task instruction and the second task delay instruction are used for the second node to respond to receiving the second task instruction and the second task delay instruction, and execute the second task after waiting for the second task delay time.
[0091] In this embodiment, the specific processing contents and technical effects of the control unit 501, the configuration unit 502, the processing unit 503 and the sending unit 504 of the information processing device 500 can be referred to in Figure 4 The relevant descriptions of step 401 to step 404 in the corresponding embodiment are not repeated here.
[0092] In some optional implementations, the control unit 501 may be further configured to: in response to receiving the first task registration information sent by the first node, lock the first data source corresponding to the first task until receiving the second-stage task instruction information.
[0093] In some optional implementations, the control unit 501 may be further configured to: in response to receiving the second task registration information sent by the second node, lock the second data source corresponding to the second task until receiving the second stage task instruction information.
[0094] In some optional embodiments, the control unit 501 can be further configured to: receive first task completion information sent by the first node and second task completion information sent by the second node, wherein the time difference between the first task completion time point corresponding to the first task completion information and the second task completion time point corresponding to the second task completion information is less than a preset time difference range.
[0095] It should be noted that the implementation details and technical effects of each unit in the information processing device provided by the embodiments of the present disclosure can be referred to the description of other embodiments in the present disclosure, and will not be repeated here.
[0096] Reference below Figure 6 , which shows a schematic diagram of an interaction process 600 of a distributed system application scenario applicable to the information processing method of an embodiment of the present disclosure.
[0097] like Figure 6 As shown, the distributed system may include: a central node, a first node, and a second node, corresponding to Figure 6 In some application scenarios, for example, a shopping scenario, an order is placed in TM, and the inventory application of RM1 is called to complete the inventory reduction operation and the account application of RM2 is called to complete the account balance reduction operation. The interaction process 600 may include the following steps:
[0098] In response to receiving the first-stage task instruction information, the central node determines the first task and the second task according to the first-stage task instruction information. Determine the delay time of the second task according to the first task and the second task, wherein the execution time of the first task is greater than the execution time of the second task; determine the first task instruction, the second task instruction, and the second task delay instruction according to the first task and the second task; send the first task instruction to the first node, and send the second task instruction and the second task delay instruction to the second node.
[0099] Here, the first-stage task instruction information is a task instruction issued to the distributed system. For example, in some application scenarios, an order instruction operation can be performed on the central node. Correspondingly, the first task and the second task are tasks that the central node coordinates the first node and the second node to perform. In some application scenarios, for example, the first task can be to reduce inventory, and the second task can be to adjust the account balance.
[0100] In the embodiment of the present disclosure, the task relationship between the participants in the distributed system corresponding to the first-stage task may be preset in the distributed system. After receiving the first-stage task indication information, the central node determines the corresponding first task and second task in the preset distributed system task configuration file according to the first-stage task type corresponding to the first-stage task indication information.
[0101] In some optional implementations, determining the delay duration of the second task based on the first task and the second task may include: obtaining the execution duration of the first task and the execution duration of the second task, and determining the difference between the execution duration of the first task and the execution duration of the second task as the delay duration of the second task.
[0102] The second task delay duration may be used as the delay time length for the second node to delay execution of the second task.
[0103] Since there are multiple call relationships in the system, we need to distinguish each call relationship and set a different delay time for each call relationship. The delay execution time is an empirical value and does not need to be calculated for each call. This time can be observed in the actual production environment for a period of time and an average value can be taken. At the same time, the delay time is written into the configuration file of each application through configuration, and a delay time is configured for each call relationship.
[0104] Here, the delay time can be calculated by statistically calculating the call chain, and can also be configured directly in the application. For important applications, a longer delay time can be configured.
[0105] In some optional implementations, the TM may carry the first task instruction, the second task instruction, and the second task delay instruction by opening a global transaction and requesting.
[0106] In response to receiving the first task instruction, the first node executes the first task.
[0107] In response to receiving the second task instruction and the second task delay instruction, the second node executes the second task after waiting for the second task delay time.
[0108] In some optional embodiments, such as Figure 6 As shown, when the first node starts to execute the first task, it sends the first task registration information to the central node.
[0109] In response to receiving the first task registration information, the central node locks the first data source corresponding to the first task until receiving the second-stage task instruction information.
[0110] When the second node starts to execute the second task, the central node first sends the second task registration information.
[0111] In response to receiving the second task registration information, the central node locks the second data source corresponding to the second task until receiving the second-stage task instruction information.
[0112] It should be noted that the implementation details and technical effects of each node in the distributed system provided by the embodiments of the present disclosure can be referred to the description of other embodiments in the present disclosure, and will not be repeated here.
[0113] Due to the existence of TM global transaction coordinator, each branch transaction needs to register with the global transaction manager at the beginning and report the result to TM at the end, so we can know the execution time of each branch transaction. TM can record the start and end time of the first phase, the time taken in the first phase minus the time taken in the branch transaction, that is, the application delay time.
[0114] Since there are multiple call relationships in the system, we need to distinguish each call relationship and set a different delay time for each call relationship. The delay execution time is an empirical value and does not need to be calculated for each call. This time can be observed in the actual production environment for a period of time and an average value can be taken. At the same time, the delay time is written into the configuration file of each application through configuration, and a delay time is configured for each call relationship.
[0115] In summary, the delay time can be calculated by counting the call chain, and can also be configured directly in the application. For important applications, a longer delay time can be configured.
[0116] To implement delayed execution, the application must not be required to change the order of calls or add delay time, which will bring a lot of changes and is too invasive, and may not necessarily follow the design plan of the business party. This requires further improvement of RM capabilities. Applications usually access data sources through the data middle layer. Existing implementations such as DBproxy implement access to separate libraries and tables. To implement this solution, it is only necessary to implement the delay function in the data middle layer. When the application accesses the data source normally, the data middle layer obtains the delay time and waits for a period of time before requesting the data source.
[0117] The disclosed embodiments have the following advantages: fully considering the characteristics of different participants and proposing a solution to the delay time; shortening the waiting time by adding a delay time stage, thereby reducing the lock time; describing the time calculation method for the delay stage and an implementation scheme that is lossless to the business party.
[0118] This solution can dynamically configure the delay time of each participant in a distributed transaction, and adjust the participation time of each participant in a global transaction, thereby ensuring that the participation time of important participants during the entire global transaction is the shortest, thereby ensuring that the locking time of related resources involving important participants is the shortest.
[0119] From a global perspective, the increase in the concurrency of important participants has reduced the global average response time. Especially when the important participants are core systems, accounting systems and other public basic modules, the global performance improvement is particularly obvious. This solution can be widely used in two-phase submission, protection and optimization solutions for important participants, and solving hot user problems.
[0120] Reference below Figure 7 , which shows a schematic diagram of the structure of a server computer system 700 suitable for implementing an embodiment of the present disclosure. Figure 7 The computer system 700 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0121] like Figure 7 As shown, the computer system 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 to a random access memory (RAM) 703. Various programs and data required for the operation of the computer system 700 are also stored in the RAM 703. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0122] Typically, the following devices may be connected to the I / O interface 705: input devices 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, etc.; output devices 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 708 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 709. The communication devices 709 may allow the computer system 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The computer system 700 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.
[0123] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0124] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0125] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0126] The computer readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device implements the following Figure 2 The illustrated embodiment and its alternative implementations illustrate an information processing method.
[0127] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0128] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, a processing unit may also be described as a "unit that determines the first task and the second task according to the first stage task instruction information."
[0130] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are formed by replacing each other with the technical features disclosed in the present disclosure (but not limited to) with similar functions.
Claims
1. An information processing method, applied to a distributed system, the distributed system comprising: A central node, a first node, and a second node, wherein the method comprises: In response to receiving the first-stage task instruction information, determining the first task and the second task according to the first-stage task instruction information; Determining a delay duration of the second task according to the first task and the second task, wherein the execution duration of the first task is greater than the execution duration of the second task; Determine a first task instruction, a second task instruction, and a second task delay instruction according to the first task and the second task; Sending the first task instruction to the first node, and sending the second task instruction and the second task delay instruction to the second node; The first task instruction is used for the first node to execute the first task in response to receiving the first task instruction; The second task instruction and the second task delay instruction are used for the second node to respond to receiving the second task instruction and the second task delay instruction and wait for the second task delay time to execute the second task; The method further comprises: When the first node starts to execute the first task, the first node sends first task registration information to the central node; In response to receiving the first task registration information sent by the first node, locking the first data source corresponding to the first task until receiving the second-stage task instruction information; When the second node starts to execute the second task, the second node sends second task registration information to the central node; In response to receiving the second task registration information sent by the second node, locking the second data source corresponding to the second task until receiving the second-stage task instruction information.
2. The method according to claim 1, wherein: The determining the delay duration of the second task according to the first task and the second task includes: The execution duration of the first task and the execution duration of the second task are obtained, and the difference between the execution duration of the first task and the execution duration of the second task is determined as the delay duration of the second task.
3. The method according to claim 1, wherein: The method further comprises: Receive first task completion information sent by the first node and second task completion information sent by the second node, wherein the time difference between the first task completion time point corresponding to the first task completion information and the second task completion time point corresponding to the second task completion information is less than a preset time difference range.
4. An information processing device, applied to a distributed system, the distributed system comprising: The central node, the first node and the second node include: a control unit configured to, in response to receiving the first-stage task instruction information, determine the first task and the second task according to the first-stage task instruction information; a configuration unit, determining a delay duration of the second task according to the first task and the second task, wherein the execution duration of the first task is greater than the execution duration of the second task; A processing unit, determining a first task instruction, a second task instruction, and a second task delay instruction according to the first task and the second task; A sending unit, sending the first task instruction to the first node, and sending the second task instruction and the second task delay instruction to the second node; The first task instruction is used for the first node to execute the first task in response to receiving the first task instruction; The second task instruction and the second task delay instruction are used for the second node to respond to receiving the second task instruction and the second task delay instruction and wait for the second task delay time to execute the second task; Also includes: When the first node starts to execute the first task, the first node sends first task registration information to the central node; The control unit is further configured to, in response to receiving the first task registration information sent by the first node, lock the first data source corresponding to the first task until receiving the second stage task instruction information; When the second node starts to execute the second task, the second node sends second task registration information to the central node; The control unit is further configured to, in response to receiving the second task registration information sent by the second node, lock the second data source corresponding to the second task until receiving the second stage task instruction information.
5. A distributed system comprising: A central node, a first node, and a second node; wherein, The central node is configured to, in response to receiving the first-stage task instruction information, determine the first task and the second task according to the first-stage task instruction information; determine the delay duration of the second task according to the first task and the second task, wherein the execution duration of the first task is greater than the execution duration of the second task; determine the first task instruction, the second task instruction, and the second task delay instruction according to the first task and the second task; send the first task instruction to the first node, and send the second task instruction and the second task delay instruction to the second node; The first node is configured to, in response to receiving the first task instruction, perform the first task; The second node is configured to, in response to receiving the second task instruction and the second task delay instruction, execute the second task after waiting for the second task delay time; When the first node starts to execute the first task, the first node sends first task registration information to the central node; In response to receiving the first task registration information, the central node locks the first data source corresponding to the first task until receiving the second-stage task instruction information; When the second node starts to execute the second task, the second node sends second task registration information to the central node; In response to receiving the second task registration information, the central node locks the second data source corresponding to the second task until receiving the second-stage task instruction information.
6. An electronic device comprising: one or more processors; A storage device having one or more programs stored thereon, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the method according to any one of claims 1 to 3.
7. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by one or more processors, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Synchronous control method and synchronous control system for multiple controlled parts
CN105652749A