CN114168343A - Service request response method, device, server and storage medium - Google Patents

Service request response method, device, server and storage medium Download PDF

Info

Publication number
CN114168343A
CN114168343A CN202111537467.6A CN202111537467A CN114168343A CN 114168343 A CN114168343 A CN 114168343A CN 202111537467 A CN202111537467 A CN 202111537467A CN 114168343 A CN114168343 A CN 114168343A
Authority
CN
China
Prior art keywords
resource
calling
interface
request
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111537467.6A
Other languages
Chinese (zh)
Inventor
张伟
焦玉阳
葛旺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Pingan Payment Technology Service Co Ltd
Original Assignee
Pingan Payment Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Pingan Payment Technology Service Co Ltd filed Critical Pingan Payment Technology Service Co Ltd
Priority to CN202111537467.6A priority Critical patent/CN114168343A/en
Publication of CN114168343A publication Critical patent/CN114168343A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application is applicable to the technical field of data processing, and provides a response method, a response device, a server and a storage medium of a service request, wherein the method comprises the following steps: receiving a service request initiated by a user terminal forwarded by a service server; the calling interface conversion module determines a resource calling interface associated with the interface identifier and feeds a calling link corresponding to the resource calling interface back to the service server; receiving calling result information fed back by the service server based on the calling request, and determining a target virtual resource to be called from the calling result information; acquiring a resource allocation algorithm matched with the service identifier through a resource forwarding module, introducing a target virtual resource into the resource allocation algorithm, and determining a plurality of virtual resource packets; and sending each virtual resource packet to the associated target forwarding object through the resource forwarding module. By adopting the method, the development cost of the business server can be reduced, and the development efficiency of the online service is improved.

Description

Service request response method, device, server and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for responding to a service request, a server, and a storage medium.
Background
With the continuous development of online services, the application field of online services is increased, and online services become an integral part of the daily life of users, such as shopping, transferring accounts, video calls, editing files and the like through online services.
In order to meet the more diversified online services, more and more third-party service platforms providing interface services are promoted, a user can manage own virtual resources, such as virtual currency, fund or cloud storage space, through the third-party service platforms, the service server providing the online services cannot determine the platform for managing the virtual resources of the user in advance, and when the online services initiated by the user are responded, the server is required to be compatible with the interfaces of all the third-party service platforms, so that the virtual resources of the user can be acquired through the interfaces provided by the third-party platforms, the development cost of the service server providing the online servers is greatly increased, and the development efficiency of the online services is reduced.
Disclosure of Invention
The embodiment of the application provides a response method, a response device, a server and a storage medium of a service request, which can solve the problems that the existing response technology of online service requires that the server can be compatible with interfaces of all third-party service platforms so as to obtain virtual resources of users through the interfaces provided by all the third-party platforms, thereby greatly increasing the development cost of a business server providing the online server and reducing the development efficiency of the online service.
In a first aspect, an embodiment of the present application provides a method for responding to a service request, including:
receiving a service request initiated by a user terminal forwarded by a service server; the service request carries an interface identifier and a service identifier;
a calling interface conversion module determines a resource calling interface associated with the interface identifier, and feeds a calling link corresponding to the resource calling interface back to the service server so that the service server feeds the calling link back to the user terminal;
receiving calling result information fed back based on the calling link, and determining 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;
acquiring a resource allocation algorithm matched with the service identifier through a resource forwarding module, and importing the target virtual resource into the resource allocation algorithm to determine a plurality of virtual resource packets; each virtual resource packet is associated with a corresponding target forwarding object;
and sending each virtual resource packet to the associated target forwarding object through the resource forwarding module.
In a possible implementation manner of the first aspect, the determining, by the call interface conversion module, a resource call interface associated with the interface identifier, and feeding back a call link corresponding to the resource call interface to the service server includes:
determining a calling request template associated with an interface server of the resource calling interface based on the interface identifier;
based on the mapping relation between a preset calling request template and a standard request template, converting the service request into a calling request suitable for the interface server through the interface conversion module; the service request is generated based on a preset standard request template;
and sending the calling request to the interface server of the resource calling interface, and receiving a calling link fed back by the interface server.
In a possible implementation manner of the first aspect, before the converting, by the interface conversion module, the service request into the invocation request applicable to the interface server based on the mapping relationship between the preset invocation request template and the standard request template, the method further includes:
acquiring 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 call request module;
respectively calculating attribute similarity between the key fields of the request response examples; the attribute similarity specifically includes:
Figure BDA0003413418560000021
wherein, QstxaAttribute value, Qst, corresponding to the a-th key field in the request response example for the x-th resource call interfaceybThe attribute value corresponding to the b-th key field in the request response example of the y-th resource calling interface is obtained; SimiarLv (Qst)xa,Qstyb) The attribute similarity is obtained; n is the total number of key fields in the request response example of the xth resource calling interface; m is the 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,Qstyb) Computing a function for the semantic similarity; alpha is a preset coefficient;
dividing the key fields with the attribute similarity larger than a preset similarity threshold into the same field class;
and the device generates the standard request module based on all the field classes, and respectively establishes the mapping relation between the call request module of each resource call interface and a standard request template based on the inclusion relation between the field classes and the included key fields.
In a possible implementation manner of the first aspect, the method further includes:
if an updating instruction about any resource calling interface is received, sending a calling detection request to the updated resource calling interface;
receiving an update request example fed back by the updated resource calling interface based on the calling detection request;
and updating the mapping relation based on the updating request example and the standard request template.
In a possible implementation manner of the first aspect, the sending, by the resource forwarding module, each virtual resource packet to the associated target forwarding object includes:
adding the virtual resource packet into a temporary resource storage server associated with the target forwarding object; each virtual resource packet is configured with a forwarding waiting time length; the initial state of each virtual resource packet is a non-transferable state;
if the fact that the storage time of any virtual resource packet in the resource temporary storage server is longer than or equal to the forwarding waiting time length is detected, a state change instruction about any virtual resource packet is sent to the resource temporary storage server, and the resource temporary storage server changes the state of the virtual resource packet from a non-transferable state to a to-be-transferred state; and the state to be transferred is used for transferring the target transfer resource matched with the transfer instruction to the target forwarding object from all the virtual resource packets in the state to be transferred when the temporary resource storage server receives the transfer instruction initiated by the target forwarding object.
In a possible implementation manner of the first aspect, when the to-be-transferred state is used to detect that a first total amount of resources of the virtual resource packets in all the to-be-transferred states is smaller than the target transfer resource, the to-be-transferred state is configured to determine a second total amount of resources of the virtual resource packets in all the non-transferable states, generate 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.
In a possible implementation manner of the first aspect, the calling result information is obtained by the service server sending the calling request to the user terminal, and then the user terminal calling the resource calling interface based on the calling link to generate 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 feedback of the interface server based on the authentication information.
In a second aspect, an embodiment of the present application provides a device for responding to a service request, including:
a service request receiving unit, configured to receive a service request initiated by a user terminal forwarded by the service server; the service request carries an interface identifier and a service identifier;
a resource calling interface feedback unit, configured to determine, by a calling interface conversion module, a resource calling interface associated with the interface identifier, and feed a calling link corresponding to the resource calling interface back to the service server, so that the service server feeds the calling link back to the user terminal;
the target virtual resource calling unit is used for receiving calling result information fed back by the service server based on the calling request and determining 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;
a virtual resource packet allocation unit, configured to obtain, through a resource forwarding module, a resource allocation algorithm matched with the service identifier, introduce the target virtual resource into the resource allocation algorithm, and determine a plurality of virtual resource packets; each virtual resource packet is associated with a corresponding target forwarding object;
a virtual resource packet sending unit, configured to send each virtual resource packet to the associated target forwarding object through the resource forwarding module.
In a third aspect, an embodiment of the present application provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the method according to any one of the above first aspects.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method according to any one of the above first aspects.
In a fifth aspect, embodiments of the present application provide a computer program product, which when run on a server, causes the server to perform the method of any one of the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that: configuring a corresponding intermediate server in a 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 the corresponding interface server according to the calling link, acquires a corresponding virtual resource from the interface server, generates calling result information, sends the calling result information to the service server, the service server feeds the calling result information back to the intermediate server, and the intermediate server can determine a target virtual resource required to be called by the calling result information, and dividing the target virtual resource into a plurality of different virtual resource packets and sending the virtual resource packets to the associated target forwarding object, thereby completing the response operation to the service request. Compared with the existing service request response technology, the service 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 interface link generation tasks for different service servers, so that the development cost of the service server is greatly reduced, and the development efficiency of online services is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a service response system according to an embodiment of the present application;
fig. 2 is a flowchart illustrating an implementation of a method for responding to a service request according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating an implementation manner of S103 of a method for responding to a service request according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating an implementation manner of a method for responding to a service request according to an embodiment of the present application;
fig. 5 is a schematic diagram of an implementation manner of a method for responding to a service request according to an embodiment of the present application;
fig. 6 is a schematic diagram illustrating an implementation manner of S109 of a method for responding to a service request according to an embodiment of the present application;
fig. 7 is a schematic diagram illustrating an implementation manner of S105 of a method for responding to a service request according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a response device for a service request provided by an embodiment of the present application;
fig. 9 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may 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.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
The response method of the service request provided by the embodiment of the present application can be applied to a service response system, and fig. 1 shows a schematic structural diagram of a service response system provided by the present application. Referring to fig. 1, the service response system includes: a user terminal 11, a service server 12, an intermediate server 13 and an interface server 14 providing a resource invocation interface. The user terminal 11 is connected to the service server 12 and the intermediate server 13 is connected to the service server 12 and the interface server 14, and in some steps the user terminal 11 may establish a communication connection with the interface server 13 based on the call link.
Referring to fig. 2, fig. 2 is an interactive flowchart illustrating a method for responding to a service request according to an embodiment of the present application, where the method includes the following steps:
in S101, the user terminal sends a service request to the service server. The service request carries an interface identifier and a service identifier.
In this embodiment, a user may generate a service operation page provided by a service server through a local terminal (i.e., a user terminal), and initiate a service request to the service server in the service operation page. The service request is any type of service which can be provided by a service server, and 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 for online video editing, the service request may be a service for online video editing.
In this embodiment, one service server may provide different types of services, so the service request may carry a service identifier for defining a service type of the service request initiated by the user terminal. In the process of executing the service request, the user terminal needs to call the corresponding virtual resource from the interface server corresponding to the third-party service platform to complete the service operation of this time, so the service request carries the interface identifier of the interface server that needs to call the virtual resource.
For example, the user can complete the online shopping service through the business server. In this case, the user may generate a shopping operation page provided by the service server on the user terminal, the shopping operation page including a plurality of commodity links for purchase. When browsing a proper commodity and purchasing, a user can initiate a service request for purchasing a specified commodity to the business server, and because the corresponding payment operation needs to be completed when purchasing the commodity, the payment can be completed through a specified payment platform, and at this moment, a resource calling interface of the payment platform needs to be called. Therefore, the service request carries a service identifier for determining a commodity to be purchased and an interface identifier of a payment channel interface, and the service request is sent to the service server.
In S102, the service server transmits the service request to the intermediate server.
In this embodiment, after receiving the service request, the service server may perform generation of a corresponding service response result based on the service identifier, and may also forward the service identifier to the intermediate server. In the process of responding to the service request, the resource calling interface of the third party is needed to be used, so that the corresponding calling link needs to be generated, and at the moment, the tasks of calling the links by all the interfaces can be all finished by the intermediate server, so that the service server can forward the service request to the intermediate server after receiving the service request.
It should be noted that the intermediate server may be configured to generate corresponding call links for different service servers, that is, the service response system may include service servers providing different service types, and different service servers may forward the received service request to the intermediate server, where the intermediate server may be configured to generate corresponding call links. For example, the service response system includes two service servers, for example, a service server corresponding to the shopping platform 1 and a service server corresponding to the shopping platform 2, and both the service server of the shopping platform 1 and the service server of the shopping platform 2 may send a service request to the intermediate server, so as to generate a corresponding call link through the intermediate server.
In S103, the intermediate server calls the interface conversion module to determine the resource calling interface associated with the interface identifier, and feeds back the calling link corresponding to the resource calling interface to the service server.
In this embodiment, the intermediate server is configured with two modules, which are respectively an interface conversion module for generating a resource calling interface and a resource forwarding module for allocating virtual resources. When the call link needs to be generated, the intermediate server can be generated through the interface conversion module. The specific way of generating the call link is as follows: the intermediate server extracts the interface identification of the resource calling interface required to be called from the service request and inputs the interface identification into the interface conversion module, thereby generating a calling link corresponding to the interface identification. The interface conversion module is internally recorded with calling templates of different resource calling interfaces, and the intermediate server can introduce key information carried in the service request, such as a terminal identifier of a user terminal, a user account and the like, into the calling templates so as to generate a calling link corresponding to the key information.
In S104, the service server transmits the call link to the user terminal.
In this embodiment, the service server may send the call link to the service server after generating the call link related to the resource call interface. And after receiving the call link, the service server feeds back the call link to the user terminal.
In a possible implementation manner, after receiving the call link, the service server may encapsulate a service response result corresponding to the service request and the call link into the same response data packet, and send a response data packet to the user terminal, where the user terminal may determine a processing result corresponding to the service request through the response data packet, and execute a subsequent virtual resource call operation through the call link.
In S105, the user terminal calls the resource calling interface based on the calling link, and generates calling result information.
In this embodiment, after receiving the call link sent by the service server, the user terminal may call the resource call interface based on the call link, so as to obtain the corresponding virtual resource from the interface server corresponding to the resource call interface.
In a possible implementation manner, the user terminal invokes the resource invoking interface based on the invoking link, and generates a corresponding invoking page locally at the user terminal, for example, if the resource invoking interface is a payment interface, a corresponding payment page may be generated in the user terminal; for example, if the resource calling interface is a calling interface of a storage space, a corresponding file management interface may be generated on the user terminal, and a file stored in the file management interface is a file stored in the cloud storage space by the user; in this case, the user may input the target virtual resource to be called through the calling page displayed on the user terminal, and click the corresponding confirmation control in the calling page after the input is completed, so that the user terminal may generate the corresponding calling instruction, send the calling instruction to the corresponding interface server through the resource calling interface, and feed back the corresponding calling result information to the user terminal.
In S106, the interface server sends the call result information to the service server and the intermediate server.
In this embodiment, after the interface server corresponding to the resource calling interface completes the calling task, the corresponding calling result information may be sent to the user terminal, and a corresponding calling completion page is generated in the user terminal, and meanwhile, the interface server may send the corresponding calling result information to the service server synchronously and asynchronously, and push the corresponding calling result information to the middleware server. In a possible implementation manner, the interface server may send the call result information to the user terminal, send the call result information to the service server through the user terminal, and then the service server forwards the call result information to the intermediate server.
Taking an online shopping scene as an example for explanation, the user terminal may locally generate a corresponding payment page according to the received call link, after inputting a corresponding payment amount and corresponding authentication information, send the payment page to a payment platform (i.e., an interface server) through a resource call interface corresponding to the payment page, after the payment platform confirms that the payment is successful, feed back a corresponding payment result to the user terminal, where the payment result is the call result information, the user terminal feeds back the payment result to the service server, and after receiving the payment result, the service server can determine whether the user terminal completes an appointed payment task, thereby determining whether the transaction is valid.
In S107, the intermediate server determines a target virtual resource to be called from the call result information.
In this embodiment, after receiving the corresponding call result information, the service server may determine whether to successfully call the virtual resource, and if the call result information is that the call is successful, identify that the user terminal has successfully called the virtual resource, in which case, the intermediate server may determine, from the call result information, the virtual resource called when responding to the service request, that is, the target virtual resource. Continuing with the online transaction as an example, the virtual resource is the amount of money paid when purchasing a commodity, or virtual currency.
In S108, the intermediate server obtains a resource allocation algorithm matching the service identifier through a resource forwarding module, and introduces the target virtual resource into the resource allocation algorithm to determine a plurality of virtual resource packets; each virtual resource packet is associated with a corresponding target forwarding object.
In this embodiment, the intermediate server is configured with a resource forwarding module, different service identifiers may correspond to different resource allocation algorithms, and the intermediate server may obtain, according to the service identifier carried in the service request, the corresponding resource allocation algorithm through the resource forwarding module, and introduce the target virtual resource into the resource allocation algorithm, thereby obtaining virtual resource packages corresponding to different target forwarding objects.
In a possible implementation manner, the resource allocation algorithm is stored in an allocation database associated with the service server, the intermediate server may 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 may select a resource allocation algorithm corresponding to the service identifier from the allocation database and feed the resource allocation algorithm back to the intermediate server, and the intermediate server may configure the resource forwarding module based on the resource allocation algorithm after receiving the resource allocation algorithm, so that the resource forwarding module may divide the target virtual resource into a plurality of virtual resource packets conforming to the resource allocation algorithm. And each virtual resource packet is associated with a corresponding target forwarding object.
Continuing with the online shopping as an example, when the shopping of the commodity is completed through the shopping platform (service server), the amount of money paid needs to be divided, for example, the amount of money obtained by the shopping platform, the amount of money obtained by the logistics service, the amount of money obtained by the manufacturer of the commodity, and the like, different commodities may correspond to different division algorithms, and based on this, the target virtual resource may be divided through the intermediate server, so as to obtain virtual resource packages corresponding to different target forwarding objects.
In S109, the intermediate server sends each virtual resource packet to the associated target forwarding object through the resource forwarding module.
In this embodiment, after the dividing operation is completed on the target virtual resource and a plurality of virtual resource packets are obtained, each virtual resource packet may be sent to the associated target forwarding object to complete the response of the service request of this time.
As can be seen from the above, in the response method for a service request provided in this embodiment of the present application, by configuring a corresponding intermediate server in a 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 the corresponding interface server according to the calling link, and obtain a corresponding virtual resource from the interface server, generates calling result information, and sends the calling result information to the service server, and the service server feeds back the calling result information to the intermediate server, the intermediate server may determine a target virtual resource to be called by the call result information, divide the target virtual resource into a plurality of different virtual resource packets, and send the virtual resource packets to the associated target forwarding object, thereby completing a response operation for the service request. Compared with the existing service request response technology, the service 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 interface link generation tasks for different service servers, so that the development cost of the service server is greatly reduced, and the development efficiency of online services is improved.
On the other hand, the intermediate server is also provided with a corresponding resource forwarding module, so that the target virtual resources obtained in the service request response process can be divided to obtain a plurality of resource data packets, and the resource data packets are forwarded to corresponding target forwarding objects, the generated target virtual resources 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 resources are improved.
Fig. 3 shows a flowchart of a specific implementation of the method S103 for responding to a service request according to the second embodiment of the present invention. Referring to fig. 3, with respect to the embodiment described in fig. 1, in the method for responding to a service request provided in this embodiment, S103 includes: s1031 to S1033 are specifically described as follows:
further, the determining, by the intermediate server call interface conversion module, the resource call interface associated with the interface identifier, and feeding back a call link corresponding to the resource call interface to the service server includes:
in S1031, the intermediate server determines, based on the interface identifier, a call request template associated with the interface server of the resource call interface.
In this embodiment, the intermediate server stores call request templates associated with interface servers of different resource call interfaces. The calling request template comprises at least one key field, and the content of the key field in the calling request template is empty, so that the key field needs to be extracted from the service request and filled into the key field of the calling request template.
For example, the key fields included in the invocation request template include: user account, authentication password, calling number, timestamp, interface identification and the like. It should be noted that the call request templates associated with the interface servers of different resource call interfaces may be the same or different. Therefore, in order to enable compatibility with different resource calling interfaces, an existing service server often needs to store multiple calling request templates, when a service request initiated by a user terminal is received, a specific calling request template is adopted to generate a corresponding calling link, and when the interface server is updated or the compatible resource calling interface needs to be expanded, the calling request template in the service server needs to be updated, so that the development workload of the service server is greatly increased, and the development cost of the service server is further increased.
In S1032, the intermediate server converts the service request into a call request applicable to the interface server through the interface conversion module based on a mapping relationship between a preset call request template and a standard request template; the service request is generated based on a preset standard request template.
In this embodiment, for calling different types of resource calling interfaces, the service server all uses the same standard request template to generate corresponding service requests, that is, for the service server, only one type of request template needs to be stored, that is, the standard request template, and the calling operations of different resource calling interfaces are the same as for the service server. After the service 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 the call request of the call request template corresponding to the interface identifier through the interface conversion module according to the mapping relation between the call request template and the standard request template which are stored in advance, so that the conversion of the data format is realized.
In S1033, the intermediate server sends the call request to the interface server of the resource call interface, and receives a call link fed back by the interface server.
In this embodiment, after the intermediate server converts the service request into a call request associated with the interface server, the call request may be sent to the interface server, and the interface server may feed back a corresponding call link to the intermediate server when the call request is identified to be legal, that is, the request conforms to a call rule, and may call the resource call interface associated with the interface server through the call link.
In the embodiment of the application, the format conversion of the calling request is completed through the intermediate server, and for the service server, when calling operation is initiated to different resource calling interfaces, only the same service request needs to be generated, and the service server does not need to be reconfigured no matter the resource calling interfaces are increased or decreased or updated, so that the development difficulty of the service server is greatly reduced; meanwhile, the intermediate server integrates format conversion services of the call requests of all the service servers, and when the call request templates of the resource call interfaces need to be increased or decreased or updated, only the mapping relation pre-stored in the intermediate server needs to be adjusted, so that batch updating of all the service servers needing to call the resource call interfaces is realized, and development workload brought by interface updating or capacity expansion is greatly reduced.
Fig. 4 is a flowchart illustrating a specific implementation of a method for responding to a service request according to a third embodiment of the present invention. Referring to fig. 4, with respect to the embodiment described in fig. 3, before S1032, the method for responding to a service request provided in this embodiment further includes: s401 to S404 are specifically detailed as follows:
before the intermediate server converts the service request into a call request applicable to the interface server through the interface conversion module based on a mapping relationship between a preset call request template and a standard request template, the method further includes:
in S401, the intermediate server obtains request response examples of different resource invocation interfaces; each request response example contains a plurality of key fields; the request reply instance is generated based on the invocation request module.
In this embodiment, in order to generate a standard request template compatible with all resource invocation interfaces, the information carried in the standard request template can satisfy the invocation requests of all resource invocation interfaces. For example, the information content that the resource calling interface 1 needs to obtain includes: a user identification and a user password; the information content required to be acquired by the resource calling interface 2 includes: a user identification and an interface number. In this case, in order to make the standard request template compatible with the resource invocation interface 1 and the resource invocation interface 2, the standard request template needs to include the following information contents: user identification, user password, and interface number. Therefore, when the standard interface template is determined, the key fields included in all the resource calling interfaces need to be determined, all the key fields are clustered and fused, and the corresponding standard request template is determined based on the clustering and fusing result.
In this embodiment, in order to determine the key fields included in different resource invocation interfaces, a request response example corresponding to each resource invocation interface needs to be obtained. The intermediate server may parse the various request-reply examples to determine the key fields contained within the different request-reply examples. For people, each request-response example is generated based on the call request template of the associated resource call interface, that is, the format of the request-response example is the same as that of the call request template.
In S402, the intermediate server calculates attribute similarity between the key fields of the request response examples respectively; the attribute similarity specifically includes:
Figure BDA0003413418560000101
wherein, QstxaAttribute value, Qst, corresponding to the a-th key field in the request response example for the x-th resource call interfaceybThe attribute value corresponding to the b-th key field in the request response example of the y-th resource calling interface is obtained; SimiarLv (Qst)xa,Qstyb) The attribute similarity is obtained; n is the total number of key fields in the request response example of the xth resource calling interface; m is the 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,Qstyb) Computing a function for the semantic similarity; alpha is a preset coefficient.
In this embodiment, the key fields with the same content in different resource invocation interfaces may be represented in different data formats or codes, for example, for a user name, part of the resource invocation interfaces may be represented in a chinese manner, and part of the resource invocation interfaces may be represented in an english manner, so to determine the same key fields, the attribute similarity between the key fields of different resource invocation interfaces needs to be calculated. Specifically, the attribute similarity between different key fields is related to two factors, namely semantic similarity and inverse text probability between different key fields. Because the request response example can be filled into the corresponding call request template based on the content carried in the training request example, and thus the generated request response example is generated, if the attributes in the two key fields are the same, the semantics of the filled content have certain relevance, such as user name or residential address, and both have certain naming rules and have larger similarity between semantics, the content of the key fields can be imported into the semantic similarity calculation function, and the semantic similarity is determined; meanwhile, the intermediate server can also determine the reverse text probability of the key field in the request and response example, so that whether similar content exists in the key field in the request and response example can be determined, and the uniqueness of the key field can be determined. The intermediate server can identify and obtain whether the two key fields are the same attribute or not through the two factors.
In S403, the intermediate server divides the key fields with the attribute similarity greater than a preset similarity threshold into the same field class.
In this embodiment, the intermediate server identifies a plurality of key fields with attribute similarity greater than a preset threshold as key fields with the same attribute, so that all the key fields with the same attribute can be divided into the same field class, and the purpose of clustering the key fields is achieved.
In S404, the intermediate server generates the standard request module based on all the field classes, and establishes the mapping relationship between the call request module of each resource call interface and the standard request template based on the inclusion relationship between the field classes and the included key fields.
In this embodiment, since the standard request template needs to be compatible with all the call request templates of different resource call interfaces, that is, key fields needed by all the call request templates need to be included, after all the key fields are clustered and a plurality of field classes are obtained, the corresponding standard request template can be generated based on all the field classes, so that the standard request template can necessarily cover information needed by the call requests of all the resource call interfaces, and based on the inclusion relationship between each field class and the key field included therein, the mapping relationship can be generated, thereby enabling format conversion between the standard request template and the call request template.
In the embodiment of the application, the key fields required by all the resource calling interfaces are subjected to cluster analysis to generate the standard request template and the corresponding mapping relation, so that the service request generated based on the standard request template can be ensured to necessarily contain information required by any type of resource calling interface, and the success rate of format conversion is improved.
Fig. 5 is a flowchart illustrating a specific implementation of a method for responding to a service request according to a fourth embodiment of the present invention. Referring to fig. 5, with respect to the embodiment described in fig. 3, the method for responding to a service request provided in this embodiment further includes: s501 to S503 are specifically detailed as follows:
in S501, if the intermediate server receives an update instruction about any one of the resource invocation interfaces, the intermediate server sends an invocation probe request to the updated resource invocation interface.
In S502, the intermediate server receives an update request example of the updated resource invocation interface based on the invocation probe request feedback.
In S503, the intermediate server updates the mapping relationship based on the update request example and the standard request template.
In this embodiment, when a resource invocation interface is updated, an interface server associated with the resource invocation interface may send an update instruction to an intermediate server, after receiving the update instruction, the intermediate server may send a call probe request to the resource invocation interface, after receiving the call probe request, an interface server corresponding to the resource invocation interface may send an update request example to the intermediate server, and based on the update request example, the intermediate server may determine key fields included in the key fields and identify key fields associated in a standard request template, and update a mapping relationship between the two key fields based on positions of the same key fields in the update request example and positions of corresponding key fields in the standard request template.
In the embodiment of the application, when the resource calling interface needs to be updated, the intermediate server sends the corresponding calling detection request to the resource calling interface so as to obtain the corresponding updating request example, and updates the original mapping relation based on the updating request example, so that the mapping relation can be automatically updated when the interface is updated, the user does not need to adjust the mapping relation again, the timeliness of the adjustment of the mapping relation is improved, and the operation of the user is reduced.
Fig. 6 shows a flowchart of a specific implementation of the method S109 for responding to a service request according to a fifth embodiment of the present invention. Referring to fig. 6, with respect to the embodiment described in any one of fig. 1 to 5, in the method for responding to a service request provided by this embodiment, S109 includes: s1091 to S1093 are specifically described below:
in S1091, the intermediate server adds the virtual resource package to the temporary resource storage server associated with the target forwarding object; each virtual resource packet is configured with a forwarding waiting time length; the initial state of each virtual resource packet is a non-transferable state.
In S1092, if the intermediate server detects that the time for storing any virtual resource packet in the temporary resource storage server is greater than or equal to the forwarding waiting time, the intermediate server sends a state change instruction about any virtual resource packet to the temporary resource storage server, so as to change the state of the virtual resource packet from the non-transferable state to the to-be-transferred state.
In this embodiment, the intermediate server may perform resource temporary storage on each virtual resource packet forwarded to the target forwarding object. Because the service response process has a certain processing period in a part of service scenes, the service request is still in a state of waiting to be completed in the processing period. Continuing with the online shopping scenario, after the user purchases an item, the user may choose to cancel the transaction to cancel the purchased item, in which case the amount paid by the user needs to be returned. In order to improve the timeliness of payment amount return, before the transaction is completed, the amount paid by the user (i.e. the virtual resource package) is in an untransferable state and is transferred to the corresponding resource temporary storage server through the intermediate server.
It should be noted that each target forwarding object may be configured with an associated resource temporary storage server, and a corresponding object account may be configured for the corresponding target forwarding object in the resource temporary storage server. Based on this, one resource temporary storage server may correspond to a plurality of target forwarding objects, and the intermediate server adds the virtual resource packet of the target forwarding object to the object account associated with the target forwarding object in the resource temporary storage server. Each virtual resource packet is configured with a corresponding forwarding waiting time length, when the storage time of the resource temporary storage server is less than the forwarding waiting time length, the state of the virtual resource packet is a non-transferable state, and 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, wherein the state change instruction comprises a resource number corresponding to the virtual resource packet, so as to change the state of the virtual resource packet, namely, the non-transferable state is changed into the to-be-transferred state.
In S1093, if the temporary resource storage server receives a transfer instruction initiated by the target forwarding object, the temporary resource storage server forwards the target transfer resource matched with the transfer instruction to the target forwarding object from all the virtual resource packets in the to-be-transferred state.
In this embodiment, the resource temporary storage server may receive a transfer instruction initiated by the target transfer object, where the transfer instruction includes a target transfer resource to be transferred, and the resource temporary storage server may extract virtual resource packages of a number matching the target transfer resource from all virtual resource packages in a state to be transferred, and transfer the corresponding virtual resource packages to a user account associated with the target transfer object.
Further, as another embodiment of the present application, the above S1903 may specifically include the following two steps, respectively:
step 1: if the resource temporary storage server detects that the total amount of the first resources of all the virtual resource packages in the state to be transferred is smaller than the target transfer resource, determining the total amount of the second resources of all the virtual resource packages in the state which cannot be transferred;
step 2: and the temporary resource 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 forwarding object.
In this embodiment, if it is detected that the total amount of the resources to be transferred (i.e., the first total amount of resources) of the target transfer object in the resource temporary storage server is smaller than the target transfer resource, it indicates that the transfer task cannot be completed. The transfer failure information may specifically include the following two cases:
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, determining transfer waiting time length, and adding the transfer waiting time length into the transfer time length information, so that the target forwarding object can wait for a specific time length when completing the resource transfer operation. Because the first total resource amount is smaller than the target transfer resource, that is, the virtual resource packet that indicates that the part to be waited is in the non-transferable state is changed into the virtual resource packet in the to-be-transferred state, the missing resource amount can be determined according to the difference between the target transfer resource and the first total resource amount, and the transfer waiting duration is calculated based on the storage durations and the corresponding forwarding waiting durations of all the virtual resource packets in the non-transferable state.
Case 2: and if the sum of the first resource total amount and the second resource total amount is less than the target transfer resource, generating transfer failure information with insufficient resources to inform the target forwarding object that the virtual resources to which the target forwarding object belongs are insufficient.
In the embodiment of the application, the virtual resource package is stored in the temporary resource storage server, and the state of the virtual resource package is changed when the preset forwarding waiting time is met, so that the safety of virtual resource management can be improved.
Fig. 7 is a flowchart illustrating a specific implementation of the method S105 for responding to a service request according to a sixth embodiment of the present invention. Referring to fig. 7, with respect to the embodiment described in any one of fig. 1 to 5, in the method for responding to a service request provided by this embodiment, S105 includes: s1051 to S1053 are specifically described as follows:
in S1051, the user terminal invokes the resource invocation interface based on the invocation link, and generates a resource invocation interface.
In S1052, the user terminal receives the target virtual resource input by the user based on the resource calling interface, and sends the target virtual resource and the authentication information to the interface server through the resource calling interface.
In S1053, the user terminal receives the call result information fed back by the interface server based on the authentication information.
In this embodiment, after receiving the call link, the user terminal may call the resource call interface based on the call link, the resource call interface may send corresponding interface data to the user terminal, and the user terminal may generate the corresponding resource call interface based on the received interface data. The user may output the virtual resource to be called, that is, the target virtual resource, in the resource calling interface, and send the target virtual resource to the interface server through the resource calling interface, and optionally, may send the corresponding authentication information and the target virtual resource to the interface server. After receiving the authentication information, the interface server can perform authentication and authentication on the local calling operation initiated by the user terminal, if the authentication information is matched with standard information prestored by a user associated with the user terminal, the calling is identified as legal calling, and calling result information containing the target virtual resource is fed back to the user terminal to complete the calling operation of the target virtual resource.
In the embodiment of the application, the calling operation can be legally authenticated by sending the corresponding authentication information to the interface server, so that the safety of virtual resource transfer is improved.
Fig. 8 is a block diagram illustrating a structure of a device for responding to a service request according to an embodiment of the present invention, where the device for responding to a service request includes units for executing steps implemented by an intermediate server in the corresponding embodiment of fig. 2. Please refer to fig. 2 and fig. 2 for the corresponding description of the embodiment. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 8, the service request responding unit includes: .
A service request receiving unit 81, configured to receive a service request initiated by a user terminal forwarded by the service server; the service request carries an interface identifier and a service identifier;
a resource calling interface feedback unit 82, configured to determine, by a calling interface conversion module, a resource calling interface associated with the interface identifier, and feed a calling link corresponding to the resource calling interface back to the service server, so that the service server feeds the calling link back to the user terminal;
a target virtual resource calling unit 83, configured to receive call result information fed back by the service server based on the call request, and determine a target virtual resource to be called from the call result information; the calling result information is generated after the user terminal calls the resource calling interface based on the calling request;
a virtual resource packet allocation unit 84, configured to obtain, through a resource forwarding module, a resource allocation algorithm matched with the service identifier, introduce the target virtual resource into the resource allocation algorithm, and determine multiple virtual resource packets; each virtual resource packet is associated with a corresponding target forwarding object;
a virtual resource packet sending unit 85, configured to send each virtual resource packet to the associated target forwarding object through the resource forwarding module.
Optionally, the resource call interface feedback unit 81 includes:
a calling request template determining unit, configured to determine, based on the interface identifier, a calling request template associated with an interface server of the resource calling interface;
the calling request conversion unit is used for converting the service request into a calling request suitable for the interface server based on the mapping relation between a preset calling request template and a standard request template; the service request is generated based on a preset standard request template;
and the call link receiving unit is used for sending the call request to the interface server of the resource call interface and receiving the call link fed back by the interface server.
Optionally, the apparatus for responding to the service request further includes:
a request response example obtaining unit, configured to obtain 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 call request module;
an attribute similarity calculation unit, configured to calculate attribute similarities between the key fields of the request response examples respectively; the attribute similarity specifically includes:
Figure BDA0003413418560000141
wherein, QstxaAttribute value, Qst, corresponding to the a-th key field in the request response example for the x-th resource call interfaceybThe attribute value corresponding to the b-th key field in the request response example of the y-th resource calling interface is obtained; SimiarLv (Qst)xa,Qstyb) The attribute similarity is obtained; n is the total number of key fields in the request response example of the xth resource calling interface; m is the 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,Qstyb) Computing a function for the semantic similarity; alpha is a preset coefficient;
dividing the field classes, wherein the field classes are used for dividing the key fields with the attribute similarity larger than a preset similarity threshold into the same field class;
and establishing a mapping relation, which is used for generating the standard request module based on all the field classes, and respectively establishing the mapping relation between the calling request module of each resource calling interface and a standard request template based on the inclusion relation between the field classes and the included key fields.
Optionally, the apparatus for responding to the service request further includes:
a calling detection request sending unit, configured to send a calling detection request to an updated resource calling interface if an update instruction about any one of the resource calling interfaces is received;
receiving an update request example, which is used for receiving the update request example fed back by the updated resource calling interface based on the call detection request;
and the mapping relation updating unit is used for updating the mapping relation based on the updating request example and the standard request template.
Optionally, the virtual resource packet sending unit 85 includes:
the resource temporary storage unit is used for adding the virtual resource packet into a resource temporary storage server associated with the target forwarding object; each virtual resource packet is configured with a forwarding waiting time length; the initial state of each virtual resource packet is a non-transferable state;
a state changing unit, configured to send a state changing instruction about any virtual resource packet to the resource temporary storage server if it is detected that the storage time of any virtual resource packet in the resource temporary storage server is greater than or equal to the forwarding waiting time, so as to change the state of the virtual resource packet from a non-transferable state to a to-be-transferred state; and the state to be transferred is used for transferring the target transfer resource matched with the transfer instruction to the target forwarding object from all the virtual resource packets in the state to be transferred when the temporary resource storage server receives the transfer instruction initiated by the target forwarding object.
Optionally, the state to be transferred is configured to, when the resource temporary storage server detects that a first total amount of resources of the virtual resource packages in all the states to be transferred is smaller than the target transfer resource, determine a second total amount of resources of the virtual resource packages in all the states that are not transferable, generate 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.
Optionally, the calling result information is obtained by the service server sending the calling request to the user terminal, the user terminal calling the resource calling interface based on the calling link to generate 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 feedback of the interface server based on the authentication information.
Therefore, the responding device for the service request provided in the embodiment of the present invention can also configure a corresponding intermediate server in the service responding system, when the user terminal initiates the service request to the service server, the service server will forward the service request to the intermediate server, the intermediate server determines the resource calling interface corresponding to the service request through the 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 the corresponding interface server according to the calling link, and obtain the corresponding virtual resource from the interface server, generate calling result information, send the calling result information to the service server, and the service server feeds back the calling result information to the intermediate server, the intermediate server may determine a target virtual resource to be called by the call result information, divide the target virtual resource into a plurality of different virtual resource packets, and send the virtual resource packets to the associated target forwarding object, thereby completing a response operation for the service request. Compared with the existing service request response technology, the service 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 interface link generation tasks for different service servers, so that the development cost of the service server is greatly reduced, and the development efficiency of online services is improved.
It should be understood that, in the structural block diagram of the response apparatus for a service request shown in fig. 8, each module is used to execute each step of the intermediate server in the embodiment corresponding to fig. 2 to 7, and each step in the embodiment corresponding to fig. 2 to 7 has been explained in detail in the above embodiment, and specific reference is made to the relevant description in the embodiments corresponding to fig. 2 to 7 and fig. 2 to 7, which is not repeated herein.
Fig. 9 is a block diagram of a server according to another embodiment of the present application. As shown in fig. 9, the server 900 of this embodiment includes: a processor 910, a memory 920, and a computer program 930, such as a program that services a response to a request, stored in the memory 920 and executable at the processor 910. The processor 910, when executing the computer program 930, implements the steps in the above-described response embodiments of the respective service requests, such as S101 to S109 shown in fig. 2. Alternatively, the processor 910, when executing the computer program 930, implements the functions of the modules in the embodiment corresponding to fig. 9, for example, the functions of the units 81 to 85 shown in fig. 8, please refer to the related description in the embodiment corresponding to fig. 8.
Illustratively, the computer program 930 may be partitioned into one or more modules, which are stored in the memory 920 and executed by the processor 910 to accomplish the present application. One or more of the modules may be a series of computer program instruction segments that can perform particular functions, and which are used to describe the execution of computer program 930 in server 900. For example, the computer program 930 may be divided into respective unit modules, and the respective modules may be specifically functioned as described above.
The server 900 may include, but is not limited to, a processor 910, a memory 920. Those skilled in the art will appreciate that fig. 9 is merely an example of a server 900 and is not intended to be limiting of the server 900, and may include more or fewer components than those shown, or some components in combination, or different components, e.g., the server may also include input-output devices, network access devices, buses, etc.
The processor 910 may be a central processing unit, but may also be other general purpose processors, digital signal processors, application specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or any conventional processor or the like.
The storage 920 may be an internal storage unit of the server 900, such as a hard disk or a memory of the server 900. The memory 920 may also be an external storage device of the server 900, such as a plug-in hard disk, a smart card, a flash memory card, etc. provided on the server 900. Further, the memory 920 may also include both internal storage units of the server 900 and external storage devices.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A response method for a service request, the response method comprising:
receiving a service request initiated by a user terminal forwarded by a service server; the service request carries an interface identifier and a service identifier;
a calling interface conversion module determines a resource calling interface associated with the interface identifier, and feeds a calling link corresponding to the resource calling interface back to the service server so that the service server feeds the calling link back to the user terminal;
receiving calling result information fed back based on the calling link, and determining 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;
acquiring a resource allocation algorithm matched with the service identifier through a resource forwarding module, and importing the target virtual resource into the resource allocation algorithm to determine a plurality of virtual resource packets; each virtual resource packet is associated with a corresponding target forwarding object;
and sending each virtual resource packet to the associated target forwarding object through the resource forwarding module.
2. The response method according to claim 1, wherein the calling 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, and the method includes:
determining a calling request template associated with an interface server of the resource calling interface based on the interface identifier;
based on the mapping relation between a preset calling request template and a standard request template, converting the service request into a calling request suitable for the interface server through the interface conversion module; the service request is generated based on a preset standard request template;
and sending the calling request to the interface server of the resource calling interface, and receiving a calling link fed back by the interface server.
3. The response method according to claim 2, before the converting the service request into the call request applicable to the interface server by the interface conversion module based on the mapping relationship between the preset call request template and the standard request template, further comprising:
acquiring 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 call request module;
respectively calculating attribute similarity between the key fields of the request response examples; the attribute similarity specifically includes:
Figure FDA0003413418550000021
wherein, QstxaAttribute value, Qst, corresponding to the a-th key field in the request response example for the x-th resource call interfaceybThe attribute value corresponding to the b-th key field in the request response example of the y-th resource calling interface is obtained; SimiarLv (Qst)xa,Qstyb) The attribute similarity is obtained; n is the total number of key fields in the request response example of the xth resource calling interface; m is the 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,Qstyb) Computing a function for the semantic similarity; alpha is a preset coefficient;
dividing the key fields with the attribute similarity larger than a preset similarity threshold into the same field class;
and the device generates the standard request module based on all the field classes, and respectively establishes the mapping relation between the call request module of each resource call interface and a standard request template based on the inclusion relation between the field classes and the included key fields.
4. The response method of claim 2, further comprising:
if an updating instruction about any resource calling interface is received, sending a calling detection request to the updated resource calling interface;
receiving an update request example fed back by the updated resource calling interface based on the calling detection request;
and updating the mapping relation based on the updating request example and the standard request template.
5. The response method according to any one of claims 1 to 4, wherein said sending each of said virtual resource packets to said associated target forwarding object via said resource forwarding module comprises:
adding the virtual resource packet into a temporary resource storage server associated with the target forwarding object; each virtual resource packet is configured with a forwarding waiting time length; the initial state of each virtual resource packet is a non-transferable state;
if the fact that the storage time of any virtual resource packet in the resource temporary storage server is longer than or equal to the forwarding waiting time length is detected, a state change instruction about any virtual resource packet is sent to the resource temporary storage server, and the resource temporary storage server changes the state of the virtual resource packet from a non-transferable state to a to-be-transferred state; and the state to be transferred is used for transferring the target transfer resource matched with the transfer instruction to the target forwarding object from all the virtual resource packets in the state to be transferred when the temporary resource storage server receives the transfer instruction initiated by the target forwarding object.
6. The response method according to claim 5, wherein the state to be transferred is configured to, when the resource staging server detects that a first total amount of resources of the virtual resource packets in all the states to be transferred is smaller than the target transfer resource, determine a second total amount of resources of the virtual resource packets in all the states not to be transferred, generate 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.
7. The response method according to any one of claims 1 to 4, wherein the call result information is obtained by the service server sending the call request to the user terminal, the user terminal calling the resource calling interface based on the call link to generate 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 feedback of the interface server based on the authentication information.
8. A response device for a service request, the response device comprising:
a service request receiving unit, configured to receive a service request initiated by a user terminal forwarded by a service server; the service request carries an interface identifier and a service identifier;
a resource calling interface feedback unit, configured to determine, by a calling interface conversion module, a resource calling interface associated with the interface identifier, and feed a calling link corresponding to the resource calling interface back to the service server, so that the service server feeds the calling link back to the user terminal;
the target virtual resource calling unit is used for receiving calling result information fed back by the service server based on the calling request and determining 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;
a virtual resource packet allocation unit, configured to obtain, through a resource forwarding module, a resource allocation algorithm matched with the service identifier, introduce the target virtual resource into the resource allocation algorithm, and determine a plurality of virtual resource packets; each virtual resource packet is associated with a corresponding target forwarding object;
a virtual resource packet sending unit, configured to send each virtual resource packet to the associated target forwarding object through the resource forwarding module.
9. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202111537467.6A 2021-12-15 2021-12-15 Service request response method, device, server and storage medium Pending CN114168343A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111537467.6A CN114168343A (en) 2021-12-15 2021-12-15 Service request response method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111537467.6A CN114168343A (en) 2021-12-15 2021-12-15 Service request response method, device, server and storage medium

Publications (1)

Publication Number Publication Date
CN114168343A true CN114168343A (en) 2022-03-11

Family

ID=80486765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111537467.6A Pending CN114168343A (en) 2021-12-15 2021-12-15 Service request response method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN114168343A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114928636A (en) * 2022-07-20 2022-08-19 北京达佳互联信息技术有限公司 Interface call request processing method, device, equipment, storage medium and product
CN115514806A (en) * 2022-11-16 2022-12-23 江苏曼荼罗软件股份有限公司 Perception discovery method and system for discrete service cluster

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114928636A (en) * 2022-07-20 2022-08-19 北京达佳互联信息技术有限公司 Interface call request processing method, device, equipment, storage medium and product
CN114928636B (en) * 2022-07-20 2022-11-04 北京达佳互联信息技术有限公司 Interface call request processing method, device, equipment, storage medium and product
CN115514806A (en) * 2022-11-16 2022-12-23 江苏曼荼罗软件股份有限公司 Perception discovery method and system for discrete service cluster

Similar Documents

Publication Publication Date Title
CN110119292B (en) System operation parameter query method, matching method, device and node equipment
CN111091429A (en) Electronic bill identification distribution method and device and electronic bill generation system
CN114168343A (en) Service request response method, device, server and storage medium
CN107464151B (en) Order data processing method and device for high-concurrency service
CN110619555A (en) Unified management method and device for order information, terminal equipment and medium
CN111176761A (en) Micro-service calling method and device
CN111427971B (en) Business modeling method, device, system and medium for computer system
CN101577718A (en) Multi-ebanking adaptive system
CN110866740A (en) Processing method and device for block chain transaction request, electronic equipment and medium
CN110880100A (en) Business approval processing method, device and system
CN109598603B (en) Account opening task processing method and account opening service system
WO2023208132A1 (en) Api conversion system and access request processing method therefor, and electronic device and medium
US10133759B1 (en) System for determining storage or output of data objects
CN114070847A (en) Current limiting method, device, equipment and storage medium of server
CN111045928A (en) Interface data testing method, device, terminal and storage medium
CN113468886B (en) Work order processing method and device and computer equipment
CN115495658A (en) Data processing method and device
CN116186649A (en) Cross-system access method, device, computer equipment and storage medium
CN112260933B (en) Communication method, communication device, electronic equipment and medium
CN114138813A (en) Attribute configuration method and related device
WO2021232860A1 (en) Communication method, apparatus and system
CN114169863A (en) Signing method, signing device, electronic equipment and computer readable medium
CN113946723A (en) Data query method, device, server, system and storage medium
CN113407339A (en) Resource request feedback method and device, readable storage medium and electronic equipment
CN114528274A (en) Authority management method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination