Business execution method, device, equipment and medium
By using the common data carrier field to carry service execution parameters in the service communication protocol, the cumbersome problem of communication protocol modification during service expansion is solved, and the efficiency and flexibility of service execution are improved.
Patent Information
- Application Number
- CN202311725003.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-13
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2043-12-13
AI Technical Summary
In the business expansion scenario, the prior art needs to synchronously modify the communication protocol to adapt to changes in the parameters required by the service, resulting in inefficient service execution.
By obtaining the service request format defined in the service communication protocol, a general data carrier field is built to carry the service execution parameters, and adding parameters when the data type matches, a service call request is generated to avoid synchronous modifications to the communication protocol.
It improves the efficiency and flexibility of business execution and provides a convenient way to expand business without defining specific parameter fields in the business communication protocol to adapt to changes in business parameters.
Smart Images

Figure CN117724865B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a service execution method, device, equipment and medium. Background Art
[0002] At present, if the node devices of two systems (such as the first node device of the first system and the second node device of the second system) want to communicate data, a communication protocol needs to be deployed in the first node device and the second node device. Among them, the communication protocol will define all parameter fields (such as field A-field C) required for the relevant business (such as business A in the second node device). When the first node device obtains the parameters corresponding to field A-field C, it can generate a correct business request (i.e., a request containing the parameters corresponding to field A-field C) based on the communication protocol to enable the second node device to execute the business A.
[0003] However, in practice, it is found that in the business expansion scenario, the parameters required by business A may be expanded (such as adding parameters corresponding to field D). At this time, if the parameter field defined in the communication protocol is not modified synchronously (that is, adding field D for business A in the communication protocol), a business request containing parameters corresponding to field A-field D cannot be generated, and business A cannot be correctly executed. Obviously, whenever the business is expanded and the parameters required by business A change, the communication protocol needs to be modified synchronously to execute business A. This step is cumbersome and affects the efficiency of business execution. Summary of the invention
[0004] The embodiments of the present application provide a service execution method, apparatus, device and medium, which can improve the execution efficiency of the service.
[0005] On the one hand, an embodiment of the present application provides a service execution method, the method comprising:
[0006] When the service execution parameters for the target service are obtained, a service request format defined in the service communication protocol is obtained; the service request format includes a first universal data carrier field;
[0007] A first initial universal data carrier for carrying a service execution parameter is constructed based on the first universal data carrier field, and based on the data type of the service execution parameter, the service execution parameter is added to the first initial universal data carrier to obtain a first target universal data carrier corresponding to the first universal data carrier field;
[0008] Based on the first target universal data carrier, a service call request corresponding to the target service is constructed, and the service call request is sent to the second node device, so that the second node device parses the service execution parameters from the first target universal data carrier in the service call request, and executes the target service based on the parsed service execution parameters.
[0009] On the one hand, an embodiment of the present application provides a service execution method, the method comprising:
[0010] receiving a service call request sent by the first node device for a target service; the service call request is generated by the first node device based on the service execution parameters and the service request format defined in the service communication protocol when the service execution parameters of the target service are obtained; the service request format includes a first universal data carrier field; the service call request is determined based on the first target universal data carrier corresponding to the first universal data carrier field; the service execution parameters are added to the first target universal data carrier;
[0011] Parsing the first target universal data carrier in the service call request to obtain the service execution parameter;
[0012] Execute the target service based on the service execution parameters obtained through analysis.
[0013] On the one hand, an embodiment of the present application provides a service execution device, the device comprising:
[0014] A parameter acquisition module, configured to acquire a service request format defined in a service communication protocol when a service execution parameter for a target service is acquired; the service request format includes a first universal data carrier field;
[0015] A first processing module is configured to construct a first initial universal data carrier for carrying a service execution parameter based on the first universal data carrier field, and add the service execution parameter to the first initial universal data carrier based on a data type of the service execution parameter to obtain a first target universal data carrier corresponding to the first universal data carrier field;
[0016] The first processing module is also used to construct a service call request corresponding to the target service based on the first target universal data carrier, and send the service call request to the second node device, so that the second node device parses the service execution parameters from the first target universal data carrier in the service call request, and executes the target service based on the parsed service execution parameters.
[0017] On the other hand, an embodiment of the present application provides a service execution device, the device comprising:
[0018] A request receiving module, configured to receive a service call request sent by a first node device for a target service; the service call request is generated by the first node device based on the service execution parameters and the service request format defined in the service communication protocol when the service execution parameters of the target service are obtained; the service request format includes a first universal data carrier field; the service call request is determined based on a first target universal data carrier corresponding to the first universal data carrier field; the service execution parameters are added to the first target universal data carrier;
[0019] A second processing module is used to parse the first target universal data carrier in the service call request to obtain the service execution parameter;
[0020] The second processing module is further used to execute the target service based on the service execution parameters obtained by parsing.
[0021] On the one hand, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute some or all of the steps in the above method.
[0022] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program includes program instructions, which, when executed by a processor, are used to execute some or all of the steps in the above method.
[0023] Accordingly, according to one aspect of the present application, a computer program product or a computer program is provided, wherein the computer program product or the computer program comprises computer instructions, and when the computer instructions are executed by a processor, some or all of the steps in the above method can be implemented.
[0024] In an embodiment of the present application, when the business execution parameters for the target business are obtained, the business request format defined in the business communication protocol can be obtained; the business request format includes a first universal data carrier field; a first initial universal data carrier (which can be used to carry the business execution parameters) is constructed based on the first universal data carrier field, and based on the data type of the business execution parameters, the business execution parameters are added to the first initial universal data carrier to obtain a first target universal data carrier corresponding to the first universal data carrier field, so as to construct a business call request corresponding to the target business, and send the business call request to the second node device, the second node device can parse the business execution parameters from the first target universal data carrier in the business call request, and execute the target business based on the parsed business execution parameters. Through the above method, there is no need to define specific parameter fields in the business request format. Instead, a universal data carrier field (called the first universal data carrier field) can be defined, and business execution parameters of various data types are added to the universal data carrier corresponding to the defined first universal data carrier field. In this way, when the business is expanded, there is no need to synchronously modify the business communication protocol. Even if the business execution parameters change, the first universal data carrier field in the business communication protocol can uniformly store the business execution parameters, and based on the universal data carrier with the required business execution parameters added, a correct business call request is generated to execute the business, which can improve the execution efficiency and flexibility of the business, and at the same time provide convenience and efficiency in business expansion. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0026] Figure 1 This is a schematic diagram of a network architecture provided by an embodiment of the present application;
[0027] Figure 2 This is a schematic diagram of a scenario for executing a service provided by an embodiment of the present application;
[0028] Figure 3 A schematic diagram of a service execution method provided in an embodiment of the present application Figure 1 ;
[0029] Figure 4 A schematic diagram of a recommendation system provided in an embodiment of the present application Figure 1 ;
[0030] Figure 5 A schematic diagram of a recommendation system provided in an embodiment of the present application Figure 2 ;
[0031] Figure 6 A schematic diagram of a service execution process provided in an embodiment of the present application;
[0032] Figure 7 A schematic diagram of a service execution method provided in an embodiment of the present application Figure 2 ;
[0033] Figure 8 A schematic diagram of an interactive process of a service execution method provided in an embodiment of the present application;
[0034] Fig. 9 A schematic diagram of the structure of a service execution device provided in an embodiment of the present application;
[0035] Fig.10 A schematic diagram of the structure of a service execution device provided in an embodiment of the present application;
[0036] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0038] The service execution method proposed in the embodiment of the present application is implemented in an electronic device, which can be a server or a terminal. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this.
[0039] Among them, a network architecture diagram proposed based on the service execution method can be shown as follows: Figure 1As shown, the network architecture may include a server cluster and user terminals (with no limitation on the number of user terminals), wherein the server cluster may include one or more servers, and the number of servers in the server cluster will not be limited here. There may be a communication connection between the servers in the server cluster. At the same time, any server in the server cluster may have a communication connection with the user terminal, so that each server in the server cluster may exchange data with the user terminal through the communication connection. The above-mentioned communication connection does not limit the connection method, and may be directly or indirectly connected through a wired communication method, or directly or indirectly connected through a wireless communication method, or through other methods, which are not limited in this application. In addition, it can be understood that the electronic device involved in the embodiments of the present application may be Figure 1 The user terminal shown can also be Figure 1 Any server in the server cluster shown.
[0040] Among them, the server cluster can be composed of multiple systems, and the multiple systems constitute a system cluster, such as including a first system and a second system. The number of systems is not limited here and can be determined based on specific business scenarios. For example, the recommendation business can be divided into two sub-businesses, the first system is used to execute the first sub-business, and the second system is used to execute the second sub-business. Alternatively, the recommendation business can be divided into X sub-businesses, and different sub-businesses are executed by different systems. In this case, the system cluster includes X systems.
[0041] Different systems communicate with each other and provide different services to the outside world. A system can include multiple node devices, such as Figure 1 The first system 100 in the example includes node devices 10a-10n, and the number of node devices in the first system is not limited. Figure 1 The second system 200 includes node devices 20a-20n, and the number of node devices in the second system is not limited. Depending on the business scenario, it can be set by relevant business personnel. Data communication can be performed between the first system and the second system, and the user terminal can perform data communication with any one or more systems.
[0042] It can be understood that in the embodiment of the present application, taking any one of the node devices 10a-10n as the first node device and any one of the node devices 20a-20n as the second node device as an example, the data communication (service execution) process between the first node device and the second node device is described, that is, data communication between systems is realized. Correspondingly, the data communication (service execution) process between the same systems is similar, and at this time, any two node devices between the same system can be represented as the first node device and the second node device.
[0043] Here, the technical solution of the present application is described by taking the first node device as a node device that initiates a service call request to call a target service on the second node device, and the second node device as a node device that executes the target service requested by the first node device as an example. In some business scenarios, the second node device may also initiate a service call request to request the first node device to execute the service on the first node device. The process and principle are the same.
[0044] For example, the system cluster is a recommendation system, the first system in the system cluster is the first recommendation subsystem in the recommendation system, and the second system in the system cluster is the second recommendation subsystem in the recommendation system. The user can initiate a recommendation request to the first node device in the first recommendation subsystem through the user terminal. When the first node device in the first recommendation subsystem receives the recommendation request, it calls the user data acquisition service on the first node device to obtain the user's user identity information and historical browsing data, and uses the user identity information and historical browsing data as service execution parameters to generate a service call request for calling the recommendation service on the second recommendation subsystem based on the technical solution of the present application, and sends the service call request to the second node device in the second recommendation subsystem. The second node device can parse the service execution parameters from the service call request based on the technical solution of the present application, and execute the recommendation service based on the service execution parameters to obtain the recommendation data recommended to the user, and return the service response information generated based on the recommendation data to the first node device. When the first node device obtains the recommendation data from the service response information based on the technical solution of the present application, it can make recommendations to the user based on the recommendation data.
[0045] For further understanding, please refer to Figure 2 , Figure 2 is a schematic diagram of a scenario of service execution provided by an embodiment of the present application. Among them, the first node device 20 can be Figure 1 The first system 100 includes any one of the node devices 10a-10n, and the second node device 21 can be Figure 1The second system 200 in the embodiment of the present application includes any one of the node devices 20a-20n. In which, when the first node device obtains the service execution parameter 22 for the target service, it can obtain the service request format 24 defined in the service communication protocol 23, and construct a first initial universal data carrier 26 for carrying the service execution parameter based on the first universal data carrier field 25 in the service request format 24, and add the service execution parameter to the first initial universal data carrier based on the data type of the service execution parameter to obtain the first target universal data carrier 27, so as to construct a service call request 28 corresponding to the target service, and send the service call request to the second node device. At this time, the second node device can parse the first target universal data carrier 27 from the service call request 28, and parse the service execution parameter 22 from the first target universal data carrier 27, so as to execute the target service 29 based on the service execution parameter 22, and then the second node device can return the service response information 211 obtained based on the service execution result 210 to the first node device. In this way, the business execution parameters can be added to the universal data carrier used to store data. Even if the business is expanded and the business execution parameters change in time, there is no need to modify the business communication protocol, thereby improving the execution efficiency and flexibility of the business.
[0046] Optionally, in some embodiments, the electronic device may execute the business execution method according to actual business needs to improve the efficiency and convenience of business expansion. The technical solution of the present application can be applied to data communications of any system, and the system can be a system in any scenario. For example, it can be a recommendation system, a translation system, and so on. The first node device and the second node device are any node devices that interact with data by request. The first node device and the second node device can be node devices in different systems, or node devices in the same system, or servers and user terminals. It can be understood that the first node device represents a device that initiates a business call request, and the second node device represents a device that returns business response information. For the same node device, it can be used as both a first node device and a second node device. This is not limited here.
[0047] Optionally, the data involved in this application, such as business execution parameters, business communication protocols, etc., can be stored in a database, or can be stored in a blockchain, such as through a blockchain distributed system, which is not limited in this application.
[0048] It should be noted that in the specific implementation of the present application, when it comes to scenarios involving obtaining relevant data such as user information, such as obtaining business execution parameters containing user information (such as historical browsing records, etc.) for user recommendations, etc., it is necessary to obtain user permission or consent. That is, when the embodiments of the present application are applied to specific products or technologies, the collection, use and processing of relevant user data comply with relevant laws, regulations and standards in the relevant regions. For example, a prompt message can be issued in the form of an interactive interface to prompt which specific data will be collected or obtained. Specifically, the type and content of these data can be prompted to the user through a list or other method. Only after receiving a confirmation operation or instruction allowing the collection of data on the interactive interface, the collection and processing of relevant data will be further performed.
[0049] It is understood that the above scenarios are only examples and do not constitute a limitation on the application scenarios of the technical solutions provided in the embodiments of the present application. The technical solutions of the present application can also be applied to other scenarios. For example, it is known to those skilled in the art that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0050] Based on the above description, the embodiment of the present application proposes a service execution method, which can be executed by the electronic device mentioned above, and can be specifically Figure 1 The first node device shown. See Figure 3 , Figure 3 A flowchart of a service execution method provided in an embodiment of the present application. Figure 3 As shown, the process of the service execution method of the embodiment of the present application may include the following:
[0051] S101. When a service execution parameter for a target service is obtained, a service request format defined in a service communication protocol is obtained.
[0052] The target business may be any type of business, for example, a business related to a recommendation scenario (such as a business of obtaining recommendation recall results, or a business of sorting recommendation recall results). For another example, it may be a business related to a translation scenario (such as a business of translating input text into English), and the target business is not limited here.
[0053] Among them, the first node device is configured with parameter definition information associated with the target business, such as the parameter field and data type required to be passed in when calling the target business (or the function name of the parameter adding function that matches the data type, the function name of the parameter obtaining function that matches the data type), and the result field and data type corresponding to the execution result corresponding to the target business. For example, for the business of obtaining the recommendation recall result, the parameter field that needs to be passed in may include: a field representing the user's age, a field representing the user's historical browsing record, a field representing the user's gender, etc. The first node device can obtain the corresponding parameters as business execution parameters based on the parameter fields in the parameter definition information, and determine and call the parameter adding function that matches the data type (or the parameter obtaining function that matches the data type) based on the data type related information in the parameter definition information. The parameter definition information can be configured by the business personnel associated with the target business. Correspondingly, the second node device used to execute the target business is configured with the execution logic of the target business, and the execution logic defines the parameter definition information of the parameters required by the target business (i.e., the parameter definition information configured in the first node device) and the parameter use logic (such as determining the embedding vector corresponding to the business execution parameter and inputting the recommendation model, etc.), which can be specifically configured by the business personnel associated with the target business.
[0054] It can be understood that the triggering condition for obtaining the business execution parameters for the target business can be based on user operations or configured timing conditions, etc., which are not limited here. For example, in a recommendation scenario, the server needs to recommend products to users. When the user logs in to the business client, the product recommendation business in the recommendation system is triggered, and the product recommendation business is divided into multiple recommendation sub-businesses (such as product recall business, recall sorting business, etc., here taking the product recall business as an example), the first node device can obtain the business execution parameters for the product recall business, and then generate a business call request corresponding to the product recall business (that is, the target business here), and send it to the second node device, so that the second node device executes the product recall business based on the business call request and obtains the product recall result for the user. For another example, in an advertising delivery scenario, the server needs to periodically (such as every hour) calculate the conversion rate of the advertising delivery. When the periodic calculation time point is reached, the advertising analysis service in the advertising delivery system is triggered, and the advertising analysis service is divided into multiple analysis sub-services (such as conversion rate calculation service, conversion rate visualization service, etc., here taking the conversion rate calculation service as an example), the first node device can obtain the service execution parameters for the conversion rate calculation service, and then generate a service call request corresponding to the conversion rate calculation service (that is, the target service here), and send it to the second node device, so that the second node device executes the conversion rate calculation service based on the service call request to obtain the conversion rate information of the advertisement within a period.
[0055] The service communication protocol defines the service request format of the service call request and the service response format of the service response information. The service request format defines the parameter fields used to form the request parameters of the service call request and the method of generating the service call request.
[0056] The parameter field of the request parameter defined in the service request format includes a first universal data carrier field (TermValue). The universal data carrier (extendData, i.e., a data structure without data type) constructed based on the first universal data carrier field can store data of various configured data types. It can be understood that the parameter field and data type of the service execution parameter are not limited here, so the data carrier that can be used to store any service execution parameter is called a universal data carrier.
[0057] It can be understood that a universal data carrier field having the same configuration information as the first universal data carrier field is also defined in the service response format. For ease of understanding, in this solution, the universal data carrier field in the service request format is referred to as the first universal data carrier field, and the universal data carrier field in the service response format is referred to as the second universal data carrier field. The relevant logic and principle of the first universal data carrier field are the same as those of the second universal data carrier field.
[0058] Among them, the universal data carrier field is a field without a data type, that is, the universal data carrier field does not indicate a specific data type. Relevant business personnel can configure any data type for the universal data carrier field, that is, configure the universal data carrier corresponding to the universal data carrier field (the first universal data carrier field and the second universal data carrier field) to carry type description information, such as:
[0059] struct TermValue{ / / indicates the general data carrier field
[0060] 1:optional bool booleanValue; / / Indicates that the data type that can be carried can be bool (Boolean data type), and the variable name that can store data is "booleanValue";
[0061] }
[0062] For example, various data types defined in computer languages can be configured for the universal data carrier field, such as the basic data type bool data type, double (double-precision floating point data type); the composite data type list <bool>(Boolean list data type), list <i32>(List of 32-bit signed integer data types), etc., where there is no limitation on the data types that can be configured.
[0063] Optionally, the parameter definition information of the first node device may define a parameter adding logic for the business execution parameters, and the parameter adding logic is used to indicate that the business execution parameters are added to the first initial data universal carrier (extendData) created, and the parameter adding logic includes the function name of the parameter adding function that matches the data type of the business execution parameters, so the business auxiliary tool can obtain and call the parameter acquisition function that matches the data type of the business execution result by executing the parameter adding logic to add the business execution parameters to the first initial data universal carrier created, thereby obtaining the first target data universal data (extendData). Similarly, the parameter definition information of the first node device will also define a parameter acquisition logic for the business response information, and the parameter acquisition logic is used to indicate that the business execution result is extracted from the second target data universal carrier (extendData) obtained by parsing, and the parameter adding logic includes the function name of the parameter acquisition function that matches the data type of the business execution result. Among them, the specific description of the second target data universal carrier can be found in the following related description.
[0064] For example, the parameter adding logic is:
[0065] addSLBoo l("queryDiffMode", rec_context->isQueryDiff(), extendData); / / indicates that the service execution parameter with the parameter field of "queryDiffMode" is added to the first initial data universal carrier (extendData) through the "addSLBoo l" parameter adding function.
[0066] It can be understood that when a certain data type is configured for the universal data carrier field, the universal data carrier indicated by the universal data carrier field can store data of this data type. In other words, the universal data carrier field can be configured with bearing type description information. The bearing type description information is used to characterize the data type of the data that the universal data carrier indicated by the universal data carrier field can carry, and the data type that can be carried can be expressed as a universal data type. Among them, the universal data type can include computer data types in the computer field (data type refers to the type of data that can be stored in a variable or constant). For example, the data type used in the computer field can be configured into the universal data type by relevant business personnel. In other words, the universal data carrier indicated by the universal data carrier field is configured as a data carrier to which data of the universal data type can be added.
[0067] It can be understood that the business communication protocol is improved from the original definition of the specific parameter fields required for the target business to only define a universal data carrier field, and define the data type that can be carried for the universal data carrier field. As the business expands, the parameter field will change, and the business communication information needs to be modified synchronously. For this solution, the data type that can be carried by the universal data carrier field is the data type defined and provided by the computer language, which can be completed through exhaustive enumeration. Even if the parameter field changes, the data type corresponding to the parameter field will not exceed the data type defined and provided by the computer language. In other words, after defining the data type that can be carried for the universal data carrier field, there is no need to modify the relevant configuration information of the universal data carrier field. In other words, changes in the parameter field do not affect the business communication protocol, and the business communication protocol does not need to be modified as the business expands. This can optimize the business expansion process and provide business expansion efficiency and business execution flexibility.
[0068] S102: construct a first initial universal data carrier for carrying service execution parameters based on the first universal data carrier field, and add the service execution parameters to the first initial universal data carrier based on the data type of the service execution parameters to obtain a first target universal data carrier corresponding to the first universal data carrier field.
[0069] A first initial universal data carrier may be constructed based on the first universal data carrier field to store the service execution parameters, and the first initial universal data carrier storing the service execution parameters is used as the first target universal data carrier.
[0070] It can be understood that the universal data carrier indicated by the first universal data carrier field can be equivalent to an array or a data table. Adding the business execution parameters to the first initial universal data carrier means adding the business execution parameters to the created array or data table. The created array or data table can store any business execution parameters, and the parameter fields of the business execution parameters are not limited. In this way, even if the parameter fields corresponding to the business execution parameters are updated, they can still be added to the first initial universal data carrier. It can be understood that this is to construct a business call request in the form of the first target universal data carrier, rather than constructing a business call request in the form of business execution parameters. In other words, a universal data carrier is constructed to store various business execution parameters.
[0071] Among them, the business communication protocol is associated with a business auxiliary tool. The business auxiliary tool is configured with a parameter adding function that matches the general data type. The general data type is the data type of data that can be added to the first initial general data carrier. It can be understood that when the business execution parameter can be added to the first initial general data carrier, it means that the data type of the business execution parameter belongs to the general data type. Therefore, based on the data type of the business execution parameter, the business execution parameter is added to the first initial general data carrier to obtain the first target general data carrier, which can be: calling the business auxiliary tool, when it is determined that the data type of the business execution parameter belongs to the general data type, from the parameter adding function that matches the general data type, a parameter adding function that matches the data type of the business execution parameter is obtained, and the obtained parameter adding function that matches the data type of the business execution parameter is used as the first parameter adding function; calling the first parameter adding function to add the business execution parameter to the first initial general data carrier; and using the first initial general data carrier to which the business execution parameter is added as the first target general data carrier.
[0072] For example, when the data type is a bool data type, the parameter adding function that matches the data type of the business execution parameter is called addSLBoo l. The parameter adding function is used to indicate that the business execution parameter and the parameter field (i.e., the parameter name) are stored in the general data carrier (extendData) in the form of a key-value pair, such as the parameter field as the key data and the business execution parameter as the value data.
[0073] S103: construct a service call request corresponding to the target service based on the first target universal data carrier, and send the service call request to the second node device.
[0074] Wherein, a service call request matching the service request format can be constructed based on the first target universal data carrier, and the service call request includes the first target universal data carrier. The first node device sends it to the second node device, so that the second node device can parse the first target universal data carrier in the service call request to obtain the service execution parameters, and execute the target service based on the parsed service execution parameters.
[0075] Subsequently, when the second node device obtains the service execution result of the target service, it may generate corresponding service response information and return it to the first node device.
[0076] The service response information is generated by the second node device based on the service execution result corresponding to the service call request and the service response format defined in the service communication protocol. The service response format includes a second universal data carrier field. The service response information is determined based on the second target universal data carrier corresponding to the second universal data carrier field. The service execution result is added to the second target universal data carrier. The service response format defines the parameter fields for constituting the response parameters of the service response information (which may include the service execution result) and the method for generating the service response information.
[0077] Therefore, when the first node device receives the service response information returned by the second node device, it can parse the service response information to obtain the second target universal data carrier based on the service response format; it can be understood that the service response information is generated based on the service response format and the second target universal data carrier, so the second target universal data carrier can be parsed from the service response information based on the service response format; the service auxiliary tool is called to obtain the parameter acquisition function that matches the data type of the service execution result from the parameter acquisition function that matches the universal data type, and the obtained parameter acquisition function that matches the data type of the service execution result is used as the first parameter acquisition function; the first parameter acquisition function is called to extract the service execution result corresponding to the service call request from the second target universal data carrier. Among them, the data type of the service execution result can be obtained from the parameter definition information associated with the target service configured in the first node device.
[0078] For example, when the data type is a bool data type, the parameter acquisition function that matches the data type of the business execution parameter is called getSLBoo l. The parameter acquisition function is used to indicate that the business execution parameter is acquired from the general data carrier (extendData) in a key-value pair manner, such as using the parameter field as the key data to extract the value data from the general data carrier as the business execution parameter.
[0079] Optionally, the parameter definition information of the second node device may define parameter acquisition logic for business execution parameters, and the parameter adding logic includes the function name of the parameter adding function that matches the data type of the business response result. The parameter acquisition logic is used to indicate the extraction of business execution parameters from the parsed first target data universal carrier (extendData), and the parameter acquisition logic includes the function name of the parameter acquisition function that matches the data type of the business execution parameters. Therefore, the business auxiliary tool can obtain and call the parameter acquisition function that matches the data type of the business execution result by executing the parameter acquisition logic to extract the business execution parameters from the first target data universal carrier. Similarly, the parameter definition information of the second node device will also define parameter adding logic for business response information. The parameter adding logic is used to indicate the addition of the business response result to the created second initial data universal carrier (extendData), and the parameter adding logic includes the function name of the parameter adding function that matches the data type of the business execution result.
[0080] For example, the parameter acquisition logic is:
[0081] boolean queryDiffMode
[0082] =AgloUtils.getSLBool("queryDiffMode",rankRequest.getExtendData(),false);
[0083] / / Indicates that the service execution parameter queryDiffMode corresponding to the parameter field "queryDiffMode" is obtained from the first target data universal carrier (extendData) through the "getSLBool" parameter acquisition function.
[0084] It can be understood that the first node device can obtain the bearer type description information configured for the first universal data carrier field; the bearer type description information is used to indicate the data type of the data that can be added to the first initial universal data carrier; based on the service request format and the bearer type description information, the service communication protocol is determined. It can be understood that the bearer type description information is configured by the service object for the first universal data carrier field and the second universal data carrier field. The bearer type description information is used to indicate the data type of the data that can be added to the first initial universal data carrier corresponding to the first universal data carrier field and the second initial universal data carrier corresponding to the second universal data carrier field. Therefore, the service communication protocol can be determined based on the service request format, the service response format and the bearer type description information.
[0085] That is to say, the service communication protocol will define the service request format, service response format, and bearer type description information. Therefore, when the service request format and service response format configured by the service object are obtained, the bearer type description information configured for the first general data carrier field in the service request format and the second general data carrier field in the service response format is obtained, and the service communication protocol can be determined based on the service request format, service response format, and bearer type description information. The service communication protocol will be configured on both the first node device and the second node device to realize data communication between the first node device and the second node device. It can be understood that the service communication protocol will also define the communication interface between different node devices.
[0086] That is, the first universal data carrier field (the second universal data carrier field) is configured with bearer type description information, and the bearer type description information is used to indicate the data type of data that can be added to the first initial universal data carrier (that is, the data type of data that can be added to the second initial universal data carrier). Therefore, the data type indicated by the bearer type description information can be used as a universal data type to construct a parameter adding function that matches the universal data type and a parameter obtaining function that matches the universal data type; based on the parameter adding function that matches the universal data type and the parameter obtaining function that matches the universal data type, a business auxiliary tool associated with the business communication protocol is configured; the parameter adding function in the business auxiliary tool is used to add business execution parameters to the first initial universal data carrier; the parameter obtaining function in the business auxiliary tool is used to parse and obtain business execution parameters from the first target universal data carrier.
[0087] That is to say, the business assistance tool will be configured with parameter acquisition functions and parameter addition functions that match the data type indicated by the carrier type description information. The parameter acquisition function that matches the reference data type is used to extract data of the reference data type from the target universal data carrier corresponding to the universal data carrier field, and the parameter addition function that matches the reference data type is used to add data of the reference data type to the initial universal data carrier corresponding to the universal data carrier field.
[0088] It can be understood that for business call requests or business response information, the data that may be updated during business expansion is written into the constructed initial universal data carrier, such as writing the business call parameters into the first initial universal data carrier, and writing the business response information into the second initial universal data carrier. This allows the business communication protocol to be a universal protocol that can be used in any scenario.
[0089] For example, Figure 4-Figure 5 As shown, Figure 4-Figure 5 A schematic diagram of a recommendation system provided in an embodiment of the present application; wherein the present application can be applied to data communication between subsystems in any business system, and here the business system is taken as an example for explanation. Figure 4 , the recommendation system may include recommendation subsystem 1 (aceflow-homefeed, such as a business recommendation engine), recommendation subsystem 2 (dolphin, a business recommendation algorithm system), and recommendation subsystem 3 (nps, a business recommendation algorithm system); wherein:
[0090] Among them, when the user opens the application through the user terminal, the recommendation function is triggered, and the proxy layer in the gateway sends the recommendation request 1 to the background recommendation system, such as specifically to the recommendation subsystem 1 in the background recommendation system. The recommendation subsystem 1 parses the recommendation request 1 through the request parsing module, obtains the relevant user data through the data acquisition module, and the business recommendation module determines the recommendation result through the relevant user data. The determination of the recommendation result can be specifically implemented by the recommendation subsystem 2-recommendation subsystem 3, that is, the business recommendation module generates the recommendation request 2 based on the user data, and sends the recommendation request 2 to the recommendation subsystem 2; when the recommendation subsystem 2 parses the recommendation request 2 through the request parsing module, the data recall module recalls the recommendation data based on the user data in the recommendation request 2 to obtain the recall result, and the business sorting module determines the recall result through the relevant recall result. The sorting result (i.e., the recommendation result) can be specifically realized by the recommendation subsystem 3, that is, the business sorting module generates a recommendation request 3 based on the recall result, and sends the recommendation request 3 to the recommendation subsystem 3. The recommendation subsystem 3 analyzes the recommendation request 3 through the request analysis module to obtain the recall result, and the data sorting module sorts the recall result to obtain the final recommendation result. The recommendation subsystem 3 returns the response information 1 of the recommendation request 3 generated based on the recommendation result to the recommendation subsystem 2; the recommendation subsystem 2 analyzes the recommendation result from the response information 1, and returns the response information 2 of the recommendation request 2 generated based on the recommendation result to the recommendation subsystem 1; the recommendation subsystem 1 analyzes the recommendation result from the response information 2, and returns the response information 3 generated based on the recommendation result to the user to realize the user recommendation. It can be understood that the present scheme is to use the universal data carrier field in the universal communication protocol to construct and parse the business call request, construct and parse the business response information, and when the functional requirements are expanded, there is no need to modify the communication protocol, thereby improving the expansion efficiency of the functional requirements, and can be flexibly used for network communication transmission between systems.
[0091] Among them, Figure 5 , taking the node device in recommendation system 2 as the first node device (client) and the node device in recommendation system 3 as the second node device (server) as an example, the data communication process between the node devices of the two subsystems is as follows: S51, the first node device generates a recommendation request (recommendation request 3) according to the business request format in the business communication protocol; S52, the first node device serializes the recommendation request and sends it to the second node device through the underlying network; S53, the second node device deserializes to obtain the recommendation request; S54, the second node device parses the recommendation request based on the business communication protocol to obtain the business execution parameters in the recommendation request; S55, the second node device executes the recommendation data recall service based on the business execution parameters to obtain the recall result; S56, the second node device generates the business response information (response information 1) corresponding to the recall result based on the business response format in the business communication protocol; S57, the second node device serializes the business response information and returns it to the first node device through the underlying network; S58, the first node device deserializes to obtain the business response information; S59, the first node device parses the business communication protocol to obtain the recall result in the business response information, and performs subsequent processing.
[0092] It can be understood that the technical solution of the present application lies in the above-mentioned steps S51, S54, S56 and S58.
[0093] For example, S51: the first node device runs the deployed business assistance tool, and when the business assistance tool obtains the business execution parameters of the recommendation request 3, based on the parameter acquisition logic that matches the requested business, calls the parameter addition function that matches the data type of the business execution parameters, adds the business execution parameters to the first initial universal data carrier, obtains the first target universal data carrier (i.e., ExtendData), and generates the recommendation request 3 corresponding to the first target universal data carrier in accordance with the business request format indicated by the business communication protocol.
[0094] For another example, S54: the second node device runs the deployed business assistance tool, and the business assistance tool parses the recommended request 3 based on the business request format indicated by the business communication protocol, obtains the first target universal data carrier, and based on the parameter acquisition logic matching the requested business, calls the parameter acquisition function matching the data type of the business execution parameter to extract the business execution parameter from the first target universal data carrier.
[0095] For example, S56: the second node device runs the deployed business assistance tool, and when the business assistance tool obtains the business execution result (recall result) of the recommendation request 3, based on the parameter addition logic that matches the recall result obtained by execution, calls the parameter addition function that matches the data type of the business execution result, adds the business execution result to the second initial universal data carrier, obtains the second target universal data carrier (i.e., ExtendData), and generates business response information 1 corresponding to the second target universal data carrier in accordance with the business response format indicated by the business communication protocol.
[0096] For example, S58: the first node device runs the deployed business assistance tool, and the business assistance tool parses the business response information 1 based on the business response format indicated by the business communication protocol, obtains the second target universal data carrier, and based on the parameter acquisition logic that matches the recall result obtained by the execution, calls the parameter acquisition function that matches the data type of the business execution result to extract the business execution result from the second target universal data carrier.
[0097] For example, Figure 6 As shown, Figure 6 A schematic diagram of a service execution process provided by an embodiment of the present application; wherein the service communication protocol includes a service request format and a service response format, the service request format includes a first universal data carrier field, the service response format includes a second universal data carrier field, and the universal data types configured for the first universal data carrier field and the second universal data carrier field include data types A, B, and C. Therefore, the service auxiliary tool will be configured with parameter processing functions matching data type A (such as parameter adding function A and parameter obtaining function A), parameter processing functions matching data type B (such as parameter adding function B and parameter obtaining function B), and parameter processing functions matching data type C (such as parameter adding function C and parameter obtaining function C); at this time, when the service execution parameters of data type A are obtained, the service execution parameters can be added to the first initial universal data carrier through parameter adding function A to obtain the first target universal data carrier, and subsequently, the service execution parameters can be obtained from the first target universal data carrier through parameter obtaining function A. It can be understood that when there are multiple service execution parameters and the data types are different, the relevant parameter processing is performed respectively through the parameter processing functions matched by each.
[0098] In an embodiment of the present application, when the business execution parameters for the target business are obtained, the business request format defined in the business communication protocol can be obtained; the business request format includes a first universal data carrier field; a first initial universal data carrier (which can be used to carry the business execution parameters) is constructed based on the first universal data carrier field, and based on the data type of the business execution parameters, the business execution parameters are added to the first initial universal data carrier to obtain a first target universal data carrier corresponding to the first universal data carrier field, so as to construct a business call request corresponding to the target business, and send the business call request to the second node device, the second node device can parse the business execution parameters from the first target universal data carrier in the business call request, and execute the target business based on the parsed business execution parameters. Through the above method, there is no need to define specific parameter fields in the business request format. Instead, a universal data carrier field (called the first universal data carrier field) can be defined, and business execution parameters of various data types are added to the universal data carrier corresponding to the defined first universal data carrier field. In this way, when the business is expanded, there is no need to synchronously modify the business communication protocol. Even if the business execution parameters change, the first universal data carrier field in the business communication protocol can uniformly store the business execution parameters, and based on the universal data carrier with the required business execution parameters added, a correct business call request is generated to execute the business, which can improve the execution efficiency and flexibility of the business, and at the same time provide convenience and efficiency in business expansion.
[0099] Based on the above description, the embodiment of the present application proposes a service execution method, which can be executed by the electronic device mentioned above, and can be specifically Figure 1 The second node device is shown. Figure 7 , Figure 7 A flowchart of a service execution method provided in an embodiment of the present application. Figure 7 As shown, the process of the service execution method of the embodiment of the present application may include the following:
[0100] S201: Receive a service invocation request sent by a first node device for a target service.
[0101] The service call request is generated by the first node device based on the service execution parameters and the service request format defined in the service communication protocol when the service execution parameters of the target service are obtained; the service request format includes a first universal data carrier field; the universal data carrier indicated by the first universal data carrier field is configured as a data carrier to which data of a universal data type can be added; the service call request is determined based on the first target universal data carrier corresponding to the first universal data carrier field; the service execution parameters are added to the first target universal data carrier. For the specific description of the first universal data carrier field, please refer to the relevant description of the above embodiment, which will not be repeated here.
[0102] S202: parse and obtain service execution parameters from the first target universal data carrier in the service call request.
[0103] The second node device may parse the first target universal data carrier from the service call request based on the service request format, and parse the service execution parameter from the first target universal data carrier.
[0104] The second node device is also configured with a business auxiliary tool, which is called to obtain a parameter acquisition function that matches the data type of the business execution parameter from the parameter acquisition function that matches the general data type, and the obtained parameter acquisition function that matches the data type of the business execution parameter is used as the second parameter acquisition function; the second parameter acquisition function is called to extract the business execution parameter from the first target general data carrier. For the specific description of the business auxiliary tool, please refer to the relevant description of the above embodiment, which will not be repeated here.
[0105] Among them, the process and principle of the second node device parsing the service execution parameters from the service call request are the same as the process and principle of the first node device parsing the service execution result from the service response information. For details, please refer to the relevant description of the above embodiment, which will not be repeated here.
[0106] S203: Execute the target service based on the service execution parameters obtained through analysis.
[0107] Among them, after the second node device executes the target business based on the business execution parameters obtained by parsing, it obtains the business execution result corresponding to the business call request and obtains the business response format defined in the business communication protocol; the business response format includes a second universal data carrier field; based on the second universal data carrier field, a second initial universal data carrier for carrying the business execution result is constructed; based on the data type of the business execution parameter, the business execution result is added to the second initial universal data carrier to obtain the second target universal data carrier corresponding to the second universal data carrier field; based on the second target universal data carrier, the business response information corresponding to the business call request is constructed and the business response information is returned to the first node device.
[0108] Adding the service execution result to the second initial universal data carrier may be: calling the service auxiliary tool, obtaining a parameter adding function matching the data type of the service execution result from the parameter adding function matching the second universal data type, using the obtained parameter adding function matching the data type of the service execution result as the second parameter adding function; calling the second parameter adding function to add the service execution parameter to the second initial universal data carrier; using the second initial universal data carrier with the service execution result added as the second target universal data carrier. The second node device may determine the data type of the service execution result from the execution logic of the configured target service.
[0109] Among them, the process and principle of the second node device generating the service response information corresponding to the service execution result is the same as the process and principle of the first node device generating the service call request corresponding to the service execution parameter. For details, please refer to the relevant description of the above embodiment, which will not be repeated here. It can be understood that when the second node device is executing the target service, if a certain execution step is divided into sub-services and executed by other node devices (such as the third node device in the third subsystem), the second node device will also generate a service call request for the sub-service according to the above process and send it to the third node device. The third node device returns the service response information to the second node device based on the service call request. When the second node device determines the service execution result of the target service based on the service execution result of the sub-service, it further determines the service response information to be returned to the first node device.
[0110] For example, Figure 8 As shown, Figure 8 A schematic diagram of an interactive process of a service execution method provided for an embodiment of the present application; wherein, S81, when the first node device obtains the service execution parameters for the target service, obtains the service request format defined in the service communication protocol; S82, the first node device constructs a first initial universal data carrier for carrying the service execution parameters based on the first universal data carrier field; S83, the first node device calls a service auxiliary tool, obtains a parameter adding function that matches the data type of the service execution parameter from the parameter adding functions that match the first universal data type, and uses the obtained parameter adding function that matches the data type of the service execution parameter as the first parameter adding function; S84, the first node device calls The first parameter adding function adds the service execution parameters to the first initial universal data carrier, and uses the first initial universal data carrier with the service execution parameters added as the first target universal data carrier; S85, the first node device constructs a service call request corresponding to the target service based on the first target universal data carrier; S86, the first node device sends the service call request to the second node device; S87, the second node device parses the service call request based on the service request format to obtain the first target universal data carrier; S88, the second node device calls the service auxiliary tool, obtains the parameter acquisition function that matches the data type of the service execution parameters from the parameter acquisition function that matches the universal data type, and uses the acquired A parameter acquisition function that matches the data type of the service execution parameter is used as the second parameter acquisition function; S89, the second node device calls the second parameter acquisition function to extract the service execution parameter from the first target universal data carrier; S810, the second node device executes the target service based on the parsed service execution parameter to obtain the service execution result; S811, the second node device obtains the service response format defined in the service communication protocol; S812, the second node device constructs a second initial universal data carrier for carrying the service execution result based on the second universal data carrier field; S813, the second node device adds the service execution result to the second initial universal data carrier based on the data type of the service execution parameter, Obtain the second target universal data carrier corresponding to the second universal data carrier field; S814, the second node device constructs and obtains the service response information corresponding to the service call request based on the second target universal data carrier; S815, the second node device returns the service response information to the first node device; S816, the first node device parses the service response information based on the service response format to obtain the second target universal data carrier; S817, the first node device calls the service auxiliary tool, obtains the parameter acquisition function that matches the data type of the service execution result from the parameter acquisition function that matches the universal data type, and uses the obtained parameter acquisition function that matches the data type of the service execution result as the first parameter acquisition function;S818, the first node device calls the first parameter acquisition function to extract the service execution result corresponding to the service call request from the second target universal data carrier. ;
[0111] In the embodiment of the present application, after obtaining a service call request sent for a target service, the service execution parameters can be parsed from the first target universal data carrier in the service call request to execute the target service. The service call request is generated by the first node device based on the service execution parameters and the service request format defined in the service communication protocol. The service request format includes a first universal data carrier field. The universal data carrier indicated by the first universal data carrier field is configured as a data carrier to which data of a universal data type can be added. The first target universal data carrier is added with the service execution parameters. Through the above method, there is no need to define a specific parameter field in the service request format, but a universal data carrier field (called the first universal data carrier field) can be defined, and the service execution parameters of various data types can be added to the universal data carrier corresponding to the defined first universal data carrier field. In this way, when the service is expanded, there is no need to modify the service communication protocol synchronously. Even if the service execution parameters change, the first universal data carrier field in the service communication protocol can uniformly store the service execution parameters, and the correct service call request is generated based on the universal data carrier added with the required service execution parameters to execute the service, which can improve the execution efficiency and execution flexibility of the service, and at the same time provide the convenience and efficiency of service expansion.
[0112] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of a service execution device provided in an embodiment of the present application. It should be noted that: Fig. 9 The service execution device shown is used to execute this application Figure 3 and Figure 7 For the convenience of explanation, only the part related to the embodiment of the present application is shown, and the specific technical details are not disclosed. Figure 3 and Figure 7 The service execution device 900 may include: a parameter acquisition module 901 and a first processing module 902. Among them:
[0113] The parameter acquisition module 901 is used to acquire the service request format defined in the service communication protocol when the service execution parameters for the target service are acquired; the service request format includes a first universal data carrier field;
[0114] A first processing module 902 is configured to construct a first initial universal data carrier for carrying a service execution parameter based on the first universal data carrier field, and add the service execution parameter to the first initial universal data carrier based on a data type of the service execution parameter to obtain a first target universal data carrier corresponding to the first universal data carrier field;
[0115] The first processing module 902 is also used to construct a service call request corresponding to the target service based on the first target universal data carrier, and send the service call request to the second node device, so that the second node device parses the service execution parameters from the first target universal data carrier in the service call request, and executes the target service based on the parsed service execution parameters.
[0116] The business communication protocol is associated with a business auxiliary tool; the business auxiliary tool is configured with a parameter adding function matching the general data type; the general data type is a data type of data that can be added to the first initial general data carrier;
[0117] The first processing module 902 is used to add the service execution parameter to the first initial universal data carrier based on the data type of the service execution parameter to obtain the first target universal data carrier corresponding to the first universal data carrier field, specifically to:
[0118] Calling the business auxiliary tool, when determining that the data type of the business execution parameter belongs to the general data type, obtaining a parameter adding function that matches the data type of the business execution parameter from the parameter adding functions that match the general data type, and using the obtained parameter adding function that matches the data type of the business execution parameter as the first parameter adding function;
[0119] Calling a first parameter adding function to add the service execution parameter to the first initial universal data carrier;
[0120] The first initial universal data carrier added with the service execution parameters is used as the first target universal data carrier.
[0121] Among them, the business auxiliary tool is configured with a parameter acquisition function that matches the general data type;
[0122] The first processing module 902 is further configured to:
[0123] receiving service response information returned by the second node device; the service response information is generated by the second node device based on the service execution result corresponding to the service call request and the service response format defined in the service communication protocol; the service response format includes a second universal data carrier field; the service response information is determined based on the second target universal data carrier corresponding to the second universal data carrier field; the service execution result is added to the second target universal data carrier;
[0124] Based on the business response format, parse the business response information to obtain a second target universal data carrier;
[0125] Calling the business auxiliary tool, obtaining a parameter acquisition function that matches the data type of the business execution result from the parameter acquisition functions that match the general data type, and using the acquired parameter acquisition function that matches the data type of the business execution result as the first parameter acquisition function;
[0126] The first parameter acquisition function is called to extract the service execution result corresponding to the service call request from the second target universal data carrier.
[0127] The first processing module 902 is further used for:
[0128] Acquire bearer type description information configured for the first universal data carrier field; the bearer type description information is used to indicate the data type of data that can be added to the first initial universal data carrier;
[0129] Determine the service communication protocol based on the service request format and bearer type description information.
[0130] The first universal data carrier field is configured with bearer type description information, and the bearer type description information is used to indicate the data type of the data that can be added to the first initial universal data carrier;
[0131] The first processing module 902 is further configured to:
[0132] The data type indicated by the bearer type description information is used as a general data type, and a parameter adding function matching the general data type and a parameter obtaining function matching the general data type are constructed;
[0133] Based on a parameter adding function matching the general data type and a parameter obtaining function matching the general data type, a business auxiliary tool associated with the business communication protocol is configured; the parameter adding function in the business auxiliary tool is used to add the business execution parameters to the first initial general data carrier; the parameter obtaining function in the business auxiliary tool is used to parse the business execution parameters from the first target general data carrier.
[0134] The specific implementation of the parameter acquisition module and the first processing module can refer to the description of the above embodiment, which will not be described in detail here. It should be understood that the description of the beneficial effects obtained by adopting the same method will not be described in detail.
[0135] See also Fig.10 , Fig.10 This is a schematic diagram of the structure of a service execution device provided in an embodiment of the present application. It should be noted that: Fig.10 The service execution device shown is used to execute this application Figure 3 and Figure 7 For the convenience of explanation, only the part related to the embodiment of the present application is shown, and the specific technical details are not disclosed. Figure 3 and Figure 7 The service execution device 1000 may include: a request receiving module 1001 and a second processing module 1002 .
[0136] in:
[0137] The request receiving module 1001 is used to receive a service call request sent by the first node device for the target service; the service call request is generated by the first node device based on the service execution parameters and the service request format defined in the service communication protocol when the service execution parameters of the target service are obtained; the service request format includes a first universal data carrier field; the service call request is determined based on the first target universal data carrier corresponding to the first universal data carrier field; the service execution parameters are added to the first target universal data carrier;
[0138] The second processing module 1002 is used to parse the first target universal data carrier in the service call request to obtain the service execution parameter;
[0139] The second processing module 1002 is further configured to execute the target service based on the service execution parameters obtained through analysis.
[0140] The second processing module 1002 is further used for:
[0141] After executing the target business, the business execution result corresponding to the business call request is obtained;
[0142] Acquire a service response format defined in a service communication protocol; the service response format includes a second universal data carrier field;
[0143] Based on the second universal data carrier field, construct a second initial universal data carrier for carrying the service execution result;
[0144] Based on the data type of the service execution parameter, adding the service execution result to the second initial universal data carrier to obtain a second target universal data carrier corresponding to the second universal data carrier field;
[0145] Based on the second target universal data carrier, business response information corresponding to the business call request is constructed and returned to the first node device.
[0146] The specific implementation of the request receiving module and the second processing module can be found in the description of the above embodiment, which will not be described in detail here. It should be understood that the description of the beneficial effects obtained by adopting the same method will not be described in detail either.
[0147] See also Fig.11 , Fig.11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.11 As shown, the electronic device 1100 includes: at least one processor 1101 and a memory 1102. Optionally, the electronic device may further include a network interface. The processor 1101, the memory 1102 and the network interface may exchange data, the network interface is controlled by the processor 1101 to send and receive messages, the memory 1102 is used to store computer programs, the computer programs include program instructions, and the processor 1101 is used to execute the program instructions stored in the memory 1102. The processor 1101 is configured to call the program instructions to execute the above method.
[0148] The memory 1102 may include a volatile memory, such as a random-access memory (RAM); the memory 1102 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the memory 1102 may also include a combination of the above-mentioned types of memory.
[0149] The processor 1101 may be a central processing unit (CPU). In one embodiment, the processor 1101 may also be a graphics processing unit (GPU). The processor 1101 may also be a combination of a CPU and a GPU. The processor 1101 may be used to call the device control application stored in the memory 1102 to execute the above Figure 3 and Figure 7 The description of the service execution method in the corresponding embodiment can also be performed as described above. Fig. 9 and Fig.10 The description of the service execution device in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated here.
[0150] In a specific implementation, the device, processor, memory, etc. described in the embodiments of the present application can execute the implementation described in the above method embodiments, and can also execute the implementation described in the embodiments of the present application, which will not be repeated here.
[0151] A computer (readable) storage medium is also provided in the embodiment of the present application, and the computer storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by the processor, the processor can execute some or all of the steps performed in the above method embodiment. Optionally, the computer storage medium can be volatile or non-volatile. The computer readable storage medium can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc.; the data storage area can store data created according to the use of the blockchain node, etc.
[0152] An embodiment of the present application provides a computer program product, which may include a computer program. When the computer program is executed by a processor, it can implement some or all of the steps in the above method, which are not described in detail here.
[0153] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0154] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer storage medium, which can be a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0155] The above disclosure is only part of the embodiments of the present application, which certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiments and equivalent changes made according to the claims of the present application are still within the scope covered by the present application. < / bool>
Claims
1. A service execution method, characterized in that: The method comprises: Acquire bearer type description information configured for the first universal data carrier field in the service request format; the bearer type description information is used to indicate the data type of data that can be added to the first initial universal data carrier; Determine a service communication protocol based on the service request format and the bearer type description information; the service communication protocol is associated with a service auxiliary tool; the service auxiliary tool is configured with a parameter adding function and a matching parameter obtaining function that match the data type indicated by the bearer type description information; When the service execution parameters for the target service are obtained, the service request format defined in the service communication protocol is obtained; A first initial universal data carrier for carrying the service execution parameter is constructed based on the first universal data carrier field, and the service execution parameter is added to the first initial universal data carrier by using a parameter adding function in the service auxiliary tool that matches the data type of the service execution parameter, so as to obtain a first target universal data carrier corresponding to the first universal data carrier field; Based on the first target universal data carrier, a service call request corresponding to the target service is constructed, and the service call request is sent to a second node device, so that the second node device uses a parameter acquisition function in the service auxiliary tool that matches the data type of the service execution parameter to parse the service execution parameter from the first target universal data carrier in the service call request, and executes the target service based on the parsed service execution parameter.
2. The method according to claim 1, characterized in that The data type indicated by the bearer type description information is a general data type; The adding of the service execution parameter to the first initial universal data carrier by using the parameter adding function in the service auxiliary tool that matches the data type of the service execution parameter to obtain the first target universal data carrier corresponding to the field of the first universal data carrier includes: Calling the business auxiliary tool, when determining that the data type of the business execution parameter belongs to the general data type, obtaining a parameter adding function that matches the data type of the business execution parameter from the parameter adding functions that match the general data type, and using the obtained parameter adding function that matches the data type of the business execution parameter as the first parameter adding function; Calling the first parameter adding function to add the service execution parameter to the first initial universal data carrier; The first initial universal data carrier added with the service execution parameters is used as the first target universal data carrier.
3. The method according to claim 2, characterized in that The method further comprises: receiving service response information returned by the second node device; the service response information is generated by the second node device based on the service execution result corresponding to the service call request and the service response format defined in the service communication protocol; the service response format includes a second universal data carrier field; the service response information is determined based on a second target universal data carrier corresponding to the second universal data carrier field; the service execution result is added to the second target universal data carrier; Based on the service response format, parsing the service response information to obtain the second target universal data carrier; Calling the business auxiliary tool, acquiring a parameter acquisition function that matches the data type of the business execution result from the parameter acquisition functions that match the general data type, and using the acquired parameter acquisition function that matches the data type of the business execution result as the first parameter acquisition function; The first parameter acquisition function is called to extract the service execution result corresponding to the service call request from the second target universal data carrier.
4. The method according to claim 1, characterized in that: The method further comprises: Taking the data type indicated by the bearer type description information as a general data type, and constructing a parameter adding function matching the general data type and a parameter obtaining function matching the general data type; Based on a parameter adding function matching the general data type and a parameter obtaining function matching the general data type, a business auxiliary tool associated with the business communication protocol is configured.
5. A service execution method, characterized in that: The method comprises: Receive a service call request sent by a first node device for a target service; the service call request is generated by the first node device when acquiring the service execution parameters of the target service based on the service execution parameters and the service request format defined in the service communication protocol; the service request format includes a first universal data carrier field; the service call request is determined based on the first target universal data carrier corresponding to the first universal data carrier field; the service execution parameters are added to the first target universal data carrier; the service communication protocol includes bearer type description information configured for the first universal data carrier field; the bearer type description information is used to indicate the data type of data that can be added to the first initial universal data carrier corresponding to the first target universal data carrier; the service communication protocol is associated with a service assistance tool; the service assistance tool is configured with a parameter addition function that matches the data type indicated by the bearer type description information and a matching parameter acquisition function; Using a parameter acquisition function in the business auxiliary tool that matches the data type of the business execution parameter, the business execution parameter is parsed from the first target universal data carrier in the business call request to obtain the business execution parameter; The target service is executed based on the service execution parameters obtained by parsing.
6. The method according to claim 5, characterized in that The method further comprises: After executing the target service, obtaining a service execution result corresponding to the service call request; Acquire a service response format defined in the service communication protocol; the service response format includes a second universal data carrier field; Based on the second universal data carrier field, construct a second initial universal data carrier for carrying the service execution result; Using a parameter adding function in the business auxiliary tool that matches the data type of the business execution result, the business execution result is added to the second initial universal data carrier to obtain a second target universal data carrier corresponding to the field of the second universal data carrier; Based on the second target universal data carrier, business response information corresponding to the business call request is constructed and returned to the first node device.
7. A service execution device, characterized in that: The device comprises: A parameter acquisition module, used to acquire bearer type description information configured for the first universal data carrier field in the service request format; the bearer type description information is used to indicate the data type of data that can be added to the first initial universal data carrier; The parameter acquisition module is further used to determine the service communication protocol based on the service request format and the bearer type description information; the service communication protocol is associated with a service auxiliary tool; the service auxiliary tool is configured with a parameter adding function matching the data type indicated by the bearer type description information and a matching parameter acquisition function; The parameter acquisition module is further used to acquire the service request format defined in the service communication protocol when the service execution parameters for the target service are acquired; A first processing module is configured to construct a first initial universal data carrier for carrying the service execution parameter based on the first universal data carrier field, and add the service execution parameter to the first initial universal data carrier by using a parameter adding function in the service auxiliary tool that matches the data type of the service execution parameter, so as to obtain a first target universal data carrier corresponding to the first universal data carrier field; The first processing module is also used to construct a business call request corresponding to the target business based on the first target universal data carrier, and send the business call request to the second node device, so that the second node device uses the parameter acquisition function in the business auxiliary tool that matches the data type of the business execution parameter to parse the business execution parameter from the first target universal data carrier in the business call request, and execute the target business based on the parsed business execution parameter.
8. A service execution device, characterized in that: The device comprises: A request receiving module, used for receiving a service call request sent by a first node device for a target service; the service call request is generated by the first node device when acquiring the service execution parameters of the target service based on the service execution parameters and the service request format defined in the service communication protocol; the service request format includes a first universal data carrier field; the service call request is determined based on the first target universal data carrier corresponding to the first universal data carrier field; the service execution parameters are added to the first target universal data carrier; the service communication protocol includes bearer type description information configured for the first universal data carrier field; the bearer type description information is used to indicate the data type of data that can be added to the first initial universal data carrier corresponding to the first target universal data carrier; the service communication protocol is associated with a service assistance tool; the service assistance tool is configured with a parameter adding function and a matching parameter obtaining function that match the data type indicated by the bearer type description information; A second processing module is used to parse the first target universal data carrier in the service call request to obtain the service execution parameter by using a parameter acquisition function in the service auxiliary tool that matches the data type of the service execution parameter; The second processing module is further configured to execute the target service based on the service execution parameters obtained through analysis.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 6.
11. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 6.
