CN113965563A - Model-based business processing method and device and server - Google Patents
Model-based business processing method and device and server Download PDFInfo
- Publication number
- CN113965563A CN113965563A CN202011511688.1A CN202011511688A CN113965563A CN 113965563 A CN113965563 A CN 113965563A CN 202011511688 A CN202011511688 A CN 202011511688A CN 113965563 A CN113965563 A CN 113965563A
- Authority
- CN
- China
- Prior art keywords
- service
- node
- service processing
- processing
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Telephonic Communication Services (AREA)
Abstract
The application discloses a model-based service processing method, a device and a server, wherein the method comprises the following steps: the forwarding service node acquires a service processing request message of the service terminal through the interface service node, wherein the service processing request message carries a service model identifier; the forwarding service node acquires node information of each service processing service node from the model operation cluster resource pool, and determines a target service processing service node from each service processing service node according to the node information of each service processing service node; the forwarding service node forwards the service processing request message to a target service processing service node; and the forwarding service node receives a service processing result corresponding to the service processing request fed back by the target service processing node, and forwards the service processing result to the service terminal through the interface service node. By the method and the device, the resource utilization rate of the model operation cluster resource pool can be improved, and the service processing efficiency is improved.
Description
Technical Field
The present application relates to the field of network technologies, and in particular, to a method and an apparatus for processing a service based on a model, and a server.
Background
With the continuous increase of service scenes, the models are increased, so that the management of the cluster resource pool operated by the models becomes a key concern. Most of the existing models are that enterprises buy a batch of applications or equipment according to business scenes, and the equipment and resources among the applications are not communicated, so that the resources cannot be dynamically adjusted according to the change of the business scenes. For example, when the existing resources of one application cannot meet the requirement, even if the resources of other applications are idle, an enterprise can only meet the resource requirement of the former application by continuously purchasing new equipment, thereby causing the problems of resource waste and low utilization rate. In addition, an old C-end model system is often used to run a model in the prior art, and since only one node in the system is used to run the model and the node is huge, the situation that the whole system is unavailable due to a single node fault easily occurs.
Disclosure of Invention
The application provides a model-based business processing method and device, a server and a storage medium, which can improve the resource utilization rate of a model operation cluster resource pool and improve the business processing efficiency.
In a first aspect, the present application provides a method for processing a service based on a model, including:
a forwarding service node acquires a service processing request message of a service terminal through an interface service node, wherein the service processing request message carries a service model identifier;
the forwarding service node acquires node information of each service processing service node from a model operation cluster resource pool, and determines a target service processing service node from each service processing service node according to the node information of each service processing service node;
the forwarding service node forwards the service processing request message to the target service processing service node, so as to determine a target service model identified by the service model identifier through the target service processing node and respond to the service processing request of the service processing request message through the target service model;
and the forwarding service node receives a service processing result corresponding to the service processing request fed back by the target service processing node, and forwards the service processing result to the service terminal through the interface service node.
With reference to the first aspect, in a possible implementation manner, the acquiring, by the forwarding service node, a service processing request message of a service terminal through an interface service node includes:
the forwarding service node acquires a service processing request message of a service terminal from a message queue, wherein the service processing request message is generated by an interface service node and is stored in the message queue.
With reference to the first aspect, in a possible implementation manner, the node information of each service processing service node includes a service processing request processing progress of each service processing service node;
the determining a target service processing service node from each service processing service node according to the node information of each service processing service node includes:
and the forwarding service node determines the service processing service node with the fastest service processing request processing progress from all the service processing service nodes as a target service processing service node according to the service processing request processing progress of all the service processing service nodes.
With reference to the first aspect, in a possible implementation manner, the node information of each service processing service node includes configuration information of each service processing service node;
the determining a target service processing service node from each service processing service node according to the node information of each service processing service node includes:
the forwarding service node determines the service processing priority of each service processing service node according to the configuration information of each service processing service node;
and determining the service processing service node with the highest service processing priority in the service processing service nodes as a target service processing service node.
In a second aspect, the present application provides a method for processing a service based on a model, including:
an interface service node receives a service processing request of a service terminal, wherein the service processing request carries a service model identifier, and the service model identifier is used for identifying a target service model responding to the service processing request;
the interface service node generates a service processing request message according to the service processing request, wherein the service processing request message carries the service model identifier;
the interface service node stores the service processing request message into a message queue;
and the interface service node acquires a service processing result output by the target service model responding to the service processing request from the message queue and sends the service processing result to the service terminal.
In a third aspect, the present application provides a method for processing a service based on a model, including:
a service processing service node receives a service processing request message of a service terminal from a forwarding service node, wherein the service processing request message carries a service model identifier;
the service processing service node determines a target service model identified by the service model identification from a plurality of built-in service models, and responds to a service processing request of the service processing request message through the target service model;
and the service processing service node acquires a service processing result corresponding to the service processing request output by the target service model and sends the service processing result to the forwarding service node.
In a fourth aspect, the present application provides a model-based service processing apparatus, including:
the acquisition module is used for acquiring a service processing request message of a service terminal through an interface service node, wherein the service processing request message carries a service model identifier;
the acquisition determining module is used for acquiring node information of each business processing service node from the model operation cluster resource pool, and determining a target business processing service node from each business processing service node according to the node information of each business processing service node;
a forwarding module, configured to forward the service processing request message to the target service processing service node, so as to determine, by the target service processing node, a target service model identified by the service model identifier, and respond to a service processing request of the service processing request message through the target service model;
and a receiving and forwarding module, configured to receive a service processing result corresponding to the service processing request fed back by the target service processing node, and forward the service processing result to the service terminal through the interface service node.
With reference to the fourth aspect, in a possible implementation manner, the obtaining module is configured to obtain a service processing request message of a service terminal from a message queue, where the service processing request message is generated by an interface service node and is stored in the message queue.
With reference to the fourth aspect, in a possible implementation manner, the node information of each service processing service node includes a service processing request processing progress of each service processing service node;
the obtaining and determining module is configured to determine, according to the service processing request processing progress of each service processing service node, a service processing service node with a fastest service processing request processing progress from the service processing service nodes as a target service processing service node.
With reference to the fourth aspect, in a possible implementation manner, the node information of each service processing service node includes configuration information of each service processing service node;
the acquisition determining module is configured to determine a service processing priority of each service processing service node according to the configuration information of each service processing service node; and determining the service processing service node with the highest service processing priority in the service processing service nodes as a target service processing service node.
In a fifth aspect, the present application provides a model-based service processing apparatus, including:
a receiving module, configured to receive a service processing request of a service terminal, where the service processing request carries a service model identifier, and the service model identifier is used to identify a target service model responding to the service processing request;
a generating module, configured to generate a service processing request message according to the service processing request, where the service processing request message carries a service model identifier;
the storage module is used for storing the service processing request message to a message queue;
and the acquisition and sending module is used for acquiring a service processing result output by the target service model responding to the service processing request from the message queue and sending the service processing result to the service terminal.
In a sixth aspect, the present application provides a model-based service processing apparatus, including:
a receiving module, configured to receive a service processing request message of a service terminal from a forwarding service node, where the service processing request message carries a service model identifier;
a determining response module, configured to determine, from multiple built-in service models, a target service model identified by the service model identifier, and respond to a service processing request of the service processing request message through the target service model;
and the sending module is used for obtaining a service processing result corresponding to the service processing request output by the target service model and sending the service processing result to the forwarding service node.
In a seventh aspect, the present application provides a server, including a processor, a memory and a transceiver, where the processor, the memory and the transceiver are connected to each other, where the memory is used to store a computer program that supports the model-based service processing apparatus to execute the model-based service processing method, and the computer program includes program instructions; the processor is configured to invoke the program instructions to execute the model-based business processing method as described in the first to third aspects of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, the computer program comprising program instructions; the program instructions described above, when executed by a processor, cause the processor to perform a method of model-based business processing as described above in the first to third aspects of the present application.
In the application, a forwarding service node acquires a service processing request message of a service terminal through an interface service node, acquires node information of each service processing service node from a model operation cluster resource pool, determines a target service processing service node from each service processing service node according to the node information of each service processing service node, further forwards the service processing request message to the target service processing service node, determines a target service model from a plurality of built-in service models according to a service model identifier carried in the service processing request message through the target service processing service node, and responds to the service processing request of the service processing request message through the target service model. And the forwarding service node receives a service processing result corresponding to the service processing request fed back by the target service processing node, and forwards the service processing result to the service terminal through the interface service node. By the method and the device, the resource utilization rate of the model operation cluster resource pool can be improved, and the service processing efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a schematic diagram of an architecture of a business processing system provided by the present application;
FIG. 2 is a flow diagram of a model-based business process method provided herein;
FIG. 3a is another schematic flow chart diagram of the model-based business processing method provided in the present application;
FIG. 3b is another schematic flow chart diagram of the model-based business processing method provided herein;
FIG. 4 is a schematic diagram of a model-based business processing apparatus provided herein;
FIG. 5 is a schematic diagram of another structure of a model-based business processing apparatus provided in the present application;
FIG. 6 is a schematic diagram of another structure of the model-based business processing apparatus provided in the present application;
fig. 7 is a schematic structural diagram of a server provided in the present application.
Detailed Description
The technical solutions in the present application will be described clearly and completely with reference to the accompanying drawings in the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The application provides a model-based service processing method, a forwarding service node acquires a service processing request message of a service terminal through an interface service node, acquires node information of each service processing service node from a model operation cluster resource pool, determines a target service processing service node from each service processing service node according to the node information of each service processing service node, and forwards the service processing request message to the target service processing service node, so that the target service processing node determines a target service model identified by a service model identifier carried in the service processing request message, responds to the service processing request of the service processing request message through the target service model, receives a service processing result corresponding to the service processing request fed back by the target service processing node, and forwards the service processing result to the service terminal through the interface service node, therefore, the condition that the whole system is unavailable due to the fault of a single node is avoided, and the resource utilization rate of the model operation cluster resource pool is improved.
The model-based service processing method provided by the application can be applied to a service processing system, and the system can include a service terminal, an interface service node, a message queue, a forwarding service node, a model operation cluster resource pool, a monitoring service node and a service processing service node cluster, please refer to fig. 1, which is a schematic diagram of the architecture of the service processing system provided by the application. As shown in fig. 1, the architecture diagram includes a service terminal 100, an interface service node 101, a message queue 102, a forwarding service node 103, a model running cluster resource pool 104, a monitoring service node 105, and a service processing service node cluster 106, where the service processing service node cluster 106 may include multiple service processing service nodes, as shown in fig. 1, specifically include a service processing service node 106a, a service processing service node 106b, service processing service nodes 106c and …, and a service processing service node 106n, and a target service processing service node may be one service processing service node in the service processing service node cluster 106, and the service processing service node 106a in fig. 1 is used as a target service processing service node for description in this application.
Each service processing service node in the service terminal 100, the interface service node 101, the forwarding service node 103, the monitoring service node 105 and the service processing service node cluster 106 may be a computer device, including a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a mobile internet device (MID, mobile internet device), a Point Of Sale (POS) machine, a wearable device (e.g., a smart watch, a smart bracelet, etc.), and the like.
In the model-based service processing method provided by the present application, the service terminal 100 sends a service processing request to the interface service node 101, where the service processing request carries a service model identifier, and the interface service node 101 generates a service processing request message according to the received service processing request, and sends the service processing request message and its associated message topic (e.g., service processing request topic) to the message queue 102 for storage. Then, the forwarding service node 103 obtains the service processing request message whose message topic is the service processing request topic from the message queue 102, and obtains the node information of each service processing service node in the service processing service node cluster 106 from the model operating cluster resource pool 104, and further determines a target service processing service node 106a from each service processing service node based on the node information of each service processing service node, and forwards the service processing request message to the target service processing service node 106 a. The target service processing service node 106a determines a target service model from the built-in multiple service models according to the service model identifier carried in the received service processing request message, and responds to the service processing request of the service processing request message through the target service model. The target service processing service node 106a obtains a service processing result corresponding to the service processing request output by the target service model, and sends the service processing result to the forwarding service node 103. The forwarding service node 103 sends the received business processing result and its associated message topic (such as business processing result topic) to the message queue 102 for storage. Then, the interface service node 101 obtains a service processing result whose message topic is a service processing result topic from the message queue 102, and sends the service processing result to the service terminal 100.
The improved model-based business processing method and apparatus of the present application will be described with reference to fig. 2 to 7.
Referring to fig. 2, it is a flow chart of the model-based business processing method provided in the present application. As shown in fig. 2, the method provided by the present application may be applied to a forwarding service node, and the method includes the following steps:
s101, the forwarding service node obtains the service processing request message of the service terminal through the interface service node.
In some possible embodiments, before performing step S101, the service terminal sends a service processing request to the interface service node, and the interface service node generates a service processing request message according to the received service processing request, and sends the service processing request message and its associated message topic (e.g., service processing request topic) to the message queue for storage. The forwarding service node may obtain the service processing request message whose message topic is the service processing request topic from the message queue.
S102, the forwarding service node obtains node information of each service processing service node from the model operation cluster resource pool, and determines a target service processing service node from each service processing service node according to the node information of each service processing service node.
The model operation cluster resource pool can be a zookeeper cluster and is used for storing node information of each service processing service node in the application; each business processing service node is internally provided with a plurality of business models; the node information of each service processing service node may include a service processing request processing progress of each service processing service node.
In some feasible embodiments, the forwarding service node obtains the service processing request processing progress of each service processing service node from the zookeeper cluster, and determines the service processing service node with the fastest service processing request processing progress in each service processing service node as the target service processing service node according to the service processing request processing progress of each service processing service node.
The service processing request processing progress of each service processing service node in the zookeeper cluster can be obtained through the following modes: the forwarding service node may determine a service processing request processing progress (N/N) × 100% for each service processing service node according to the total number N of the service processing request messages forwarded to each service processing service node and the number N of the received service processing results fed back by each service processing service node every a first preset time period (e.g., 5 minutes), and send the service processing request processing progress of the service processing service node to the Zookeeper cluster. Meanwhile, the monitoring service node can send node state determination information to each service processing service node in the Zookeeper cluster every second preset time period, and if the monitoring service node receives node state feedback information returned by the service processing service node m within a preset time period, the node working state of the service processing service node m is determined to be a normal state; if the monitoring service node does not receive the node state feedback information returned by the service processing service node m within the preset time length, the node state determination information is repeatedly sent to the service processing service node m, and if the repeated sending times reach the preset repeated times (such as 3 times), the monitoring service node still does not receive the node state feedback information returned by the service processing service node m, the node working state of the service processing service node m is determined to be an abnormal state. After determining the node working state of each node, the monitoring service reports the node identifier of the service processing service node with the normal node working state to the Zookeeper cluster. The Zookeeper cluster receives the processing progress of the service processing request of each service processing service node sent by the forwarding service, and monitors the node identification of the service processing service node of which the working state of the node sent by the forwarding service is a normal state, so as to obtain the node information of at least one service processing service node (available service processing service node).
Here, when the monitoring service node does not receive the node state feedback information returned by the service processing service node within the preset time, a retry mechanism is adopted to send the node state determination information to the service processing node that does not normally return the node state feedback information within the preset time, thereby ensuring that each service processing service node can receive the node state determination information.
S103, the forwarding service node forwards the service processing request message to the target service processing service node.
In some feasible embodiments, the forwarding service node forwards the service processing request message to the target service processing service node, and after receiving the service processing request message, the target service processing service node determines a target service model identified by the service model identification from a plurality of built-in service models according to the service model identification carried in the service processing request message, and responds to the service processing request of the service processing request message through the target service model. And then, the target service processing service node acquires a service processing result corresponding to the service processing request and returns the service processing result to the forwarding service node.
And S104, the forwarding service node receives the service processing result corresponding to the service processing request fed back by the target service processing node, and forwards the service processing result to the service terminal through the interface service node.
In some possible embodiments, the forwarding service node receives a service processing result corresponding to the service processing request fed back by the target service processing node, and sends the service processing result and a message topic (such as a service processing result topic) associated with the service processing result to the message queue for storage. And then, the interface service node acquires the service processing result with the message topic as the service processing result topic from the message queue and sends the service processing result to the service terminal.
In the application, the forwarding service node obtains a service processing request message of a service terminal through an interface service node, obtains node information of each service processing service node from a model operation cluster resource pool, determines a target service processing service node from each service processing service node according to the node information of each service processing service node, and forwards the service processing request message to the target service processing service node, so that the target service processing node determines a target service model identified by a service model identifier carried in the service processing request message, and responds to the service processing request of the service processing request message through the target service model, the forwarding service node receives a service processing result corresponding to the service processing request fed back by the target service processing node, and forwards the service processing result to the service terminal through the interface service node, therefore, the condition that the whole system is unavailable due to the fault of a single node is avoided, and the resource utilization rate of the model operation cluster resource pool is improved.
For convenience of description, the following describes, with reference to fig. 3a, an example of obtaining configuration information of available service processing service nodes in a cluster resource pool operated by a model in the model-based service processing method provided in this embodiment of the present application. Please refer to fig. 3a, which is another flow chart of the model-based business processing method provided in the present application. As shown in fig. 3a, the method provided by the present application may include the following steps:
s201, the monitoring service node sends a node configuration information acquisition request to the service processing service node.
In some possible embodiments, the traffic processing service node may be each traffic processing service node in a cluster of traffic processing service nodes. The monitoring service node may send a node configuration information acquisition request to each service processing service node in the service processing service node cluster at regular time (e.g., every 1 minute) to trigger each service processing service node to feed back its configuration information.
S202, the service processing service node sends the configuration information of the available service processing service node to the monitoring service node.
In some feasible embodiments, any service processing service node (assumed to be a service processing service node m) in the service processing service node cluster within a preset time period may return node configuration information to the monitoring service node according to a node configuration information acquisition request issued by the monitoring service node, and the monitoring service node receives the configuration information of the service processing service node m, and at this time, the monitoring service node may determine the service processing service node m as an available service processing service node. If the monitoring service node does not receive the node configuration information returned by a certain service processing service node (such as the service processing service node n) within the preset time length, the node configuration information acquisition request can be sent to the service processing service node n again. If the number of times of sending the node configuration information acquisition request to the service processing service node n reaches a preset repetition number (for example, 3 times), and the monitoring service node still does not receive the node configuration information returned by the service processing service node n, the service processing service node n is determined as an unavailable service processing service node.
Here, when the monitoring service node does not receive the configuration information returned by the service processing request node within the preset time, a retry mechanism is adopted to send a node configuration information acquisition request to the service processing node that does not return the configuration information within the preset time, thereby ensuring that each service processing service node can receive the node configuration information acquisition request sent by the monitoring service node.
S203, the monitoring service node sends configuration information of the available service processing service node to the model operation cluster resource pool.
In some possible embodiments, after determining the available business processing service nodes in the Zookeeper cluster, the monitoring service node may send configuration information of each available business processing service node to the Zookeeper cluster.
In the application, the monitoring service node can regularly send a node configuration information acquisition request to each service processing service node in the service processing service node cluster, determine the service processing service node returning the node configuration information as an available service processing service node, and send the configuration information of the available service processing service node to the Zookeeper cluster, thereby ensuring that all the nodes storing the node configuration information in the Zookeeper cluster are available service processing service nodes.
Next, the present application introduces a model-based business processing method based on a condition that the model-based operation cluster resource pool stores configuration information of available business processing service nodes. Please refer to fig. 3b, which is another flow chart of the model-based business processing method provided in the present application. As shown in fig. 3b, the method provided by the present application may include the following steps:
s204, the service terminal sends a service processing request to the interface service node.
In some possible embodiments, the service terminal sends a service processing request to the interface service node, where the service processing request carries a service model identifier, and the service model identifier is used to identify a target service model for responding to the service processing request, thereby improving the efficiency and accuracy of processing the service processing request.
S205, the interface service node generates a service processing request message according to the service processing request.
In some possible embodiments, the interface service node receives a service processing request sent by a service terminal, generates a service processing request message according to the service processing request, and determines a message topic associated with the service processing request message, such as a service processing request topic. Here, the service processing request topic may be a topic agreed by a protocol between a message producer (such as an interface service node) and a message consumer (such as a forwarding service node), or a topic generated by the message producer and then shared to the message consumer, or a topic generated by the message consumer and then shared to the message producer, and may be determined according to an actual application scenario, which is not limited herein.
S206, the interface service node sends the service processing request message to the message queue.
In some possible embodiments, after the interface service node generates the service processing request message, the service processing request message and the associated message topic thereof may be sent to the message queue for storage.
S207, the forwarding service node obtains the service processing request message from the message queue.
In some possible embodiments, the forwarding service node obtains a service processing request message whose message topic is a service processing request topic from the message queue to obtain a service processing request message that is sent by the interface service node and stored in the message queue.
S208, the forwarding service node obtains the configuration information of the available service processing service node from the model operation cluster resource pool.
In some feasible embodiments, the forwarding service node sends a configuration information acquisition request of the available service processing service node to the Zookeeper cluster, and the Zookeeper cluster returns the configuration information of the available service processing service node to the forwarding service node according to the configuration information acquisition request of the available service processing service node.
S209, the forwarding service node determines the target service processing service node.
In some possible embodiments, the forwarding service node may determine the service processing priority of each available service processing service node according to the configuration information of the available service processing service node, and determine an available service processing service node with the highest service processing priority among the available service processing service nodes as the target service processing service node.
Specifically, if the configuration information of each available service processing service node is basically consistent, the forwarding service node can randomly determine the service processing priority of each available service processing service node and make the service processing request quota of each available service processing service node the same; if the configuration information of each available service processing service node is inconsistent, the forwarding service node determines the service processing priority of each available service processing service node according to the principle that the higher the configuration information is, the higher the service processing priority is, and determines the service processing request quota of each available service processing service node according to the principle that the higher the configuration information is, the higher the service processing request quota is. If the service processing request amount of the available service processing service node with the highest service processing priority is larger than 0, determining the available service processing service node with the highest service processing priority as a target service processing service node; and if the service processing request quota of the available service processing service node with the highest service processing priority is equal to 0, determining the available service processing service node with the second service processing priority as the target service processing service node in all the available service processing service nodes which are sequenced from high to low according to the service processing priorities.
It can be understood that, if the configuration information of each available service processing service node is basically consistent, the forwarding service node may determine a target service processing service node from each available service processing service node according to a sequential polling policy; if the configuration information of each available service processing service node is not consistent, the forwarding service node may determine a target service processing service node from each available service processing service node according to a weighted polling policy (the higher the configuration information of the node is, the higher the service processing priority is). In other words, the forwarding service node determines a target service processing service node from all available service processing service nodes according to the load balancing policy, so that the target service processing service node processes the service processing request, the resource utilization rate of the service processing service node cluster can be improved to the maximum extent, and the average idle time of all nodes is guaranteed to be the shortest.
S210, the forwarding service node sends a service processing request message to the target service processing service node.
S211, the target service processing service node determines a target service model, responds to the service processing request through the target service model, and obtains a service processing result corresponding to the service processing request.
In some possible embodiments, the target service processing service node receives a service processing request message sent by the forwarding service node, where the service processing request message carries a service model identifier, model input data, and model operating parameters. And the target business processing service node determines a target business model identified by the business model identification from a plurality of built-in business models according to the business model identification, inputs model input data and model operation parameters into the target business model, operates the target business model according to the model input data and the model operation parameters, outputs a business processing result corresponding to the business processing request of the business processing request message, and acquires the business processing result.
The target business processing service node can quickly determine the target business model from the built-in multiple business models according to the business model identification, and then responds the business processing request through the target business model, so that the processing efficiency of the business processing request is improved. In addition, the target service processing service node can determine the target service model meeting different service requirements according to different service scenes, and the applicability is strong.
S212, the target service processing service node sends the service processing result to the forwarding service node.
S213, the forwarding service node sends the service processing result to the message queue.
Specifically, the forwarding service node receives a service processing result sent by the target service processing service node, and sends the service processing result and a message topic (such as a service processing result topic) associated with the service processing result to the message queue for storage.
In addition, if the forwarding service node does not receive the service processing result returned by the target service processing service node within the first preset time after sending the service processing request message to the target service processing service node, step S210 is executed, if the service processing result returned by the target service processing service node is not received within the first preset time, step S210 is repeatedly executed, if the service processing result returned by the target service processing service node is not received within the second preset time, step S210 is continuously repeated until the retry number reaches the preset number, for example, three times. The first preset time period and the second preset time period may be equal to each other, or may be in a direct relationship, and the like, which is not limited herein.
Here, when the forwarding service node does not receive the service processing result returned by the target service processing service node within the first preset time, the forwarding service node sends the service processing request message to the target service processing service node by using a retry mechanism, thereby ensuring that the target service processing service node can receive the service processing request message, and further ensuring that the service processing request of the service processing request message can be processed and completed by the target service processing service node.
S214, the interface service node obtains the service processing result from the message queue.
Specifically, the interface service node obtains a service processing result with a message topic as a service processing result topic from the message queue.
S215, the interface service node sends the service processing result to the service terminal.
In the application, after receiving a service processing request sent by a service terminal, an interface service node sends a service processing request message generated according to the service processing request to a message queue to notify the service terminal, so that a processing result does not need to be waited in real time, the time-consuming duration of one request is shortened, and the concurrency efficiency is improved. And then, the forwarding service node acquires the service processing request message from the message queue, and the safety of the service processing service node is ensured because the forwarding service node and the interface service node are isolated by the message queue, so that the memory overflow caused by a large number of instantaneous requests can be avoided. Further, the forwarding service node acquires configuration information of each available service processing service node from the Zookeeper cluster, determines a target service processing service node from each available service processing service node according to the configuration information of each available service processing service node by adopting a load balancing strategy, and forwards a service processing request message to the target service processing service node so as to process a service processing request of the service processing request message through the target service processing service node, thereby improving the resource utilization rate of the model operation cluster resource pool, shortening the overall time consumption of the service processing service node cluster for processing the service processing request, and improving the service processing efficiency.
Based on the description of the above method embodiment, the present application also provides a model-based service processing apparatus, which may be a forwarding service node in the above method embodiment. Please refer to fig. 4, which is a schematic structural diagram of the model-based service processing apparatus provided in the present application. As shown in fig. 4, the model-based service processing apparatus 4 may include: an acquisition module 41, an acquisition determination module 42, a forwarding module 43, and a receiving forwarding module 44.
An obtaining module 41, configured to obtain, through an interface service node, a service processing request message of a service terminal, where the service processing request message carries a service model identifier;
an obtaining and determining module 42, configured to obtain node information of each service processing service node from a model operating cluster resource pool, and determine a target service processing service node from each service processing service node according to the node information of each service processing service node;
a forwarding module 43, configured to forward the service processing request message to the target service processing service node, so as to determine, by the target service processing node, a target service model identified by the service model identifier, and respond to a service processing request of the service processing request message through the target service model;
a receiving and forwarding module 44, configured to receive a service processing result corresponding to the service processing request fed back by the target service processing node, and forward the service processing result to the service terminal through the interface service node.
In a possible implementation manner, the obtaining module 41 is configured to obtain a service processing request message of a service terminal from a message queue, where the service processing request message is generated by an interface service node and is stored in the message queue.
In a possible implementation manner, the node information of each service processing service node includes a service processing request processing progress of each service processing service node;
the obtaining and determining module 42 is configured to determine, according to the service processing request processing progress of each service processing service node, a service processing service node with a fastest service processing request processing progress from the service processing service nodes as a target service processing service node.
In a possible implementation manner, the node information of each service processing service node includes configuration information of each service processing service node;
the obtaining and determining module 42 is configured to determine a service processing priority of each service processing service node according to the configuration information of each service processing service node; and determining the service processing service node with the highest service processing priority in the service processing service nodes as a target service processing service node.
It will be appreciated that the model-based traffic handling apparatus 4 is used to implement the steps performed by the forwarding service node in the embodiments of fig. 2 and 3 a-3 b. As to specific implementation manners and corresponding advantageous effects of the functional blocks included in the model-based service processing apparatus 4 of fig. 4, reference may be made to the specific descriptions of the embodiments of fig. 2 and fig. 3a to fig. 3b, which are not described herein again.
Based on the description of the above method embodiment, the present application also provides a model-based service processing apparatus, which may be an interface service node in the above method embodiment. Please refer to fig. 5, which is a schematic diagram of another structure of the model-based service processing apparatus provided in the present application. As shown in fig. 5, the model-based service processing apparatus 5 may include: a receiving module 51, a generating module 52, a storing module 53 and an acquiring and sending module 54.
A receiving module 51, configured to receive a service processing request of a service terminal, where the service processing request carries a service model identifier, and the service model identifier is used to identify a target service model responding to the service processing request;
a generating module 52, configured to generate a service processing request message according to the service processing request, where the service processing request message carries a service model identifier;
a storage module 53, configured to store the service processing request message in a message queue;
and an obtaining and sending module 54, configured to obtain, from the message queue, a service processing result that is output by the target service model in response to the service processing request, and send the service processing result to the service terminal.
It will be appreciated that the model-based traffic handling apparatus 5 is arranged to implement the steps performed by the interface service node in the embodiments of fig. 2 and 3 a-3 b. As to the specific implementation manner and corresponding advantageous effects of the functional blocks included in the model-based service processing apparatus 5 of fig. 5, reference may be made to the specific descriptions of the embodiments of fig. 2 and fig. 3a to fig. 3b, which are not repeated herein.
Based on the description of the above method embodiment, the present application also provides a model-based service processing apparatus, which may be a target service processing service node in the above method embodiment. Fig. 6 is a schematic diagram of another structure of the model-based service processing apparatus provided in the present application. As shown in fig. 6, the model-based service processing apparatus 6 may include: a receiving module 61, a determination response module 62 and a sending module 63.
A receiving module 61, configured to receive a service processing request message of a service terminal from a forwarding service node, where the service processing request message carries a service model identifier;
a determining response module 62, configured to determine, from multiple built-in business models, a target business model identified by the business model identifier, and respond to a business processing request of the business processing request message through the target business model;
a sending module 63, configured to obtain a service processing result corresponding to the service processing request output by the target service model, and send the service processing result to the forwarding service node.
It will be appreciated that the model-based traffic processing apparatus 6 is arranged to implement the steps performed by the target traffic processing service node in the embodiments of figures 2 and 3 a-3 b. As to the specific implementation manner and corresponding advantageous effects of the functional blocks included in the model-based service processing apparatus 6 of fig. 6, reference may be made to the specific descriptions of the embodiments of fig. 2 and fig. 3a to fig. 3b, which are not repeated herein.
The model-based service processing apparatus in the embodiments shown in fig. 4 to 6 can be implemented by the server 700 shown in fig. 7, and the model-based service processing apparatus can be operated in the server. Please refer to fig. 7, which is a schematic structural diagram of a server provided in the present application. As shown in fig. 7, the server 700 may include: one or more processors 701, a memory 702, and a transceiver 703. The processor 701, the memory 702, and the transceiver 703 are connected by a bus 704. The transceiver 703 is configured to receive or transmit data, and the memory 702 is configured to store a computer program, where the computer program includes program instructions;
optionally, the processor 701 is configured to execute the program instructions executed by the forwarding service node stored in the memory 702, and perform the following operations:
acquiring a service processing request message of a service terminal through an interface service node, wherein the service processing request message carries a service model identifier;
acquiring node information of each service processing service node from a model operation cluster resource pool, and determining a target service processing service node from each service processing service node according to the node information of each service processing service node;
forwarding the service processing request message to the target service processing service node, so as to determine a target service model identified by the service model identifier through the target service processing node and respond to a service processing request of the service processing request message through the target service model;
and receiving a service processing result corresponding to the service processing request fed back by the target service processing node, and forwarding the service processing result to the service terminal through the interface service node.
In some possible embodiments, the processor 701 obtains a service processing request message of a service terminal through an interface service node, and specifically performs the following operations:
and acquiring a service processing request message of a service terminal from a message queue, wherein the service processing request message is generated by an interface service node and is stored in the message queue.
In some possible embodiments, the node information of each service processing service node includes a service processing request processing progress of each service processing service node;
the processor 701 determines a target service processing service node from the service processing service nodes according to the node information of each service processing service node, and specifically performs the following operations:
and determining the service processing service node with the fastest service processing request processing progress from the service processing service nodes as a target service processing service node according to the service processing request processing progress of each service processing service node.
In some possible embodiments, the node information of each service processing service node includes configuration information of each service processing service node;
the processor 701 determines a target service processing service node from the service processing service nodes according to the node information of each service processing service node, and specifically performs the following operations:
determining the service processing priority of each service processing service node according to the configuration information of each service processing service node;
and determining the service processing service node with the highest service processing priority in the service processing service nodes as a target service processing service node.
Optionally, the processor 701 is configured to execute the program instructions executed by the interface service node stored in the memory 702, and perform the following operations:
receiving a service processing request of a service terminal, wherein the service processing request carries a service model identifier, and the service model identifier is used for identifying a target service model responding to the service processing request;
generating a service processing request message according to the service processing request, wherein the service processing request message carries the service model identifier;
storing the service processing request message to a message queue;
and acquiring a service processing result output by the target service model responding to the service processing request from the message queue, and sending the service processing result to the service terminal.
Optionally, the processor 701 is configured to execute the program instructions executed by the service processing node stored in the memory 702, and perform the following operations:
receiving a service processing request message of a service terminal from a forwarding service node, wherein the service processing request message carries a service model identifier;
determining a target business model identified by the business model identification from a plurality of built-in business models, and responding to the business processing request of the business processing request message through the target business model;
and acquiring a service processing result corresponding to the service processing request output by the target service model, and sending the service processing result to the forwarding service node.
Further, here, it is to be noted that: the present application further provides a computer-readable storage medium, where a computer program executed by the model-based service processing apparatus in the embodiment shown in fig. 4 to fig. 6 is stored in the computer-readable storage medium, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the model-based service processing method in the embodiment corresponding to fig. 2 or fig. 3a to fig. 3b can be executed, so that details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application. As an example, program instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network, which may comprise a block chain system.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The method and the related device provided by the application are described by referring to the method flow chart and/or the structure schematic diagram provided by the application, and each flow and/or block of the method flow chart and/or the structure schematic diagram and the combination of the flow and/or block in the flow chart and/or the block diagram can be realized by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block or blocks.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.
Claims (10)
1. A business processing method based on a model is characterized by comprising the following steps:
a forwarding service node acquires a service processing request message of a service terminal through an interface service node, wherein the service processing request message carries a service model identifier;
the forwarding service node acquires node information of each service processing service node from a model operation cluster resource pool, and determines a target service processing service node from each service processing service node according to the node information of each service processing service node;
the forwarding service node forwards the service processing request message to the target service processing service node, so as to determine a target service model identified by the service model identifier through the target service processing node and respond to a service processing request of the service processing request message through the target service model;
and the forwarding service node receives a service processing result corresponding to the service processing request fed back by the target service processing node, and forwards the service processing result to the service terminal through the interface service node.
2. The method of claim 1, wherein the forwarding service node obtains the service processing request message of the service terminal through the interface service node, and comprises:
the forwarding service node acquires a service processing request message of a service terminal from a message queue, wherein the service processing request message is generated by an interface service node and is stored in the message queue.
3. The method according to claim 1 or 2, wherein the node information of each service processing service node comprises a service processing request processing progress of each service processing service node;
the determining a target service processing service node from each service processing service node according to the node information of each service processing service node includes:
and the forwarding service node determines the service processing service node with the fastest service processing request processing progress from all the service processing service nodes as a target service processing service node according to the service processing request processing progress of all the service processing service nodes.
4. The method according to claim 1 or 2, wherein the node information of each traffic processing service node comprises configuration information of each traffic processing service node;
the determining a target service processing service node from each service processing service node according to the node information of each service processing service node includes:
the forwarding service node determines the service processing priority of each service processing service node according to the configuration information of each service processing service node;
and determining the service processing service node with the highest service processing priority in all the service processing service nodes as a target service processing service node.
5. A business processing method based on a model is characterized by comprising the following steps:
an interface service node receives a service processing request of a service terminal, wherein the service processing request carries a service model identifier, and the service model identifier is used for identifying a target service model responding to the service processing request;
the interface service node generates a service processing request message according to the service processing request, wherein the service processing request message carries the service model identification;
the interface service node stores the service processing request message to a message queue;
and the interface service node acquires a service processing result output by the target service model responding to the service processing request from the message queue and sends the service processing result to the service terminal.
6. A business processing method based on a model is characterized by comprising the following steps:
a service processing service node receives a service processing request message of a service terminal from a forwarding service node, wherein the service processing request message carries a service model identifier;
the service processing service node determines a target service model identified by the service model identification from a plurality of built-in service models, and responds to a service processing request of the service processing request message through the target service model;
and the service processing service node acquires a service processing result corresponding to the service processing request output by the target service model and sends the service processing result to the forwarding service node.
7. A model-based transaction processing apparatus, comprising:
the system comprises an acquisition module, a service model identification module and a service model identification module, wherein the acquisition module is used for acquiring a service processing request message of a service terminal through an interface service node, and the service processing request message carries the service model identification;
the acquisition determining module is used for acquiring node information of each business processing service node from a model operation cluster resource pool, and determining a target business processing service node from each business processing service node according to the node information of each business processing service node;
a forwarding module, configured to forward the service processing request message to the target service processing service node, so as to determine, by the target service processing node, a target service model identified by the service model identifier and respond to a service processing request of the service processing request message through the target service model;
and the receiving and forwarding module is used for receiving a service processing result corresponding to the service processing request fed back by the target service processing node and forwarding the service processing result to the service terminal through the interface service node.
8. A model-based transaction processing apparatus, comprising:
the system comprises a receiving module, a service processing module and a service processing module, wherein the receiving module is used for receiving a service processing request of a service terminal, the service processing request carries a service model identifier, and the service model identifier is used for identifying a target service model responding to the service processing request;
the generating module is used for generating a service processing request message according to the service processing request, wherein the service processing request message carries a service model identifier;
the storage module is used for storing the service processing request message to a message queue;
and the acquisition and sending module is used for acquiring a service processing result output by the target service model responding to the service processing request from the message queue and sending the service processing result to the service terminal.
9. A model-based transaction processing apparatus, comprising:
a receiving module, configured to receive a service processing request message of a service terminal from a forwarding service node, where the service processing request message carries a service model identifier;
the determining response module is used for determining a target business model identified by the business model identification from a plurality of built-in business models and responding a business processing request of the business processing request message through the target business model;
and the sending module is used for acquiring a service processing result corresponding to the service processing request output by the target service model and sending the service processing result to the forwarding service node.
10. A server, comprising a processor, a memory and a transceiver, the processor, the memory and the transceiver being interconnected, wherein the transceiver is configured to receive or transmit data, the memory is configured to store program code, and the processor is configured to invoke the program code to perform the method of any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011511688.1A CN113965563B (en) | 2020-12-18 | 2020-12-18 | Service processing method and device based on model and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011511688.1A CN113965563B (en) | 2020-12-18 | 2020-12-18 | Service processing method and device based on model and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113965563A true CN113965563A (en) | 2022-01-21 |
CN113965563B CN113965563B (en) | 2023-09-26 |
Family
ID=79460097
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011511688.1A Active CN113965563B (en) | 2020-12-18 | 2020-12-18 | Service processing method and device based on model and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113965563B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115174472A (en) * | 2022-07-18 | 2022-10-11 | 天翼云科技有限公司 | Message forwarding processing method and related device |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107784400A (en) * | 2016-08-24 | 2018-03-09 | 北京京东尚科信息技术有限公司 | A kind of execution method and apparatus of business model |
CN108366086A (en) * | 2017-12-25 | 2018-08-03 | 聚好看科技股份有限公司 | A kind of method and device of control business processing |
CN108961071A (en) * | 2018-06-01 | 2018-12-07 | 中国平安人寿保险股份有限公司 | The method and terminal device of automatic Prediction composite service income |
CN109739654A (en) * | 2018-08-10 | 2019-05-10 | 比亚迪股份有限公司 | Message-oriented middleware and method for message transmission |
US20190253517A1 (en) * | 2018-02-13 | 2019-08-15 | International Business Machines Corporation | Conversational agent learning model service selection to address a client service request |
CN110351342A (en) * | 2019-06-20 | 2019-10-18 | 平安科技(深圳)有限公司 | Service order processing method, device, computer equipment and storage medium |
CN110493190A (en) * | 2019-07-15 | 2019-11-22 | 平安科技(深圳)有限公司 | Processing method, device, computer equipment and the storage medium of data information |
CN110515731A (en) * | 2019-08-22 | 2019-11-29 | 北京浪潮数据技术有限公司 | A kind of data processing method, apparatus and system |
-
2020
- 2020-12-18 CN CN202011511688.1A patent/CN113965563B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107784400A (en) * | 2016-08-24 | 2018-03-09 | 北京京东尚科信息技术有限公司 | A kind of execution method and apparatus of business model |
CN108366086A (en) * | 2017-12-25 | 2018-08-03 | 聚好看科技股份有限公司 | A kind of method and device of control business processing |
US20190253517A1 (en) * | 2018-02-13 | 2019-08-15 | International Business Machines Corporation | Conversational agent learning model service selection to address a client service request |
CN108961071A (en) * | 2018-06-01 | 2018-12-07 | 中国平安人寿保险股份有限公司 | The method and terminal device of automatic Prediction composite service income |
CN109739654A (en) * | 2018-08-10 | 2019-05-10 | 比亚迪股份有限公司 | Message-oriented middleware and method for message transmission |
CN110351342A (en) * | 2019-06-20 | 2019-10-18 | 平安科技(深圳)有限公司 | Service order processing method, device, computer equipment and storage medium |
CN110493190A (en) * | 2019-07-15 | 2019-11-22 | 平安科技(深圳)有限公司 | Processing method, device, computer equipment and the storage medium of data information |
CN110515731A (en) * | 2019-08-22 | 2019-11-29 | 北京浪潮数据技术有限公司 | A kind of data processing method, apparatus and system |
Non-Patent Citations (1)
Title |
---|
欧海文;曾淑娟;: "基于数据标识的跨域增量数据交换模型", 北京电子科技学院学报, no. 04 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115174472A (en) * | 2022-07-18 | 2022-10-11 | 天翼云科技有限公司 | Message forwarding processing method and related device |
CN115174472B (en) * | 2022-07-18 | 2024-01-02 | 天翼云科技有限公司 | Message forwarding processing method and related device |
Also Published As
Publication number | Publication date |
---|---|
CN113965563B (en) | 2023-09-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3637733B1 (en) | Load balancing engine, client, distributed computing system, and load balancing method | |
US10977077B2 (en) | Computing node job assignment for distribution of scheduling operations | |
CN112099935B (en) | Task processing method and device | |
CN112579304A (en) | Resource scheduling method, device, equipment and medium based on distributed platform | |
CN109254854A (en) | Asynchronous invoking method, computer installation and storage medium | |
CN113468025A (en) | Data warning method, system, device and storage medium | |
CN111464352A (en) | Call link data processing method and device | |
CN114237852A (en) | Task scheduling method, device, server and storage medium | |
CN110751458A (en) | Business approval method, device and system | |
CN113965563B (en) | Service processing method and device based on model and server | |
CN113608751B (en) | Operation method, device and equipment of reasoning service platform and storage medium | |
CN110071952B (en) | Service call quantity control method and device | |
CN111835809B (en) | Work order message distribution method, work order message distribution device, server and storage medium | |
CN113656239A (en) | Monitoring method and device for middleware and computer program product | |
CN109308219B (en) | Task processing method and device and distributed computer system | |
CN111367680A (en) | Job task allocation method, device, server, system and storage medium | |
CN112925623A (en) | Task processing method and device, electronic equipment and medium | |
CN116719632B (en) | Task scheduling method, device, equipment and medium | |
CN117130873B (en) | Task monitoring method and device | |
CN117076057B (en) | AI service request scheduling method, device, equipment and medium | |
CN117857465B (en) | Data processing method, device, equipment, storage medium and program product | |
CN118210667A (en) | Inspection task execution method, inspection task execution device and storage medium | |
CN117998310A (en) | Short message routing method and device | |
CN118802690A (en) | Data routing method, device, electronic equipment and storage medium | |
CN114281525A (en) | Transaction task asynchronous deletion method, device, equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |