Business request processing method, device, equipment and storage medium

By predicting the number of business requests and processing capabilities in the process engine, automatically creating replica instances and allocating requests, the problem of insufficient timeliness of the process engine expansion is solved, and the ability to handle business requests is improved, and business backlog is avoided.

CN116954812BActive Publication Date: 2024-11-15CHINA MOBILE M2M +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211017317.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-23
Publication Date
2024-11-15
Estimated Expiration
2042-08-23

AI Technical Summary

Technical Problem

The existing process engines have poor timely expansion when facing large-scale business requests, resulting in a backlog of business.

Method used

The main instance predicts the number of service requests and processing capabilities. If the ratio is greater than or equal to the preset expansion coefficient, multiple replica instances will be automatically created and unprocessed service requests will be allocated to the first node of these replica instances to improve expansion timely and processing capabilities.

Benefits of technology

It realizes rapid expansion under high request pressure, enhances business request processing capabilities, and avoids business backlogs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116954812B_ABST
    Figure CN116954812B_ABST
Patent Text Reader

Abstract

The present invention provides a method, apparatus, device and storage medium for processing business requests, the method comprising: the master instance predicts the number of first business requests and the first business processing capacity of the master instance, the first number of business requests being the number of business requests for the next unit time, and the first business processing capacity being the business processing capacity for the next unit time; when the ratio of the first number of business requests to the first business processing capacity is greater than or equal to a preset expansion coefficient, the master instance creates N replica instances, each of the N replica instances includes multiple nodes, and N is an integer greater than or equal to 1; the master instance allocates unprocessed business requests to the first node of the N replica instances. When the request pressure for the next unit time is high, the execution engine in the master instance is triggered to automatically expand to create N replica instances, thereby improving the timeliness of expansion and enhancing the processing capacity of business requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of process engine technology, and in particular to a business request processing method, device, equipment and storage medium. Background Art

[0002] The process engine is usually divided into two parts: "node" and "execution engine". "Node" is the basic unit of workflow. Workflow planners use nodes with different functions and connect them in a certain order to get a workflow with certain business processing logic. The "execution engine" can identify the nodes in the workflow and the relationship between them, and perform calculations according to the order of the process and the function of the node. At present, when facing business requests with large amounts of data, the process engine is prone to business backlogs. Therefore, a solution to expand the capacity of the process engine is proposed.

[0003] However, in the prior art, the capacity expansion of the process engine is usually carried out manually, and the timeliness of the capacity expansion is poor. Summary of the invention

[0004] The embodiments of the present invention provide a service request processing method, device, equipment and storage medium to solve the problem of poor timeliness of capacity expansion in the prior art.

[0005] An embodiment of the present invention provides a method for processing a service request, the method comprising:

[0006] The master instance predicts a first business request quantity and a first business processing capacity of the master instance, wherein the first business request quantity is the business request quantity for the next unit time, and the first business processing capacity is the business processing capacity for the next unit time;

[0007] When the ratio of the number of the first service requests to the first service processing capacity is greater than or equal to a preset expansion coefficient, the primary instance creates N replica instances, each of the N replica instances includes multiple nodes, and N is an integer greater than or equal to 1;

[0008] The master instance distributes unprocessed service requests to the first node of the N replica instances.

[0009] Optionally, the primary instance predicts the number of first service requests and the first service processing capability of the primary instance, including:

[0010] The main instance calculates the first business request number according to the growth rate trend of the business request number and the second business request number, where the second business request number is the business request number in the previous unit time;

[0011] The master instance calculates the first business processing capability according to the unit time, the execution time of a single business process and the number of created replica instances.

[0012] Optionally, the master instance creates N replica instances, including:

[0013] Configure a trigger type for the first node of the N replica instances;

[0014] The master instance distributes the unprocessed service request to the first node of the N replica instances, including:

[0015] The master instance distributes unprocessed service requests to the first node of the N replica instances according to the type of the service request and the trigger type of the first node of the N replica instances.

[0016] Optionally, the trigger type of the first node of the N replica instances includes any one of a hypertext trigger type and a timing trigger type.

[0017] Optionally, the master instance distributes the unprocessed service request to the first node of the N replica instances, including:

[0018] The master instance distributes unprocessed business requests from the Mth node of the master instance to the first node of the N replica instances, and the business processing capacity of the node following the Mth node is less than the number of business requests.

[0019] Optionally, before the step of the primary instance allocating the unprocessed service request to the first node of the N replica instances, the method further includes:

[0020] The main instance classifies the business request entering the first node of the main instance to obtain the business request of the global variable part, the business request of the process variable part and the business request of the workflow variable part;

[0021] The master instance distributes the unprocessed service request to the first node of the N replica instances, including:

[0022] The master instance distributes the business request of the global variable part and / or the business request of the workflow variable part to the first node of the N replica instances.

[0023] The embodiment of the present invention further provides a service request processing device, including:

[0024] A prediction module, configured for the master instance to predict the number of first service requests and the first service processing capacity of the master instance, wherein the first service request number is the number of service requests for the next unit time, and the first service processing capacity is the service processing capacity for the next unit time;

[0025] A creation module, configured to, when the ratio of the number of the first service requests to the first service processing capacity is greater than or equal to a preset expansion coefficient, cause the master instance to create N replica instances, each of the N replica instances including a plurality of nodes, where N is an integer greater than or equal to 1;

[0026] The allocation module is used for the master instance to allocate unprocessed business requests to the first node of the N replica instances.

[0027] Optionally, the prediction module includes:

[0028] A first calculation submodule, configured for the main instance to calculate the number of first business requests according to a growth rate trend of the number of business requests and the number of second business requests, where the second number of business requests is the number of business requests in the previous unit time;

[0029] The second calculation submodule is used for the main instance to calculate the first business processing capacity according to the unit time, the execution time of a single business process and the number of created replica instances.

[0030] Optionally, the creation module includes:

[0031] A configuration submodule, used to configure a trigger type for the first node of the N replica instances;

[0032] The allocation module comprises:

[0033] The first allocation submodule is used for the master instance to allocate unprocessed business requests to the first node of the N replica instances according to the type of the business request and the trigger type of the first node of the N replica instances.

[0034] Optionally, the trigger type of the first node of the N replica instances includes any one of a hypertext trigger type and a timing trigger type.

[0035] Optionally, the allocation module includes:

[0036] The second allocation submodule is used for the master instance to allocate unprocessed business requests from the Mth node of the master instance to the first node of the N replica instances, and the business processing capacity of the subsequent node of the Mth node is less than the number of business requests.

[0037] Optionally, the device further comprises:

[0038] A classification module, used for the main instance to classify the business request entering the first node of the main instance to obtain the business request of the global variable part, the business request of the process variable part and the business request of the workflow variable part;

[0039] The allocation module comprises:

[0040] The third allocation submodule is used for the master instance to allocate the business request of the global variable part and / or the business request of the workflow variable part to the first node of the N replica instances.

[0041] An embodiment of the present invention further provides an electronic device, including:

[0042] at least one processor; and

[0043] a memory communicatively connected to the at least one processor; wherein,

[0044] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned service request processing method.

[0045] The embodiment of the present invention further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the above-mentioned service request processing method.

[0046] In an embodiment of the present invention, the master instance predicts the number of first business requests and the first business processing capacity of the master instance to determine whether the business processing capacity of the next unit time can meet the number of business requests to be processed in the next unit time. When the request pressure in the next unit time is large, that is, when the ratio of the number of first business requests to the first business processing capacity is greater than or equal to the preset expansion coefficient, the execution engine in the master instance can be triggered to automatically expand to create N replica instances, thereby improving the timeliness of expansion and enhancing the processing capacity of business requests. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0048] Figure 1 is a flow chart of a service request processing method provided by an embodiment of the present invention;

[0049] Figure 2 is a schematic diagram of the structure of a process execution engine provided by an embodiment of the present invention;

[0050] Figure 3 It is a schematic diagram of the structure of the workflow provided by an embodiment of the present invention;

[0051] Figure 4 It is a schematic diagram of the structure of the replica instance replacement provided by an embodiment of the present invention;

[0052] Figure 5 is a schematic diagram of data sharding provided by an embodiment of the present invention;

[0053] Figure 6 It is a structural diagram of a service request processing device provided by an embodiment of the present invention;

[0054] Figure 7 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0056] See also Figure 1 , Figure 1 : is a flow chart of a service request processing method provided by an embodiment of the present invention, the method comprising:

[0057] Step 101: The master instance predicts the number of first service requests and the first service processing capacity of the master instance, wherein the first service request number is the number of service requests for the next unit time, and the first service processing capacity is the service processing capacity for the next unit time;

[0058] In this step, the main instance can be a process execution engine based on containerization technology. The process execution engine can be divided into two parts: nodes and execution engines. Nodes can be the basic units of workflow. Workflow planners use nodes with different functions and connect them in a certain order to obtain a workflow with certain business processing logic. The process execution engine can identify the nodes in the workflow and the relationship between them, and execute operations such as passing in parameters, executing functions, and storing result data according to the order of the process and the functions of the nodes. Figure 2 shown.

[0059] The master instance is the entry point for all requests. It can execute specific business logic according to the configuration. The master instance predicts the number of first business requests and the first business processing capacity of the master instance to determine whether the business processing capacity of the next unit time can meet the number of business requests to be processed in the next unit time, that is, predicts the request pressure in the next unit time.

[0060] Step 102: When the ratio of the number of the first service requests to the first service processing capacity is greater than or equal to a preset expansion coefficient, the primary instance creates N replica instances, each of the N replica instances includes a plurality of nodes, where N is an integer greater than or equal to 1;

[0061] In this step, if the ratio of the number of first business requests to the first business processing capacity is greater than or equal to the preset expansion coefficient, the execution engine in the master instance can be triggered to automatically expand. The entire expansion process can be completed by relying on containers. The master instance can call the container interface to create one or more new replica instances, and then allocate network configurations, including IP, port numbers, etc., to the replica instances through the container.

[0062] Step 103: The master instance distributes unprocessed service requests to the first node of the N replica instances.

[0063] In this step, after the replica instance is created, the unprocessed business requests of the primary instance can be distributed to the N replica instances for processing according to the load balancing algorithm to improve the processing capacity of business requests.

[0064] In this implementation, the master instance predicts the number of first business requests and the first business processing capacity of the master instance to determine whether the business processing capacity of the next unit time can meet the number of business requests to be processed in the next unit time. When the request pressure in the next unit time is large, that is, when the ratio of the number of first business requests to the first business processing capacity is greater than or equal to the preset expansion coefficient, the execution engine in the master instance can be triggered to automatically expand to create N replica instances, thereby improving the timeliness of expansion and enhancing the processing capacity of business requests.

[0065] Optionally, the primary instance predicts the number of first service requests and the first service processing capability of the primary instance, including:

[0066] The main instance calculates the first business request number according to the growth rate trend of the business request number and the second business request number, where the second business request number is the business request number in the previous unit time;

[0067] The master instance calculates the first business processing capability according to the unit time, the execution time of a single business process and the number of created replica instances.

[0068] In one example, the growth rate trend of the number of business requests can be a predicted value automatically calculated by the system. For example, the growth rate trend can be predicted from the start of the main instance operation, accumulated, and the calculation area is divided according to the unit time setting. Among them, if the unit time is in hours, the calculation area can be divided into 24, and the initial value is 0. After each unit time, the growth rate of the unit time will be calculated, and then the average value will be obtained with the corresponding growth rate in the system to obtain a new growth rate trend. When entering the unit area next time, the number of requests per unit time will be estimated based on this new growth rate trend. The growth rate trend has the property of constantly comparing with historical situations, so the longer it runs, the higher the accuracy of the growth rate trend.

[0069] It should be noted that the unit time may be an hour, a day or other time unit, which may be set by the user when scheduling a service, and is set to an hour by default.

[0070] The second business request quantity, i.e., the business request quantity in the previous unit time, can be a cumulative value. When some requests enter the engine and need to be processed by the engine, the number of requests will be added once after the corresponding process node is selected. In this way, the first business request quantity, i.e., the total number of requests in the next unit time, can be calculated by multiplying the growth rate trend of the business request quantity by the second business request quantity.

[0071] In one example, the execution time of a single business process can be an average value, which is recorded by the business execution engine. When each process is executed, the execution time of the single business process is taken out, and then the average value is calculated again with the currently recorded average execution time of the single business process, and it is continuously updated. The physical configuration of the replica instances can be the same, and the business request processing capabilities are theoretically the same. By calculating the ratio of unit time to the execution time of a single business process, the number of requests that can be processed by an instance of the current system per unit time can be obtained.

[0072] The number of replica instances created is the number of replica instances created by the current master instance. By calculating the product of the number of requests that an instance can process per unit time and the number of replica instances that have been created, the amount of requests that the engine can process within the current time can be obtained, thereby obtaining the first business processing capacity, that is, the amount of requests that can be processed in the next unit time.

[0073] In this way, based on the number of first business requests and the first business processing capacity, it is possible to predict whether the system is likely to generate a business backlog. Thus, when the request pressure in the next unit time is large, that is, when the ratio of the number of first business requests to the first business processing capacity is greater than or equal to the preset expansion coefficient, the execution engine in the main instance is triggered to automatically expand to create N replica instances, thereby improving the timeliness of expansion and enhancing the processing capacity of business requests.

[0074] Among them, the preset expansion coefficient can adjust the expansion situation according to the specific circumstances of the business. For example, when the timeliness of the expansion is very demanding, the preset expansion coefficient can be reduced so that the first business processing capacity is greater than or equal to the number of first business requests; when the timeliness of the expansion is not required and backlogs are allowed, the preset expansion coefficient can be appropriately increased so that the system allows the number of first business requests to be greater than the first business processing capacity, so as to save resources occupied when creating replica instances.

[0075] When the ratio of the number of first service requests to the first service processing capacity is greater than or equal to the preset expansion factor, in other words, when the number of service requests exceeds a certain threshold, the primary instance creates N replica instances. The threshold is calculated as follows:

[0076]

[0077] Among them, the number of first business requests = growth rate trend * the number of requests in the previous unit time;

[0078]

[0079] When the coefficient is ignored, a threshold of 1 means that the system can just handle all business requests under normal circumstances; a threshold less than 1 means that the system can fully handle upcoming business requests; and a threshold greater than 1 means that a backlog may occur in the current unit time. Users can adjust the expansion according to the specific business situation. For example, if the timeliness of expansion is very demanding, the coefficient can be increased, and the calculation result will be too large, and the system will think that it "cannot handle it" and will expand as soon as possible; when the timeliness of expansion is not required and backlogs are allowed, the coefficient can be reduced, and the calculation result will be too small, and the system will think that it "can handle it" and will delay expansion.

[0080] When the final calculated result is greater than 1, the execution engine will be triggered to expand. The entire expansion process can be completed by relying on the container. The main engine in the main instance will call the container's interface to let the container create a new replica instance, and then assign the network configuration to the instance through the container, including IP, port number, etc.

[0081] Optionally, the master instance creates N replica instances, including:

[0082] Configure a trigger type for the first node of the N replica instances;

[0083] The master instance distributes the unprocessed service request to the first node of the N replica instances, including:

[0084] The master instance distributes unprocessed service requests to the first node of the N replica instances according to the type of the service request and the trigger type of the first node of the N replica instances.

[0085] In this implementation, according to the basic functions of the nodes, the nodes can be divided into four categories: start, function, data operation and end. Each category needs to be implemented according to the requirements of the base class and the standards of the node. The business execution engine solves the problem of transforming from a single instance to multiple instances mainly by relying on the engine's transformation of requests, data rules and the definition of node specifications. If the pre-set nodes in the instance cannot meet the specific needs of the business, developers can perform secondary development based on the abstract classes and interfaces provided by the business execution engine. The specific system can be seen in the following description:

[0086] 1) Three types of node classification are specified, namely "start" type nodes, "data operation" type nodes, and "end" type nodes.

[0087] 2) The workflow can be implemented by a doubly linked list. Except for the "end" class node, all nodes have a successor node, so they all need to implement the successor (next) method. The return of the next method can be an array, and the business execution engine will use it to call all the nodes in the array. However, it should be noted that the nodes in the array have an execution order and will not be executed in parallel.

[0088] 3) All "start" class nodes need to inherit the base class of the "start" class node and implement the abstract methods in the base class: data encapsulation and business processing. Among them: data encapsulation requires developers to encapsulate the data in the protocol to the place required by the business; business processing means that after the data is encapsulated, the start class node allows business logic calculations to be performed on the data.

[0089] 4) The "Start" class node can be converted from a local call to a remote procedure call (RPC) when the replica instance is expanded. This process is implemented by the base class of the "Start" class node. After the expansion is completed, the business execution engine will automatically switch from a local call to a remote call after selecting the node. The node will not change after being deployed in the replica instance. The request will be uniformly parsed and distributed by the business execution engine of the replica instance, and then the workflow execution will be triggered.

[0090] 5) "Data Operation" class nodes require access to global variables, flow variables, and workflow (Message) variables through Get and Set. The business execution engine will ensure data concurrency security, permission isolation, and data sharding access in the Get and Set methods. If an object is created in the node through the new keyword of the programming language, the business execution engine cannot provide relevant reliability guarantees for this data.

[0091] The specific structure of the workflow in the example is shown in Figure 3. When the workflow executes the deployment operation, the configured workflow will be initialized in sequence to a linked list and maintained in the process list. The process list configures the trigger type for the first node of the N replica instances according to different triggering methods. Among them, the trigger type of the first node of the N replica instances can include any one of the Hyper Text Transfer Protocol (HTTP) trigger type and the timed trigger type.

[0092] When the start node is configured with HTTP trigger mode, the HTTP request will first enter the distribution interface of the master instance engine. According to the type of business request and the trigger type of the first node of the replica instance, the first node of the replica instance is selected in the HTTP trigger list, that is, the start node of the replica instance, and then the complete data of the HTTP protocol is passed to the node as a parameter, so that the master instance can distribute the unprocessed business requests to the first node of N replica instances.

[0093] When the start node is configured with a timed trigger, a timed task will be registered inside the engine when the process is deployed, and the engine will call the process start node based on the timed task.

[0094] It should be noted that when calling the workflow start node, it is not entirely a local call, but may also include a remote call.

[0095] In terms of business implementation, the start node can not only be deployed according to different trigger types, but also deploy by combining local calls with remote calls. This is because after the business execution engine is expanded, all processes are not distributed in only one instance. The master instance can still be the main entrance for business request data. The master instance can distribute different requests to N replica instances according to the load balancing algorithm. If the selected process is not in the master instance, or the process should be dispatched to the replica instance for execution, it is necessary to trigger the workflow through a remote call.

[0096] Specifically, if there is only one master instance, the process will be saved in the normal way, and the process can only be called locally. When the process execution engine is expanded, the master instance will distribute the unprocessed business requests to the first node of N replica instances according to the configuration method. The configuration methods include "remote call" and "hybrid call". "Remote call" means that the user does not allow the master instance to process the business process; "hybrid call" means that the user allows the master instance to process the business process.

[0097] When the number of engine instances changes, the original simple local call within the program will be changed to a cross-process remote call. At the same time, the process engine "start" node needs to maintain good protocol scalability. The execution engine has made special treatments for the "start" class nodes. After the business execution engine instance is expanded, the main instance will select all "start" class nodes, replace the post-nodes of the nodes with RPC call nodes, and then replace the "start" nodes of the business process according to the information generated by the call node (including: call address, node ID, replica engine ID and other data) and send them to the replica instance to perform the parsing and deployment of the workflow. After all processes are deployed, the expansion operation of the business execution engine is completed. It should be noted that after the expansion is completed, the local call method is replaced by an RPC remote call. If the RPC call node has multiple branches that need to be selected according to conditions, this condition is executed in the RPC call node of the replica instance. The replacement of the process is as follows Figure 4 shown.

[0098] The master instance distributes unprocessed business requests to the first node of N replica instances, including:

[0099] The master instance distributes unprocessed business requests from the Mth node of the master instance to the first node of the N replica instances, and the business processing capacity of the node behind the Mth node is less than the number of business requests.

[0100] After the first node of the workflow is determined, the execution engine will pass the required parameters to the node. After the node is executed, it will select the next node to execute based on the array of subsequent nodes. The selection algorithm is implemented in two specific ways: "serial processing" and "parallel processing". "Serial processing" means that if there is only one node in the array of subsequent nodes, this unique node is executed; if there are multiple nodes, the Mth node of the main instance returns the logical node to the first node of the N replica instances through the next method. The specific selection logic needs to be implemented when the node is implemented, and the interface needs to be exposed for the previous node to call. According to the order of the workflow, the nodes will be executed one by one until the end node is executed to complete the call of the entire workflow.

[0101] As the number of replica instances continues to increase, there will be more and more RPC call nodes after the "Start" node. Before initiating an RPC call, the master instance will select an idle replica instance in the idle queue to initiate the call, and then move the replica instance to the processing queue. When the workflow is processed, the instance will be added to the end of the idle queue. If there are multiple replica instances in the idle queue, the first replica instance in the queue will be selected to process the request. If there are no available replica instances in the idle queue, the task will be stored in the queue and wait for the workflow in the processing queue to be released before being assigned.

[0102] In addition, RPC calls involve timeouts, replica instances losing response, and other issues. When such call exceptions occur, the process execution engine will first release the replica instance from the processing queue, then select the first replica instance in the idle queue to initiate a retry, and record the currently failed replica instance and workflow identifier. If the replica fails continuously, it is considered invalid and the replica instance will be deregistered. The deregistration process first applies for new resources from the container and creates an instance, and then replaces the invalid replica instance in all "start" class nodes; if the replica instance fails continuously only in a certain workflow identifier, it is considered that the replica instance is partially invalid, and the business execution engine will try to redeploy the process in the replica instance. If it continues to fail continuously, the replica instance will be deregistered.

[0103] Optionally, before the step of the primary instance allocating the unprocessed service request to the first node of the N replica instances, the method further includes:

[0104] The main instance classifies the business request entering the first node of the main instance to obtain the business request of the global variable part, the business request of the process variable part and the business request of the workflow variable part;

[0105] The master instance distributes the unprocessed service request to the first node of the N replica instances, including:

[0106] The master instance distributes the business request of the global variable part and / or the business request of the workflow variable part to the first node of the N replica instances.

[0107] In this implementation, the business execution engine can divide the memory space of the node storage variables into three parts: Global global variables, Flow process variables, and Message workflow variables. The master instance classifies the business request entering the first node of the master instance to obtain the business request of the global variable part, the business request of the process variable part, and the business request of the workflow variable part, and stores the business request of the global variable part, the business request of the process variable part, and the business request of the workflow variable part in the memory space corresponding to the Global global variable, the Flow process variable, and the Message workflow variable, respectively.

[0108] Among them, Global global variables are accessible to all processes and nodes in the business execution engine; Flow process variables restrict access to these data to only the process that creates itself, and other processes are not allowed to access them; Message workflow variables are only allowed to be accessed by the current request, and different requests in the same process or different processes are not allowed to access them. When the process engine instance is expanded, due to the increase in instance data, the same process may be deployed in different instances. If there is a requirement to access the same data in different instances, the master instance will distribute the business requests for the global variables and / or the business requests for the workflow variables to the first node of N replica instances, and improve the consistency of data in multiple replica instances through data sharding.

[0109] Specifically, in the business execution engine, such as Figure 5 As shown in the figure, all business request data can be stored in the memory in the form of key-value, using the key's hash code, and then the hash code is multiplied by the current number of instances. The remainder is the instance location. Each instance also allows external access or modification of the data managed by the instance by providing an RPC call interface. This can solve the problem when a single instance does not need to reference additional middleware, but multiple instances need to share data.

[0110] It should be noted that when the replica instance is expanded, the data needs to be re-hashed to a new location. During this process, the master instance controls the trigger time, and each instance initiates RPC remote calls to obtain or set variables. At the same time, the results need to be forwarded to the master instance, and the master instance evaluates whether the re-hashing is successful. During the hashing process, the data of all instances will be locked, that is, data modification is not allowed, only data reading is allowed, and data will only be released after hashing is completed. Therefore, after each instance reports to the master instance that the hashing is completed, the master instance will compare the data list to confirm.

[0111] In the business execution engine, there are two ways to access data: one is to access through nodes; the other is to access data by writing code in the script parsing node. The business execution engine has different control methods for the security of these two ways of accessing data, which need to be discussed separately. All node access and modification of data in variables are operated through the Get and Set methods provided by the corresponding object. When users use preset nodes to operate data, the nodes are only responsible for business logic processing. When data is read and written to memory, it will be controlled by the parent class inherited by the node. This design requires users to inherit and implement the data operation template class preset by the business execution engine when implementing custom data operation nodes. However, if users use the script execution engine to operate data, according to the rules of data access, users can only access and modify data in variables through Get and Set methods, which requires the access interface provided by Global global variables and Flow local variables to achieve concurrency control, permission control and data sharding capabilities.

[0112] See also Figure 6 , Figure 6 6 is a schematic diagram of the structure of a service request processing device provided by an embodiment of the present invention. The service request processing device 600 includes:

[0113] Prediction module 601, used for the master instance to predict the number of first service requests and the first service processing capacity of the master instance, where the first service request number is the number of service requests in the next unit time, and the first service processing capacity is the service processing capacity in the next unit time;

[0114] A creation module 602 is configured to, when the ratio of the number of the first service requests to the first service processing capability is greater than or equal to a preset expansion factor, cause the master instance to create N replica instances, each of the N replica instances including a plurality of nodes, where N is an integer greater than or equal to 1;

[0115] The allocation module 603 is used for the master instance to allocate unprocessed business requests to the first node of the N replica instances.

[0116] Optionally, the prediction module 601 includes:

[0117] A first calculation submodule, configured for the main instance to calculate the number of first business requests according to a growth rate trend of the number of business requests and the number of second business requests, where the second number of business requests is the number of business requests in the previous unit time;

[0118] The second calculation submodule is used for the main instance to calculate the first business processing capacity according to the unit time, the execution time of a single business process and the number of created replica instances.

[0119] Optionally, the creation module 602 includes:

[0120] A configuration submodule, used to configure a trigger type for the first node of the N replica instances;

[0121] The allocation module 603 includes:

[0122] The first allocation submodule is used for the master instance to allocate unprocessed business requests to the first node of the N replica instances according to the type of the business request and the trigger type of the first node of the N replica instances.

[0123] Optionally, the trigger type of the first node of the N replica instances includes any one of a hypertext trigger type and a timing trigger type.

[0124] Optionally, the allocation module 603 includes:

[0125] The second allocation submodule is used for the master instance to allocate unprocessed business requests from the Mth node of the master instance to the first node of the N replica instances, and the business processing capacity of the subsequent node of the Mth node is less than the number of business requests.

[0126] Optionally, the device further comprises:

[0127] A classification module, used for the main instance to classify the business request entering the first node of the main instance to obtain the business request of the global variable part, the business request of the process variable part and the business request of the workflow variable part;

[0128] The allocation module 603 includes:

[0129] The third allocation submodule is used for the master instance to allocate the business request of the global variable part and / or the business request of the workflow variable part to the first node of the N replica instances.

[0130] The service request processing device provided by the embodiment of the present invention can realize Figure 1 The various processes implemented by the method embodiment achieve the same technical effect and are not described here again to avoid repetition.

[0131] See also Figure 7 , Figure 7 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 7 As shown, the electronic device 700 includes:

[0132] at least one processor 701; and

[0133] A memory 702 in communication with the at least one processor; wherein,

[0134] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above Figure 1 The various processes in the corresponding method embodiments can achieve the same technical effects and will not be described again here to avoid repetition.

[0135] The embodiment of the present invention also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the above Figure 1 The various processes in the corresponding method embodiments can achieve the same technical effects and will not be described again here to avoid repetition.

[0136] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present invention is not limited to performing functions in the order discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0138] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A method for processing a business request, characterized in that: The method comprises: The master instance predicts a first business request quantity and a first business processing capacity of the master instance, wherein the first business request quantity is the business request quantity for the next unit time, and the first business processing capacity is the business processing capacity for the next unit time; When the ratio of the number of the first service requests to the first service processing capacity is greater than or equal to a preset expansion coefficient, the primary instance creates N replica instances, each of the N replica instances includes multiple nodes, and N is an integer greater than or equal to 1; The master instance distributes the unprocessed service request to the first node of the N replica instances; The main instance predicts the number of first service requests and the first service processing capability of the main instance, including: The main instance calculates the first business request number according to the growth rate trend of the business request number and the second business request number, where the second business request number is the business request number in the previous unit time; The master instance calculates the first business processing capacity according to the unit time, the execution time of a single business process and the number of created replica instances; Before the master instance distributes the unprocessed service request to the first node of the N replica instances, the method further includes: The main instance classifies the business request entering the first node of the main instance to obtain the business request of the global variable part, the business request of the process variable part and the business request of the workflow variable part; The master instance distributes the unprocessed service request to the first node of the N replica instances, including: The master instance distributes the business request of the global variable part and / or the business request of the workflow variable part to the first node of the N replica instances.

2. The method according to claim 1, characterized in that The master instance creates N replica instances, including: Configure a trigger type for the first node of the N replica instances; The master instance distributes the unprocessed service request to the first node of the N replica instances, including: The master instance distributes unprocessed service requests to the first node of the N replica instances according to the type of the service request and the trigger type of the first node of the N replica instances.

3. The method according to claim 2, characterized in that The trigger type of the first node of the N replica instances includes any one of a hypertext trigger type and a timing trigger type.

4. The method according to claim 1, characterized in that: The master instance distributes the unprocessed service request to the first node of the N replica instances, including: The master instance distributes unprocessed business requests from the Mth node of the master instance to the first node of the N replica instances, and the business processing capacity of the node following the Mth node is less than the number of business requests.

5. A service request processing device, characterized in that: include: A prediction module, configured for the master instance to predict the number of first service requests and the first service processing capacity of the master instance, wherein the first service request number is the number of service requests for the next unit time, and the first service processing capacity is the service processing capacity for the next unit time; A creation module, configured to, when the ratio of the number of the first service requests to the first service processing capacity is greater than or equal to a preset expansion factor, cause the master instance to create N replica instances, each of the N replica instances including a plurality of nodes, where N is an integer greater than or equal to 1; An allocation module, configured for the master instance to allocate unprocessed service requests to the first node of the N replica instances; Wherein, the prediction module includes: A first calculation submodule, configured for the main instance to calculate the number of first business requests according to a growth rate trend of the number of business requests and the number of second business requests, where the second number of business requests is the number of business requests in the previous unit time; A second calculation submodule, configured for the master instance to calculate the first business processing capacity according to the unit time, the execution time of a single business process and the number of created replica instances; Wherein, the device further comprises: A classification module, used for the main instance to classify the business requests entering the first node of the main instance to obtain the business requests of the global variable part, the business requests of the process variable part and the business requests of the workflow variable part; The allocation module comprises: The third allocation submodule is used for the master instance to allocate the business request of the global variable part and / or the business request of the workflow variable part to the first node of the N replica instances.

6. The device according to claim 5, characterized in that The creation module includes: A configuration submodule, used to configure a trigger type for the first node of the N replica instances; The allocation module comprises: The first allocation submodule is used for the master instance to allocate unprocessed business requests to the first node of the N replica instances according to the type of the business request and the trigger type of the first node of the N replica instances.

7. The device according to claim 6, characterized in that The trigger type of the first node of the N replica instances includes any one of a hypertext trigger type and a timing trigger type.

8. The device according to claim 5, characterized in that The allocation module comprises: The second allocation submodule is used for the master instance to allocate unprocessed business requests from the Mth node of the master instance to the first node of the N replica instances, and the business processing capacity of the subsequent node of the Mth node is less than the number of business requests.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.