CN108595280B - Interface adaptation method and device, computer equipment and storage medium - Google Patents
Interface adaptation method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN108595280B CN108595280B CN201810381590.5A CN201810381590A CN108595280B CN 108595280 B CN108595280 B CN 108595280B CN 201810381590 A CN201810381590 A CN 201810381590A CN 108595280 B CN108595280 B CN 108595280B
- Authority
- CN
- China
- Prior art keywords
- application program
- private cloud
- program interface
- version information
- private
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/541—Interprogram communication via adapters, e.g. between incompatible applications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote 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)
- Stored Programmes (AREA)
Abstract
The application relates to an interface adaptation method, an interface adaptation device, computer equipment and a storage medium. The method comprises the following steps: the method comprises the steps of obtaining a login request carrying a private cloud identifier, obtaining version information of an application program interface corresponding to the private cloud identifier according to the login request, obtaining an operation request, searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier, and obtaining a response result corresponding to the operation request, wherein the response result is obtained by calling the corresponding private cloud application program interface through the public cloud application program interface to execute service logic. By acquiring the version information of the private cloud application program interface, the private cloud application program interface is called after the corresponding public cloud application program interface is found, and communication between the public cloud and the private cloud can be realized without adjusting the application program interfaces of all the private clouds, so that the efficiency of interface adaptation is improved.
Description
Technical Field
The present application relates to the field of internet technologies, and in particular, to an interface adaptation method and apparatus, a computer device, and a storage medium.
Background
With the development of internet technology, various cloud services have emerged. In the hybrid cloud mode, the cloud platform is formed by combining a public cloud platform and a private cloud platform. In the hybrid cloud mode, the public cloud realizes data access by calling the interface of the private cloud, the public cloud defines a set of interface specifications, and the private cloud needs to adjust the interface of the private cloud to adapt to the interface specification of the public cloud when wanting to realize data access with the public cloud. When the interface specification of the public cloud changes or is adjusted, the private cloud also needs to synchronously adjust the interface of the private cloud, so that the abnormal communication between the public cloud and the private cloud can be avoided.
When the number of the private clouds is larger and larger, all the private clouds need to adjust the interfaces to adapt to the interface specifications of the public cloud as long as the interface specifications of the public cloud are changed. The current interface adaptation method has the problems of low efficiency and resource waste.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an interface adaptation method, an apparatus, a computer device, and a storage medium, which can improve interface adaptation efficiency and save resources.
A method of interface adaptation, the method comprising:
acquiring a login request carrying a private cloud identifier;
acquiring version information of an application program interface corresponding to the private cloud identifier according to the login request;
acquiring an operation request, and searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier;
and acquiring a response result corresponding to the operation request, wherein the response result is obtained by calling a corresponding private cloud application program interface through the public cloud application program interface to execute service logic.
In one embodiment, the obtaining version information of the application program interface corresponding to the private cloud identifier according to the login request includes:
sending an information acquisition request to a private cloud corresponding to the private cloud identifier according to the login request;
and acquiring the version information of the corresponding application program interface returned by the private cloud according to the information acquisition request.
In one embodiment, the method further comprises:
detecting a user session carrying a private cloud identifier;
and when the user session fails, re-acquiring the login request carrying the private cloud identifier.
In one embodiment, before the steps of obtaining an operation request and searching for a corresponding application program interface according to the operation request and the version information of the application program interface, the method further includes:
establishing a corresponding relation between the version information of the private cloud application program interface and the private cloud application program interface;
and storing the version information of the private cloud application program interface to the current user session according to the corresponding relation.
In one embodiment, the version information of the application program interface corresponding to the private cloud identifier is the maximum version information in the version information base of the current private cloud application program interface.
In one embodiment, the method further comprises:
acquiring a first instruction for changing the public cloud application program interface;
and updating the public cloud application program interface according to the first instruction.
In one embodiment, the method further comprises:
acquiring a second instruction for updating the version information of the private cloud application program interface;
updating the version information base of the private cloud application program interface according to the second instruction to obtain an updated version information base of the private cloud application program interface;
the updated version information base of the private cloud application program interface comprises version information of an original application program interface and version information of an updated application program interface.
An interface adaptation apparatus, the apparatus comprising:
the request acquisition module is used for acquiring a login request carrying a private cloud identifier;
the information acquisition module is used for acquiring version information of an application program interface corresponding to the private cloud identifier according to the login request;
the interface searching module is used for acquiring an operation request and searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier;
and the result acquisition module is used for acquiring a response result corresponding to the operation request, wherein the response result is obtained by calling a corresponding private cloud application program interface through the public cloud application program interface to execute service logic.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a login request carrying a private cloud identifier;
acquiring version information of an application program interface corresponding to the private cloud identifier according to the login request;
acquiring an operation request, and searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier;
and acquiring a response result corresponding to the operation request, wherein the response result is obtained by calling a corresponding private cloud application program interface through the public cloud application program interface to execute service logic.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a login request carrying a private cloud identifier;
acquiring version information of an application program interface corresponding to the private cloud identifier according to the login request;
acquiring an operation request, and searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier;
and acquiring a response result corresponding to the operation request, wherein the response result is obtained by calling a corresponding private cloud application program interface through the public cloud application program interface to execute service logic.
According to the interface adaptation method, the device, the computer equipment and the storage medium, the login request carrying the private cloud identifier is obtained, the version information of the application program interface corresponding to the private cloud identifier is obtained according to the login request, the operation request is obtained, the corresponding public cloud application program interface is searched according to the operation request and the version information of the application program interface corresponding to the private cloud identifier, and the response result corresponding to the operation request is obtained, wherein the response result is obtained by calling the corresponding private cloud application program interface through the public cloud application program interface to execute the service logic. By acquiring the version information of the private cloud application program interface, the private cloud application program interface is called after the corresponding public cloud application program interface is found, and because each public cloud application program interface is realized by the corresponding private cloud application program interface, communication between the public cloud and the private cloud can be realized without adjusting the application program interface of each private cloud, so that the efficiency of interface adaptation is improved. Because all private cloud application program interfaces are not required to be adjusted, the cost is reduced, and the resources are saved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of an application environment of a method for interface adaptation in one embodiment;
FIG. 2 is a diagram of the internal structure of a computer device in one embodiment;
FIG. 3 is a schematic diagram of a hybrid cloud model in one embodiment;
FIG. 4 is a flow diagram illustrating a method for interface adaptation in one embodiment;
FIG. 5 is a flowchart illustrating a method for obtaining private cloud application program interface version information according to an embodiment;
FIG. 6 is a flowchart illustrating a method for retrieving a login request according to one embodiment;
FIG. 7 is a flowchart illustrating a method for storing private cloud application program interface version information in one embodiment;
FIG. 8 is a flowchart illustrating a method for updating a public cloud application program interface in one embodiment;
FIG. 9 is a flowchart illustrating a method for updating private cloud application program interface version information in one embodiment;
FIG. 10 is a schematic diagram of a version information base of a private cloud application program interface in one embodiment;
FIG. 11 is a schematic diagram illustrating an interaction flow of an interface adaptation method according to another embodiment;
FIG. 12 is a diagram illustrating a scenario of an interface adaptation method according to an embodiment;
fig. 13 is a block diagram showing the structure of an interface adapter according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The interface adaptation method provided by the application can be applied to the application environment shown in fig. 1. The terminal 110 is connected to the public cloud 120 through a network, and the public cloud 120 communicates with the private cloud 130 through the network. The terminal 110 communicates with the server through the network. The terminal 110 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and the like, the public cloud 120 may provide public services through a network, and the private cloud 130 may provide private resources through the network.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 2. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the private cloud identification and the operation type. The network interface of the computer device is used for communicating with a public cloud through network connection. The computer program is executed by a processor to implement an interface adaptation method.
Those skilled in the art will appreciate that the architecture shown in fig. 2 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, as shown in FIG. 3, a hybrid cloud model may include a public cloud 310 and a plurality of private clouds. In the hybrid cloud mode, the public cloud 310 may be connected to the private cloud 320, the private cloud 330, and the private cloud 340 through a network, respectively. Private cloud 320, private cloud 330, and private cloud 340 may store proprietary resources of different tenants, e.g., private cloud 320 may store data and resources of a financial company, private cloud 330 may store data and resources of a technology company, and private cloud 340 may store data and resources of a training company. For a user operation of one of the private clouds, the public cloud 310 may interface with the private cloud according to the user operation of the private cloud.
In one embodiment, as shown in fig. 4, there is provided an interface adaptation method, including the steps of:
The private cloud is a kind of cloud service, and can provide storage capacity and processing capacity for various functions, and data stored in the private cloud, the security of the data, and the quality of service are relatively guaranteed. Public clouds are also a kind of cloud services, such cloud services are not owned by users, and public clouds are services providing computing resources for the public, and resources in the public clouds can be acquired through the internet. For example, public cloud service providers have amazon, google, microsoft and arilocos, tengyo, and so on.
Each private cloud corresponds to a private cloud identifier for distinguishing from other private clouds, and the private cloud identifier may be a string of numbers or a string of codes. The terminal can send a login request to the public cloud in a mode of logging in the public cloud through an account and a password, the sent login request can carry a private cloud identifier, and the public cloud can obtain the login request which is sent by the terminal and carries the private cloud identifier.
And step 404, acquiring version information of the application program interface corresponding to the private cloud identification according to the login request.
During data encapsulation, each layer in the network hierarchy interacts with each other by using an interface and provides services, wherein the interface between an application layer and a user is called application Programming interface (api). The application program interfaces of different versions can be deployed into different applications, and can also be deployed on different servers and are independent of each other. The version information of the application program interface comprises the version number, version content, domain name information, interface number, IP address and the like of the application program interface.
After receiving a login request sent by a terminal, the public cloud can identify a private cloud identifier carried in the login request to obtain a private cloud corresponding to the private cloud identifier. The public cloud can search the application program interface of the corresponding private cloud and then acquire the version information of the application program interface of the private cloud.
And 406, acquiring the operation request, and searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier.
When the terminal does not exit the public cloud for logging in, the public cloud can acquire the operation request sent by the terminal. The operation request may include an operation type. The terminal needs to call the application program interface of the private cloud only through the public cloud application program interface, and therefore the application program interface of each public cloud can be realized through the corresponding private cloud application program interface.
The public cloud can find the corresponding public cloud application program interface according to the operation type in the operation request and the version information of the application program interface corresponding to the private cloud identifier, and call the corresponding private cloud application program interface through the public cloud application program interface.
And step 408, obtaining a response result corresponding to the operation request, wherein the response result is obtained by calling a corresponding private cloud application program interface through a public cloud application program interface to execute service logic.
The business logic comprises data extraction, operation, updating and the like. And the public cloud searches and calls the corresponding public cloud application program interface according to the operation type in the operation request and the version information of the application program interface corresponding to the private cloud identifier, and then calls the corresponding private cloud application program interface through the public cloud and executes the service logic corresponding to the operation type in the operation request through the private cloud application program interface. After the service logic is executed, the public cloud can obtain a response result sent by the private cloud, and the response result corresponds to the operation request.
The method comprises the steps of obtaining a login request carrying a private cloud identifier, obtaining version information of an application program interface corresponding to the private cloud identifier according to the login request, obtaining an operation request, searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier, and obtaining a response result corresponding to the operation request, wherein the response result is obtained by calling the corresponding private cloud application program interface through the public cloud application program interface to execute business logic. By acquiring the version information of the private cloud application program interface, the private cloud application program interface is called after the corresponding public cloud application program interface is found, and because each public cloud application program interface is realized by the corresponding private cloud application program interface, communication between the public cloud and the private cloud can be realized without adjusting the application program interface of each private cloud, so that the efficiency of interface adaptation is improved. Because all private cloud application program interfaces are not required to be adjusted, the cost is reduced, and the resources are saved.
As shown in fig. 5, in an embodiment, the provided interface adaptation method may further include a process of obtaining private cloud application program interface version information, and the specific steps include:
The login request carries the private cloud identification, and the public cloud finds the corresponding private cloud through the private cloud identification in the login request and is connected through the network. The public cloud can send an information acquisition request to the private cloud through the network, and the information acquisition request is used for acquiring the version information of the application program interface of the private cloud.
And step 504, acquiring the version information of the corresponding application program interface returned by the private cloud according to the information acquisition request.
After receiving the information acquisition request sent by the public cloud, the private cloud can send the version information of the corresponding application program interface to the public cloud, so that a user session between the public cloud and the private cloud is established.
And sending an information acquisition request to the private cloud corresponding to the private cloud identifier according to the login request, and acquiring the version information of the corresponding application program interface returned by the private cloud according to the information acquisition request. The public cloud sends the information acquisition request to the private cloud so as to acquire the version information of the application program interface corresponding to the private cloud, and the private cloud does not need to change the application program interface, so that the cost is reduced, and the resources are saved.
In an embodiment, as shown in fig. 6, the provided interface adaptation method may further include a process of retrieving the login request, and the specific steps include:
The public cloud can detect a user session, and the user session refers to a session for establishing connection between the public cloud and the private cloud. The private cloud identifier can be carried in the user session detected by the public cloud, and the public cloud can search the private cloud establishing the user session with the public cloud according to the private cloud identifier.
And step 604, when the user session fails, re-acquiring the login request carrying the private cloud identifier.
The user session invalidation information may be information that causes the user session to be invalidated and disconnects the connection between the public cloud and the private cloud. For example, the user session invalidation information may be that the user logs out, or the network is not good, so that the connection between the public cloud and the private cloud is disconnected and communication cannot be performed. The public cloud can search for the private cloud with the invalid user session establishment according to the private cloud identification.
When the user session fails, the public cloud can acquire the login request again, the login request can carry the private cloud identifier, and the public cloud can acquire the private cloud identifier through the login request.
By detecting the user session carrying the private cloud identifier, when the user session fails, the login request carrying the private cloud identifier is obtained again. Along with the failure of the user session, the version information of the corresponding private cloud application program interface is marked as failure, the connection between the public cloud and the private cloud is also disconnected, the public cloud can acquire the login request again, and the private cloud identifier is acquired according to the login request so as to maintain the connection relationship established between the public cloud and the private cloud.
As shown in fig. 7, in an embodiment, the provided interface adaptation method may further include a process of storing private cloud application program interface version information, and the specific steps include:
After the public cloud acquires the version information of the private cloud application program interface, the corresponding private cloud application program interface can be found according to the acquired version information of the private cloud application program interface, and the public cloud can also correspond the version information of the private cloud application program interface and the private cloud application program interface in a manner of establishing a corresponding relation. Because the version information of each private cloud application program interface is different, the public cloud can find the corresponding unique private cloud application program interface according to the version information of the private cloud application program interface.
The user session is established between the public cloud and the private cloud for communication between the public cloud and the private cloud. While the current user session is only for the public cloud to currently communicate with the private cloud. After the public cloud acquires the corresponding relationship between the version information of the private cloud application program interface and the application program interface, the version information of the private cloud application program interface and the application program interface can be corresponding according to the corresponding relationship and stored in the current user session of the public cloud and the private cloud.
When an operation request sent by a terminal is received, the public cloud can search version information of a corresponding public cloud application program interface in a database according to the operation request and version information of a private cloud application program interface in a current user session, the public cloud can also search version information of the private cloud application program interface corresponding to the version information of the public cloud application program interface in the database, then the corresponding private cloud application program interface is called through the version information of the private cloud application program interface, and the private cloud application program interface can execute business logic corresponding to the operation request.
And storing the version information of the private cloud application program interface to the current user session according to the corresponding relation by establishing the corresponding relation between the version information of the private cloud application program interface and the private cloud application program interface. The public cloud can call the public cloud application program interface in the database according to the version information of the private cloud application program interface in the current user session and the operation request, and then call the corresponding private cloud application program interface through the public cloud application program interface, so that the private cloud application program interface does not need to be changed, and the interface adaptation efficiency is improved.
In an embodiment, in the interface adaptation method provided, the version information of the application program interface corresponding to the private cloud identifier is the maximum version information in the version information base of the current private cloud application program interface.
The private cloud may have an application program interface version information base for storing the private cloud application program interface version information. The public cloud sends an information acquisition request to the private cloud according to the login request so as to acquire the version information of the private cloud application program interface corresponding to the private cloud identifier, and the version information of the application program interface returned to the public cloud by the private cloud can be the maximum version information in the version information base of the current private cloud application program interface.
In an embodiment, as shown in fig. 8, the provided interface adaptation method may further include a process of updating a public cloud application program interface, specifically including:
The change of the public cloud application program interface can be a new public cloud application program interface, and the public cloud application program interface can be changed or deleted. The terminal can send a first instruction for changing the application program interface of the public cloud to the public cloud, the terminal is connected with the public cloud through a network, and the public cloud can obtain the first instruction for changing the application program interface of the public cloud sent by the terminal.
And step 804, updating the public cloud application program interface according to the first instruction.
The public cloud can correspondingly update the application program interface of the public cloud according to the first instruction sent by the terminal. For example, the first instruction sent by the terminal is to add a new public cloud application program interface, the first instruction sent by the terminal may include a new public cloud application program interface that needs to be added, and the public cloud may add a new public cloud application program interface according to the first instruction.
As shown in fig. 9, in an embodiment, the provided interface adaptation method may further include a process of updating the private cloud application program interface version information, and the specific steps include:
The terminal may send a second instruction for updating the version information of the private cloud application program interface to the public cloud, and the second instruction may include the version information of the high-version private cloud application program interface.
And 904, updating the version information base of the private cloud application program interface according to the second instruction to obtain the updated version information base of the private cloud application program interface.
After the public cloud obtains the version information of the high-version private cloud application program interface in the second instruction, the public cloud can store the version information of the high-version private cloud application program interface in the version information base of the private cloud application program interface, and then the updated version information base of the private cloud application program interface is obtained. The updated version information base of the private cloud application program interface comprises version information of an original application program interface and version information of an updated application program interface.
And updating the version information base of the private cloud application program interface according to the second instruction by acquiring the second instruction for updating the version information of the private cloud application program interface to obtain the updated version information base of the private cloud application program interface. The updated version information base of the private cloud application program interface comprises the version information of the original application program interface and the version information of the updated application program interface, when the private cloud application program interface with a low version needs to be called, the private cloud application program interface can be directly called from the version information base of the private cloud application program interface, and the cost and the time for calling the interface are reduced.
In one embodiment, as shown in fig. 10, the version information base of the private cloud application program interface may store version information of a plurality of application program interfaces and corresponding interfaces. For example, the interfaces corresponding to the private cloud application interface V100 may be-fun 1 and-fun 2, the interfaces corresponding to the private cloud application interface V101 may be-fun 2 and-fun 3, the interface corresponding to the private cloud application interface V102 may be-fun 4, the interface corresponding to the private cloud application interface V103 may be-fun 5, and the like.
In one embodiment, as shown in fig. 11, an interface adaptation method is provided, which specifically includes the following steps 1102 to 1120.
Step 1102, the terminal sends a login request carrying a private cloud identifier to the public cloud.
And 1104, after receiving the login request, the public cloud sends an information acquisition request to the private cloud corresponding to the private cloud identifier.
Step 1106, the private cloud returns the version information of the corresponding application program interface according to the information acquisition request sent by the public cloud.
Step 1108, the public cloud stores the version information of the private cloud application program interface to the current user session.
In step 1110, the terminal sends an operation request to the public cloud, where the operation request sent by the terminal is sent after the login request, and the terminal has not logged out.
Step 1112, the public cloud searches the corresponding public cloud application program interface information in the database according to the operation request and the version information of the private cloud application program interface, and calls the public cloud application program interface.
Step 1114, the public cloud invokes the corresponding private cloud application program interface through the public cloud application program interface.
Step 1116, the private cloud application program interface executes the service logic, and a response result is obtained.
Step 1118, the private cloud returns the obtained response result to the public cloud.
And step 1120, the public cloud returns a response result to the terminal.
The method comprises the steps of obtaining a login request carrying a private cloud identifier, obtaining version information of an application program interface corresponding to the private cloud identifier according to the login request, obtaining an operation request, searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier, and obtaining a response result corresponding to the operation request, wherein the response result is obtained by calling the corresponding private cloud application program interface through the public cloud application program interface to execute business logic. By acquiring the version information of the private cloud application program interface, the private cloud application program interface is called after the corresponding public cloud application program interface is found, and communication between the public cloud and the private cloud can be realized without adjusting the application program interfaces of all the private clouds, so that the efficiency of interface adaptation is improved.
In one embodiment, as shown in FIG. 12, an interface adaptation method is provided. The interface adaptation method is performed in sequence according to the numerical references as in fig. 12.
First, the public cloud can obtain a login request carrying a private cloud identifier. Each private cloud corresponds to a private cloud identifier for distinguishing from other private clouds, and the private cloud identifier may be a string of numbers or a string of codes. The terminal can send a login request to the public cloud in a mode of logging in the public cloud through an account and a password, the sent login request can carry a private cloud identifier, and the public cloud can obtain the login request which is sent by the terminal and carries the private cloud identifier.
Then, the public cloud can establish a corresponding relationship between the version information of the private cloud application program interface and the private cloud application program interface. After the public cloud acquires the version information of the private cloud application program interface, the corresponding private cloud application program interface can be found according to the acquired version information of the private cloud application program interface, and the public cloud can also correspond the version information of the private cloud application program interface and the private cloud application program interface in a manner of establishing a corresponding relation. Because the version information of each private cloud application program interface is different, the public cloud can find the corresponding unique private cloud application program interface according to the version information of the private cloud application program interface. The public cloud may store the version information of the private cloud application program interface to the current user session according to the correspondence.
Secondly, when the public cloud receives an operation request sent by the terminal, the public cloud can search version information of a corresponding public cloud application program interface in the database according to the operation request and version information of a private cloud application program interface in a current user session, the public cloud can also search version information of a private cloud application program interface corresponding to the version information of the public cloud application program interface in the database, then the corresponding private cloud application program interface is called through the version information of the private cloud application program interface, and the private cloud application program interface can execute business logic corresponding to the operation request.
Then, the public cloud can send an information acquisition request to the private cloud corresponding to the private cloud identifier according to the login request. The login request carries the private cloud identification, and the public cloud finds the corresponding private cloud through the private cloud identification in the login request and is connected through the network. The public cloud can send an information acquisition request to the private cloud through the network, and the information acquisition request is used for acquiring the version information of the application program interface of the private cloud. The public cloud can also acquire version information of the corresponding application program interface returned by the private cloud according to the information acquisition request. After receiving the information acquisition request sent by the public cloud, the private cloud can send the version information of the corresponding application program interface to the public cloud, so that a user session between the public cloud and the private cloud is established. The version information of the application program interface corresponding to the private cloud identifier is the maximum version information in the version information base of the current private cloud application program interface.
The public cloud may also detect user sessions carrying private cloud identities. The public cloud can detect a user session, and the user session refers to a session for establishing connection between the public cloud and the private cloud. The private cloud identifier can be carried in the user session detected by the public cloud, and the public cloud can search the private cloud establishing the user session with the public cloud according to the private cloud identifier. When the user session fails, the public cloud can acquire the login request carrying the private cloud identifier again. The user session invalidation information may be information that causes the user session to be invalidated and disconnects the connection between the public cloud and the private cloud. For example, the user session invalidation information may be that the user logs out, or the network is not good, so that the connection between the public cloud and the private cloud is disconnected and communication cannot be performed. The public cloud can search for the private cloud with the invalid user session establishment according to the private cloud identification. When the user session fails, the public cloud can acquire the login request again, the login request can carry the private cloud identifier, and the public cloud can acquire the private cloud identifier through the login request.
Then, the public cloud can obtain the operation request, and the corresponding public cloud application program interface is searched according to the operation request and the version information of the application program interface corresponding to the private cloud identifier. When the terminal does not exit the public cloud for logging in, the public cloud can acquire the operation request sent by the terminal. The operation request may include an operation type. The terminal needs to call the application program interface of the private cloud only through the public cloud application program interface, and therefore the application program interface of each public cloud can be realized through the corresponding private cloud application program interface. The public cloud can find the corresponding public cloud application program interface according to the operation type in the operation request and the version information of the application program interface corresponding to the private cloud identifier, and call the corresponding private cloud application program interface through the public cloud application program interface.
And finally, the public cloud can also obtain a response result corresponding to the operation request, wherein the response result is obtained by calling a corresponding private cloud application program interface through the public cloud application program interface to execute the service logic. And the public cloud searches and calls the corresponding public cloud application program interface according to the operation type in the operation request and the version information of the application program interface corresponding to the private cloud identifier, and then calls the corresponding private cloud application program interface through the public cloud and executes the service logic corresponding to the operation type in the operation request through the private cloud application program interface. After the service logic is executed, the public cloud can obtain a response result sent by the private cloud, and the response result corresponds to the operation request.
The public cloud can also obtain a first instruction for changing the public cloud application program interface, and the public cloud application program interface is updated according to the first instruction. The public cloud can correspondingly update the application program interface of the public cloud according to the first instruction sent by the terminal. For example, the first instruction sent by the terminal is to add a new public cloud application program interface, the first instruction sent by the terminal may include a new public cloud application program interface that needs to be added, and the public cloud may add a new public cloud application program interface according to the first instruction.
The public cloud can also obtain a second instruction for updating the version information of the private cloud application program interface, and update the version information base of the private cloud application program interface according to the second instruction to obtain the updated version information base of the private cloud application program interface. After the public cloud obtains the version information of the high-version private cloud application program interface in the second instruction, the public cloud can store the version information of the high-version private cloud application program interface in the version information base of the private cloud application program interface, and then the updated version information base of the private cloud application program interface is obtained. The updated version information base of the private cloud application program interface comprises version information of an original application program interface and version information of an updated application program interface.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in the above-described flowcharts may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or the stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 13, there is provided an interface adapting apparatus including: a request obtaining module 1310, an information obtaining module 1320, an interface searching module 1330, and a result obtaining module 1340, wherein:
the request obtaining module 1310 is configured to obtain a login request carrying a private cloud identifier.
The information obtaining module 1320 is configured to obtain version information of the application program interface corresponding to the private cloud identifier according to the login request.
The interface searching module 1330 is configured to obtain the operation request, and search the corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier.
The result obtaining module 1340 is configured to obtain a response result corresponding to the operation request, where the response result is obtained by calling a corresponding private cloud application program interface through a public cloud application program interface to execute a service logic.
In an embodiment, the information obtaining module 1320 may further be configured to send an information obtaining request to a private cloud corresponding to the private cloud identifier according to the login request, and obtain version information of a corresponding application program interface returned by the private cloud according to the information obtaining request.
In an embodiment, the request obtaining module 1310 may be further configured to detect a user session carrying a private cloud identifier, and obtain a login request carrying the private cloud identifier again when the user session fails.
In one embodiment, the information obtaining module 1320 may be further configured to establish a corresponding relationship between the version information of the private cloud application program interface and the private cloud application program interface, and store the version information of the private cloud application program interface to the current user session according to the corresponding relationship.
In one embodiment, the version information of the application program interface corresponding to the private cloud identifier is the maximum version information in the version information base of the current private cloud application program interface.
In one embodiment, the request obtaining module 1310 may be further configured to obtain a first instruction for changing the public cloud application program interface, and update the public cloud application program interface according to the first instruction.
In an embodiment, the request obtaining module 1310 may be further configured to obtain a second instruction for updating the version information of the private cloud application program interface, and update the version information base of the private cloud application program interface according to the second instruction to obtain an updated version information base of the private cloud application program interface, where the updated version information base of the private cloud application program interface includes version information of an original application program interface and version information of an updated application program interface.
For specific definition of the interface adaptation means, reference may be made to the above definition of the interface adaptation method, which is not described herein again. The various modules in the above described interface adaptation apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, there is also provided a computer readable storage medium storing a computer program which when executed by a processor implements the steps of: the method comprises the steps of obtaining a login request carrying a private cloud identifier, obtaining version information of an application program interface corresponding to the private cloud identifier according to the login request, obtaining an operation request, searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier, and obtaining a response result corresponding to the operation request, wherein the response result is obtained by calling the corresponding private cloud application program interface through the public cloud application program interface to execute service logic.
In one embodiment, the computer program is executed by a processor to acquire version information of an application program interface corresponding to a private cloud identifier according to a login request, and the method includes: and sending an information acquisition request to the private cloud corresponding to the private cloud identifier according to the login request, and acquiring the version information of the corresponding application program interface returned by the private cloud according to the information acquisition request.
In one embodiment, the computer program when executed by the processor may further implement the steps of: and detecting the user session carrying the private cloud identifier, and when the user session fails, re-acquiring the login request carrying the private cloud identifier.
In one embodiment, the computer program when executed by the processor may further implement the steps of: and establishing a corresponding relation between the version information of the private cloud application program interface and the private cloud application program interface, and storing the version information of the private cloud application program interface to the current user session according to the corresponding relation.
In one embodiment, when the computer program is executed by the processor, the version information of the application program interface corresponding to the private cloud identifier is the maximum version information in the version information base of the current private cloud application program interface.
In one embodiment, the computer program when executed by the processor may further implement the steps of: the method comprises the steps of obtaining a first instruction for changing a public cloud application program interface, and updating the public cloud application program interface according to the first instruction.
In one embodiment, the computer program when executed by the processor may further implement the steps of: and acquiring a second instruction for updating the version information of the private cloud application program interface, and updating the version information base of the private cloud application program interface according to the second instruction to obtain an updated version information base of the private cloud application program interface, wherein the updated version information base of the private cloud application program interface comprises the version information of the original application program interface and the version information of the updated application program interface.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A method of interface adaptation, the method comprising:
acquiring a login request carrying a private cloud identifier;
sending an information acquisition request to a private cloud corresponding to the private cloud identifier according to the login request;
acquiring version information of a corresponding application program interface returned by the private cloud according to the information acquisition request;
acquiring an operation request, and searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier;
and acquiring a response result corresponding to the operation request, wherein the response result is obtained by calling a corresponding private cloud application program interface through the public cloud application program interface to execute service logic.
2. The method according to claim 1, wherein the sending an information acquisition request to a private cloud corresponding to the private cloud identity according to the login request comprises:
identifying the private cloud identification carried in the login request to obtain a private cloud corresponding to the private cloud identification;
and sending an information acquisition request to the private cloud corresponding to the private cloud identifier.
3. The method of claim 1, further comprising:
detecting a user session carrying a private cloud identifier;
and when the user session fails, re-acquiring the login request carrying the private cloud identifier.
4. The method according to claim 1, wherein before the steps of obtaining an operation request, and searching for a corresponding application program interface according to the operation request and the version information of the application program interface, the method further comprises:
establishing a corresponding relation between the version information of the private cloud application program interface and the private cloud application program interface;
and storing the version information of the private cloud application program interface to the current user session according to the corresponding relation.
5. The method according to claim 1, wherein the version information of the application program interface corresponding to the private cloud identity is the maximum version information in a version information base of a current private cloud application program interface.
6. The method of claim 1, further comprising:
acquiring a first instruction for changing the public cloud application program interface;
and updating the public cloud application program interface according to the first instruction.
7. The method of any one of claims 1 to 6, further comprising:
acquiring a second instruction for updating the version information of the private cloud application program interface;
updating the version information base of the private cloud application program interface according to the second instruction to obtain an updated version information base of the private cloud application program interface;
the updated version information base of the private cloud application program interface comprises original version information of the private cloud application program interface and updated version information of the private cloud application program interface.
8. An interface adapter device, the device comprising:
the request acquisition module is used for acquiring a login request carrying a private cloud identifier;
the information acquisition module is used for sending an information acquisition request to the private cloud corresponding to the private cloud identifier according to the login request; acquiring version information of a corresponding application program interface returned by the private cloud according to the information acquisition request;
the interface searching module is used for acquiring an operation request and searching a corresponding public cloud application program interface according to the operation request and the version information of the application program interface corresponding to the private cloud identifier;
and the result acquisition module is used for acquiring a response result corresponding to the operation request, wherein the response result is obtained by calling a corresponding private cloud application program interface through the public cloud application program interface to execute service logic.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810381590.5A CN108595280B (en) | 2018-04-25 | 2018-04-25 | Interface adaptation method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810381590.5A CN108595280B (en) | 2018-04-25 | 2018-04-25 | Interface adaptation method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108595280A CN108595280A (en) | 2018-09-28 |
CN108595280B true CN108595280B (en) | 2021-02-19 |
Family
ID=63609851
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810381590.5A Active CN108595280B (en) | 2018-04-25 | 2018-04-25 | Interface adaptation method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108595280B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110932927B (en) * | 2019-10-31 | 2021-12-03 | 北京浪潮数据技术有限公司 | Service processing method, device, equipment and readable storage medium |
CN111866091B (en) * | 2020-06-30 | 2023-10-31 | 海尔优家智能科技(北京)有限公司 | Method, device, server and system for cloud platform information interaction |
CN115150242B (en) * | 2022-06-23 | 2023-04-25 | 北京青云科技股份有限公司 | Deployment method and system of PaaS application |
CN115695555B (en) * | 2022-09-06 | 2023-09-12 | 恒生电子股份有限公司 | Interface calling method, system, processing device and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090070759A1 (en) * | 2007-09-10 | 2009-03-12 | Samsung Electronics Co., Ltd. | Electronic apparatus and program downloading method thereof |
CN103440337A (en) * | 2013-09-09 | 2013-12-11 | 百度在线网络技术(北京)有限公司 | API (application program interface) compatibility scanning method and API compatibility scanning device |
CN105183484A (en) * | 2015-09-28 | 2015-12-23 | 北京奇虎科技有限公司 | Method and device for compatibility of multi-version application programming interface |
US20170163480A1 (en) * | 2013-04-03 | 2017-06-08 | Salesforce.Com, Inc. | System and method for generic configuration management system application programming interface |
-
2018
- 2018-04-25 CN CN201810381590.5A patent/CN108595280B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090070759A1 (en) * | 2007-09-10 | 2009-03-12 | Samsung Electronics Co., Ltd. | Electronic apparatus and program downloading method thereof |
US20170163480A1 (en) * | 2013-04-03 | 2017-06-08 | Salesforce.Com, Inc. | System and method for generic configuration management system application programming interface |
CN103440337A (en) * | 2013-09-09 | 2013-12-11 | 百度在线网络技术(北京)有限公司 | API (application program interface) compatibility scanning method and API compatibility scanning device |
CN105183484A (en) * | 2015-09-28 | 2015-12-23 | 北京奇虎科技有限公司 | Method and device for compatibility of multi-version application programming interface |
Also Published As
Publication number | Publication date |
---|---|
CN108595280A (en) | 2018-09-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110727499B (en) | Method, device, computer equipment and storage medium for acquiring resource data | |
CN108965381B (en) | Nginx-based load balancing implementation method and device, computer equipment and medium | |
CN110287709B (en) | User operation authority control method, device, equipment and medium | |
CN108595280B (en) | Interface adaptation method and device, computer equipment and storage medium | |
CN109842617B (en) | Advertisement blocking method and device and storage medium | |
CN110602169B (en) | Service calling method and device, computer equipment and storage medium | |
CN108093094B (en) | Database instance access method, device, system, storage medium and equipment | |
CN110290112B (en) | Authority control method and device, computer equipment and storage medium | |
CN108959384B (en) | Webpage data acquisition method and device, computer equipment and storage medium | |
CN112612595A (en) | Method and device for establishing micro-service calling relationship, computer equipment and storage medium | |
CN111193716A (en) | Service data calling method and device, computer equipment and storage medium | |
CN110708247B (en) | Message routing method, message routing device, computer equipment and storage medium | |
CN112153170B (en) | Method, device and equipment for accessing server and storage medium | |
CN106953746A (en) | Clustered node upgrade-system and method | |
CN110213392B (en) | Data distribution method and device, computer equipment and storage medium | |
CN113676563B (en) | Scheduling method, device, equipment and storage medium of content distribution network service | |
CN111343236A (en) | Method, device and communication system for communication between server and client | |
CN106210155A (en) | The method and apparatus connecting application server | |
CN110602168A (en) | Data synchronization method and device, computer equipment and storage medium | |
CN110659938A (en) | Method and device for determining promotion channel, computer equipment and storage medium | |
CN111026988A (en) | Page loading method, device and system and computer equipment | |
CN114281263A (en) | Storage resource processing method, system and equipment of container cluster management system | |
CN108763396B (en) | Access request processing method, device, computer equipment and storage medium | |
CN111209061A (en) | Method and device for filling in user information, computer equipment and storage medium | |
CN112507010B (en) | Service data processing method and device, computer equipment and storage medium |
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 |