Business scenario invocation method, device, electronic device, and storage medium
By configuring the business scenarios in a node-like manner and determining the target nodes and response nodes according to the business scenario call instructions, the problem of redundancy and complex business scenario organization methods in the existing technology is solved, and efficient business scenario calls and flexible version switching are achieved.
Patent Information
- Application Number
- CN202410379039.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2044-03-29
AI Technical Summary
In the prior art, business scenario organization methods are redundant and complex, resulting in low efficiency in calling and viewing of business scenarios and difficult to flexibly switch to different historical versions.
By configuring the business scenario in a node-like manner, each node includes at least a business scope and an execution function. The target business scenario node is determined by comparing the trigger conditions in the business scenario call instruction with the business scope of the node, and determining the response node in the node, and executing the execution function of the response node is executed to complete the call of the business scenario.
It realizes rapid query and call of various business scenarios, improves operational efficiency, improves user experience, and supports the combination method of flexibly combining various logical steps in business scenarios.
Smart Images

Figure CN118259989B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular, to a method, apparatus, electronic device, and storage medium for calling business scenarios. Background Art
[0002] In applications such as vehicle control applications, there can be multiple different services, each service can further include multiple different business scenarios, and each business scenario can further include multiple logical steps. In the related art, the organization method of each logical step is disordered. If one wants to understand, it requires the user to manually read the application's instruction manual, which is inefficient and has a certain technical threshold.
[0003] On the other hand, if the business scenario changes, for example, the business scope corresponding to the business scenario changes, some business scenarios are added, some business scenarios need to be deleted, or some business scenarios need to be split. In the business scenario organization method provided by the related art, it is necessary to adjust multiple pieces of code to implement a change, which is inefficient and error-prone. Further, in the business scenario organization method provided by the related art, since each updated business scenario is obtained by modifying the logic code according to the user's needs, it is difficult to flexibly switch to different historical versions of the business scenario at any time. Summary of the Invention
[0004] In view of this, embodiments of the present application provide a method, apparatus, electronic device, and storage medium for calling business scenarios to solve the problem in the prior art that the business scenario organization method is redundant and complex, resulting in low call and viewing efficiency.
[0005] In the first aspect of the embodiments of the present application, a method for calling a business scenario is provided, including:
[0006] Create business scenario nodes, each business scenario node has a business scope, and each business scenario node includes N child nodes, where N is a positive integer;
[0007] Receive a business scenario call instruction, where the business scenario call instruction includes a business scenario trigger condition;
[0008] Determine a target business scenario node whose business scope corresponds to the business scenario trigger condition;
[0009] Determine a response node in the target business scenario node, where the response node is a target child node that responds to the business scenario instruction, or the target business scenario node;
[0010] Execute the execution function of the response node to complete the call of the business scenario.
[0011] In the second aspect of the embodiments of the present application, a device for calling a business scenario is provided, including:
[0012] A creation module, configured to create business scenario nodes, each business scenario node having a business scope, and each business scenario node including N child nodes, where N is a positive integer;
[0013] A reception module, configured to receive a business scenario invocation instruction, the business scenario invocation instruction including a business scenario trigger condition;
[0014] A scenario determination module, configured to determine a target business scenario node having a corresponding business scope with the business scenario trigger condition;
[0015] A node determination module, configured to determine a response node in the target business scenario node, the response node being a target child node or the target business scenario node that responds to the business scenario instruction;
[0016] An execution module, configured to execute the execution function of the response node to complete the invocation of the business scenario.
[0017] In a third aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above method are implemented.
[0018] In a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0019] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: In the embodiments of the present application, the business scenarios are configured in the form of nodes, and each node includes at least a business scope and an execution function. By comparing the business scenario trigger condition in the business scenario invocation instruction with the business scope of each node, the target business scenario node is determined. Further, the response node is determined in the target business scenario, and the execution function of the response node is executed to complete the invocation of the business scenario. It can quickly query and know all the effective business scenarios under each business, and can flexibly combine the combination methods of each logical step in the business scenario, so as to quickly invoke each business scenario, improve the operation efficiency, and enhance the user experience. Description of the Drawings
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 It is a schematic flowchart of a service scenario calling method provided by an embodiment of the present application.
[0022] Figure 2 It is a schematic diagram of a node sorting method provided by an embodiment of the present application.
[0023] Figure 3 It is a schematic diagram of the coordinates and ranges corresponding to some service scenario nodes in a vehicle control application provided by an embodiment of the present application.
[0024] Figure 4 It is a schematic flowchart of a method for determining a response node in a target service scenario node provided by an embodiment of the present application.
[0025] Figure 5 It is a schematic flowchart of another service scenario calling method provided by an embodiment of the present application.
[0026] Figure 6 It is a schematic flowchart of yet another service scenario calling method provided by an embodiment of the present application.
[0027] Figure 7 It is a schematic flowchart of a method for calling a parent node response test function of a modified specific service scenario node provided by an embodiment of the present application.
[0028] Figure 8 It is a schematic diagram of the service scope of a shielding node and a specific service scenario node provided by an embodiment of the present application.
[0029] Figure 9 It is a schematic diagram of the service scope of another shielding node and a specific service scenario node provided by an embodiment of the present application.
[0030] Figure 10 It is a schematic diagram of the service scope of yet another shielding node and a specific service scenario node provided by an embodiment of the present application.
[0031] Figure 11 It is a schematic diagram of the service scope of still another shielding node and a specific service scenario node provided by an embodiment of the present application.
[0032] Figure 12 It is a schematic flowchart of a method for calling a response test function of a modified same-parent node provided by an embodiment of the present application.
[0033] Figure 13 It is a schematic diagram of a service scenario calling device provided by an embodiment of the present application.
[0034] Figure 14 It is a schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0035] In the following description, specific details such as specific system architectures and technologies are presented for illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0036] A method and device for invoking a service scenario according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0037] As mentioned above, in the related art, the organization manner of each logical step included in the service scenario is disordered. If one wants to understand it, the user needs to manually read the application's instruction document, which is inefficient and has a certain technical threshold. On the other hand, if the service scenario changes, for example, the service scope corresponding to the service scenario changes, some new service scenarios are added, some service scenarios need to be deleted, or some service scenarios need to be split, in the service scenario organization manner provided by the related art, multiple pieces of code need to be adjusted to achieve a change, which is inefficient and error-prone. Further, in the service scenario organization manner provided by the related art, since each updated service scenario is obtained by modifying the logic code according to the user's needs, it is difficult to flexibly switch to different historical versions of the service scenario at any time.
[0038] In view of this, an embodiment of the present application provides a method for invoking a service scenario. By configuring the service scenario in the form of nodes, each node includes at least a service scope and an execution function. By comparing the service scenario trigger condition in the service scenario invocation instruction with the service scope of each node, a target service scenario node is determined. Further, a response node is determined in the target service scenario, and the execution function of the response node is executed to complete the invocation of the service scenario. It can quickly query and know all the effective service scenarios under each service, and can flexibly combine the combination manner of each logical step in the service scenario, so as to quickly invoke each service scenario, improve the operation efficiency, and enhance the user experience.
[0039] Figure 1 It is a schematic flowchart of a method for invoking a service scenario provided by an embodiment of the present application. As Figure 1 shown, the method includes the following steps:
[0040] In step S101, a service scenario node is created.
[0041] Among them, each business scenario node has a business scope, and each business scenario node includes N child nodes, where N is an integer greater than or equal to 0. Further, each business scenario includes a root node and at least one business scenario node, and each business scenario node is a child node of the root node. In some embodiments, a business scenario may also include only one root node and no child nodes.
[0042] In step S102, a business scenario invocation instruction is received.
[0043] Among them, the business scenario invocation instruction includes a business scenario trigger condition.
[0044] In step S103, a target business scenario node corresponding to the business scenario trigger condition is determined.
[0045] In step S104, a response node in the target business scenario node is determined.
[0046] Among them, the response node is a target child node or a target business scenario node that responds to the business scenario instruction.
[0047] In step S105, the execution function of the response node is executed to complete the invocation of the business scenario.
[0048] In the embodiments of the present application, the business scenario invocation method can be executed by a terminal installed with a business scenario control application. A business scenario refers to different scenarios included in each business module. Taking the vehicle control application as an example, the login module therein can include three business scenarios: verification code login business scenario, username and password login business scenario, and forgotten password login business scenario. With the development of business requirements, the business scenarios in each business module may change, including adding new business scenarios, deleting old business scenarios, updating existing business scenarios, etc. Further, each business scenario may include multiple specific logical steps.
[0049] In the embodiments of the present application, under a business module, when a certain scenario is triggered, only one business scenario will respond at the same time. Still taking the login module in the vehicle control application as an example, when the user selects verification code login in the login module, the verification code login business scenario will perform the login operation; when the user selects password login in the login module, the username and password login business scenario will perform the login operation.
[0050] In the embodiments of the present application, before invoking a business scenario, a business scenario node can be created first. In one example, a business scenario node can be established for each business scenario in each business module, and each business scenario node has a business scope.
[0051] In the embodiments of the present application, each business scenario node may include N child nodes, where N is an integer greater than or equal to 0. That is to say, a business scenario node may include child nodes or may not have child nodes. When it has no child nodes, the business scenario node is a leaf node. Among them, the attributes and method configurations of the child nodes are exactly the same as those of the business scenario node. That is to say, a business scenario node may be a child node of its parent node, and each child node may also be a business scenario node.
[0052] In the embodiments of the present application, after the creation of a business scenario node is completed, a business scenario call instruction may be received. The business scenario call instruction may be sent by a user in a business control application or may be automatically sent by a terminal in the business control application according to business requirements, and there is no limitation here. Among them, the business scenario call instruction includes a business scenario trigger condition, and the business scenario trigger condition refers to the business scenario triggered by the call instruction. The business scenario trigger condition may also include a business scope.
[0053] In the embodiments of the present application, after receiving the business scenario trigger condition, a target business scenario node corresponding to the business scope of the business scenario trigger condition may be determined. That is to say, the business scope in the business scenario trigger condition may be compared with the business scopes of each business scenario node to obtain a target business scenario node corresponding to the business scenario trigger condition.
[0054] In the embodiments of the present application, after the target business scenario node is determined, a response node may be further determined in the target business scenario node. The response node may be a target child node in the target business scenario node, and the target child node is the child node determined to respond to the business scenario instruction. Or, the response node may also be the target business scenario node itself.
[0055] In the embodiments of the present application, the execution function of the determined response node may be executed to complete the call of the business scenario. For specific function execution methods, function value return methods, etc., refer to the descriptions in related technologies, and there is no limitation here.
[0056] According to the technical solution provided by the embodiments of the present application, by configuring business scenarios in the form of nodes, each node includes at least a business scope and an execution function. By comparing the business scenario trigger condition in the business scenario call instruction with the business scopes of each node, a target business scenario node is determined. Further, a response node is determined in the target business scenario, and the execution function of the response node is executed to complete the call of the business scenario, which can quickly query and know all effective business scenarios under each business, and can flexibly combine the combination methods of each logical step in the business scenario, so as to quickly call each business scenario, improve the operation efficiency, and enhance the user experience.
[0057] In the embodiments of the present application, all business scenarios inherit from a parent class, and each business scenario corresponds to a node. Each node includes three core attributes, namely the parent node, the child nodes, and whether to respond to scenario conditions. Among them, each node can have only one parent node, which can be null, indicating that this node is the first node of this business scenario. If the parent node of a node is not null, it means that this node is a child node.
[0058] Furthermore, a node can have multiple child nodes, and these child nodes exist in the form of an array or a linked list or other ordered forms. This ordered relationship represents the priority among the child nodes, that is, the child nodes have a preset priority order. When representing the child nodes with an array or a linked list, since the array or the linked list is inherently ordered, the order of the sequence can be used to represent their priority, and there is no need to add an additional priority field. The priority can be in reverse order or in sequential order, which is specified according to actual needs.
[0059] Figure 2 It is a schematic diagram of the node sorting method provided by the embodiments of the present application. As Figure 2 shown, a business scenario node of a certain business scenario includes 4 child nodes, namely V1, V2, V3, and V4. These four child nodes are represented by the array [V1, V2, V3, V4], and their priority is: V4 > V3 > V2 > V1, and the one ranked at the front is the latest child node.
[0060] Even further, the attribute of whether to respond to scenario conditions can be a boolean value. When it is true, it means that this node and its child nodes can participate in responding to the scenario trigger condition. As for whether the node will ultimately respond to a certain scenario trigger condition, it is determined by the response test function in the node to be introduced below. When the attribute value is false, it means that this node and its child nodes do not participate in responding to any scenario trigger conditions. By adopting this method, it is possible to make a node and its child nodes exit or participate in business requirements by configuring an attribute value in the node according to business needs, which is convenient and efficient.
[0061] In the embodiments of the present application, each node can also include three core methods, namely the response test function, the business scope judgment function, and the execution function.
[0062] Among them, the response test function can be an Application Programming Interface (API). In implementation, it can be a member function or a member property. When the parent class provides the default implementation steps, the subclass can override this API and modify the default implementation. The input parameter of this response test function is the business scenario trigger condition, and the return value is a child node of this node or this node itself. When the return value is a child node of this node, it means that this child node executes the business scenario call instruction for this time; when the return value is this node itself, it means that this node executes the business scenario call instruction by itself.
[0063] In the embodiments of the present application, the business scope judgment function is used to judge whether the business scenario trigger condition belongs to the business scope of the node itself. The input parameter of this business scope judgment function is the business scenario trigger condition, and the trigger condition of the business scenario is a complex business logic type. For example, a user clicking on a certain button is one condition, and the App receiving a notification is another condition, and so on. The business scenario trigger condition can be assigned a number or described in the form of coordinates. For specific details, please refer to the detailed description later and will not be elaborated here. The return value of the business scope judgment function is a boolean value. When it is true, it means that the business scenario trigger condition belongs to the business scope of this node; when it is false, it means that the business scenario trigger condition does not belong to the business scope of this node.
[0064] In the embodiments of the present application, the execution function can be an API. In implementation, it can be a member function or a member property, in which the detailed logic step execution code is placed. For the parent class, it should be an empty function for the subclass to override and specifically implement. For the specific implementation methods of each step in the execution function, reference can be made to the description in the related application of the applicant and will not be elaborated here.
[0065] As mentioned above, the business scenario trigger condition can be assigned a number or described in the form of coordinates. Correspondingly, the business scope of each business scenario node can also be represented by a mapping relationship table, which is composed of the business scope numbers of the business scenario trigger conditions or described in the form of coordinates and ranges.
[0066] On the one hand, when the business scope of each business scenario node is represented by a mapping relationship table, the following method can be used to determine the target business scenario node with a corresponding business scope for the business scenario trigger condition: input the business scenario trigger condition as an input parameter into the business scope judgment function to obtain the business scope number of the business scenario trigger condition; call the mapping relationship table of each business scenario node to determine the business scenario node corresponding to the business scope number of the business scenario trigger condition as the target business scenario node.
[0067] That is to say, each business scenario trigger condition can be numbered. For example, the user clicking the login button in the vehicle control application is numbered 001, the user clicking the air conditioner remote control button is numbered 002, and so on. Then, the mapping relationship table of each business scenario is saved. When the business scenario trigger condition is input into the business scope judgment function, the obtained is the business scope number of the business scenario trigger condition. It is judged in each business scenario node whether it includes this business scope number. If it includes, it means that this business scenario node meets this business scenario trigger condition.
[0068] Still taking the vehicle control application as an example, if the business scenario trigger condition is that the user clicks the login button and the current scenario is the vehicle control remote control scenario, and the business scope number of the user clicking the login button cannot be obtained by querying the mapping relationship table of the current scenario, then the business scope judgment function returns false. If the business scenario trigger condition is that the user clicks the air conditioner remote control button and the current scenario is the vehicle control remote control scenario, and the business scope number of the user clicking the login button can be obtained by querying the mapping relationship table of the current scenario, then the business scope judgment function returns true.
[0069] On the other hand, when the business scenario trigger condition is represented by coordinates and the business scope of each business scenario node is represented by coordinates and a range, the following method can be used to determine the target business scenario node with a corresponding business scope for the business scenario trigger condition: The business scenario trigger condition is used as an input parameter to input into the business scope judgment function to obtain the coordinates of the business scenario trigger condition; the business scenario nodes whose coordinates of the business scenario trigger condition fall within their own ranges are determined as the target business scenario nodes.
[0070] That is to say, the way to transform complex scenario trigger conditions into a coordinate system can be a two-dimensional coordinate system, or a three-dimensional coordinate system, or an n-dimensional coordinate system, where n is a positive integer greater than 3. Still taking the vehicle control application as an example, the business scenario trigger conditions in the vehicle control application are only composed of click events, and the button feature values clicked are composed of the button business type (such as clicking an air conditioner button or a one-key start button) and the press event (such as long press, short press, or others). These two feature values form a two-dimensional coordinate, including the x-axis and the y-axis. Therefore, the business scenario trigger condition can be represented by the coordinate point (x, y). For example, the coordinate of clicking the air conditioner button is (x: 50, y: 20), and the coordinate of clicking the login button is (x: 150, y: 30). Each business scenario node has its own coordinates and range on this coordinate system, that is, x, y, width, and height, thus forming a rectangle (in the case of a three-dimensional coordinate, it is a cube, and so on).
[0071] Figure 3 It is a schematic diagram of the coordinates and ranges corresponding to some business scenario nodes in a vehicle control application provided by an embodiment of the present application. AsFigure 3 As shown, the x-axis and y-axis respectively correspond to button service types and press events (and vice versa). The remote vehicle control scenario may include multiple different version service scenario nodes from V0 to V3. These different version service scenario nodes correspond to different coordinates and ranges. The verification code login service scenario node and the community posting service scenario node also respectively correspond to different coordinates and ranges. That is, different service scenario nodes have different coordinates and ranges.
[0072] At this time, the judgment logic of the service scope judgment function in the node is to use the coordinates of the service scenario trigger condition as the input of the service scope judgment function, and judge whether the input coordinates fall within the scope of this node. Taking the example in Figure 3 as an example, if the service scenario trigger condition is to click the air conditioner button, its coordinates are (x: 50, y: 20), and the current node is the remote vehicle control service scenario V3, whose coordinates and range are (x: 10, y: 5, width: 100, height: 100). Since the coordinates (x: 50, y: 20) fall within the range of (x: 10, y: 5, width: 100, height: 100), the service scope judgment function of the V3 node returns true. Further, if the service scenario trigger condition is the login button, its coordinates are (x: 150, y: 30). Since it does not fall within the range of the remote vehicle control service scenario V3 (x: 10, y: 5, width: 100, height: 100), the service scope judgment function of the V3 node returns false. On the other hand, since the coordinates (x: 150, y: 30) fall within the range of the remote vehicle control service scenario V0 (x: 120, y: 20, width: 40, height: 20), the service scope judgment function of the V0 node returns true.
[0073] As mentioned above, each service scenario node and each sub-node include a response test function and a service scope judgment function. All sub-nodes of each service scenario node are arranged in a preset priority order. Among them, the implementation steps of the response test function of each node are as follows: when the service scenario trigger condition is input into the response test function of the node, first call whether the member attribute of the node needs to respond to the scenario condition. If the setting of this node is false, directly return a null value and end the process; if the setting of this node is true, further judge whether the service scenario trigger condition belongs to its own service scope. This judgment can be executed through the service scope judgment function introduced above, which will not be elaborated here.
[0074] If it is determined that the business scenario trigger condition does not belong to its own business scope, it indicates that the business scenario trigger condition does not belong to this node. The response test function returns a null value and ends the process, representing that neither this node nor its child nodes respond to the business scenario trigger condition. If it is determined that the business scenario trigger condition belongs to its own business scope, when this node has no child nodes, the response test function directly returns this node itself and ends the process. When this node has child nodes, it traverses all child nodes of this node according to the preset priority, and calls the response test function of each child node one by one to obtain the return value.
[0075] When any one of the child nodes returns a non-null return value, the response test function of this node stops traversing the child nodes and returns the non-null return value of that child node as the return value of the response test function of this node. When all child nodes of this node return null values, this node is returned as the return value of the response test function of this node.
[0076] Adopting the technical solution of the embodiment of the present application can quickly obtain all existing and effective business scenarios under a certain business module. This is because each business module stores the marks assigned to all its underlying nodes, and each parent node knows which of its current effective child nodes are. Only by calling the response test function on the parent node, the function will recursively traverse its child nodes layer by layer, and finally its return value is the currently effective child node.
[0077] Furthermore, when a certain business scenario needs to be changed from one business module to another, the mapping relationship table of the original business scenario node, or its coordinates and range, can be directly modified, so as to modify the business scope of the business scenario node and realize the change of the business module to which the business scenario belongs.
[0078] Even further, when a new business module is added, corresponding business scenario nodes can be created under the new business module. Among them, the business scope of the newly added business scenario node can be realized by adding a mapping relationship table, and the newly added mapping relationship table can include the newly added numbers corresponding to the newly added business trigger conditions, or can be realized by adding coordinates and range. The newly added coordinates and range can be an independent range selected in the original coordinate system, or can be selected in a new coordinate system, and there is no limitation here.
[0079] Figure 4 It is a schematic flowchart of the method for determining the response node in the target business scenario node provided by the embodiment of the present application. As Figure 4 shown, the method includes the following steps:
[0080] In step S401, the response test function of the target business scenario node is called to determine whether the target business scenario node needs to respond to the scenario condition.
[0081] In step S402, in response to determining that the target business scenario node needs to respond to the scenario condition, the business scope judgment function of the target business scenario node is called.
[0082] In step S403, in response to determining that the business scenario trigger condition is within the business scope of the target business scenario node, the response test functions of each child node are called in sequence according to the preset priority order, and the return values of the response test functions of each child node are received.
[0083] Among them, the return value of the response test function of the child node is not empty when it is determined that the child node needs to respond to the scenario condition and the business scenario trigger condition is within the business scope of the child node; otherwise, the return value of the response test function of the child node is empty.
[0084] In step S404, in response to receiving that the return value of the response test function of the target child node is not empty, the target child node is determined as the response node, and the call to the response test functions of the remaining child nodes is stopped.
[0085] In step S405, in response to receiving that the return values of the response test functions of all child nodes are empty, the target business scenario node is determined as the response node.
[0086] In the embodiment of the present application, when determining the response node, the response test function of the root node of the target business scenario node can be called first. The root node first determines whether it needs to respond to the scenario condition and determines whether the business scenario trigger condition is within the business scope of the root node. If so, each child node of the root node, including the target business scenario node, is traversed according to the preset order. When traversing to the target business scenario node, the response test function of the target business scenario node can be called to determine whether the target business scenario node needs to respond to the scenario condition. If the target business scenario node does not need to respond to the scenario condition, the response test function of the target business scenario node returns empty, and it is prompted that the target business scenario node cannot respond to the business scenario trigger condition, whether to re-determine the target business scenario node or re-enter the business scenario trigger condition. If the target business scenario node needs to respond to the scenario condition, the business scope judgment function of the target business scenario node is called.
[0087] If the business scenario trigger condition is within the business scope of the target business scenario node, the response test functions of each child node are called in sequence according to the preset priority order, and the return values of the response test functions of each child node are received. It should be noted that the step of determining the target business scenario node can be executed at this time, that is, the business scenario trigger condition can be input into the response test functions of each business scenario node in sequence, and the business scenario node that needs to respond to the scenario condition and whose business scenario trigger condition is within the business scope of this node is determined as the target business scenario node. Therefore, for the target business scenario node, the business scenario trigger condition must be within the business scope of the target business scenario node.
[0088] When the return value of the response test function of the target child node is not empty, it can be determined that the target child node is the response node, and the call to the response test functions of the remaining child nodes is stopped. When the return values of the response test functions of all received child nodes are empty, it can be determined that the target business scenario node is the response node.
[0089] In the embodiments of the present application, each business scenario node can be flexibly configured, including adding a business scenario node, splitting a business scenario node, deleting a business scenario node, modifying the version or scope of a business scenario node, shielding a business scenario node, etc.
[0090] Figure 5 It is a schematic flowchart of another business scenario call method provided by the embodiments of the present application. Among them, Figure 5 Steps S501 to S505 in the illustrated embodiment are substantially the same as Figure 1 Steps S101 to S105 in the embodiment. As Figure 5 shown, the method further includes the following steps:
[0091] In step S506, in response to receiving a new business scenario instruction, a new business scenario node is added, and the newly added business scenario node is set to have the highest priority.
[0092] In step S507, in response to receiving a call instruction for the new business scenario, a response node is determined in the newly added business scenario node.
[0093] In step S508, the execution function of the response node is executed to complete the call of the new business scenario.
[0094] In the embodiments of the present application, when a new business scenario emerges, it is necessary to add a business scenario node corresponding to this business scenario. At this time, the newly added business scenario node has no parent node, but can have child nodes. On the other hand, as the business develops and the business scenario is modified, a new version (i.e., a newly added business scenario node) can be created, forming a sibling relationship with the historical version, both placed under the parent node, and the new version has the highest priority. The business scope of the newly added business scenario node can become smaller or larger, depending on business requirements. When the business scope of the newly added business scenario node is smaller than that of the business scenario node in the historical version, the extra business scope is responded to by the business scenario node in the historical version, thus realizing partial function updates.
[0095] On the other hand, the newly added business scenario node can also be set as a child node of the business scenario node in the historical version, so that the newly added business scenario node has the highest priority.
[0096] When a business scenario trigger condition is received and it is determined that the business scenario trigger condition matches the business scope of the newly added business scenario node, that is, when a call instruction for the newly added business scenario is received, a response node can be determined in the newly added business scenario node, and then the execution function of the response node is executed to complete the call of the newly added business scenario. The method for determining the response node is described in detail above and will not be elaborated here.
[0097] Figure 6 It is a flowchart showing another business scenario call method provided by the embodiments of the present application. Among them, Figure 6 Steps S601 to S605 in the illustrated embodiment are basically the same as Figure 1 Steps S101 to S105 in the Figure 6 embodiment. As
[0098] shown, the method further includes the following steps:
[0099] In step S606, in response to receiving a specific business scenario change instruction, update the specific business scenario node of the specific business scenario.
[0100] In step S607, in response to receiving a call instruction for a specific business scenario, determine a response node in the specific business scenario node.
[0101] In the embodiments of the present application, when a specific business scenario change instruction is received, the specific business scenario nodes of the specific business scenario can be updated. When a business scenario trigger condition is received and it is determined that the business scenario trigger condition matches the business scope of the specific business scenario node, that is, when a call instruction for the specific business scenario is received, a response node can be determined in the specific business scenario node, and then the execution function of the response node is executed to complete the call of the specific business scenario. For the method of determining the response node, refer to the detailed description above and will not be elaborated here.
[0102] In the embodiments of the present application, the specific business scenario change instruction may be a split specific business scenario instruction. At this time, the updated business scenario nodes of the specific business scenario are: splitting the specific business scenario node into M specific business scenario nodes, and the M specific business scenario nodes are parent-child nodes or sibling nodes.
[0103] In the embodiments of the present application, each version of the business scenario can also be further split. Taking the vehicle control application as an example, the vehicle control scenario of the vehicle originally did not support the Bluetooth process. Later, the manufacturer developed this function and it needed to be supported, but only one was effective at the same time. Therefore, the vehicle control scenario is split into: a remote vehicle control scenario and a Bluetooth vehicle control scenario. These two vehicle control scenarios can be in a sibling relationship or a parent-child relationship.
[0104] If the remote vehicle control scenario and the Bluetooth vehicle control scenario are in a sibling relationship, according to business requirements, the Bluetooth vehicle control scenario needs to be judged first. Therefore, the priority of the Bluetooth vehicle control scenario can be set higher than that of the remote vehicle control scenario. When the scenario trigger condition, that is, the button is clicked, the parent node first asks the Bluetooth vehicle control scenario, and the Bluetooth vehicle control scenario returns true. Then the parent node returns the Bluetooth vehicle control scenario and the process terminates. Finally, the Bluetooth vehicle control scenario takes effect for this scenario trigger condition.
[0105] If the remote vehicle control scenario and the Bluetooth vehicle control scenario are in a parent-child relationship, according to business requirements, the Bluetooth vehicle control scenario needs to be judged first. So the priority of the Bluetooth vehicle control scenario is higher than that of the remote vehicle control scenario. When the scenario trigger condition, that is, the button is clicked, the parent node first asks the Bluetooth vehicle control scenario. The Bluetooth vehicle control scenario calls its own "function to judge whether it belongs to its own business scope" and returns true; the Bluetooth vehicle control scenario further asks its child node, the remote vehicle control scenario. The remote vehicle control scenario calls its own "function to judge whether it belongs to its own business scope" and returns false; therefore, the parent node returns the Bluetooth vehicle control scenario and the process terminates. Finally, the Bluetooth vehicle control scenario takes effect for this scenario trigger condition.
[0106] It should be noted that when using the default implementation method, the business scope of the Bluetooth vehicle control scenario node must be set to be greater than or equal to that of the remote vehicle control scenario node. Otherwise, the sibling relationship is used.
[0107] In the embodiments of the present application, the specific business scenario change instruction may also be a delete specific business scenario instruction. At this time, updating the specific business scenario node of the specific business scenario may be: deleting the specific business scenario node from the storage unit; or deleting the specific business scenario node from the child node list of the parent node of the specific business scenario node; or in the response test function of the specific business scenario node, setting the attribute of whether to respond to the scenario condition to no; or returning false in the "function for determining whether it belongs to its own business scope" of the specific business scenario node.
[0108] In the embodiments of the present application, whether a node is effective depends on its hierarchical relationship under the module. If this relationship is severed, it is equivalent to deleting the node because it is no longer queried by the parent and can no longer function. The advantage of this deletion method is that it is not a physical deletion and does not modify the code, which is irreversible. Deleting the relationship is reversible, and the node can be added back at any time. The deletion of the node and the reset of the node relationship can be achieved through the change of a pointer.
[0109] In the embodiments of the present application, node deletion can be achieved by deleting the specific business scenario node from the storage unit. That is to say, the node to be deleted can be directly put into the recycle bin, which can be implemented as an array or a dictionary in terms of implementation. It is a memory area responsible for saving these temporarily invalidated nodes. The recycle bin can have a garbage collection mechanism, that is, regularly accessing the nodes therein and destroying the nodes that have not been used for a long time to save memory.
[0110] In the embodiments of the present application, node deletion can also be achieved by deleting the specific business scenario node from the child node list of the parent node of the specific business scenario node. That is to say, deleting the node from the child node list of its parent node can achieve the deletion of the node.
[0111] In the embodiments of the present application, node deletion can also be achieved by setting the attribute of whether to respond to the scenario condition to no in the response test function of the specific business scenario node.
[0112] In the embodiments of the present application, the specific business scenario may include at least two different versions of specific business scenario nodes, and the specific business scenario change instruction may be a version iteration instruction. At this time, updating the specific business scenario node of the specific business scenario is to set the priority of the specific business scenario node of the specified version in the specific business scenario to the highest.
[0113] That is to say, in the same parent-child node system, the business scenario node with the highest priority is the current version. Therefore, by setting the priority of any historical version to the highest, the purpose of using that historical version as the current version can be achieved. At this time, the response test function of the specific business scenario node of the historical version to be used can be modified to directly return itself.
[0114] In the embodiments of the present application, the specific business scenario change instruction may also be an instruction to modify the business scope of a specific child node, where the business scope of the child node is represented by a number, or by coordinates and a range. At this time, the specific business scenario node of the specific business scenario is updated as follows: when the specific business scenario change instruction is an instruction to narrow the business scope of the specific child node, the business scope number of the specific child node is modified to the narrowed business scope number, or the coordinates and range of the specific child node are modified to the narrowed coordinates and range.
[0115] When the specific business scenario change instruction is an instruction to expand the business scope of the specific child node, the business scope number of the specific child node can be modified to the expanded business scope number, or the coordinates and range of the specific child node can be modified to the expanded coordinates and range, and it is set that the expanded business scope of the specific child node is less than or equal to the business scope of the specific business scenario node.
[0116] When the specific business scenario change instruction is an instruction to expand the business scope of the specific child node, the response test function of the specific business scenario node can also be modified to update the business scenario node of the specific business scenario.
[0117] Taking the coordinate system judgment method as an example, if the original response range of a specific business scenario node may be a rectangle: (x: 100, y: 100, width: 50, height: 50), and now it is required to temporarily expand its response range according to business requirements, expanding 10 in each of the 4 directions, that is, its current response range is a rectangle: (x: 90, y: 90, width: 70, height: 70). It can be achieved by directly adjusting the range of the node temporarily. This method is simple, direct, and effective quickly, but it is necessary to ensure that the range of this node must be less than the range of the parent node, otherwise it will not achieve the expected effect, and the part of the child node that exceeds the parent node cannot respond. Because according to the default implementation, the parent node first judges its own business scope, and if it is not within the scope of the parent node, it directly returns null.
[0118] When modifying the mapping relation table, due to the implementation method of the coordinate size of a scenario, the implementation of mapping to the coordinate system judgment method is that each trigger condition corresponds to a number, which is equivalent to projecting multiple dimensions into one dimension. Therefore, each node maintains its own trigger condition number pool, and this pool is equivalent to the rectangle of the node. Therefore, the business scope of the node can be expanded by increasing the numbers in the node's number pool.
[0119] On the other hand, it can also be achieved by modifying the parent node response test function of the specific business scenario node.
[0120] Figure 7 It is a schematic flowchart of the calling method of the parent node response test function of the modified specific business scenario node provided by the embodiment of the present application. As Figure 7 shown, the method includes the following steps:
[0121] In step S701, input the business scenario trigger condition.
[0122] In step S702, in response to determining that the parent node of the specific business scenario node needs to respond to the scenario condition, call the business scope judgment function of the parent node of the specific business scenario node.
[0123] In step S703, in response to determining that the business scenario trigger condition is not within the business scope of the parent node of the specific business scenario node, call the response test functions of each child node of the parent node of the specific business scenario node in sequence according to the preset priority order, and receive the return values of the response test functions of each child node.
[0124] Among them, the return value of the response test function of each child node is not empty when it is determined that each child node needs to respond to the scenario condition and the business scenario trigger condition is within the business scope of each child node, otherwise the return value of the response test function of each child node is empty.
[0125] In step S704, in response to receiving that the return value of the response test function of the specific business scenario node is not empty, determine that the specific business scenario node is the response node, and stop calling the response test functions of the remaining child nodes.
[0126] In step S705, in response to receiving that the return values of the response test functions of all child nodes are all empty, determine that the return value of the response test function of the parent node of the specific business scenario node is empty.
[0127] In the embodiments of the present application, the service scope of a specific service scenario node can be expanded by modifying the response test function of the parent node of the specific service scenario node. At this time, the service scope of the specific service scenario node is greater than the service scope of the parent node of the specific service scenario node, that is, the service scope of the specific service scenario node is the expanded service scope, and the expanded service scope is greater than the service scope of the parent node of the specific service scenario node.
[0128] In the embodiments of the present application, when calling the response test function of the parent node of the modified specific service scenario node, the service scenario trigger condition can be first input in the response test function of the root node of the specific service scenario node. When the response test function of the root node traverses to the parent node of the specific service scenario node and determines that the parent node of the specific service scenario node needs to respond to the scenario condition, the service scope judgment function of the parent node of the specific service scenario node is called. If it is determined that the service scenario trigger condition is within the service scope of the parent node of the specific service scenario node, the conventional method can be used to traverse each child node of the parent node of the specific service scenario node in sequence.
[0129] On the other hand, if it is determined that the service scenario trigger condition is not within the service scope of the parent node of the specific service scenario node, according to the conventional method, the response test function of the parent node of the specific service scenario node should return a null value, and the parent node of the specific service scenario node and its child nodes do not respond to the service scenario trigger condition. However, since the service scope of the current specific service scenario node has been expanded, and the expanded service scope is greater than the service scope of the parent node of the specific service scenario node, although the parent node of the specific service scenario node cannot respond to the service scenario trigger condition, the specific service scenario node may be able to respond to the service scenario trigger condition.
[0130] Therefore, at this time, the response test function of the parent node of the specific service scenario node can be made to continue to execute the steps of sequentially calling the response test functions of its child nodes according to the preset priority order and receiving the return values of the response test functions of each child node until a non-null value is returned by the specific service scenario node, indicating that the specific service scenario node can respond to the service scenario trigger condition. Therefore, the specific service scenario node is determined as the response node to respond to the service scenario trigger condition input by the user. If the return values of the response test functions of all child nodes of the parent node of the specific service scenario node are null, it indicates that no child node can respond to the service scenario trigger condition, and the service scenario trigger condition exceeds the service scope of the parent node of the specific service scenario node and the service scope of the specific service scenario node. Therefore, the response test function of the parent node of the specific service scenario node returns a null value.
[0131] In the embodiments of the present application, the specific service scenario change instruction may also be an instruction to block a specific service scenario node. At this time, updating the specific service scenario node of the specific service scenario is as follows: create a new blocking node, set the priority of the blocking node to the highest; set the service scope of the blocking node so that the blocking node can block the service scope of the specific service scenario node. Further, the execution function of the blocking node can be set to be empty so that the blocking node can perform a non-execution operation on the service to be blocked. Furthermore, the execution function of the blocking node can be set to other service logics, and the other service logics are different from the logic of the execution function of the specific service scenario node.
[0132] Among them, the instruction to block a specific service scenario node may be an instruction to block the entire service scope of a specific service scenario node or an instruction to block a partial service scope of a specific service scenario node. When the instruction to block a specific service scenario node is an instruction to block the entire service scope of a specific service scenario node, the service scope of the blocking node can be set to be larger than the service scope of the specific service scenario node, so as to enable the blocking node to block the service scope of the specific service scenario node. When the instruction to block a specific service scenario node is an instruction to block a partial service scope of a specific service scenario node, the service scope of the blocking node can be set to be larger than the service scope specified to be blocked of the specific service scenario node, so as to enable the blocking node to block the service scope of the specific service scenario node.
[0133] That is to say, the technical solution provided in the embodiments of the present application can flexibly block service scenarios, including partial blocking, full blocking, cross-blocking, and multiple blocking. When blocking, one or more blocking nodes can be added (the added nodes may have their own service logics), which are mounted on a parent node (because sibling nodes can overwrite each other arbitrarily), and their service scopes are set to be larger than the service scenario nodes to be blocked and the priorities are higher than the service scenario nodes to be blocked. When this service requirement is no longer needed, the added nodes can be removed.
[0134] In the embodiments of the present application, the specific service scenario node may include one or more service scenario nodes. That is to say, the blocking node can block the service scope of one service scenario node or the service scopes of multiple service scenario nodes. Further, the blocking node can block a partial service scope of one or more service scenario nodes or the entire service scope of one or more service scenario nodes.
[0135] Figures 8 to 11 is a schematic diagram of the service scopes of the blocking node and the specific service scenario node provided in the embodiments of the present application. Among them, Figure 8 the blocking node partially blocks the service scope of the specific service scenario node 1, Figure 9The middle shielding node completely shields the service scope of the specific service scenario node 1. Figure 10 The middle shielding node partially shields the service scopes of the specific service scenario node 1 and the specific service scenario 2. Figure 11 The middle shielding node completely shields the service scopes of the specific service scenario node 1 and the specific service scenario 2.
[0136] In the embodiments of the present application, the specific service scenario change instruction may also be an instruction to shield the first specific service scenario node in the specific service scenario and retain the second specific service scenario node in the specific service scenario. At this time, the service scenario nodes for updating the specific service scenario are as follows: create a new shielding node, set the priority of the shielding node to the highest, set the execution function of the shielding node to be empty or other business logics, and this other business logic is different from the logic in the execution function of the first specific service scenario node. In one implementation, the other business logic may be, for example, to pop up a prompt box and display "This is a novice guide program". At the same time, it can also be set that the shielding node is a sibling node of both the first specific service scenario node and the second specific service scenario node; set the service scope of the shielding node to be greater than the service scopes of the first specific service scenario node and the second specific service scenario node; add the second specific service scenario node as a new member attribute to the shielding node; modify the response test function of the shielding node so that when the input parameter of the response test function of the same parent node is the service scope of the first specific service scenario node, it calls the response test function of the parent class of the shielding node and returns the return value of the response test function of the parent class, and when the input parameter of the response test function of the same parent node is the service scope of the second specific service scenario node, the response test function of the shielding node returns a null value; where the same parent node is the common parent node or ancestor node of the shielding node, the first specific service scenario node, and the second specific service scenario node, and the shielding node inherits from its parent class.
[0137] Figure 12 It is a schematic flowchart of the calling method of the modified response test function of the same parent node provided by the embodiments of the present application. As Figure 12 shown, the method includes the following steps:
[0138] In step S1201, input the service scenario trigger condition in the response test function of the same parent node.
[0139] In step S1202, in response to determining that the same parent node needs to respond to the scenario condition, call the service scope judgment function of the same parent node.
[0140] In step S1203, in response to determining that the service scenario trigger condition is within the service scope of the same parent node, call the response test function of the shielding node.
[0141] In step S1204, in response to determining that the shielding node needs to respond to the scenario condition and based on the newly added member attributes, it is determined that the service scenario trigger condition is within the service scope of the second specific service scenario node, and the response test function of the shielding node returns a null value.
[0142] In step S1205, the response test functions of the remaining child nodes of the same parent node are called in sequence according to the preset priority order.
[0143] In step S1206, after traversing the response test functions of the remaining child nodes, in response to receiving a non-null return value in the response test functions of the remaining child nodes, the execution function of the service scenario node corresponding to the non-null return value is called to execute the service scenario call instruction.
[0144] In step S1207, in response to determining that the shielding node needs to respond to the scenario condition and determining that the service scenario trigger condition is within the service scope of the shielding node and not within the service scope of the second specific service scenario node, the response test function of the parent class of the shielding node is called, and the return value of the response test function of this parent class is used as the return value of the response test function of the same parent node.
[0145] In the embodiment of the present application, the service scenario trigger condition can be first input into the response test function of the same parent node. If it is determined that the same parent node needs to respond to the scenario condition, the service scope judgment function of the same parent node is called. If it is determined based on the service scope judgment function of the same parent node that the service scenario trigger condition is within the service scope of the same parent node, the response test function of the shielding node is called.
[0146] If it is determined that the shielding node needs to respond to the scenario conditions, and the business scenario trigger conditions are determined based on the newly added member attributes within the business scope of the second specific business scenario node, the response test function of the shielding node returns a null value. That is to say, in the response test function of the root node of the shielding node, the business scenario trigger conditions can be input, and the root node will call its child nodes layer by layer, including this shielding node and the possible parent node of the shielding node. When the call reaches the shielding node, the business scenario trigger conditions will be transmitted to the newly added member attributes of this shielding node, and each second specific business scenario node in the newly added member attributes will judge one by one to determine whether the business scenario trigger conditions are within the business scope of the second specific business scenario node, that is, call the business scope judgment function of the second specific business scenario node to judge whether the business scenario trigger conditions belong to its own business scope. When the business scope judgment function of the second specific business scenario node returns true, it indicates that the scenario trigger conditions are within the business scope of the second specific business scenario node. At this time, to improve efficiency and reduce workload, the response test function of the shielding node can return a null value, and then the sibling node will continue to query other child nodes until the second specific business scenario node is queried and returns itself, so as to determine the second specific business scenario node as the response node, and the second specific business scenario node responds to the business scenario trigger conditions, without repeating the execution function logic of the second specific business scenario node in the execution function of the shielding node.
[0147] That is to say, after the response test function of the shielding node returns a null value, the response test functions of the remaining child nodes of the sibling node can be called in sequence according to the preset priority order. After traversing the response test functions of the remaining child nodes, if a non-null return value is included in the response test functions of the remaining child nodes, the execution function of the business scenario node corresponding to the non-null return value will be called to execute the business scenario call instruction, thus realizing the retention of the second specific business scenario node.
[0148] On the other hand, if it is determined based on the service scope judgment function of the shielding node that the service scenario trigger condition is within the service scope of the shielding node, and it is determined based on the new attributes of the shielding node that the service scenario trigger condition is not within the service scope of the second specific service scenario node, the response test function of the shielding node returns the shielding node itself as the return value of the response test function of the parent node. When the response test function completes the traversal of each node, since the non-empty return value obtained is returned by the response test function of this shielding node, the execution function of this shielding node can be called to respond to the service scenario condition. Further, since the execution function of this shielding node is empty, the response result is not to perform any operation, thus realizing the shielding of the first specific service scenario node. Or, since the execution function of this shielding node is other logic, the response result is a response based on business requirements, such as popping up a prompt message instead of executing the execution function of the first specific service scenario node, thus also realizing the shielding of the first specific service scenario node.
[0149] In the embodiment of the present application, if it is determined based on the service scope judgment function of the shielding node that the service scenario trigger condition is not within the service scope of the shielding node, the parent node continues to traverse other child nodes to determine the response node.
[0150] In the embodiment of the present application, the first specific service scenario node may include one or more child nodes, and the second specific service scenario node may also include one or more child nodes.
[0151] By adopting the technical solution of the embodiment of the present application, all existing effective service scenarios under a certain service module can be quickly known. When a certain scenario may change from the original service module to a new service module, relying on the traditional development method may involve multiple adjustments to the code, while adopting the technical solution of the embodiment of the present application only requires changing the configuration.
[0152] By adopting the technical solution of the embodiment of the present application, the scenario change can be conveniently and quickly realized. To delete a service scenario, only the configuration needs to be changed. To add a new service scenario, only nodes need to be added and the configuration needs to be changed. To split a service scenario, only nodes need to be derived and the configuration needs to be changed, which is convenient to implement.
[0153] By adopting the technical solution of the embodiment of the present application, each service scenario can retain its own historical version, which is convenient for viewing and changing its changes. At the same time, each scenario is also reversible, that is to say, if a scenario has gone through multiple versions such as A->B->C->D, then it can switch to version A at any time, or switch to version C at any time. The traditional development method cannot achieve this, or it is very difficult to achieve, because the traditional development method is to modify the logic code corresponding to the requirements and lacks an overall management.
[0154] By adopting the technical solution of the embodiment of the present application, the currently effective node can be adjusted at any time and arbitrarily, so as to achieve the purpose of being compatible with various temporary requirements.
[0155] Any combination of the above all optional technical solutions can form an optional embodiment of the present application, which will not be elaborated one by one here.
[0156] The following is an embodiment of the device of the present application, which can be used to execute the method embodiment of the present application. For the details not disclosed in the device embodiment of the present application, please refer to the method embodiment of the present application.
[0157] Figure 13 It is a schematic diagram of a business scenario calling device provided by an embodiment of the present application. As Figure 13 shown, the device includes:
[0158] A creation module 1301, configured to create business scenario nodes, each business scenario node has a business scope, and each business scenario node includes N sub-nodes, where N is an integer greater than or equal to 0.
[0159] A receiving module 1302, configured to receive a business scenario calling instruction, and the business scenario calling instruction includes a business scenario triggering condition.
[0160] A scenario determination module 1303, configured to determine a target business scenario node whose business scope corresponds to the business scenario triggering condition.
[0161] A node determination module 1304, configured to determine a response node in the target business scenario node, where the response node is the target sub-node or the target business scenario node that responds to the business scenario instruction.
[0162] An execution module 1305, configured to execute the execution function of the response node to complete the call of the business scenario.
[0163] According to the technical solution provided by the embodiment of the present application, by configuring the business scenario in the form of nodes, each node includes at least a business scope and an execution function. By comparing the business scenario triggering condition in the business scenario calling instruction with the business scope of each node, the target business scenario node is determined. Further, the response node is determined in the target business scenario, and the execution function of the response node is executed to complete the call of the business scenario, which can quickly query and know all the effective business scenarios under each business, and can flexibly combine the combination methods of each logical step in the business scenario, so as to quickly call each business scenario, improve the operation efficiency, and enhance the user experience.
[0164] In an embodiment of the present application, each business scenario node includes a business scope judgment function. The business scopes of each business scenario node are represented by a mapping relationship table, and the mapping relationship table is composed of the business scope numbers of the business scenario trigger conditions; determining a target business scenario node having a corresponding business scope with the business scenario trigger condition includes: inputting the business scenario trigger condition as a parameter into the business scope judgment function to obtain the business scope number of the business scenario trigger condition; calling the mapping relationship tables of each business scenario node, and determining the business scenario node corresponding to the business scope number of the business scenario trigger condition as the target business scenario node.
[0165] In an embodiment of the present application, each business scenario node includes a business scope judgment function. The business scopes of each business scenario node are represented by coordinates and ranges; determining a target business scenario node having a corresponding business scope with the business scenario trigger condition includes: inputting the business scenario trigger condition as a parameter into the business scope judgment function to obtain the coordinates of the business scenario trigger condition; determining the business scenario node whose coordinates of the business scenario trigger condition fall within its own range as the target business scenario node.
[0166] In an embodiment of the present application, each business scenario node and each sub-node include a response test function and a business scope judgment function. All sub-nodes of each business scenario node are arranged in a preset priority order; determining a response node in the target business scenario node includes: calling the response test function of the target business scenario node to determine whether the target business scenario node needs to respond to the scenario condition; in response to determining that the target business scenario node needs to respond to the scenario condition, calling the business scope judgment function of the target business scenario node; in response to determining that the business scenario trigger condition is within the business scope of the target business scenario node, sequentially calling the response test functions of each sub-node in the preset priority order, and receiving the return values of the response test functions of each sub-node; wherein, the return value of the response test function of the sub-node is not empty when it is determined that the sub-node needs to respond to the scenario condition and the business scenario trigger condition is within the business scope of the sub-node, otherwise the return value of the response test function of the sub-node is empty; in response to receiving that the return value of the response test function of the target sub-node is not empty, determining the target sub-node as the response node and stopping calling the response test functions of the remaining sub-nodes; in response to receiving that the return values of the response test functions of all sub-nodes are empty, determining the target business scenario node as the response node.
[0167] In an embodiment of the present application, it further includes: in response to receiving a new business scenario instruction, adding a new business scenario node and setting the new business scenario node to have the highest priority; in response to receiving a call instruction for the new business scenario, determining a response node in the new business scenario node; executing the execution function of the response node to complete the call of the new business scenario.
[0168] In the embodiments of the present application, it further includes: in response to receiving a specific service scenario change instruction, updating the specific service scenario nodes of the specific service scenario; in response to receiving a call instruction for the specific service scenario, determining a response node among the specific service scenario nodes; and executing the execution function of the response node to complete the call of the specific service scenario.
[0169] In the embodiments of the present application, the specific service scenario change instruction is a split specific service scenario instruction; updating the specific service scenario nodes of the specific service scenario includes: splitting the specific service scenario nodes into M specific service scenario nodes, and the M specific service scenario nodes are parent-child nodes or sibling nodes.
[0170] In the embodiments of the present application, the specific service scenario change instruction is a delete specific service scenario instruction; updating the specific service scenario nodes of the specific service scenario includes: deleting the specific service scenario nodes from the storage unit; or deleting the specific service scenario nodes from the child node list of the parent node of the specific service scenario nodes; or in the response test function of the specific service scenario nodes, setting whether the response scenario condition attribute is required to be no; the execution module is further configured to: in response to receiving a call instruction for the specific service scenario, not execute the instruction.
[0171] In the embodiments of the present application, the specific service scenario includes at least two different versions of specific service scenario nodes, and the specific service scenario change instruction is a version iteration instruction; updating the specific service scenario nodes of the specific service scenario includes: setting the priority of the specific service scenario nodes of the specified version in the specific service scenario to the highest.
[0172] In the embodiments of the present application, the specific service scenario change instruction is a modify specific service scenario node business scope instruction, and the specific service scenario node business scope is represented by a number or by coordinates and a range; updating the specific service scenario nodes of the specific service scenario includes: in response to the specific service scenario change instruction being a narrow specific service scenario node business scope instruction, modifying the business scope number of the specific service scenario node to the narrowed business scope number, or modifying the coordinates and range of the specific service scenario node to the narrowed coordinates and range; in response to the specific service scenario change instruction being an expand specific service scenario node business scope instruction, modifying the business scope number of the specific service scenario node to the expanded business scope number, or modifying the coordinates and range of the specific service scenario node to the expanded coordinates and range, and setting the expanded business scope of the specific service scenario node to be less than or equal to the business scope of the specific service scenario node; or in response to the specific service scenario change instruction being an expand specific service scenario node business scope instruction, modifying the response test function of the parent node of the specific service scenario node to update the specific service scenario nodes of the specific service scenario.
[0173] In the embodiments of the present application, the business scope of a specific business scenario node is larger than that of the parent node of the specific business scenario node. The response test function of the modified parent node of the specific business scenario node is called in the following manner: input the business scenario trigger condition; in response to determining that the parent node of the specific business scenario node needs to respond to the scenario condition, call the business scope judgment function of the parent node of the specific business scenario node; in response to determining that the business scenario trigger condition is not within the business scope of the parent node of the specific business scenario node, call the response test functions of each child node of the parent node of the specific business scenario node in sequence according to the preset priority order, and receive the return values of the response test functions of each child node; in response to receiving that the return value of the response test function of the specific business scenario node is not empty, determine that the specific business scenario node is the response node, and stop calling the response test functions of the remaining child nodes; in response to receiving that the return values of the response test functions of all child nodes are empty, determine that the return value of the response test function of the parent node of the specific business scenario node is empty.
[0174] In the embodiments of the present application, the specific business scenario change instruction is an instruction to shield a specific business scenario node; updating the specific business scenario node of the specific business scenario includes: creating a new shielding node, setting the priority of the shielding node to the highest; setting the business scope of the shielding node so that the shielding node can shield the business scope of the specific business scenario node; setting the execution function of the shielding node to be empty or other business logic, and the other business logic is different from the logic in the execution function of the specific business scenario node.
[0175] In the embodiments of the present application, the instruction to shield a specific business scenario node is an instruction to shield all the business scope of the specific business scenario node or an instruction to shield a partial business scope of the specific business scenario node; setting the business scope of the shielding node so that the shielding node can shield the business scope of the specific business scenario node includes: in response to the instruction to shield a specific business scenario node being an instruction to shield all the business scope of the specific business scenario node, setting the business scope of the shielding node to be larger than the business scope of the specific business scenario node; in response to the instruction to shield a specific business scenario node being an instruction to shield a partial business scope of the specific business scenario node, setting the business scope of the shielding node to be larger than the specified shielding business scope of the specific business scenario node.
[0176] In the embodiments of the present application, a specific business scenario node includes one or more business scenario nodes.
[0177] In an embodiment of the present application, the specific service scenario change instruction is an instruction to block the first specific service scenario node in the specific service scenario and retain the second specific service scenario node in the specific service scenario; updating the specific service scenario nodes of the specific service scenario includes: creating a blocking node, setting the priority of the blocking node to the highest, setting the execution function of the blocking node to be empty or other business logic, where the other business logic is different from the logic in the execution function of the first specific service scenario node, and setting the blocking node to be a sibling node of both the first specific service scenario node and the second specific service scenario node; setting the service scope of the blocking node to be larger than the service scopes of the first specific service scenario node and the second specific service scenario node; adding the second specific service scenario node as a new member attribute to the blocking node; modifying the response test function of the blocking node so that when the input parameter of the response test function of the same parent node is the service scope of the first specific service scenario node, the response test function of the parent class of the blocking node is called and the return value of the response test function of the parent class is returned, and when the input parameter of the response test function of the same parent node is the service scope of the second specific service scenario node, the execution function of the blocking node is executed; where the same parent node is the common parent node or ancestor node of the blocking node, the first specific service scenario node, and the second specific service scenario node, and the blocking node inherits from the parent class.
[0178] In an embodiment of the present application, after changing the specific service scenario, the response test function of the same parent node is called in the following manner: inputting a service scenario trigger condition into the response test function of the same parent node; in response to determining that the same parent node needs to respond to the scenario condition, calling the service scope judgment function of the same parent node; in response to determining that the service scenario trigger condition is within the service scope of the same parent node, calling the response test function of the blocking node; in response to determining that the blocking node needs to respond to the scenario condition and based on the new member attribute determining that the service scenario trigger condition is within the service scope of the second specific service scenario node, the response test function of the blocking node returns a null value; calling the response test functions of the remaining child nodes of the same parent node in sequence according to the preset priority order; after traversing the response test functions of the remaining child nodes, in response to receiving a non-null return value included in the response test functions of the remaining child nodes, calling the execution function of the service scenario node corresponding to the non-null return value to execute the service scenario call instruction; in response to determining that the blocking node needs to respond to the scenario condition and determining that the service scenario trigger condition is within the service scope of the blocking node and not within the service scope of the second specific service scenario node, calling the response test function of the parent class of the blocking node and using the return value of the response test function of the parent class as the return value of the response test function of the same parent node.
[0179] In an embodiment of the present application, the first specific service scenario node includes one or more child nodes, and the second specific service scenario node includes one or more child nodes.
[0180] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not imply the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0181] Figure 14 is a schematic diagram of the electronic device provided by the embodiments of the present application. As Figure 14 shown, the electronic device 14 in this embodiment includes: a processor 1401, a memory 1402, and a computer program 1403 stored in the memory 1402 and executable on the processor 1401. When the processor 1401 executes the computer program 1403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 1401 executes the computer program 1403, the functions of each module / unit in the above-mentioned device embodiments are implemented.
[0182] The electronic device 14 may be a desktop computer, a notebook, a palm computer, a cloud server, or other electronic devices. The electronic device 14 may include, but is not limited to, the processor 1401 and the memory 1402. Those skilled in the art can understand that Figure 14 merely examples of the electronic device 14, and do not constitute a limitation to the electronic device 14. It may include more or fewer components than those shown in the figure, or different components.
[0183] The processor 1401 may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0184] The memory 1402 may be an internal storage unit of the electronic device 14. For example, the hard disk or memory of the electronic device 14. The memory 1402 may also be an external storage device of the electronic device 14. For example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 14. The memory 1402 may also include both the internal storage unit and the external storage device of the electronic device 14. The memory 1402 is used to store the computer program and other programs and data required by the electronic device.
[0185] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be assigned to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0186] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above embodiment methods of this application, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. The computer program can include computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0187] The above embodiments are only used to illustrate the technical solutions of this application, rather than to limit it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of each embodiment of this application, and should all be included in the protection scope of this application.
Claims
1. A business scenario calling method, characterized in that: include: Create a business scenario node, each business scenario node has a business scope, and each business scenario node includes N child nodes, where N is an integer greater than or equal to 0; Receive a business scenario calling instruction, wherein the business scenario calling instruction includes a business scenario triggering condition; Determine a target business scenario node having a business scope corresponding to the business scenario trigger condition; Determine a response node in the target business scenario node, the response node being a target subnode that responds to the business scenario call instruction, or the target business scenario node; Execute the execution function of the response node to complete the call of the business scenario; In response to receiving a specific business scenario change instruction, updating a specific business scenario node of the specific business scenario, wherein the specific business scenario change instruction is an instruction to modify a business scope of the specific business scenario node, and the business scope of the specific business scenario node is represented by a number, or by coordinates and a range; The updating of the specific business scenario node of the specific business scenario includes: In response to the specific business scenario change instruction being an instruction to expand the business scope of a specific business scenario node, the business scope number of the specific business scenario node is modified to the expanded business scope number, or the coordinates and range of the specific business scenario node are modified to the expanded coordinates and range, and the expanded business scope of the specific business scenario node is set to be less than or equal to the business scope of the specific business scenario node; or In response to the specific business scenario change instruction being an instruction to expand the business scope of a specific business scenario node, a response test function of a parent node of the specific business scenario node is modified to update the specific business scenario node of the specific business scenario.
2. The method according to claim 1, characterized in that: Each business scenario node includes a business scope judgment function, and the business scope of each business scenario node is represented by a mapping relationship table, which is composed of the business scope number of the business scenario trigger condition; The determining of a target business scenario node having a business scope corresponding to the business scenario trigger condition includes: Input the business scenario trigger condition as an input parameter into the business scope judgment function to obtain the business scope number of the business scenario trigger condition; The mapping relationship table of each business scenario node is called to determine that the business scenario node corresponding to the business scope number of the business scenario trigger condition is the target business scenario node.
3. The method according to claim 1, characterized in that Each business scenario node includes a business scope judgment function, and the business scope of each business scenario node is represented by coordinates and range; The determining of a target business scenario node having a business scope corresponding to the business scenario trigger condition includes: Input the business scenario trigger condition as an input parameter into the business scope judgment function to obtain the coordinates of the business scenario trigger condition; The business scenario node whose coordinates of the business scenario triggering condition fall within its own range is determined as the target business scenario node.
4. The method according to claim 1, characterized in that: Each business scenario node and each sub-node includes a response test function and a business scope judgment function, and all sub-nodes of each business scenario node are arranged in a preset priority order; The determining of the response node in the target business scenario node includes: Calling a response test function of the target business scenario node to determine whether the target business scenario node needs to respond to a scenario condition; In response to determining that the target business scenario node needs to respond to a scenario condition, calling a business scope determination function of the target business scenario node; In response to determining that the business scenario trigger condition is within the business scope of the target business scenario node, calling the response test function of each subnode in sequence according to the preset priority order, and receiving the response test function return value of each subnode; The response test function return value of the subnode is not empty when it is determined that the subnode needs to respond to the scenario condition and the business scenario trigger condition is within the business scope of the subnode, otherwise the response test function return value of the subnode is empty; In response to receiving that the return value of the response test function of the target child node is not empty, determining that the target child node is the response node, and stopping calling the response test functions of the remaining child nodes; In response to the return values of the response test functions of all received child nodes being empty, the target business scenario node is determined to be the response node.
5. The method according to claim 1, characterized in that The method further comprises: In response to receiving the instruction to add a new business scenario, adding a new business scenario node, and setting the newly added business scenario node to have the highest priority; In response to receiving a call instruction of the newly added business scenario, determining a response node in the newly added business scenario node; Execute the execution function of the response node to complete the call of the newly added business scenario.
6. The method according to claim 1, characterized in that After updating the specific business scenario node of the specific business scenario, the method further includes: In response to receiving a call instruction of the specific business scenario, determining a response node in the specific business scenario node; Execute the execution function of the response node to complete the call of the specific business scenario.
7. The method according to claim 6, characterized in that The specific business scenario change instruction is a specific business scenario splitting instruction; The updating of the specific business scenario node of the specific business scenario includes: The specific business scenario node is split into M specific business scenario nodes, and the M specific business scenario nodes are parent-child nodes, or brother nodes.
8. The method according to claim 6, characterized in that The specific business scenario change instruction is an instruction to delete the specific business scenario; The updating of the specific business scenario node of the specific business scenario includes: Deleting the specific business scenario node from the storage unit; or Deleting the specific business scenario node from the child node list of the parent node of the specific business scenario node; or Setting the whether to need to respond to the scenario condition attribute in the response test function of the specific business scenario node to no; The method further comprises: In response to receiving the calling instruction of the specific business scenario, the instruction is not executed.
9. The method according to claim 6, characterized in that The specific business scenario includes at least two specific business scenario nodes of different versions, and the specific business scenario change instruction is a version iteration instruction; The updating of the specific business scenario node of the specific business scenario includes: The priority of the specific business scenario node of the specified version in the specific business scenario is set to the highest.
10. The method according to claim 1, characterized in that The updating of the specific business scenario node of the specific business scenario further includes: In response to the specific business scenario change instruction being an instruction to reduce the business scope of a specific business scenario node, the business scope number of the specific business scenario node is modified to the reduced business scope number, or the coordinates and range of the specific business scenario node are modified to the reduced coordinates and range.
11. The method according to claim 10, characterized in that The business scope of the specific business scenario node is greater than the business scope of the parent node of the specific business scenario node, and the modified response test function of the parent node of the specific business scenario node is called in the following manner: Enter the business scenario trigger conditions; In response to determining that the parent node of the specific business scenario node needs to respond to a scenario condition, calling a business scope determination function of the parent node of the specific business scenario node; In response to determining that the business scenario trigger condition is not within the business scope of the parent node of the specific business scenario node, calling the response test function of each child node of the parent node of the specific business scenario node in sequence according to a preset priority order, and receiving a response test function return value of each child node; In response to receiving that the return value of the response test function of the specific business scenario node is not empty, determining that the specific business scenario node is the response node, and stopping calling the response test functions of the remaining child nodes; In response to the received return values of the response test functions of all child nodes being null, it is determined that the return value of the response test function of the parent node of the specific business scenario node is null.
12. The method according to claim 6, characterized in that The specific business scenario change instruction is an instruction to shield a specific business scenario node; The updating of the specific business scenario node of the specific business scenario includes: Create a new shielding node and set the priority of the shielding node to the highest; Setting the service scope of the shielding node so that the shielding node can shield the service scope of the specific service scenario node; The execution function of the shielding node is set to be empty or other business logic, and the other business logic is different from the logic in the execution function of the specific business scenario node.
13. The method according to claim 12, characterized in that The instruction to block the specific business scenario node is an instruction to block the entire business scope of the specific business scenario node, or an instruction to block part of the business scope of the specific business scenario node; The step of setting the service scope of the shielding node so that the shielding node can shield the service scope of the specific service scenario node includes: In response to the instruction to shield the specific business scenario node being an instruction to shield the entire business scope of the specific business scenario node, setting the business scope of the shielded node to be larger than the business scope of the specific business scenario node; In response to the instruction to shield the specific business scenario node being an instruction to shield part of the business scope of the specific business scenario node, the business scope of the shielded node is set to be larger than the business scope specified to be shielded by the specific business scenario node.
14. The method according to claim 12 or 13, characterized in that: The specific business scenario node includes one or more business scenario nodes.
15. The method according to claim 6, characterized in that The specific business scenario change instruction is an instruction to shield a first specific business scenario node in the specific business scenario and retain a second specific business scenario node in the specific business scenario; The updating of the specific business scenario node of the specific business scenario includes: Create a new shielding node, set the priority of the shielding node to the highest, set the execution function of the shielding node to be empty or other business logic, the other business logic is different from the logic in the execution function of the first specific business scenario node, and set the shielding node and the first specific business scenario node and the second specific business scenario node to be brother nodes; Setting the service scope of the shielding node to be larger than the service scopes of the first specific service scenario node and the second specific service scenario node; Adding the second specific business scenario node as a newly added member attribute to the shielding node; Modify the response test function of the shielded node so that when the input parameter of the response test function of the same parent node is the business scope of the first specific business scenario node, the response test function of the parent class of the shielded node is called and the return value of the response test function of the parent class is returned, and when the input parameter of the response test function of the same parent node is the business scope of the second specific business scenario node, the response test function of the shielded node returns a null value; The same-parent node is a common parent node or ancestor node of the shielding node, the first specific business scenario node and the second specific business scenario node, and the shielding node inherits from the parent class.
16. The method according to claim 15, characterized in that After changing the specific business scenario, the response test function of the same parent node is called in the following way: Entering a business scenario trigger condition into the response test function of the same parent node; In response to determining that the node with the same parent needs to respond to a scenario condition, calling a service scope determination function of the node with the same parent; In response to determining that the business scenario trigger condition is within the business scope of the same parent node, calling the response test function of the shielding node; In response to determining that the shielding node needs to respond to a scenario condition, and determining based on the newly added member attribute that the business scenario trigger condition is within the business scope of the second specific business scenario node, the response test function of the shielding node returns a null value; Calling the response test functions of the remaining child nodes of the same parent node in sequence according to a preset priority order; After traversing the response test functions of the remaining child nodes, in response to receiving a non-empty return value included in the response test functions of the remaining child nodes, calling the execution function of the business scenario node corresponding to the non-empty return value to execute the business scenario call instruction; In response to determining that the shielding node needs to respond to scenario conditions, and determining that the business scenario trigger condition is within the business scope of the shielding node and not within the business scope of the second specific business scenario node, the response test function of the parent class of the shielding node is called, and the return value of the response test function of the parent class is used as the return value of the response test function of the same parent node.
17. The method according to claim 15 or 16, characterized in that: The first specific business scenario node includes one or more sub-nodes, and the second specific business scenario node includes one or more sub-nodes.
18. A business scenario calling device, characterized in that: include: A creation module is configured to create a business scenario node, each business scenario node has a business scope, and each business scenario node includes N child nodes, where N is an integer greater than or equal to 0; A receiving module is configured to receive a business scenario calling instruction, wherein the business scenario calling instruction includes a business scenario triggering condition; A scenario determination module is configured to determine a target business scenario node having a business scope corresponding to the business scenario trigger condition; A node determination module is configured to determine a response node in the target business scenario node, wherein the response node is a target subnode that responds to the business scenario call instruction, or the target business scenario node; An execution module, configured to execute the execution function of the response node to complete the call of the business scenario; In response to receiving a specific business scenario change instruction, updating a specific business scenario node of the specific business scenario, wherein the specific business scenario change instruction is an instruction to modify a business scope of the specific business scenario node, and the business scope of the specific business scenario node is represented by a number, or by coordinates and a range; The updating of the specific business scenario node of the specific business scenario includes: In response to the specific business scenario change instruction being an instruction to expand the business scope of a specific business scenario node, the business scope number of the specific business scenario node is modified to the expanded business scope number, or the coordinates and range of the specific business scenario node are modified to the expanded coordinates and range, and the expanded business scope of the specific business scenario node is set to be less than or equal to the business scope of the specific business scenario node; or In response to the specific business scenario change instruction being an instruction to expand the business scope of a specific business scenario node, a response test function of a parent node of the specific business scenario node is modified to update the specific business scenario node of the specific business scenario.
19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 17 are implemented.
20. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 17 are implemented.
Citation Information
Patent Citations
Service approval process configuration method and device, computer equipment and storage medium
CN114186961A
Business data processing method and device, computer equipment and storage medium
CN114265577A
Business logic process development method and device and business logic process implementation method and device
CN115407990A
Business processing system and method, electronic equipment and storage medium
CN116911557A
Automatic processing method, device and equipment for approval business and storage medium
CN117709878A