CN106878367B - Method and device for realizing asynchronous call of service interface - Google Patents

Method and device for realizing asynchronous call of service interface Download PDF

Info

Publication number
CN106878367B
CN106878367B CN201610575322.8A CN201610575322A CN106878367B CN 106878367 B CN106878367 B CN 106878367B CN 201610575322 A CN201610575322 A CN 201610575322A CN 106878367 B CN106878367 B CN 106878367B
Authority
CN
China
Prior art keywords
user
service
gateway
calling
provider
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.)
Active
Application number
CN201610575322.8A
Other languages
Chinese (zh)
Other versions
CN106878367A (en
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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610575322.8A priority Critical patent/CN106878367B/en
Publication of CN106878367A publication Critical patent/CN106878367A/en
Application granted granted Critical
Publication of CN106878367B publication Critical patent/CN106878367B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application provides a method for realizing asynchronous call of a service interface, which is applied to a gateway accessing one to a plurality of service users and one to a plurality of service providers, and comprises the following steps: after receiving a user calling request comprising a calling interface and a user service identifier, generating an association value according to at least one association field, storing the corresponding relation between the association value and the user service identifier, and acquiring a provider service identifier according to the calling interface; sending a gateway calling request to the calling interface based on a user calling request; after receiving a gateway calling response including the associated fields from the service provider from the calling interface, generating associated values according to the associated fields, and acquiring a user service identifier corresponding to the associated values; based on the gateway invocation response, sending a consumer invocation response including the consumer service identification to the service consumer. By the technical scheme, the reduction of the operation speed of the database caused by the lack of the service identifier of the user is avoided.

Description

Method and device for realizing asynchronous call of service interface
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a method and an apparatus for implementing asynchronous invocation of a service interface.
Background
As technology develops, more and more life and work items can be completed over a network. Some matters require mutual cooperation between different application systems belonging to different enterprises, so that many application systems provide service interfaces for other systems to use corresponding system functions by calling the service interfaces. The calling of the service interface between different application systems usually adopts an asynchronous mode, that is, a service user initiates a request to a service provider through the service interface, and after the service provider finishes processing the service request, the service provider returns a response to the request to the service user.
Generally, an application system uses a service identifier to uniquely represent a service process, and the service identifier is often used as an index or a part of an index of an application system database table to perform operations such as querying and modifying service data of the service process. Because each application system generates respective service identification according to the self-defined specification, the service identification of a user and the service identification of a provider are carried in the request and the response called by the service interface, so that the two parties can identify which service process the request or the response belongs to.
In the prior art, a service user and a service provider respectively store the corresponding relationship between a user service identifier and a provider service identifier, and when a request or a response is generated, the service user searches for the service identifier of the other party according to the service identifier of the user, and encapsulates the service identifier in the request or the response and sends the request or the response to the other party. When the method is applied to a plurality of service users and/or a plurality of service providers, the service identifications of different service users or different service providers may be the same, so that the service identification of the other party cannot be uniquely determined according to the service identification of the party. When the service user can not obtain the service identifier in the response, the service data of the service process can be operated in the database table only according to other data in the response, so that the processing efficiency of the data user is greatly reduced. When a data user stores service data by adopting a sub-database and sub-table structure, scanning of all sub-database and sub-table is triggered, and intolerable influence is caused on services under the condition of high concurrency.
Disclosure of Invention
In view of the above, the present application provides a method for implementing asynchronous invocation of a service interface, which is applied to a gateway accessing one service provider to multiple service users and one service provider to multiple service providers, and the method includes:
after receiving a user calling request which comes from a service user and comprises a calling interface and a user service identifier, generating an association value according to at least one association field in the user calling request, storing the corresponding relation between the association value and the user service identifier, and acquiring the provider service identifier according to the calling interface; all the associated fields can uniquely represent the service identifier of the user;
based on a user calling request, sending a gateway calling request to a service provider with the calling interface, wherein the gateway calling request comprises provider service identification and all associated fields;
after receiving a gateway calling response including the associated fields from the service provider from the calling interface, generating associated values according to the associated fields in the gateway calling response, and acquiring a user service identifier corresponding to the associated values;
based on the gateway invocation response, sending a consumer invocation response including the consumer service identification to the service consumer.
The application also provides a device for implementing asynchronous call of service interfaces, which is applied to a gateway accessing one to a plurality of service users and one to a plurality of service providers, and the device comprises:
the user request processing unit is used for generating an association value according to at least one association field in the user calling request after receiving the user calling request which comes from a service user and comprises a calling interface and a user service identifier, storing the corresponding relation between the association value and the user service identifier and acquiring the provider service identifier according to the calling interface; all the associated fields can uniquely represent the service identifier of the user;
the user request forwarding unit is used for sending a gateway calling request to a service provider with the calling interface based on the user calling request, wherein the gateway calling request comprises a provider service identifier and all associated fields;
the gateway response processing unit is used for generating a correlation value according to the correlation field in the gateway calling response after receiving the gateway calling response including the correlation field from the service provider from the calling interface, and acquiring a user service identifier corresponding to the correlation value;
and the gateway response forwarding unit is used for sending the user calling response comprising the user service identifier to the service user based on the gateway calling response.
According to the technical scheme, in the embodiment of the application, the gateways of the access service provider and the service user generate the associated values according to one to a plurality of associated fields which can uniquely represent the service identifier of the user, store the corresponding relation between the associated values and the service identifier of the user, and carry all the associated fields in the call request sent to the service provider; after receiving a response including the associated field from the service provider, searching the service identifier of the user according to the associated value of the associated field, and replying the response to the service user; service users and business processes are distinguished through uniqueness of the associated fields, and reduction of database operation speed caused by lack of user business identification in response is avoided.
Drawings
Fig. 1 is a network structure diagram of an application scenario in an embodiment of the present application;
FIG. 2 is a flowchart of a method for implementing asynchronous invocation of a service interface applied to a gateway in an embodiment of the present application;
FIG. 3 is a flow chart of interaction between a service consumer, a gateway and a service provider in an application example of the present application;
FIG. 4 is a hardware block diagram of a device in which the gateway is located;
fig. 5 is a logic structure diagram of an implementation apparatus for asynchronous invocation of a service interface applied to a gateway in an embodiment of the present application.
Detailed Description
A logic structure of an application scenario of the embodiment of the present application is shown in fig. 1, when a plurality of service users need to invoke service interfaces of a plurality of service providers, compared with the implementation of changing each service user and each service provider, one to a plurality of service users and one to a plurality of service providers can be respectively accessed to a gateway, and the embodiment of the present application is run on the gateway, and a request and a response for invoking the interfaces between the service users and the service providers are transferred, and by carrying an association field uniquely representing a service identifier in a user invocation request in a call request initiated to the service provider, an association field can be obtained from a call response returned by the service provider, so as to further obtain a service identifier of the user corresponding to the response, thereby avoiding full-table scanning of a service user database and not causing a decrease in database operation speed, to solve the problems existing in the prior art.
In embodiments of the present application, the gateway is mutually accessible with each service consumer and each service provider that is accessed. It should be noted that the gateway, the service user and the service provider may run on separate physical or logical devices respectively; the gateway can also be used as a functional module to run on equipment of a service user and used for calling one service interface to a plurality of service providers; the gateway can also be used as a functional module to run on a device where a service provider is located, and used as a preposed functional module of a service interface of the gateway for being called by one to a plurality of service users.
The embodiments of the present application may be executed on any device with computing and storage capabilities, for example, a physical device or a logical device such as a mobile phone, a tablet Computer, a PC (Personal Computer), a notebook, a server, a virtual machine, etc.; the functions of the embodiments of the present application may be implemented by two or more physical or logical devices sharing different responsibilities and cooperating with each other.
In the embodiment of the present application, a flow of a method for implementing asynchronous invocation of a service interface is shown in fig. 2, and the method is applied to a gateway accessing one to a plurality of service users and one to a plurality of service providers.
Step 210, after receiving a user call request including a call interface and a user service identifier from a service user, generating an association value according to at least one association field in the user call request, storing a corresponding relationship between the association value and the user service identifier, and acquiring a provider service identifier according to the call interface.
When a certain service process performed at a service user needs to call a service interface of a certain service provider, a user calling request is generated and sent to the gateway.
The use calling request comprises a user service identifier and a calling interface. The service identifier of the user is an identifier given by the service user to a service process for calling the service interface, and the service user can uniquely represent the service process; if multiple service interface calls are required in the service process, the user service identifier is used in each user call request. The calling interface is a service interface called by a service user and can only represent one service interface in all service interfaces accessed by the gateway; the content included in the calling interface may be determined according to the specific implementation of the actual application scenario, for example, the application scenario of a service provider is accessed to the gateway, and the calling interface may be a service interface identifier; for an application scenario where a gateway accesses multiple service providers, the call interface may be a service provider identifier and a service interface identifier.
In the embodiment of the application, the user invocation request carries one or more associated fields, and the combination of all the associated fields can uniquely represent the service process of the service user on the gateway, or all the associated fields can uniquely represent the service identifier of the user. It should be noted that, the association field may include a user service identifier and/or a call interface. Similarly, which contents are used as the associated fields can be selected according to the specific implementation of the actual application scenario, for example, an application scenario where a service user accesses a gateway may use a user service identifier, or a user service identifier and a call interface as the associated fields; for an application scenario that the gateway accesses a plurality of service users, the service user identifier and the user service identifier may be used as associated fields, or the service user identifier, the user service identifier and the calling interface may be used as associated fields.
After receiving a user calling request sent by a service user, the gateway extracts all the associated fields from the user calling request, generates associated values according to all the associated fields, and stores the corresponding relation between the associated values and the user service identifier.
In some application scenarios, different invocation interfaces may employ different associated fields or combinations of associated fields. The gateway can preset the corresponding relation between the calling interface and the associated rule of the user, obtain the associated rule of the user from the calling interface in the calling request of the user, extract all the associated fields from the calling request of the user according to the associated fields specified in the associated rule of the user, and combine all the associated fields according to the combination mode specified in the associated rule of the user.
The method for generating the association value according to all the association fields may be selected by referring to the length of all the association fields, the speed requirement for calling the gateway processing interface, and the like, and the embodiment of the present application is not limited. For example, if the combined length of all the associated fields is short, the associated field combination (only one associated field is the associated field itself) can be directly used as the associated value; for another example, if the length of the associated field combination is long or the gateway is required to be able to process the interface call quickly, the combination of all associated fields may be input to a predetermined digest algorithm, and the digest value output by the digest algorithm is used as the associated value. The digest Algorithm may be CRC (Cyclic Redundancy Check), MD (Message-digest Algorithm), SHA (Secure Hash Algorithm), or the like. It should be noted that, in the above two examples, if there is only one associated field, the associated field combination is the associated field itself.
When only one service user or the service identifiers of the service users are not the same in the application scenario in which the embodiment of the application is located, the gateway can directly store the corresponding relationship between the association value and the service identifier of the user. If the service identifiers of the service users are probably the same, two database tables can be adopted on the gateway: and the user service identifier record table and the association relation table are used for storing the corresponding relation between the association value and the user service identifier. Specifically, the gateway generates a unique index code for the user call request (the index code is unique in the user service identification record table), and stores the corresponding relation between the index code and the user service identification in the user service identification record table by taking the index code as a main key; after generating the association value, the gateway saves the corresponding relation between the association value and the index code in the association relation table by taking the association value as a main key. Therefore, the associated value of the same user calling request can be corresponding to the user service identifier through the index code.
And according to the calling interface in the calling request of the user, the gateway acquires the provider service identifier of the calling interface and is used for carrying out the service process at the service provider when the service interface is called. According to the specific implementation of the service provider and the service interface thereof, the gateway may obtain the provider service identifier in different manners, which is not limited in the embodiments of the present application. For example, when there are multiple service interfaces using different interface identification rules (rules for generating provider service identifiers), the corresponding relationship between the calling interface and the interface identification rule may be stored in the gateway, and after receiving a user calling request, the provider service identifier may be generated using the interface identification rule corresponding to the calling interface. For another example, the gateway may request the provider service identifier from the calling interface in the user calling request, and the service provider where the calling interface is located generates a new provider service identifier according to the generation rule of the service identifier of the service provider, and returns the new provider service identifier to the gateway for use.
Step 220, based on the user calling request, sending a gateway calling request to the service provider with the calling interface.
The gateway generates a gateway calling request corresponding to the user calling request by adopting a provider service identifier on the basis of the user calling request, and sends the gateway calling request to a service provider where a calling interface in the user calling request is located. The gateway call request carries all the associated fields in the user call request and the provider service identifier.
The gateway calling request is used for calling the service interface by adopting the provider service identifier according to the specification of the service interface.
Step 230, after receiving the gateway call response including the association field from the service provider from the call interface, generating an association value according to the association field in the gateway call response, and acquiring the service identifier of the user corresponding to the association value.
And the service provider receives the gateway calling request from the calling interface, executes the service process with the provider service identifier in the gateway calling request, encapsulates the execution result and all associated fields in the gateway calling request in a gateway calling response, and sends the gateway calling response to the service provider.
In an application scenario that different calling interfaces adopt different associated fields or associated field combinations, a corresponding relation between the calling interface and a provider associated rule is preset on a gateway, the gateway can obtain the provider associated rule according to the corresponding relation by using the calling interface which sends a gateway calling response, then extracts all associated fields from the gateway calling response according to the associated fields specified in the provider associated rule, and combines all associated fields according to a combination mode specified in the provider associated rule. The user association rule and the provider association rule of the same calling interface can generate the same association field combination based on the same association field content.
In the same manner as in step 210, the gateway generates an association value according to the combination of the association fields in the gateway call response, and obtains the user identifier of the reply object (i.e., the service process of the service user) of the gateway call response by using the correspondence between the association value stored in step 210 and the user service identifier. In an application scenario that a gateway stores a corresponding relation between an association value and a user service identifier by using a user service identifier record table and an association relation table, after the gateway generates the association value according to the combination of association fields in a gateway call response, an index code corresponding to the association value is searched in the association relation table, then the user service identifier corresponding to the index code is searched in the user service identifier record table, and the user service identifier corresponding to the association value can be obtained.
Step 240, based on the gateway call response, sending the consumer call response including the consumer service identifier to the service consumer.
The gateway generates a user calling response corresponding to the gateway calling response by using the user service identifier on the basis of the gateway calling response, and sends the user calling response to the service user initiating the corresponding user calling request. The user calling response carries the execution result of the service interface calling and the user service identifier, so that the service user can identify which user calling request the user calling response is to.
The gateway can identify the corresponding gateway call request and gateway call response by carrying the same associated field, and identify the corresponding service user call request and service user call response by carrying the same user service identifier.
In the embodiment of the application, the gateway generates the associated value according to the associated field which uniquely represents the service identifier of the user in the user calling request, and carries the associated field in the gateway calling request initiated to the service provider, so that the service provider returns the gateway calling response with the associated field, and returns the user calling response with the service identifier of the user to the service user according to the corresponding relation between the associated value and the service identifier of the user, thereby respectively adopting the service identifier of the user and the service identifier of the provider to carry out the service processes of the service user and the service provider, avoiding the full-table scanning of the database of the service user and avoiding the reduction of the operation speed of the database.
In an application example of the present application, multiple service users and multiple service providers access the same gateway, each service user and each service provider have their own traffic serial number (traffic identifier) generation rule, and the service provider opens a service interface available for invocation to an external system. When a service user calls a service interface of a service provider in a business process, the interaction flow of the service user, the gateway and the service provider is shown in fig. 3.
The service user generates the service serial number of the user according to the database-dividing and table-dividing rules of the system, encapsulates the service serial number of the user, the service user identifier, the service provider identifier and the service interface identifier in the user calling request and sends the user calling request to the gateway. The calling interface is a service provider identifier and a service interface identifier.
The gateway maintains a user association table and a provider association table, which are respectively used for storing the corresponding relation between the calling interface and the user association rule and the corresponding relation between the calling interface and the provider association rule. After receiving the user calling request, the gateway extracts the service provider identifier and the service interface identifier from the user calling request, and finds out the user association rule for the calling interface in the user association table, namely: and using the user identifier, the service serial number of the user and the provider identifier as associated fields, and combining the associated fields in the sequence. The gateway extracts the user identifier, the user service serial number and the provider identifier from the user call request according to the user association rule, generates an associated field combination, and takes an MD5(Message Digest Algorithm version 5) value of the associated field combination as an associated value.
The gateway generates an index code for the user calling request, takes the index code as a main key, and stores the corresponding relation between the index code and the user service flow number in the user calling request in the user service flow water meter; and storing the corresponding relation between the associated value and the index code in an associated relation table by taking the associated value as a main key.
And the gateway generates a provider service serial number according to a provider serial number generation rule (interface identification rule) of the calling interface.
And the gateway packages the user identifier, the user service serial number, the provider identifier, the provider service serial number and other service information in the user calling request into the gateway calling request on the basis of the user calling request, and sends the gateway calling request to the service provider where the calling interface is positioned.
And the service provider executes the service process of the calling interface by adopting the provider service serial number according to the gateway calling request to obtain an execution result. The service provider encapsulates the execution result, the user identifier, the user service serial number and the provider identifier in a gateway calling response, and replies to the gateway through the calling interface.
And the gateway searches the association table of the provider by using a calling interface for receiving the gateway calling response to obtain the association rule of the provider. The provider association rule matches with the user association rule of the same invocation interface, namely: and using the user identifier, the service serial number of the user and the provider identifier as associated fields, and combining the associated fields in the sequence. And the gateway extracts the user identifier, the user service serial number and the provider identifier from the gateway calling response according to the provider association rule and generates an association field combination. The gateway calculates the MD5 value for the associated field combination as the associated value.
The gateway searches the association relation table according to the association value to obtain an index code; and searching the service flow water meter of the user by the obtained index code to obtain the service flow number of the user.
The gateway packages the service serial number and the execution result of the user in the user calling response based on the gateway calling response, and sends the service user who initiates the user calling request with the service serial number of the user.
And the service user determines the service process applying the execution result according to the service serial number of the user and performs subsequent service processing according to the service logic of the service user.
Corresponding to the above flow implementation, an embodiment of the present application further provides an implementation apparatus for asynchronous call of a service interface applied to a gateway. The apparatus may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, the logical device is formed by reading a corresponding computer program instruction into a memory for running through a Central Processing Unit (CPU) of the device. In terms of hardware, in addition to the CPU, the memory, and the nonvolatile memory shown in fig. 4, the device in which the service interface asynchronous call implementation apparatus is located generally includes other hardware such as a chip for performing wireless signal transmission and reception and/or other hardware such as a board for implementing a network communication function.
Fig. 5 is a device for implementing asynchronous invocation of service interfaces, which is applied to a gateway accessing one service provider to multiple service users and one service provider to multiple service providers, and includes a user request processing unit, a user request forwarding unit, a gateway response processing unit, and a gateway response forwarding unit, where:
the user request processing unit is used for generating an association value according to at least one association field in the user calling request after receiving the user calling request which comes from a service user and comprises a calling interface and a user service identifier, storing the corresponding relation between the association value and the user service identifier and acquiring the provider service identifier according to the calling interface; all the associated fields can uniquely represent the service identifier of the user;
the user request forwarding unit is used for sending a gateway calling request to a service provider with the calling interface based on the user calling request, wherein the gateway calling request comprises a provider service identifier and all associated fields;
the gateway response processing unit is used for generating a correlation value according to the correlation field in the gateway calling response after receiving the gateway calling response including the correlation field from the service provider from the calling interface, and acquiring a user service identifier corresponding to the correlation value;
the gateway response forwarding unit is used for sending a user calling response comprising the user service identification to the service user based on the gateway calling response.
Optionally, the storing, by the user request processing unit, a corresponding relationship between the association value and the user service identifier includes: generating a unique index code for the user calling request, storing the corresponding relation between the index code and the user service identifier by taking the index code as a main key in a user service identifier record table, and storing the corresponding relation between an association value and the index code by taking the association value as the main key in an association relation table; the gateway response processing unit acquires the user service identifier corresponding to the associated value, and the method comprises the following steps: and searching an index code corresponding to the association value in the association relation table, and searching a user service identifier corresponding to the index code in a user service identifier record table.
Optionally, the association value is generated by using a predetermined digest algorithm with a combination of all the association fields as input.
Optionally, the obtaining, by the user request processing unit, the provider service identifier according to the call interface includes: and generating a provider service identifier according to an interface identifier rule corresponding to the calling interface.
In one example, the generating, by the consumer request processing unit, an association value according to at least one association field in the consumer invocation request includes: extracting the associated fields from the user calling request according to the associated fields and the specified combination mode specified by the user associated rule corresponding to the calling interface in the user calling request, combining the associated fields, and generating an associated value by adopting the associated field combination; the gateway response processing unit generates a correlation value according to the correlation field in the gateway call response, and the method comprises the following steps: and extracting the associated fields from the gateway call response according to the associated fields specified by the provider associated rule corresponding to the call interface for receiving the gateway call response and the specified combination mode, combining the associated fields, and generating an associated value by adopting the associated field combination.
In the above example, the user service identifier includes: the user service serial number, the provider service identification includes: a provider service flow number; the association field includes: a user identifier, a user service serial number, and a provider identifier.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (12)

1. A method for implementing asynchronous invocation of a service interface for use in a gateway for accessing one to a plurality of service consumers and one to a plurality of service providers, the method comprising:
after receiving a user calling request which comes from a service user and comprises a calling interface and a user service identifier, generating an association value according to at least one association field in the user calling request, storing the corresponding relation between the association value and the user service identifier, and acquiring the provider service identifier according to the calling interface; all the associated fields can uniquely represent the service identifier of the user;
based on a user calling request, sending a gateway calling request to a service provider with the calling interface, wherein the gateway calling request comprises provider service identification and all associated fields;
after receiving a gateway calling response including the associated fields from the service provider from the calling interface, generating associated values according to the associated fields in the gateway calling response, and acquiring a user service identifier corresponding to the associated values;
based on the gateway invocation response, sending a consumer invocation response including the consumer service identification to the service consumer.
2. The method of claim 1, wherein the storing the association value and the corresponding relation between the associated value and the user service identifier comprises: generating a unique index code for the user calling request, storing the corresponding relation between the index code and the user service identifier by taking the index code as a main key in a user service identifier record table, and storing the corresponding relation between an association value and the index code by taking the association value as the main key in an association relation table;
the obtaining of the user service identifier corresponding to the associated value includes: and searching an index code corresponding to the association value in the association relation table, and searching a user service identifier corresponding to the index code in a user service identifier record table.
3. The method of claim 1, wherein the associated value is input in a combination of all associated fields and is generated using a predetermined summarization algorithm.
4. The method of claim 1, wherein obtaining the provider service identifier according to the invocation interface comprises: and generating a provider service identifier according to an interface identifier rule corresponding to the calling interface.
5. The method of any one of claims 1 to 4, wherein generating an association value according to at least one association field in a user invocation request comprises: extracting the associated fields from the user calling request according to the associated fields and the specified combination mode specified by the user associated rule corresponding to the calling interface in the user calling request, combining the associated fields, and generating an associated value by adopting the associated field combination;
the generating of the correlation value according to the correlation field in the gateway call response includes: and extracting the associated fields from the gateway call response according to the associated fields specified by the provider associated rule corresponding to the call interface for receiving the gateway call response and the specified combination mode, combining the associated fields, and generating an associated value by adopting the associated field combination.
6. The method of claim 5, wherein the user service identifier comprises: the user service serial number, the provider service identification includes: a provider service flow number; the association field includes: a user identifier, a user service serial number, and a provider identifier.
7. An apparatus for implementing asynchronous invocation of service interfaces for use in a gateway for accessing one to a plurality of service consumers and one to a plurality of service providers, the apparatus comprising:
the user request processing unit is used for generating an association value according to at least one association field in the user calling request after receiving the user calling request which comes from a service user and comprises a calling interface and a user service identifier, storing the corresponding relation between the association value and the user service identifier and acquiring the provider service identifier according to the calling interface; all the associated fields can uniquely represent the service identifier of the user;
the user request forwarding unit is used for sending a gateway calling request to a service provider with the calling interface based on the user calling request, wherein the gateway calling request comprises a provider service identifier and all associated fields;
the gateway response processing unit is used for generating a correlation value according to the correlation field in the gateway calling response after receiving the gateway calling response including the correlation field from the service provider from the calling interface, and acquiring a user service identifier corresponding to the correlation value;
and the gateway response forwarding unit is used for sending the user calling response comprising the user service identifier to the service user based on the gateway calling response.
8. The apparatus of claim 7, wherein the user request processing unit stores a correspondence between the association value and the user service identifier, and comprises: generating a unique index code for the user calling request, storing the corresponding relation between the index code and the user service identifier by taking the index code as a main key in a user service identifier record table, and storing the corresponding relation between an association value and the index code by taking the association value as the main key in an association relation table;
the gateway response processing unit acquires the user service identifier corresponding to the associated value, and the method comprises the following steps: and searching an index code corresponding to the association value in the association relation table, and searching a user service identifier corresponding to the index code in a user service identifier record table.
9. The apparatus of claim 7, wherein the associated value is generated by a predetermined summarization algorithm using a combination of all associated fields as input.
10. The apparatus of claim 7, wherein the user request processing unit obtains the provider service identifier according to a call interface, comprising: and generating a provider service identifier according to an interface identifier rule corresponding to the calling interface.
11. The apparatus according to any one of claims 7 to 10, wherein the user request processing unit generates an association value according to at least one association field in the user invocation request, including: extracting the associated fields from the user calling request according to the associated fields and the specified combination mode specified by the user associated rule corresponding to the calling interface in the user calling request, combining the associated fields, and generating an associated value by adopting the associated field combination;
the gateway response processing unit generates a correlation value according to the correlation field in the gateway call response, and the method comprises the following steps: and extracting the associated fields from the gateway call response according to the associated fields specified by the provider associated rule corresponding to the call interface for receiving the gateway call response and the specified combination mode, combining the associated fields, and generating an associated value by adopting the associated field combination.
12. The apparatus of claim 11, wherein the user service identifier comprises: the user service serial number, the provider service identification includes: a provider service flow number; the association field includes: a user identifier, a user service serial number, and a provider identifier.
CN201610575322.8A 2016-07-19 2016-07-19 Method and device for realizing asynchronous call of service interface Active CN106878367B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610575322.8A CN106878367B (en) 2016-07-19 2016-07-19 Method and device for realizing asynchronous call of service interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610575322.8A CN106878367B (en) 2016-07-19 2016-07-19 Method and device for realizing asynchronous call of service interface

Publications (2)

Publication Number Publication Date
CN106878367A CN106878367A (en) 2017-06-20
CN106878367B true CN106878367B (en) 2020-04-07

Family

ID=59239330

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610575322.8A Active CN106878367B (en) 2016-07-19 2016-07-19 Method and device for realizing asynchronous call of service interface

Country Status (1)

Country Link
CN (1) CN106878367B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019244A (en) 2018-05-14 2019-07-16 网联清算有限公司 Data processing method, device and computer readable storage medium
CN109309712B (en) * 2018-09-07 2022-06-17 平安科技(深圳)有限公司 Data transmission method based on interface asynchronous call, server and storage medium
CN111142960B (en) * 2018-11-02 2023-11-14 中国电信股份有限公司 Interface providing method, device and system
CN110351383A (en) * 2019-07-18 2019-10-18 深圳市元征科技股份有限公司 Method for processing business, equipment and readable storage medium storing program for executing
CN113076153B (en) * 2021-03-29 2023-09-01 北京京东振世信息技术有限公司 Interface calling method and device
CN113518008A (en) * 2021-07-07 2021-10-19 北京明略软件系统有限公司 Method and device for processing services based on gateway access
CN113704258B (en) * 2021-08-20 2023-12-26 辽宁振兴银行股份有限公司 Method for storing transaction messages based on MongoDB database

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0479660A3 (en) * 1990-10-02 1992-11-19 Digital Equipment Corporation Distributed configuration profile for computing system
CN101753588A (en) * 2008-12-05 2010-06-23 中国移动通信集团公司 Method and system for controlling integrated service operation
CN103688509A (en) * 2013-09-29 2014-03-26 华为技术有限公司 Acquiring method, supply method, device and system for business content

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0479660A3 (en) * 1990-10-02 1992-11-19 Digital Equipment Corporation Distributed configuration profile for computing system
CN101753588A (en) * 2008-12-05 2010-06-23 中国移动通信集团公司 Method and system for controlling integrated service operation
CN103688509A (en) * 2013-09-29 2014-03-26 华为技术有限公司 Acquiring method, supply method, device and system for business content

Also Published As

Publication number Publication date
CN106878367A (en) 2017-06-20

Similar Documents

Publication Publication Date Title
CN106878367B (en) Method and device for realizing asynchronous call of service interface
US10728361B2 (en) System for association of customer information across subscribers
CN111859470B (en) Business data chaining method and device
TW201804353A (en) Two-dimensional code information query method and system, server and client
CN107018174B (en) Unitized system service processing method and device and business processing system
CN112380294B (en) Block chain cross-chain access method and device
CN110019080B (en) Data access method and device
CN110633309A (en) Block chain transaction processing method and device
CN110569281A (en) Block chain transaction query method and system
CN107103011B (en) Method and device for realizing terminal data search
CN108599973B (en) Log association method, device and equipment
US11972414B2 (en) Data recording methods and apparatuses, electronic devices, and storage media
CN113220717B (en) Block chain-based data verification method and device and electronic equipment
CN113077259A (en) Block chain-based evidence storing method and device and electronic equipment
CN108399175B (en) Data storage and query method and device
CN110019444B (en) Operation request processing method, device, equipment and system
CN113076153A (en) Interface calling method and device
CN115002228A (en) Service cascade calling method and device, electronic equipment and storage medium
CN107276998B (en) OpenSSL-based performance optimization method and device
CN113077260A (en) Data access method and device based on block chain and electronic equipment
CN110992039B (en) Transaction processing method, device and equipment
CN109710609B (en) Method and device for generating data table identification
CN112491943A (en) Data request method, device, storage medium and electronic equipment
CN114338527B (en) IPv6 active identifier processing method and system
CN112738181A (en) Method, device and server for cluster external IP access

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200921

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200921

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.