Response method and device for service request, server and storage medium
By introducing an interface conversion module and resource allocation algorithm from an intermediate server, the problem of online service systems being compatible with multiple third-party interfaces was solved, reducing the development cost of business servers and improving development efficiency and resource forwarding efficiency.
Patent Information
- Application Number
- CN202111537467.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2041-12-15
AI Technical Summary
The existing online service system needs to be compatible with the interfaces of multiple third-party service platforms, which leads to high server development costs and reduced development efficiency.
An intermediate server is introduced, which generates call links through an interface conversion module. The business server does not need to be compatible with different interfaces. The intermediate server is responsible for generating call links and allocating virtual resource packages.
It reduced the development cost of business servers and improved the development efficiency of online services and the forwarding efficiency of virtual resources.
Smart Images

Figure CN114168343B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of data processing, and particularly relates to a service request response method and device, a server and a storage medium. BACKGROUND
[0002] With the continuous development of online service technology, the application field of online service has also increased, and online service has become an integral part of users' daily life, such as shopping, transferring money, video calling and file editing through online service.
[0003] In order to meet the increasing diversification of online services, more and more third-party service platforms providing interface services have emerged, and users can manage their virtual resources, such as virtual currency, funds or cloud storage space, through third-party service platforms. The business server providing online service cannot determine in advance the platform for managing the virtual resources of the user, and when responding to the online service initiated by the user, the server is required to be compatible with the interfaces of all third-party service platforms, so as to obtain the virtual resources of the user through the interfaces provided by each third-party platform, thereby greatly increasing the development cost of the business server providing online server and reducing the development efficiency of online service. SUMMARY
[0004] The embodiments of the present application provide a service request response method, device, server and storage medium, which can solve the problem of the existing online service response technology, which requires the server to be compatible with the interfaces of all third-party service platforms, so as to obtain the virtual resources of the user through the interfaces provided by each third-party platform, thereby greatly increasing the development cost of the business server providing online server and reducing the development efficiency of online service.
[0005] In a first aspect, the embodiments of the present application provide a service request response method, comprising:
[0006] receiving a service request initiated by a user terminal forwarded by a business server; the service request carries an interface identifier and a service identifier;
[0007] calling an interface conversion module to determine a resource calling interface associated with the interface identifier, and feeding back a calling link corresponding to the resource calling interface to the business server, so that the business server feeds back the calling link to the user terminal;
[0008] receiving calling result information based on the calling link feedback, and determining a target virtual resource required to be called from the calling result information; the calling result information is generated after the user terminal calls the resource calling interface based on the calling request;
[0009] The resource forwarding module obtains a resource allocation algorithm matched with the service identifier, and imports the target virtual resource into the resource allocation algorithm to determine a plurality of virtual resource packages; each virtual resource package is associated with a corresponding target forwarding object;
[0010] The resource forwarding module sends each virtual resource package to the associated target forwarding object.
[0011] In a possible implementation of the first aspect, the interface conversion module determines a resource calling interface associated with the interface identifier, and feeds back a calling link corresponding to the resource calling interface to the service server, including:
[0012] Based on the interface identifier, the interface conversion module determines a calling request template associated with an interface server of the resource calling interface;
[0013] Based on a preset mapping relationship between the calling request template and a standard request template, the interface conversion module converts the service request into a calling request applicable to the interface server; the service request is generated based on a preset standard request template;
[0014] The interface conversion module sends the calling request to the interface server of the resource calling interface, and receives a calling link fed back by the interface server.
[0015] In a possible implementation of the first aspect, before the interface conversion module converts the service request into a calling request applicable to the interface server based on the preset mapping relationship between the calling request template and the standard request template, the method further includes:
[0016] The interface conversion module obtains request and response examples of different resource calling interfaces; each request and response example contains a plurality of key fields; the request and response examples are generated based on the calling request module;
[0017] The interface conversion module respectively calculates attribute similarities between the key fields of each request and response example; the attribute similarity is specifically:
[0018]
[0019] Qst xa is an attribute value corresponding to an a-th key field in an x-th resource calling interface request and response example, Qst yb is an attribute value corresponding to a b-th key field in a y-th resource calling interface request and response example; SimilarLv(Qst xa , Qst yb) is the attribute similarity; n is the total number of key fields in the request and response examples of the xth resource calling interface; m is the total number of key fields in the request and response examples of the yth resource calling interface; IDF is an inverse text probability calculation function; Semta(Qst xa , Qst yb ) is a semantic similarity calculation function; and a is a preset coefficient.
[0020] The key fields with the attribute similarity greater than a preset similarity threshold are divided into the same field class.
[0021] The standard request module is generated based on all the field classes, and the mapping relationship between the calling request module of each resource calling interface and the standard request template is established based on the inclusion relationship between the field class and the included key field.
[0022] In a possible implementation manner of the first aspect, the method further includes:
[0023] If an update instruction about any resource calling interface is received, a calling probe request is sent to the updated resource calling interface.
[0024] An update request example fed back by the updated resource calling interface based on the calling probe request is received.
[0025] The mapping relationship is updated based on the update request example and the standard request template.
[0026] In a possible implementation manner of the first aspect, the sending, by the resource forwarding module, of each virtual resource package to the associated target forwarding object includes:
[0027] The virtual resource package is added to a resource temporary storage server associated with the target forwarding object; each virtual resource package is configured with a forwarding waiting time length; and the initial state of each virtual resource package is an untransferable state.
[0028] If it is detected that the storage time of any virtual resource package in the resource temporary storage server is greater than or equal to the forwarding waiting time length, a state change instruction about the any virtual resource package is sent to the resource temporary storage server, so that the resource temporary storage server changes the state of the virtual resource package from the untransferable state to a transferable state; and the transferable state is used to forward, from all the virtual resource packages in the transferable state, a target transfer resource matching a transfer instruction initiated by the target forwarding object to the target forwarding object when the resource temporary storage server receives the transfer instruction.
[0029] In a possible implementation manner of the first aspect, the to-be-migrated state is determined when the first resource total amount of the virtual resource package of all the non-migratable states is determined after the resource temporary storage server detects that the first resource total amount of all the virtual resource packages of the to-be-migrated states is less than the target migration resource, and the migration failure information is generated according to the first resource total amount, the second resource total amount, and the target migration resource, and the migration failure information is fed back to the target forwarding object.
[0030] In a possible implementation manner of the first aspect, the calling result information is obtained by the user terminal based on the calling link of the resource calling interface after the service server sends the calling request to the user terminal, the user terminal generates a resource calling interface, receives the target virtual resource input by the user based on the resource calling interface, and sends the target virtual resource and authentication information to the interface server through the resource calling interface, and then receives the calling result information fed back by the interface server based on the authentication information.
[0031] In the second aspect, an embodiment of the present application provides a service request response apparatus, comprising:
[0032] a service request receiving unit configured to receive a service request initiated by a user terminal forwarded by a service server, wherein the service request carries an interface identifier and a service identifier;
[0033] a resource calling interface feedback unit configured to determine a resource calling interface associated with the interface identifier by an interface conversion module, and feed back a calling link corresponding to the resource calling interface to the service server, so that the service server feeds back the calling link to the user terminal;
[0034] a target virtual resource calling unit configured to receive calling result information fed back by the service server based on the calling request, and determine a target virtual resource to be called from the calling result information, wherein the calling result information is generated by the user terminal based on the calling request calling the resource calling interface;
[0035] a virtual resource package allocation unit configured to obtain a resource allocation algorithm matched with the service identifier by a resource forwarding module, and import the target virtual resource into the resource allocation algorithm to determine a plurality of virtual resource packages, wherein each virtual resource package is associated with a corresponding target forwarding object;
[0036] a virtual resource package sending unit configured to send each virtual resource package to the associated target forwarding object by the resource forwarding module.
[0037] In a third aspect, an embodiment of the present application provides a server, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the method according to any one of the first aspect when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the method according to any one of the first aspect.
[0039] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a server, causes the server to perform the method according to any one of the first aspect.
[0040] Compared with the prior art, the embodiment of the present application has the beneficial effects that: by configuring a corresponding intermediate server in the service response system, when a user terminal initiates a service request to a service server, the service server forwards the service request to the intermediate server, the intermediate server determines a resource calling interface corresponding to the service request through a built-in interface conversion module, generates a calling link for calling the resource calling interface, and sends the calling link to the service server, the service server can forward the calling link to the user terminal, the user terminal can call a corresponding interface server according to the calling link, and obtain a corresponding virtual resource from the interface server, and generate calling result information, and send the calling result information to the service server, the service server feeds back the calling result information to the intermediate server, the intermediate server can determine a target virtual resource to be called by the calling result information, divide the target virtual resource into a plurality of different virtual resource packages, and send the virtual resource packages to an associated target forwarding object, thereby completing the response operation to the service request. Compared with the prior art of responding to a service request, the service server in the embodiment of the present application does not need to be compatible with different interface servers, but only needs to forward the service request to a corresponding intermediate server, and the intermediate server can provide the generation task of the interface link for different service servers, thereby greatly reducing the development cost of the service server, and improving the development efficiency of online services. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0042] Figure 1is a structural schematic diagram of a service response system provided by an embodiment of the present application;
[0043] Figure 2 is an implementation flowchart of a service request response method provided by an embodiment of the present application;
[0044] Figure 3 is an implementation manner schematic diagram of S103 of a service request response method provided by an embodiment of the present application;
[0045] Figure 4 is an implementation manner schematic diagram of a service request response method provided by an embodiment of the present application;
[0046] Figure 5 is an implementation manner schematic diagram of a service request response method provided by an embodiment of the present application;
[0047] Figure 6 is an implementation manner schematic diagram of S109 of a service request response method provided by an embodiment of the present application;
[0048] Figure 7 is an implementation manner schematic diagram of S105 of a service request response method provided by an embodiment of the present application;
[0049] Figure 8 is a structural schematic diagram of a service request response apparatus provided by an embodiment of the present application;
[0050] Figure 9 is a structural schematic diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION
[0051] In the following description, for the purpose of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
[0052] It should be understood that the term "comprising" as used in the specification and in the claims indicates the presence of the recited features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0053] In addition, in the description of the specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0054] The service request response method provided by the embodiments of the present application can be applied to a service response system, and the method comprises the following steps. Figure 1 A structural schematic diagram of a service response system provided by the present application is shown. Referring to Figure 1 As shown, the service response system comprises a user terminal 11, a service server 12, an intermediate server 13 and an interface server 14 providing a resource calling interface. The user terminal 11 is connected with the service server 12, and the intermediate server 13 is connected with the service server 12 and the interface server 14. In some steps, the user terminal 11 can establish a communication connection with the interface server 13 based on a calling link.
[0055] Please refer to Figure 2 , Figure 2 A flowchart of an interaction process of a service request response method provided by the embodiments of the present application is shown. The method comprises the following steps.
[0056] In S101, the user terminal sends a service request to the service server. The service request carries an interface identifier and a service identifier.
[0057] In the embodiment, the user can generate a business operation page provided by the service server through a local terminal (i.e. the user terminal), and initiate a service request to the service server in the business operation page. The service request is any type of service provided by the service server. If the service server is a server of a shopping platform, the service request can be an online shopping service. If the service server is a server of an online video editing, the service request can be an online video editing service.
[0058] In the embodiment, one service server can provide different types of services, and therefore the service request can carry a service identifier for limiting the service type of the service request initiated by the user terminal. Since the user terminal needs to call a corresponding virtual resource from an interface server of a third-party service platform to complete the service operation in the process of executing the service request, the service request carries an interface identifier of the interface server of the virtual resource to be called.
[0059] For example, the user can complete the online shopping service through the business server. In this case, the user can generate a shopping operation page provided by the business server on the user terminal, and the shopping operation page contains a plurality of links of goods to be purchased. When the user browses the appropriate goods and makes a purchase, the user can initiate a service request for purchasing the specified goods to the business server. Since the payment operation needs to be completed when purchasing the goods, the payment can be completed through the specified payment platform. At this time, the resource calling interface of the payment platform needs to be called. Therefore, the service request will carry the service identifier for determining the goods to be purchased and the interface identifier of the payment channel interface, and the service request is sent to the business server.
[0060] In S102, the business server sends the service request to the intermediate server.
[0061] In this embodiment, after receiving the service request, the business server can not only generate the corresponding service response result based on the service identifier, but also forward the service identifier to the intermediate server. Since the resource calling interface of the third party needs to be used in the process of responding to the service request, the corresponding calling link needs to be generated. At this time, all interface calling links can be completed by the intermediate server. Therefore, the business server can forward the service request to the intermediate server after receiving the service request.
[0062] It should be noted that the intermediate server can be used to generate the corresponding calling link for different business servers. That is, the service response system can include business servers providing different service types. Different business servers can forward the received service request to the intermediate server, and the intermediate server can generate the corresponding calling link. For example, the service response system includes two business servers, such as the business server corresponding to the shopping platform 1 and the business server corresponding to the shopping platform 2. The business server of the shopping platform 1 and the business server of the shopping platform 2 can send the service request to the intermediate server to generate the corresponding calling link through the intermediate server.
[0063] In S103, the intermediate server calling interface conversion module determines the resource calling interface associated with the interface identifier, and feeds back the calling link corresponding to the resource calling interface to the business server.
[0064] In the embodiment, the intermediate server is configured with two modules, an interface conversion module for generating a resource calling interface and a resource forwarding module for allocating a virtual resource. When a calling link needs to be generated, the intermediate server can generate the calling link through the interface conversion module. The specific way of generating the calling link is that the intermediate server extracts the interface identifier of the required resource calling interface from the service request and inputs the interface identifier into the interface conversion module, so as to generate a calling link corresponding to the interface identifier. The interface conversion module records the calling templates of different resource calling interfaces, and the intermediate server can import the key information carried in the service request, such as the terminal identifier of the user terminal and the user account, into the calling template, so as to generate a calling link corresponding to the interface identifier.
[0065] In S104, the service server sends the calling link to the user terminal.
[0066] In the embodiment, after the service server generates the calling link of the resource calling interface, the service server can send the calling link to the service server. After the service server receives the calling link, the service server feeds back to the user terminal.
[0067] In a possible implementation, after the service server receives the calling link, the service server can encapsulate the service response result corresponding to the service request and the calling link into the same response data packet, and send the response data packet to the user terminal. The user terminal can determine the processing result corresponding to the service request through the response data packet, and execute the subsequent operation of calling the virtual resource through the calling link.
[0068] In S105, the user terminal calls the resource calling interface based on the calling link, and generates calling result information.
[0069] In the embodiment, after the user terminal receives the calling link sent by the service server, the user terminal can call the resource calling interface based on the calling link, so as to obtain the corresponding virtual resource from the interface server corresponding to the resource calling interface.
[0070] In a possible implementation, the user terminal invokes the resource invocation interface based on the invocation link, and generates a corresponding invocation page locally. For example, the resource invocation interface is a payment interface, and a corresponding payment page can be generated on the user terminal. For another example, the resource invocation interface is an invocation interface of a storage space, and a corresponding file management interface can be generated on the user terminal, and the file stored in the file management interface is a file stored by the user in the cloud storage space. In this case, the user can input a target virtual resource required to be invoked through the invocation page displayed on the user terminal, and click a corresponding confirmation control in the invocation page after inputting is completed. Then, the user terminal generates a corresponding invocation instruction, sends the invocation instruction to the interface server through the resource invocation interface, and feeds back corresponding invocation result information to the user terminal.
[0071] In S106, the interface server sends the invocation result information to the business server and the intermediate server.
[0072] In this embodiment, the interface server corresponding to the resource invocation interface can send the corresponding invocation result information to the user terminal after completing the invocation task, and generate a corresponding invocation completion page in the user terminal. At the same time, the interface server can send the corresponding invocation result information to the business server synchronously and to the intermediate server asynchronously. In a possible implementation, the interface server can send the invocation result information to the user terminal, send the invocation result information to the business server through the user terminal, and then the business server forwards the invocation result information to the intermediate server.
[0073] Taking an online shopping scenario as an example, the user terminal can generate a corresponding payment page locally according to the invocation link received above. After inputting a corresponding payment amount and corresponding authentication information, the payment platform (that is, the interface server) is sent through the resource invocation interface corresponding to the payment page. After the payment platform confirms that the payment is successful, the corresponding payment result is fed back to the user terminal. The payment result is the invocation result information above. The user terminal feeds back the payment result to the business server. After receiving the payment result, the business server can determine whether the user terminal completes the specified payment task, and thus determine whether the transaction is valid.
[0074] In S107, the intermediate server determines the target virtual resource required to be invoked from the invocation result information.
[0075] In the embodiment, after receiving the corresponding calling result information, the service server can determine whether the virtual resource is successfully called. If the calling result information is calling success, it is identified that the user terminal has successfully called the virtual resource. In this case, the intermediate server can determine the virtual resource called when responding to the service request, i.e., the target virtual resource, from the calling result information. Continuing with the online transaction as an example, the above-mentioned virtual resource is the amount of money paid when purchasing goods, or virtual currency, etc.
[0076] In S108, the intermediate server obtains the resource allocation algorithm matched with the service identifier through the resource forwarding module, and imports the target virtual resource into the resource allocation algorithm to determine a plurality of virtual resource packages. Each virtual resource package is associated with a corresponding target forwarding object.
[0077] In the embodiment, the intermediate server is configured with a resource forwarding module, different service identifiers can correspond to different resource allocation algorithms, and the intermediate server can obtain the corresponding resource allocation algorithm through the resource forwarding module according to the service identifier carried in the service request, and import the target virtual resource into the resource allocation algorithm, thereby obtaining the virtual resource package corresponding to different target forwarding objects.
[0078] In a possible implementation, the resource allocation algorithm is stored in an allocation database associated with the service server. The intermediate server can input the service identifier to the resource forwarding module, the resource forwarding module generates an algorithm acquisition request based on the service identifier, and sends the algorithm acquisition request to the service server. The service server can select the corresponding resource allocation algorithm from the allocation database and feed back to the intermediate server. After receiving the resource allocation algorithm, the intermediate server can configure the resource forwarding module based on the resource allocation algorithm, so that the resource forwarding module can divide the target virtual resource into a plurality of virtual resource packages conforming to the resource allocation algorithm. Each virtual resource package is associated with a corresponding target forwarding object.
[0079] Continuing to take online shopping as an example for description, when completing the shopping through the shopping platform (service server), the amount of money paid needs to be divided, for example, including the income of the shopping platform, the income of the logistics business, and the income of the manufacturer of the goods, etc. Different goods can correspond to different division algorithms. Based on this, the intermediate server can divide the target virtual resource to obtain the virtual resource package corresponding to different target forwarding objects.
[0080] In S109, the intermediate server sends each virtual resource package to the associated target forwarding object through the resource forwarding module.
[0081] In the embodiment, after the target virtual resource is divided and a plurality of virtual resource packages are obtained, each virtual resource package can be sent to the associated target forwarding object to complete the response to the service request.
[0082] As can be seen from the above, the method for responding to a service request provided by the embodiment of the application comprises the following steps: configuring a corresponding intermediate server in a service response system; when a user terminal initiates a service request to a business server, the business server forwards the service request to the intermediate server; the intermediate server determines a resource calling interface corresponding to the service request through an internal interface conversion module, generates a calling link for calling the resource calling interface, and sends the calling link to the business server; the business server can forward the calling link to the user terminal; the user terminal can call a corresponding interface server according to the calling link, and obtain a corresponding virtual resource from the interface server, and generate calling result information and send the calling result information to the business server; the business server feeds back the calling result information to the intermediate server; the intermediate server can determine a target virtual resource required by the calling result information, divide the target virtual resource into a plurality of different virtual resource packages, and send the virtual resource packages to associated target forwarding objects, so as to complete the response to the service request. Compared with the prior art, the business server in the embodiment of the application does not need to be compatible with different interface servers, but only needs to forward the service request to the corresponding intermediate server, and the intermediate server can provide the generation task of the interface link for different business servers, so that the development cost of the business server is greatly reduced, and the development efficiency of the online service is improved.
[0083] On the other hand, the intermediate server is also configured with a corresponding resource forwarding module, which can divide the target virtual resource obtained in the service request response process to obtain a plurality of resource data packages and forward them to the corresponding target forwarding object, so that the target virtual resource generated can be divided according to a specified allocation algorithm, and the automation degree of the service response process and the forwarding efficiency of the virtual resource are improved.
[0084] Figure 3 A specific implementation flowchart of the method S103 for responding to a service request provided by the second embodiment of the application is shown. Referring to Figure 3 , compared with Figure 1 the embodiment, the method for responding to a service request provided by the embodiment comprises S1031-S1033, which are specifically described as follows.
[0085] Further, the intermediate server calling interface conversion module determines the resource calling interface associated with the interface identifier, and feeds back the calling link corresponding to the resource calling interface to the business server, which comprises the following steps:
[0086] In S1031, the intermediate server determines the calling request template associated with the interface server of the resource calling interface based on the interface identifier.
[0087] In the embodiment, the intermediate server stores the calling request templates associated with the interface servers of different resource calling interfaces. The calling request template contains at least one key field. In the calling request template, the content of the key field is empty, which needs to be extracted from the service request and filled into the key field of the calling request template.
[0088] For example, the key fields contained in the calling request template include user account, authentication password, calling number, timestamp, and interface identifier. It should be noted that the calling request templates associated with the interface servers of different resource calling interfaces can be the same or different. The number and arrangement of key fields contained in different calling request templates can also be different. Therefore, in order to be compatible with different resource calling interfaces, the existing business server often needs to store multiple calling request templates. When receiving the service request initiated by the user terminal, a specific calling request template is used to generate a corresponding calling link. When the interface server is updated or needs to be expanded to be compatible with the resource calling interface, the calling request template in the business server needs to be updated, which greatly increases the development workload of the business server and in turn increases the development cost of the business server.
[0089] In S1032, the intermediate server converts the service request into a calling request suitable for the interface server through the interface conversion module based on the mapping relationship between the preset calling request template and the standard request template. The service request is generated based on the preset standard request template.
[0090] In the embodiment, for calling different types of resource calling interfaces, the business server generates corresponding service requests using the same standard request template. That is, the business server only needs to store one type of request template, i.e., the standard request template. The calling operations of different resource calling interfaces are the same for the business server. In this case, whether the interface server is increased, decreased, or updated, the business server does not need to be developed or adjusted again. After the business server sends the service request generated based on the standard request template to the intermediate server, the intermediate server can convert the service request based on the standard request template into a calling request of the calling request template corresponding to the interface identifier through the interface conversion module based on the mapping relationship between the preset calling request template and the standard request template, thereby realizing the conversion of the data format.
[0091] In S1033, the intermediate server sends the calling request to the interface server of the resource calling interface, and receives the calling link fed back by the interface server.
[0092] In the embodiment, after the intermediate server converts the service request into the calling request associated with the interface server, the intermediate server can send the calling request to the interface server. When the interface server identifies that the calling request is legal, i.e., the request meets the calling rule, the interface server feeds back the corresponding calling link to the intermediate server. The interface server associated resource calling interface can be called through the calling link.
[0093] In the embodiment, the intermediate server is used to complete the format conversion of the calling request. For the business server, the same service request can be generated when the calling operation is initiated to different resource calling interfaces. Regardless of the increase or update of the resource calling interface, the business server does not need to be reconfigured, thereby greatly reducing the development difficulty of the business server. At the same time, since the intermediate server integrates the format conversion of the calling request of all business servers, when the calling request template of the resource calling interface needs to be increased or updated, the mapping relationship pre-stored in the intermediate server can be adjusted, thereby realizing the batch update of all business servers that need to call the resource calling interface, and greatly reducing the development workload caused by the interface update or expansion.
[0094] Figure 4 A specific implementation flowchart of a service request response method provided by a third embodiment of the application is shown. Referring to Figure 4 , compared with Figure 3 the embodiment, the service request response method provided by the embodiment further includes S401-S404 before S1032, which are specifically described as follows.
[0095] Before the intermediate server converts the service request into the calling request applicable to the interface server through the interface conversion module based on the mapping relationship between the preset calling request template and the standard request template, the method further includes:
[0096] In S401, the intermediate server acquires request response examples of different resource calling interfaces. Each request response example contains a plurality of key fields. The request response example is generated based on the calling request module.
[0097] In the embodiment, in order to generate a standard request template which is compatible with all resource calling interfaces, the information carried in the standard request template can meet the calling request of all resource calling interfaces. For example, the information content required by the resource calling interface 1 includes a user identifier and a user password, and the information content required by the resource calling interface 2 includes a user identifier and an interface number. In this case, in order to be compatible with the resource calling interface 1 and the resource calling interface 2, the information content required by the standard request template includes a user identifier, a user password and an interface number. As can be seen, when determining the standard interface template, the key fields included in all resource calling interfaces need to be determined, and all key fields are clustered and fused, and the corresponding standard request template is determined based on the clustering and fusion result.
[0098] In the embodiment, in order to determine the key fields included in different resource calling interfaces, the request and response examples corresponding to each resource calling interface need to be obtained. The intermediate server can analyze each request and response example to determine the key fields included in different request and response examples. It needs to be pointed out that each request and response example is generated based on the calling request template of the associated resource calling interface, that is, the format of the request and response example is the same as that of the calling request template.
[0099] In S402, the intermediate server calculates the attribute similarity between the key fields of each request and response example; the attribute similarity is specifically:
[0100]
[0101] Qst xa is the attribute value corresponding to the a-th key field in the request and response example of the x-th resource calling interface, Qst yb is the attribute value corresponding to the b-th key field in the request and response example of the y-th resource calling interface; SimilarLv(Qst xa , Qst yb ) is the attribute similarity; n is the total number of key fields in the request and response example of the x-th resource calling interface; m is the total number of key fields in the request and response example of the y-th resource calling interface; IDF is an inverse text probability calculation function; Semta(Qst xa , Qst yb ) is a semantic similarity calculation function; and a is a preset coefficient.
[0102] In the embodiment, the same key fields in different resource calling interfaces can be represented in different data formats or encoding, for example, for a user name, some resource calling interfaces can represent the user name in Chinese, and some resource calling interfaces can represent the user name in English. Therefore, in order to determine the same key fields, the attribute similarity between the key fields in different resource calling interfaces needs to be calculated. Specifically, the attribute similarity between different key fields is related to two factors, namely, semantic similarity between different key fields and inverse text probability. Since the content in the above request and response example can be filled into the corresponding calling request template based on the content carried in the training request example, if the attributes of two key fields are the same, the semantics of the filled content have certain relevance, such as user name or residence address, which have certain naming rules and great semantic similarity. Therefore, the content of the key fields can be imported into the semantic similarity calculation function to determine the semantic similarity. At the same time, the intermediate server can also determine the inverse text probability of the key field in the request and response example, so as to determine whether the key field has similar content in the request and response example, thereby determining the uniqueness of the key field. The intermediate server can identify whether the two key fields are the same attribute by the above two factors.
[0103] In S403, the intermediate server divides the key fields with the attribute similarity greater than the preset similarity threshold to the same field class.
[0104] In the embodiment, the intermediate server identifies the key fields with the attribute similarity greater than the preset threshold as the key fields with the same attribute, so that all key fields with the same attribute can be divided into the same field class, thereby achieving the clustering purpose of the key fields.
[0105] In S404, the intermediate server generates the standard request module based on all the field classes, and establishes the mapping relationship between the calling request module of each resource calling interface and the standard request template based on the inclusion relationship between the field class and the included key field.
[0106] In the embodiment, since the standard request template needs to be compatible with the calling request templates of all different resource calling interfaces, that is, it needs to include all the key fields required by the calling request templates, after clustering all the key fields and obtaining a plurality of field classes, the corresponding standard request template can be generated based on all the field classes. Therefore, the standard request template can necessarily cover all the information required by the calling request of the resource calling interface, and based on the inclusion relationship between each field class and the included key field, the above mapping relationship can be generated, thereby achieving the format conversion between the standard request template and the calling request template.
[0107] In the embodiment of the application, the clustering analysis is performed on the key fields required by all resource calling interfaces to generate a standard request template and a corresponding mapping relationship, so that the service request generated based on the standard request template can necessarily contain information required by any type of resource calling interface, and the success rate of format conversion is improved.
[0108] Figure 5 A specific implementation flowchart of a response method of a service request provided by the fourth embodiment of the application is shown. Referring to Figure 5 , compared with Figure 3 the embodiment, the response method of the service request provided by the embodiment further includes S501-S503, which are specifically described as follows.
[0109] In S501, if the intermediate server receives an update instruction about any resource calling interface, the intermediate server sends a calling probe request to the updated resource calling interface.
[0110] In S502, the intermediate server receives an update request example fed back by the updated resource calling interface based on the calling probe request.
[0111] In S503, the intermediate server updates the mapping relationship based on the update request example and the standard request template.
[0112] In the embodiment, in the case where the resource calling interface is updated, the interface server associated with the resource calling interface can send an update instruction to the intermediate server. After the intermediate server receives the update instruction, the intermediate server can send a calling probe request to the resource calling interface. After the interface server corresponding to the resource calling interface receives the calling probe request, the interface server sends an update request example to the intermediate server. The intermediate server can determine the key fields contained in the update request example and identify the key fields associated in the standard request template based on the update request example. The mapping relationship between the update request example and the standard request template is updated based on the positions of the same key fields in the update request example and the standard request template.
[0113] In the embodiment of the application, when the resource calling interface needs to be updated, the intermediate server sends a corresponding calling probe request to the resource calling interface to obtain a corresponding update request example, and updates the original mapping relationship based on the update request example, so that the mapping relationship can be automatically updated when the interface is updated, without the need for the user to adjust again, the timeliness of the mapping relationship adjustment is improved, and the operation of the user is reduced.
[0114] Figure 6A specific implementation flowchart of the method S109 for responding to a service request provided by the fifth embodiment of the present application is shown. Referring to Figure 6 , relative to Figures 1-5 any one of the embodiments, the method S109 for responding to a service request provided by the embodiment includes S1091-S1093, which are specifically described as follows:
[0115] In S1091, the intermediate server adds the virtual resource package to the resource temporary storage server associated with the target forwarding object; each virtual resource package is configured with a forwarding waiting time length; and the initial state of each virtual resource package is an untransferable state.
[0116] In S1092, if the intermediate server detects that any virtual resource package is stored in the resource temporary storage server for a time greater than or equal to the forwarding waiting time length, the intermediate server sends a state change instruction about the virtual resource package to the resource temporary storage server, so as to change the state of the virtual resource package from the untransferable state to the transferable state.
[0117] In the embodiment, the intermediate server can temporarily store the virtual resource package forwarded to the target forwarding object. Since the service response process has a certain processing period in some service scenarios, the service request is still in the to-be-completed state within the processing period. Taking the online shopping scenario as an example, after a user purchases a product, the user can choose to cancel the transaction to cancel the purchased product, in which case the user's payment amount needs to be refunded. In order to improve the timeliness of the payment amount refund, the user's payment amount (i.e., the virtual resource package) is in an untransferable state before the transaction is completed, and is temporarily stored in the corresponding resource temporary storage server by the intermediate server.
[0118] It should be noted that each target forwarding object can be configured with an associated resource temporary storage server, and the corresponding object account of the corresponding target forwarding object can be configured in the resource temporary storage server. Based on this, one resource temporary storage server can correspond to multiple target forwarding objects, and the intermediate server adds the virtual resource package of the target forwarding object to the object account associated with the target forwarding object in the resource temporary storage server. Each virtual resource package is configured with a corresponding forwarding waiting time length, and when the storage time in the resource temporary storage server is less than the forwarding waiting time length, the state of the virtual resource package is an untransferable state. Only when the storage time is greater than the forwarding waiting time length, the intermediate server sends a state change instruction to the resource temporary storage server, and the state change instruction contains the resource number corresponding to the virtual resource package, so as to change the state of the virtual resource package, i.e., from the untransferable state to the transferable state.
[0119] In S1093, the resource temporary storage server forwards the target transfer resource matching the transfer instruction to the target transfer object from all the virtual resource packages in the to-be-transferred state.
[0120] In the embodiment, the resource temporary storage server can receive a transfer instruction initiated by the target transfer object, the transfer instruction containing the target transfer resource to be transferred. The resource temporary storage server can extract a number of virtual resource packages matching the target transfer resource from all the virtual resource packages in the to-be-transferred state, and transfer the corresponding virtual resource packages to the user account associated with the target transfer object.
[0121] Further, as another embodiment of the present application, S1903 can specifically include the following two steps.
[0122] Step 1: The resource temporary storage server determines the second resource total amount of the virtual resource packages in the untransferrable state if the first resource total amount of all the virtual resource packages in the to-be-transferred state is less than the target transfer resource.
[0123] Step 2: The resource temporary storage server generates transfer failure information according to the first resource total amount, the second resource total amount, and the target transfer resource, and feeds back the transfer failure information to the target transfer object.
[0124] In the embodiment, if the total amount of the to-be-transferred resources of the target transfer object in the resource temporary storage server (i.e., the first resource total amount) is less than the target transfer resource, it means that the transfer task cannot be completed. In this case, in order to facilitate the target transfer object to understand the reason for the failure of this transfer, the second resource total amount of the virtual resource packages in the untransferrable state is counted, and the corresponding transfer failure information is generated based on the first resource total amount, the second resource total amount, and the target transfer resource. The transfer failure information can specifically include the following two cases.
[0125] Case 1: If the sum of the first resource total amount and the second resource total amount is greater than or equal to the target transfer resource, the transfer waiting time is determined, and the transfer waiting time is added to the transfer time information so that the target transfer object knows how long he needs to wait to complete the resource transfer operation. Since the first resource total amount is less than the target transfer resource, it means that some virtual resource packages in the untransferrable state need to be changed to virtual resource packages in the to-be-transferred state. Therefore, the missing resource amount can be determined according to the difference between the target transfer resource and the first resource total amount, and the transfer waiting time can be calculated based on the storage time of all the virtual resource packages in the untransferrable state and the corresponding transfer waiting time.
[0126] Case 2: if the sum of the first resource total amount and the second resource total amount is less than the target transfer resource, a transfer failure information of insufficient resource is generated to notify the target forwarding object that the virtual resource to which the target forwarding object belongs is insufficient.
[0127] In the embodiment of the present application, the virtual resource package is stored in the resource temporary storage server, and the state of the virtual resource package is changed only when the preset forwarding waiting time length is met, thereby improving the security of virtual resource management.
[0128] Figure 7 A specific implementation flowchart of a service request response method S105 provided by the sixth embodiment of the present application is shown. Referring to Figure 7 , the embodiment provides a service request response method S105, which includes S1051-S1053, and specific details are as follows: Figures 1-5
[0129] In S1051, the user terminal invokes the resource invocation interface based on the invocation link, and generates a resource invocation interface.
[0130] In S1052, the user terminal receives the target virtual resource input by the user based on the resource invocation interface, and sends the target virtual resource and authentication information to the interface server through the resource invocation interface.
[0131] In S1053, the user terminal receives the invocation result information fed back by the interface server based on the authentication information.
[0132] In the embodiment, after receiving the invocation link, the user terminal can invoke the resource invocation interface based on the invocation link. The resource invocation interface can send corresponding interface data to the user terminal, and the user terminal can generate a corresponding resource invocation interface based on the received interface data. The user can output the required called virtual resource, i.e., the target virtual resource, in the resource invocation interface, and send the target virtual resource to the interface server through the resource invocation interface. Optionally, the corresponding authentication information and the target virtual resource can be sent to the interface server. After receiving the authentication information, the interface server can authenticate the local invocation operation initiated by the user terminal. If the authentication information matches the standard information pre-stored by the user associated with the user terminal, the current invocation is identified as a legal invocation, and the invocation result information containing the target virtual resource is fed back to the user terminal, and the current target virtual resource invocation operation is completed.
[0133] In the embodiment of the present application, by sending the corresponding authentication information to the interface server, the legal authentication of the invocation operation can be performed, and the security of virtual resource transfer is improved.
[0134] Figure 8 A structural block diagram of a service request response apparatus provided by an embodiment of the present application is shown, which comprises units for performing Figure 2 the steps implemented by the intermediate server in the corresponding embodiment. For details, please refer to Figure 2 and Figure 2 the related description in the corresponding embodiment. For ease of illustration, only the parts related to the present embodiment are shown.
[0135] Please refer to Figure 8 , the service request response apparatus comprises:
[0136] A service request receiving unit 81 is configured to receive a service request initiated by a user terminal and forwarded by a service server; the service request carries an interface identifier and a service identifier;
[0137] A resource calling interface feedback unit 82 is configured to determine a resource calling interface associated with the interface identifier by calling an interface conversion module, and feed back a calling link corresponding to the resource calling interface to the service server, so that the service server feeds back the calling link to the user terminal;
[0138] A target virtual resource calling unit 83 is configured to receive calling result information fed back by the service server based on the calling request, and determine a target virtual resource to be called from the calling result information; the calling result information is generated after the user terminal calls the resource calling interface based on the calling request;
[0139] A virtual resource package allocation unit 84 is configured to obtain a resource allocation algorithm matching the service identifier by a resource forwarding module, and import the target virtual resource into the resource allocation algorithm to determine a plurality of virtual resource packages; each virtual resource package is associated with a corresponding target forwarding object;
[0140] A virtual resource package sending unit 85 is configured to send each virtual resource package to the associated target forwarding object by the resource forwarding module.
[0141] Optionally, the resource calling interface feedback unit 81 comprises:
[0142] A calling request template determination unit is configured to determine a calling request template associated with an interface server of the resource calling interface based on the interface identifier;
[0143] A calling request conversion unit is configured to convert the service request into a calling request applicable to the interface server based on a mapping relationship between a preset calling request template and a standard request template; the service request is generated based on a preset standard request template;
[0144] The calling link receiving unit is configured to send the calling request to the interface server of the resource calling interface and receive a calling link fed back by the interface server.
[0145] Optionally, the service request response device further comprises:
[0146] The request response example obtaining unit is configured to obtain request response examples of different resource calling interfaces; each of the request response examples comprises a plurality of key fields; the request response examples are generated based on the calling request module;
[0147] The attribute similarity calculating unit is configured to calculate attribute similarities between the key fields of each of the request response examples; the attribute similarity is specifically:
[0148]
[0149] wherein, Qst xa is an attribute value corresponding to an a-th key field in a request response example of an x-th resource calling interface, Qst yb is an attribute value corresponding to a b-th key field in a request response example of a y-th resource calling interface; SimilarLv(Qst xa , Qst yb ) is the attribute similarity; n is a total number of key fields in the request response example of the x-th resource calling interface; m is a total number of key fields in the request response example of the y-th resource calling interface; IDF is an inverse text probability calculation function; Semta(Qst xa , Qst yb ) is a semantic similarity calculation function; and a is a preset coefficient.
[0150] The field class division is configured to divide the key fields with the attribute similarity greater than a preset similarity threshold to the same field class.
[0151] The mapping relationship establishment is configured to generate the standard request module based on all the field classes and establish the mapping relationship between the calling request module and the standard request template of each of the resource calling interfaces based on a containing relationship between the field classes and the key fields contained therein.
[0152] Optionally, the service request response device further comprises:
[0153] The calling probe request sending unit is configured to send a calling probe request to an updated resource calling interface if an update instruction about any of the resource calling interfaces is received.
[0154] The update request example is received, and the updated resource calling interface is based on the update request example and the calling probe request feedback.
[0155] The mapping relationship updating unit is configured to update the mapping relationship based on the update request example and the standard request template.
[0156] Optionally, the virtual resource package sending unit 85 comprises:
[0157] The resource temporary storage unit is configured to add the virtual resource package to a resource temporary storage server associated with the target forwarding object, each virtual resource package is configured with a forwarding waiting time length, and an initial state of each virtual resource package is an untransferable state.
[0158] The state changing unit is configured to send a state changing instruction about any virtual resource package to the resource temporary storage server if it is detected that the storage time of the virtual resource package in the resource temporary storage server is greater than or equal to the forwarding waiting time length, so as to change the state of the virtual resource package from the untransferable state to a transferable state, and the transferable state is used to forward a target transfer resource matching a transfer instruction initiated by the target forwarding object to the target forwarding object from all virtual resource packages in the transferable state when the resource temporary storage server receives the transfer instruction.
[0159] Optionally, the transferable state is used to determine a second total amount of resources of all virtual resource packages in the untransferable state, generate a transfer failure information according to the first total amount of resources, the second total amount of resources and the target transfer resource, and feed back the transfer failure information to the target forwarding object when it is detected that the first total amount of resources of all virtual resource packages in the transferable state is less than the target transfer resource.
[0160] Optionally, the calling result information is obtained by the user terminal based on the calling link, calling the resource calling interface, generating a resource calling interface, receiving a target virtual resource input by the user based on the resource calling interface, sending the target virtual resource and authentication information to an interface server through the resource calling interface, and receiving the interface server feedback based on the authentication information.
[0161] Therefore, the service request response device provided in this embodiment of the invention can also be configured with a corresponding intermediate server in the service response system. When a user terminal initiates a service request to a business server, the business server forwards the service request to the intermediate server. The intermediate server determines the resource call interface corresponding to the service request through its built-in interface conversion module, generates a call link for calling the resource call interface, and sends the call link to the business server. The business server can forward the call link to the user terminal, which can then call the corresponding interface server according to the call link, obtain the corresponding virtual resource from the interface server, generate call result information, and send the call result information to the business server. The business server feeds back the call result information to the intermediate server, which can determine the target virtual resource to be called according to the call result information, divide the target virtual resource into multiple different virtual resource packages, and send them to the associated target forwarding object, thereby completing the service request response operation. Compared with existing service request response technologies, in this embodiment, the business server does not need to be compatible with different interface servers, but only needs to forward the service request to the corresponding intermediate server. The intermediate server can provide interface link generation tasks for different business servers, thereby greatly reducing the development cost of the business server and improving the development efficiency of online services.
[0162] It should be understood that, Figure 8 In the structural block diagram of the service request response device shown, each module is used to perform... Figures 2 to 7 The corresponding steps of the intermediate server in the embodiment, and for Figures 2 to 7 The steps in the corresponding embodiments have been explained in detail in the above embodiments. Please refer to them for details. Figures 2 to 7 as well as Figures 2 to 7 The relevant descriptions in the corresponding embodiments will not be repeated here.
[0163] Figure 9 This is a structural block diagram of a server provided in another embodiment of this application. For example... Figure 9 As shown, the server 900 of this embodiment includes a processor 910, a memory 920, and a computer program 930 stored in the memory 920 and executable on the processor 910, such as a program for responding to service requests. When the processor 910 executes the computer program 930, it implements the steps in the various embodiments for responding to service requests described above, for example... Figure 2 S101 to S109 are shown. Alternatively, the processor 910 implements the above when executing the computer program 930. Figure 9 The functions of each module in the corresponding embodiments, for example, Figure 8 For details on the functions of units 81 to 85 shown, please refer to [link / reference]. Figure 8 The relevant descriptions in the corresponding embodiments.
[0164] For example, the computer program 930 can be divided into one or more modules, which are stored in the memory 920 and executed by the processor 910 to complete the present application. One or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 930 in the server 900. For example, the computer program 930 can be divided into various unit modules, and the specific functions of each module are as described above.
[0165] The server 900 can include, but is not limited to, a processor 910, a memory 920. Those skilled in the art can understand that the server 900 can include more or fewer components than those shown, or combine some components, or include different components, for example, the server can also include an input / output device, a network access device, a bus, etc. Figure 9 The above is only an example of the server 900, and does not constitute a limitation on the server 900, and can include more or fewer components than those shown, or combine some components, or different components, for example, the server can also include an input / output device, a network access device, a bus, etc.
[0166] The processor 910 can be a central processing unit, and can also be other general-purpose processors, digital signal processors, application-specific integrated circuits, ready programmable gate arrays or other programmable logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0167] The memory 920 can be an internal storage unit of the server 900, such as a hard disk or memory of the server 900. The memory 920 can also be an external storage device of the server 900, such as a plug-in hard disk, a smart memory card, a flash memory card, etc. equipped on the server 900. Further, the memory 920 can include both the internal storage unit and the external storage device of the server 900.
[0168] The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
[0169] The above examples are only used to illustrate the technical solutions of the present application, but not limit the same; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that the technical solutions recorded in the foregoing examples can be modified, or some technical features can be replaced by equivalent ones; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for responding to a service request, characterized in that, The response method includes: The service server receives service requests initiated by user terminals and forwards them; the service requests carry an interface identifier and a service identifier. The call interface conversion module determines the resource call interface associated with the interface identifier, and feeds back the call link corresponding to the resource call interface to the business server, so that the business server feeds back the call link to the user terminal; the call link is used by the user terminal to call the resource call interface based on the call link, generate a corresponding call page on the user terminal, generate a call instruction through the call page, and send the call instruction to the corresponding interface server through the resource call interface. Receive call result information based on the call link, and determine the target virtual resource to be called from the call result information; the call result information is generated after the user terminal calls the resource call interface based on the service request; The resource forwarding module obtains a resource allocation algorithm that matches the service identifier, and imports the target virtual resource into the resource allocation algorithm to determine multiple virtual resource packages; each virtual resource package is associated with a corresponding target forwarding object; The resource forwarding module sends each of the virtual resource packets to the associated target forwarding object. The call interface conversion module determines the resource call interface associated with the interface identifier and feeds back the call link corresponding to the resource call interface to the business server, including: Based on the interface identifier, determine the call request template associated with the interface server of the resource call interface; Based on the mapping relationship between the preset call request template and the standard request template, the interface conversion module converts the service request into a service request suitable for the interface server; the service request is generated based on the preset standard request template. Send the service request to the interface server of the resource call interface, and receive the call link returned by the interface server; Before the interface conversion module converts the service request into a service request suitable for the interface server based on the preset mapping relationship between the call request template and the standard request template, the following steps are also included: Obtain request and response examples for different resource call interfaces; each request and response example contains multiple key fields; the request and response examples are generated based on the call request template; Calculate the attribute similarity between the key fields of each of the aforementioned request-response examples; specifically, the attribute similarity is as follows: in, For the request and response example of the xth resource call interface, the attribute value corresponding to the a-th key field is... This is the attribute value corresponding to the b-th key field in the request and response example of the y-th resource call interface; The attribute similarity is n; n is the total number of key fields in the request-response example of the x-th resource call interface; m is the total number of key fields in the request-response example of the y-th resource call interface; IDF is the inverse text probability calculation function; Semta( , () is the semantic similarity calculation function; α These are preset coefficients; Key fields whose attribute similarity is greater than a preset similarity threshold are grouped into the same field class; The standard request template is generated based on all the field classes, and the mapping relationship between the call request template of each resource call interface and the standard request template is established based on the inclusion relationship between the field classes and the included key fields.
2. The response method according to claim 1, characterized in that, Also includes: If an update instruction is received for any of the resource call interfaces, a call probe request is sent to the updated resource call interface; An example of an update request returned by the resource call interface based on the call probe request; Update the mapping relationship based on the update request example and the standard request template.
3. The response method according to any one of claims 1-2, characterized in that, The step of sending each of the virtual resource packets to the associated target forwarding object through the resource forwarding module includes: The virtual resource packet is added to the resource storage server associated with the target forwarding object; each virtual resource packet is configured with a forwarding wait time; the initial state of each virtual resource packet is a non-transferable state; If it is detected that the storage time of any virtual resource packet in the resource staging server is greater than or equal to the forwarding waiting time, a status change instruction for the virtual resource packet is sent to the resource staging server, so that the resource staging server changes the status of the virtual resource packet from an untransferable state to a pending transfer state; the pending transfer state is used when the resource staging server receives a transfer instruction initiated by the target forwarding object, to forward the target transfer resource matching the transfer instruction from all virtual resource packets in the pending transfer state to the target forwarding object.
4. The response method according to claim 3, characterized in that, When the resource storage server detects that the total first resource amount of all virtual resource packages in the pending transfer state is less than the target transfer resource, it determines the total second resource amount of all virtual resource packages in the non-transferable state, generates transfer failure information based on the first resource amount, the second resource amount, and the target transfer resource, and feeds back the transfer failure information to the target forwarding object.
5. The response method according to any one of claims 1-2, characterized in that, The call result information is obtained after the business server sends the service request to the user terminal, the user terminal calls the resource call interface based on the call link, generates a resource call interface, receives the target virtual resource input by the user based on the resource call interface, and sends the target virtual resource and authentication information to the interface server through the resource call interface, and then receives the feedback from the interface server based on the authentication information.
6. A service request response device, characterized in that, The response device includes: The service request receiving unit is used to receive service requests initiated by user terminals forwarded by the business server; the service request carries an interface identifier and a service identifier. The resource call interface feedback unit is used to call the interface conversion module to determine the resource call interface associated with the interface identifier, and to feed back the call link corresponding to the resource call interface to the business server, so that the business server feeds back the call link to the user terminal; the call link is used by the user terminal to call the resource call interface based on the call link, generate a corresponding call page locally on the user terminal, generate a call instruction through the call page, and send the call instruction to the corresponding interface server through the resource call interface. The target virtual resource invocation unit is used to receive invocation result information fed back by the service server based on the service request, and determine the target virtual resource to be invoked from the invocation result information; the invocation result information is generated after the user terminal invokes the resource invocation interface based on the service request; The virtual resource packet allocation unit is used to obtain a resource allocation algorithm that matches the service identifier through the resource forwarding module, and import the target virtual resource into the resource allocation algorithm to determine multiple virtual resource packets; each virtual resource packet is associated with a corresponding target forwarding object; A virtual resource packet sending unit is used to send each of the virtual resource packets to the associated target forwarding object through the resource forwarding module; The resource call interface feedback unit includes: The request template determination unit is used to determine the request template associated with the interface server of the resource call interface based on the interface identifier. The call request conversion unit is used to convert the service request into a service request suitable for the interface server based on the mapping relationship between the preset call request template and the standard request template; the service request is generated based on the preset standard request template. The call link receiving unit is used to send the service request to the interface server of the resource call interface, and receive the call link fed back by the interface server; The service request response device further includes: The request-response example acquisition unit is used to acquire request-response examples for different resource call interfaces; each request-response example contains multiple key fields; the request-response example is generated based on the call request template. An attribute similarity calculation unit is used to calculate the attribute similarity between the key fields of each of the request-response examples; the attribute similarity is specifically as follows: in, For the request and response example of the xth resource call interface, the attribute value corresponding to the a-th key field is... This is the attribute value corresponding to the b-th key field in the request and response example of the y-th resource call interface; The attribute similarity is n; n is the total number of key fields in the request-response example of the x-th resource call interface; m is the total number of key fields in the request-response example of the y-th resource call interface; IDF is the inverse text probability calculation function; Semta( , () is the semantic similarity calculation function; α These are preset coefficients; Field class division is used to classify key fields whose attribute similarity is greater than a preset similarity threshold into the same field class; The mapping relationship is established to generate the standard request template based on all the field classes, and to establish the mapping relationship between the call request template of each resource call interface and the standard request template based on the inclusion relationship between the field classes and the included key fields.
7. A server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Proxy component, search management method and search management system
CN107818122A
Payment service processing method and device, and machine readable storage medium
CN112330316A