Service request processing method, device and system, and service configuration method and device
By decoupling the algorithm model and business logic of configuration files, and dynamically configuring the business interface and identification information, the problem of rewriting code in the existing technology changes in algorithm models is solved, and the effect of reducing development costs and improving business processing efficiency is achieved.
Patent Information
- Application Number
- CN202010131356.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-28
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-02-28
AI Technical Summary
In the prior art, the algorithm model is coupled with business logic, causing the algorithm model corresponding to the business to change and need to rewrite the code, which increases development costs and reduces business processing efficiency.
The business interface and identification information are obtained through the configuration file, stored in the configuration database, decoupling the algorithm model and business logic, realizing dynamic configuration, receiving business requests, and calling the algorithm model in the corresponding container based on the identification information, and feedback the calculation results.
No need to redevelop code can deal with algorithm model changes, reduce development costs, improve business request processing efficiency, and realize dynamic configuration and efficient processing of business.
Smart Images

Figure CN113326060B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a service request processing method, device and system, and a service configuration method and device. Background Art
[0002] Algorithm models are widely used in various business processing processes.
[0003] In the prior art, the algorithm model is coupled with the business logic. When the algorithm model corresponding to the business changes, the developer needs to rewrite the code. Summary of the invention
[0004] In view of this, the embodiments of the present invention provide a business request processing method, device and system, and a business configuration method and device, which can decouple the algorithm model and business logic, reduce development costs, and improve business processing efficiency.
[0005] In a first aspect, an embodiment of the present invention provides a service configuration method, including:
[0006] Get the business configuration file;
[0007] According to the configuration file, determine the interface of the service and the identification information corresponding to the interface; wherein the interface includes: the identification of the container; the algorithm model is deployed in the container;
[0008] The interface and the identification information are stored in a configuration database in correspondence.
[0009] Preferably,
[0010] The configuration file for obtaining the service includes:
[0011] Monitor the service discovery system;
[0012] If the configuration file in the service discovery system is changed, the configuration file is obtained from the service discovery system.
[0013] Preferably,
[0014] The determining, according to the configuration file, the interface of the service and the identification information corresponding to the interface includes:
[0015] Parsing the configuration file to obtain the identification information and the operation flow information and operation unit information corresponding to the identification information;
[0016] Creating an operation unit according to the operation unit information; wherein the operation unit includes: an identifier of the container;
[0017] The operation unit is encapsulated into the interface according to the operation flow information.
[0018] In a second aspect, an embodiment of the present invention provides a service request processing method, including:
[0019] Receive a service request sent by a service party; wherein the service request includes: identification information corresponding to parameters and interfaces;
[0020] According to the identification information, the interface is obtained from a configuration database; wherein the interface includes: an identification of a container; an algorithm model is deployed in the container;
[0021] The parameters are passed into the interface, so that the interface sends the parameters to the container according to the identifier of the container, and outputs the call result according to the calculation result fed back by the container; wherein the calculation result is determined by the container according to the parameters and the algorithm model;
[0022] According to the call result, the request result is determined, and the request result is fed back to the business party.
[0023] Preferably,
[0024] The determining the request result according to the calling result includes:
[0025] storing the calling result in the configuration database;
[0026] The calling result stored in the configuration database is sent to the vector database according to the data exchange tool, and the request result fed back by the vector database is received.
[0027] Preferably,
[0028] The interface includes n operation units, where n is an integer greater than or equal to 2; the operation units have corresponding execution orders;
[0029] The interface sends the parameter to the container according to the identifier of the container, and outputs the call result according to the calculation result fed back by the container, including:
[0030] The operation unit ranked first in execution order sends the parameter to the first container according to the identifier of the first container included in it, and inputs the calculation result fed back by the first container to the operation unit ranked second in execution order;
[0031] The operation unit ranked at the i-th execution order sends the calculation result input by the operation unit ranked at the i-1th execution order to the i-th container according to the identifier of the i-th container included in it, and inputs the calculation result fed back by the i-th container to the operation unit ranked at the i+1th execution order;
[0032] The operation unit ranked at the nth execution order sends the calculation result input by the operation unit ranked at the n-1th execution order to the nth container according to the identifier of the nth container included therein, and outputs the calculation result fed back by the nth container; wherein the calculation result fed back by the nth container is the call result, and i is an integer greater than 1 and less than n.
[0033] In a third aspect, an embodiment of the present invention provides a service configuration device, including:
[0034] An acquisition module, configured to acquire a configuration file of a service;
[0035] A determination module is configured to determine the interface of the service and the identification information corresponding to the interface according to the configuration file; wherein the interface includes: an identification of a container; an algorithm model is deployed in the container;
[0036] The storage module is configured to store the interface and the identification information in a configuration database in correspondence.
[0037] In a fourth aspect, an embodiment of the present invention provides a service request processing device, including:
[0038] A receiving module configured to receive a service request sent by a service party; wherein the service request includes: identification information corresponding to parameters and interfaces;
[0039] An acquisition module is configured to acquire the interface from a configuration database according to the identification information; wherein the interface includes: an identification of a container; an algorithm model is deployed in the container;
[0040] A calling module, configured to pass the parameters into the interface, so that the interface sends the parameters to the container according to the identifier of the container, and outputs a calling result according to the calculation result fed back by the container; wherein the calculation result is determined by the container according to the parameters and the algorithm model;
[0041] The determination module is configured to determine the request result according to the call result, and feed back the request result to the business party.
[0042] In a fifth aspect, an embodiment of the present invention provides a service request processing system, comprising: the service configuration device described in the above embodiment and the service request processing device described in the above embodiment.
[0043] In a sixth aspect, an embodiment of the present invention provides an electronic device, including:
[0044] one or more processors;
[0045] a storage device for storing one or more programs,
[0046] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.
[0047] In a seventh aspect, an embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the method described in any of the above embodiments is implemented.
[0048] An embodiment of the above invention has the following advantages or beneficial effects: through the configuration file, dynamic configuration of the business can be realized. The algorithm model is separated from the configuration file, so that the algorithm model is decoupled from the business logic. When the algorithm model corresponding to the business changes, there is no need to redevelop the code, which reduces the development cost and improves the efficiency of business request processing.
[0049] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0051] Figure 1 is a flow chart of a service configuration method provided by an embodiment of the present invention;
[0052] Figure 2 It is a schematic diagram of the relationship between an operation unit, an interface, and a service provided by an embodiment of the present invention;
[0053] Figure 3 is a schematic diagram of a container provided by an embodiment of the present invention;
[0054] Figure 4 is a flow chart of a service request processing method provided by an embodiment of the present invention;
[0055] Figure 5 is a flow chart of a service request processing method provided by another embodiment of the present invention;
[0056] Figure 6 is a schematic diagram of a service configuration device provided by an embodiment of the present invention;
[0057] Figure 7 is a schematic diagram of a service request processing device provided by an embodiment of the present invention;
[0058] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0059] Fig. 9 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0061] like Figure 1 As shown, an embodiment of the present invention provides a service configuration method, including:
[0062] Step 101: Obtain a service configuration file.
[0063] Different business services can be provided through different business configuration files, such as payment services, image recognition services, image feature extraction services, etc.
[0064] The business configuration file can be uploaded by the business service provider or obtained from the service discovery system.
[0065] Step 102: Determine the service interface and identification information corresponding to the interface according to the configuration file; wherein the interface includes: an identification of a container; and an algorithm model is deployed in the container.
[0066] The identification information corresponding to the interface may include: the identification of the interface and the identification of the service to which the interface belongs. For example, if the identification of the registered interface is a and the identification of the service to which the registered interface belongs is A, then the identification information corresponding to the registered interface is a and A. In the process of calling an interface, the interface to be called can be accurately determined by the identification information corresponding to the interface.
[0067] The embodiment of the present invention associates the algorithm model with the interface through the identifier of the container. An interface may include the identifier of one or more containers. The identifier of the container may be the domain name corresponding to the container. The container may be encapsulated into an interface service through a mirror container and provide corresponding algorithm services to the outside. The container is mounted under the domain name through the IP address of the mirror container. A domain name may correspond to a mirror container corresponding to one or more containers. When the computing power of a container is insufficient, the IP addresses of the mirror containers of other containers may be mounted under the same domain name for load balancing. By adding a mirror container of the mounted container under the domain name, it is possible to process business requests with large computing power and improve business processing capabilities.
[0068] The algorithm model can be a visual target tracking algorithm, a regression algorithm model, etc.
[0069] Step 103: Store the interface and identification information in a configuration database in correspondence.
[0070] The interface and its corresponding identification information are stored in correspondence, so as to facilitate the calling of the corresponding interface according to the identification information.
[0071] This method can realize dynamic configuration of business through configuration files. The algorithm model is separated from the configuration file, so that the algorithm model is decoupled from the business logic. When the algorithm model corresponding to the business changes, there is no need to redevelop the code, which reduces the development cost.
[0072] In one embodiment of the present invention, obtaining a configuration file of a service includes:
[0073] Monitor the service discovery system;
[0074] If the configuration file in the service discovery system changes, obtain the configuration file from the service discovery system.
[0075] The service discovery system can be ETCD or Consul, etc. Among them, ETCD is a distributed, consistent key-value storage system for shared configuration and service discovery; Consul is a service management software that supports distributed, highly available service discovery and configuration sharing in multiple data centers.
[0076] Taking ETCD as an example, the service discovery system can include one or more servers with ETCD installed. Compared with a single server, the ETCD service cluster composed of multiple servers has higher stability and reliability.
[0077] In the embodiment of the present invention, the change of the configuration file refers to the modification and addition of the configuration file. If the configuration file in the service discovery system is modified, the modified configuration file is obtained from the service discovery system; if a new configuration file is added to the service discovery system, the new configuration file is obtained from the service discovery system. In the actual application scenario, if the deletion of the configuration file in the service discovery system is monitored, the interface corresponding to the configuration file and the identification information corresponding to the interface are deleted from the configuration database according to the identification of the deleted configuration file.
[0078] By monitoring the service discovery system, you can obtain information about configuration file changes in a timely manner, and then make timely adjustments to the configured services.
[0079] In one embodiment of the present invention, determining the interface of the service and the identification information corresponding to the interface according to the configuration file includes:
[0080] Parse the configuration file to obtain identification information and operation flow information and operation unit information corresponding to the identification information;
[0081] An operation unit is created according to the operation unit information; wherein the operation unit includes: an identifier of a container.
[0082] According to the operation flow information, the operation unit is encapsulated into an interface.
[0083] A configuration file can generate at least one interface, and an interface includes at least one operation unit. For example, business 1 corresponds to the search interface, and the operation units included in the search interface are: detection, quality, feature, and matching; business 2 corresponds to the registration interface and the search interface, where the search interface is the same as the search interface of business 1, and the operation units included in the registration interface are: detection, liveness, feature, and recognition.
[0084] An operation unit corresponds to an algorithm model. For example, the detection unit corresponds to the detection algorithm model, the recognition unit corresponds to the recognition algorithm model, and the attribute unit corresponds to the attribute algorithm model. The operation flow information includes information such as the logical order of each operation unit in the interface. For example, the output of the detection unit is the input of the quality unit, and the output of the quality unit is the input of the recognition unit.
[0085] like Figure 2 The figure is a schematic diagram describing the relationship between operation units, interfaces, and services. The services include two interfaces, interface 1 and interface 2. Interface 1 includes three operation units, and interface 2 includes two operation units.
[0086] In one embodiment of the present invention, an algorithm model is deployed in the container, including:
[0087] The algorithm model is deployed in a container through TensorFlow Serving.
[0088] TensorFlow Serving is an open source serving system for deploying machine learning models that is flexible, high-performance, and can be used in production environments.
[0089] like Figure 3The figure shows a schematic diagram of a container, which includes: a TensorFlow model, TensorFlowServing and a Client module. The Client module further includes: a prediction submodule, a preprocessing submodule and a service submodule, wherein the service submodule is used to interact with the operation unit. The preprocessing submodule is used to convert images, texts or other data sent by the operation unit into tensors. The prediction submodule sends the tensor to TensorFlowServing based on gRPC. gRPC is a high-performance, general-purpose open source RPC (Remote Procedure Call) framework.
[0090] like Figure 4 As shown, an embodiment of the present invention provides a service request processing method, including:
[0091] Step 401: receiving a service request sent by a service party; wherein the service request includes: parameters and identification information corresponding to the interface.
[0092] The business party can be a business system that needs to call an interface. Parameters can be data such as images and text. The business party can call multiple interfaces through one business request. These called interfaces can belong to one business or different businesses.
[0093] For example, the identification information corresponding to business request 1 includes: business A and interface a, and the corresponding parameter is picture 1. Then, through business request 1, interface a of business A can be called, and picture 1 is the input parameter of the interface. The identification information corresponding to business request 2 includes: business A, interface a corresponding to business A, business B, interface b corresponding to business B; the parameter corresponding to interface a is picture 1, and the parameter corresponding to interface b is picture 2. Through business request 2, interface a of business A and interface b of business B can be called, and the input parameters are picture 1 and picture 2 respectively.
[0094] Step 402: According to the identification information, an interface is obtained from a configuration database; wherein the interface includes: an identification of a container; and an algorithm model is deployed in the container.
[0095] The relationship between the service, interface and operation unit has been described in the above embodiments and will not be repeated here.
[0096] Step 403: pass the parameters into the interface so that the interface sends the parameters to the container according to the identifier of the container, and outputs the call result according to the calculation result fed back by the container; wherein the calculation result is determined by the container according to the parameters and the algorithm model.
[0097] The interface can include only one operation unit, in which case the output result of the operation unit is the call result. The interface (or operation unit) interacts with the container based on HTTP (Hyper Text Transfer Protocol) or gRPC.
[0098] Step 404: Determine the request result according to the call result, and feed back the request result to the business party.
[0099] In actual application scenarios, depending on the business, the call results output by some interfaces can be directly used as request results, while the call results output by some interfaces need to be further processed to obtain request results. The specific situation will be explained in subsequent embodiments.
[0100] In the process of processing the service request, the corresponding algorithm model can be called for calculation according to the identifier of the container included in the interface. If the algorithm model corresponding to the interface changes, only the identifier of the container in the interface needs to be changed without rewriting the code. This method can improve the processing efficiency of service requests.
[0101] In one embodiment of the present invention, determining the request result according to the call result includes:
[0102] Store the call results in the configuration database;
[0103] The calling result stored in the configuration database is sent to the vector database according to the data exchange tool, and the request result fed back by the vector database is received.
[0104] Taking image recognition business as an example, the call result is the extracted features of the image to be recognized. The features of the template image are stored in the vector database. After the feature input of the image to be recognized is exchanged to the vector database, the vector database will obtain the recognition result based on the features of the image to be recognized and the features of the template image. The recognition result is the request result.
[0105] In one embodiment of the present invention, the interface includes n operation units, where n is an integer greater than or equal to 2; the operation units have corresponding execution orders;
[0106] The interface sends parameters to the container according to the container's identifier and outputs the call results according to the calculation results fed back by the container, including:
[0107] The operation unit ranked first in execution order sends the parameters to the first container according to the identifier of the first container included in it, and inputs the calculation result fed back by the first container into the operation unit ranked second in execution order;
[0108] The operation unit ranked at the i-th execution order sends the calculation result input by the operation unit ranked at the i-1th execution order to the i-th container according to the identifier of the i-th container included in it, and inputs the calculation result fed back by the i-th container to the operation unit ranked at the i+1th execution order;
[0109] The operation unit ranked at the nth execution order sends the calculation result input by the operation unit ranked at the n-1th execution order to the nth container according to the identifier of the nth container included therein, and outputs the calculation result fed back by the nth container; wherein the calculation result fed back by the nth container is the call result, and i is an integer greater than 1 and less than n.
[0110] Taking the search interface as an example, the search interface includes the following operation units: detection, quality, feature, and matching. The execution order of the operation units is 1, 2, 3, and 4 respectively. The detection unit sends the parameters in the business request to the detection container, and inputs the calculation result fed back by the detection container into the quality unit; the quality unit sends the calculation result input by the detection unit to the quality container, and inputs the calculation result fed back by the quality container into the feature unit; the feature unit sends the calculation result input by the quality unit to the feature container, and inputs the calculation result fed back by the feature container into the matching unit; the matching unit sends the calculation result input by the feature unit to the matching container, and outputs the calculation result fed back by the matching container.
[0111] In one embodiment of the present invention, the method further includes: determining the time taken by the container from receiving data sent by the corresponding operation unit to outputting the calculation result, and saving the time. The time corresponding to the container reflects the performance of the container, and the change of the container performance can be monitored through the time.
[0112] In one embodiment of the present invention, the method further comprises: if the operation unit fails to connect to the algorithm model, sending an alarm signal. The alarm signal may be an alarm text message, or an alarm email or other forms. The object of the alarm signal may be a business party, or a maintenance party of the business request processing device.
[0113] In one embodiment of the present invention, the method further includes: generating a log of the operation unit according to the input and output of the operation unit, and saving the log. Saving the log is helpful for subsequent checking of the operation status of the operation unit.
[0114] like Figure 5 As shown, an embodiment of the present invention provides a service request processing method, including:
[0115] Step 501: Monitor the service discovery system.
[0116] Step 502: When a new configuration file is added to the service discovery system, the configuration file is obtained from the service discovery system.
[0117] Step 503: Parse the configuration file to obtain identification information and operation flow information and operation unit information corresponding to the identification information.
[0118] Step 504: Create an operation unit according to the operation unit information; wherein the operation unit includes: an identifier of the container.
[0119] Step 505: Encapsulate the operation unit into an interface according to the operation flow information; wherein the interface includes: an identifier of a container; and an algorithm model is deployed in the container.
[0120] Step 506: Store the interface and identification information in a configuration database in correspondence.
[0121] Step 507: Receive a service request sent by the service party; wherein the service request includes: parameters and identification information corresponding to the target interface.
[0122] Step 508: According to the identification information, a target interface is obtained from the configuration database; wherein the target interface includes: an identification of a container; and an algorithm model is deployed in the container.
[0123] Step 509: pass the parameters into the target interface so that the target interface sends the parameters to the container according to the container identifier, and outputs the call result according to the calculation result fed back by the container; wherein the calculation result is determined by the container according to the parameters and the algorithm model.
[0124] Step 510: Store the call result in the configuration database.
[0125] Step 511: Send the call result stored in the configuration database to the vector database according to the data exchange tool, and receive the request result fed back by the vector database.
[0126] Step 512: Feedback the request result to the business party.
[0127] This method decouples business logic from algorithm models, enables dynamic configuration of business, reduces development costs, and improves the processing efficiency of business requests.
[0128] like Figure 6 As shown, an embodiment of the present invention provides a service configuration device, including:
[0129] An acquisition module 601 is configured to acquire a configuration file of a service;
[0130] The determination module 602 is configured to determine the interface of the service and the identification information corresponding to the interface according to the configuration file; wherein the interface includes: the identification of the container; the algorithm model is deployed in the container;
[0131] The storage module 603 is configured to store the interface and identification information in a configuration database in correspondence.
[0132] In one embodiment of the present invention, the acquisition module 601 is configured to monitor the service discovery system; if the configuration file in the service discovery system is changed, the configuration file is acquired from the service discovery system.
[0133] In one embodiment of the present invention, the determination module 602 is configured to parse the configuration file to obtain identification information and operation flow information and operation unit information corresponding to the identification information; create an operation unit according to the operation unit information; wherein the operation unit includes: an identification of a container; and encapsulate the operation unit into an interface according to the operation flow information.
[0134] In one embodiment of the present invention, an algorithm model is deployed in a container, including: the algorithm model is deployed in the container through TensorFlow Serving.
[0135] like Figure 7 As shown, an embodiment of the present invention provides a service request processing device, including:
[0136] The receiving module 701 is configured to receive a service request sent by a service party; wherein the service request includes: identification information corresponding to parameters and interfaces;
[0137] The acquisition module 702 is configured to acquire an interface from a configuration database according to the identification information; wherein the interface includes: an identification of a container; an algorithm model is deployed in the container;
[0138] The calling module 703 is configured to pass the parameters into the interface so that the interface sends the parameters to the container according to the identifier of the container, and outputs the calling result according to the calculation result fed back by the container; wherein the calculation result is determined by the container according to the parameters and the algorithm model;
[0139] The determination module 704 is configured to determine the request result according to the call result, and feed back the request result to the business party.
[0140] In one embodiment of the present invention, the determination module 704 is configured to store the call result in the configuration database; send the call result stored in the configuration database to the vector database according to the data exchange tool, and receive the request result fed back by the vector database.
[0141] In one embodiment of the present invention, the interface includes n operation units, where n is an integer greater than or equal to 2; the operation units have corresponding execution orders;
[0142] The interface sends parameters to the container according to the container's identifier and outputs the call results according to the calculation results fed back by the container, including:
[0143] The operation unit ranked first in execution order sends the parameters to the first container according to the identifier of the first container included in it, and inputs the calculation result fed back by the first container into the operation unit ranked second in execution order;
[0144] The operation unit ranked at the i-th execution order sends the calculation result input by the operation unit ranked at the i-1th execution order to the i-th container according to the identifier of the i-th container included in it, and inputs the calculation result fed back by the i-th container to the operation unit ranked at the i+1th execution order;
[0145] The operation unit ranked at the nth execution order sends the calculation result input by the operation unit ranked at the n-1th execution order to the nth container according to the identifier of the nth container included therein, and outputs the calculation result fed back by the nth container; wherein the calculation result fed back by the nth container is the call result, and i is an integer greater than 1 and less than n.
[0146] An embodiment of the present invention provides a service request processing system, comprising: the service configuration device described in any one of the above embodiments and the service request processing device described in any one of the above embodiments.
[0147] An embodiment of the present invention provides an electronic device, including:
[0148] one or more processors;
[0149] a storage device for storing one or more programs,
[0150] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.
[0151] An embodiment of the present invention provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method described in any one of the above embodiments is implemented.
[0152] Figure 8 An exemplary system architecture 800 is shown to which the service configuration method or service request processing method or service configuration device or service request processing device according to the embodiments of the present invention can be applied.
[0153] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0154] Users can use terminal devices 801, 802, and 803 to interact with server 805 through network 804 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 801, 802, and 803, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0155] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0156] The server 805 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 801, 802, and 803. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0157] It should be noted that the service configuration method or service request processing method provided in the embodiment of the present invention is generally executed by the server 805 , and accordingly, the service configuration device or service request processing device is generally arranged in the server 805 .
[0158] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0159] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0160] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0161] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.
[0162] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.
[0163] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0164] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0165] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes a sending module, an acquisition module, a determination module, and a first processing module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the sending module may also be described as a "module for sending a picture acquisition request to the connected server."
[0166] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device.
[0167] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the device includes:
[0168] Get the business configuration file;
[0169] According to the configuration file, determine the interface of the service and the identification information corresponding to the interface; wherein the interface includes: the identification of the container; the algorithm model is deployed in the container;
[0170] The interface and the identification information are stored in a configuration database in correspondence.
[0171] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the device includes:
[0172] Receive a service request sent by a service party; wherein the service request includes: identification information corresponding to parameters and interfaces;
[0173] According to the identification information, the interface is obtained from a configuration database; wherein the interface includes: an identification of a container; an algorithm model is deployed in the container;
[0174] The parameters are passed into the interface, so that the interface sends the parameters to the container according to the identifier of the container, and outputs the call result according to the calculation result fed back by the container; wherein the calculation result is determined by the container according to the parameters and the algorithm model;
[0175] According to the call result, the request result is determined, and the request result is fed back to the business party.
[0176] According to the technical solution of the embodiment of the present invention, dynamic configuration of the business can be realized through the configuration file. The algorithm model is separated from the configuration file, so that the algorithm model is decoupled from the business logic. When the algorithm model corresponding to the business changes, there is no need to redevelop the code, which reduces the development cost and improves the efficiency of business request processing.
[0177] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A service configuration method, characterized in that: include: Get the business configuration file; According to the configuration file, determine the interface of the service and the identification information corresponding to the interface; wherein the interface includes: the identification of the container; the algorithm model is deployed in the container; the identification information corresponding to the interface includes: the identification of the interface and the identification of the service to which the interface belongs, one of the interfaces includes the identification of one or more containers, the container can be encapsulated into an interface service through a mirror container, and provide corresponding algorithm services to the outside, and the algorithm model is associated with the interface through the identification of the container; The interface and the identification information corresponding to the interface are stored in a configuration database in correspondence.
2. The method according to claim 1, characterized in that The configuration file for obtaining the service includes: Monitor the service discovery system; If the configuration file in the service discovery system is changed, the configuration file is obtained from the service discovery system.
3. The method according to claim 1 or 2, characterized in that The determining, according to the configuration file, the interface of the service and the identification information corresponding to the interface includes: Parsing the configuration file to obtain the identification information and the operation flow information and operation unit information corresponding to the identification information; Creating an operation unit according to the operation unit information; wherein the operation unit includes: an identifier of the container; The operation unit is encapsulated into the interface according to the operation flow information.
4. A method for processing a business request, characterized in that: include: Receive a service request sent by a service party; wherein the service request includes: identification information corresponding to parameters and interfaces; According to the identification information, the interface is obtained from a configuration database; wherein the interface includes: an identification of a container; an algorithm model is deployed in the container; The parameters are passed into the interface, so that the interface sends the parameters to the container according to the identifier of the container, and outputs the call result according to the calculation result fed back by the container; wherein the calculation result is determined by the container according to the parameters and the algorithm model; According to the call result, the request result is determined, and the request result is fed back to the business party; specifically including: storing the call result in the configuration database; sending the call result stored in the configuration database to the vector database according to the data exchange tool, and receiving the request result fed back by the vector database.
5. The method according to claim 4, characterized in that The interface includes n operation units, where n is an integer greater than or equal to 2; the operation units have corresponding execution orders; The interface sends the parameter to the container according to the identifier of the container, and outputs the call result according to the calculation result fed back by the container, including: The operation unit ranked first in execution order sends the parameter to the first container according to the identifier of the first container included in it, and inputs the calculation result fed back by the first container to the operation unit ranked second in execution order; The operation unit ranked at the i-th execution order sends the calculation result input by the operation unit ranked at the i-1th execution order to the i-th container according to the identifier of the i-th container included in it, and inputs the calculation result fed back by the i-th container to the operation unit ranked at the i+1th execution order; The operation unit ranked at the nth execution order sends the calculation result input by the operation unit ranked at the n-1th execution order to the nth container according to the identifier of the nth container included therein, and outputs the calculation result fed back by the nth container; wherein the calculation result fed back by the nth container is the call result, and i is an integer greater than 1 and less than n.
6. A service configuration device, characterized in that: include: An acquisition module, configured to acquire a configuration file of a service; A determination module is configured to determine the interface of the service and the identification information corresponding to the interface according to the configuration file; wherein the interface includes: the identification of the container; the algorithm model is deployed in the container; the identification information corresponding to the interface includes: the identification of the interface and the identification of the service to which the interface belongs, one of the interfaces includes the identification of one or more containers, the container can be encapsulated into an interface service through a mirror container, and provide corresponding algorithm services to the outside, and the algorithm model is associated with the interface through the identification of the container; The storage module is configured to store the interface and the identification information corresponding to the interface in a configuration database in correspondence.
7. A service request processing device, characterized in that: include: A receiving module configured to receive a service request sent by a service party; wherein the service request includes: identification information corresponding to parameters and interfaces; An acquisition module is configured to acquire the interface from a configuration database according to the identification information; wherein the interface includes: an identification of a container; an algorithm model is deployed in the container; A calling module, configured to pass the parameters into the interface, so that the interface sends the parameters to the container according to the identifier of the container, and outputs a calling result according to the calculation result fed back by the container; wherein the calculation result is determined by the container according to the parameters and the algorithm model; A determination module is configured to determine a request result based on the call result and feed back the request result to the business party; specifically used to: store the call result in the configuration database; send the call result stored in the configuration database to the vector database according to the data exchange tool, and receive the request result fed back by the vector database.
8. A business request processing system, characterized in that: include: The service configuration device as claimed in claim 6 and the service request processing device as claimed in claim 7.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
