CN113472781A - Service acquisition method, server and computer readable storage medium - Google Patents

Service acquisition method, server and computer readable storage medium Download PDF

Info

Publication number
CN113472781A
CN113472781A CN202110736369.9A CN202110736369A CN113472781A CN 113472781 A CN113472781 A CN 113472781A CN 202110736369 A CN202110736369 A CN 202110736369A CN 113472781 A CN113472781 A CN 113472781A
Authority
CN
China
Prior art keywords
server
service
acquisition request
target
service acquisition
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.)
Granted
Application number
CN202110736369.9A
Other languages
Chinese (zh)
Other versions
CN113472781B (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.)
Ping An Securities Co Ltd
Original Assignee
Ping An Securities Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Securities Co Ltd filed Critical Ping An Securities Co Ltd
Priority to CN202110736369.9A priority Critical patent/CN113472781B/en
Publication of CN113472781A publication Critical patent/CN113472781A/en
Application granted granted Critical
Publication of CN113472781B publication Critical patent/CN113472781B/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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0807Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • G06F8/4432Reducing the energy consumption
    • 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
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Telephonic Communication Services (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application is applicable to the technical field of cloud transmission, and provides a service acquisition method, a server and a computer-readable storage medium, wherein the method comprises the following steps: a first server in a first network receives a service acquisition request from a target terminal device in the first network through a first general interface, verifies the validity of the service acquisition request according to a first token in the service acquisition request, and calls a second general interface of a second server in a second network to send the service acquisition request to the second server after the service acquisition request is determined to be valid; the second server determines a target service interface corresponding to the target service based on the identification of the target service in the service acquisition request, calls the target service interface to obtain a response result aiming at the service acquisition request, and sends the response result to the first server; the first server sends the response result to the target terminal equipment, so that the redundancy of codes in the first server is avoided, and the programming cost of writing the service interface is reduced.

Description

Service acquisition method, server and computer readable storage medium
Technical Field
The present application relates to the field of cloud transmission technologies, and in particular, to a service acquisition method, a server, and a computer-readable storage medium.
Background
In order to realize mobile office work and enable terminal equipment in an external network to acquire related services provided by a server in an internal network, a firewall is generally established between an internal network server and an external network server in the prior art, so that when the terminal equipment in the external network needs to acquire a certain service provided by the internal network server, a service acquisition request sent by the terminal equipment in the external network can be forwarded to the internal network server through the external network server.
In the related art, in order to enable the extranet server to forward a service acquisition request, which is sent by the terminal device and is directed to any service provided by the intranet server, to the intranet server, a research and development staff configures a plurality of service interfaces in the extranet server for the terminal device to call, wherein each service interface corresponds to one service provided by the intranet server. Therefore, when the number of services provided by the intranet server is large, the number of service interfaces required to be configured by the extranet server is large, code redundancy in the extranet server is caused, and programming cost for writing the service interfaces is increased.
Disclosure of Invention
In view of this, embodiments of the present application provide a service acquisition method, a server, and a computer-readable storage medium, so as to solve the technical problems that the existing service acquisition method may cause code redundancy in a server in the same network as a terminal device, and programming cost for writing a service interface is high.
A first aspect of an embodiment of the present application provides a service acquisition method, which is applied to a first server in a first network, where the first server is configured with a first general interface; the service acquisition method comprises the following steps:
receiving a service acquisition request from a target terminal device in the first network through the first general interface; the service acquisition request carries a first token and an identifier of a target service to be requested, wherein the target service is a service provided by a second server in a second network;
verifying the validity of the service acquisition request according to the first token, and calling a second universal interface of the second server to send the service acquisition request to the second server after the service acquisition request is determined to be valid;
receiving a response result returned by the second server and aiming at the service acquisition request;
and sending the response result to the target terminal equipment.
A second aspect of the embodiments of the present application provides a service acquisition method, which is applied to a second server in a second network, where the second server is configured with a second universal interface; the service acquisition method comprises the following steps:
receiving a service acquisition request from a first server in a first network through the second universal interface; the service acquisition request carries an identifier of a target service to be requested;
determining a target service interface corresponding to the target service based on the identification of the target service;
and calling the target service interface to obtain a response result aiming at the service acquisition request, and sending the response result to the first server.
A third aspect of an embodiment of the present application provides a server, where the server is a first server in a first network, and the first server is configured with a first general interface; the first server includes:
a first receiving unit, configured to receive, through the first generic interface, a service acquisition request from a target terminal device in the first network; the service acquisition request carries a first token and an identifier of a target service to be requested, wherein the target service is a service provided by a second server in a second network;
the first sending unit is used for verifying the validity of the service acquisition request according to the first token and calling a second general interface of the second server to send the service acquisition request to the second server after the service acquisition request is determined to be valid;
a second receiving unit, configured to receive a response result returned by the second server for the service acquisition request;
and the second sending unit is used for sending the response result to the target terminal equipment.
A fourth aspect of the embodiments of the present application provides a server, where the server is a second server in a second network, and the second server is configured with a second universal interface; the second server includes:
a third receiving unit, configured to receive, through the second universal interface, a service acquisition request from a first server in a first network; the service acquisition request carries an identifier of a target service to be requested;
a first determining unit, configured to determine, based on the identifier of the target service, a target service interface corresponding to the target service;
and the service management unit is used for calling the target service interface, obtaining a response result aiming at the service acquisition request and sending the response result to the first server.
A fifth aspect of an embodiment of the present application provides a server, where the server is a first server in a first network, and the first server is configured with a first general interface; the server includes a memory, a processor, and a computer program stored in the memory and executable on the server, and the processor implements the steps of the service acquisition method provided in the first aspect when executing the computer program.
A sixth aspect of an embodiment of the present application provides a server, where the server is a second server in a second network, and the second server is configured with a second universal interface; the server includes a memory, a processor, and a computer program stored in the memory and executable on the server, and the processor implements the steps of the service acquisition method provided by the second aspect when executing the computer program.
A seventh aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the service acquisition method provided by the first aspect.
An eighth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the service acquisition method provided by the second aspect.
The implementation of the service acquisition method, the server and the computer readable storage medium provided by the embodiment of the application has the following beneficial effects:
in the service acquisition method provided by the embodiment of the application, the first general interface is configured for the first server in the first network, so that no matter which service provided by the second server needs to be acquired by the target terminal device in the first network, the target terminal device can call the first general interface to send the service acquisition request of the target service provided by the second server to the first server, and the first server can forward the service acquisition request to the second server, so that the target terminal device acquires the target service provided by the second server. Compared with the prior art that a plurality of different service interfaces need to be configured in the first server, in the embodiment of the application, no matter how many services are provided by the second server, any service provided by the second server can be obtained only by configuring one first general interface in the first server, so that the redundancy of codes in the first server is avoided, and the programming cost for writing the service interfaces is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic view of a scenario to which a service acquisition method provided in an embodiment of the present application is applied;
fig. 2 is a flowchart illustrating an implementation of a service acquisition method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating an implementation of a service acquisition method according to another embodiment of the present application;
fig. 4 is a block diagram of a server according to an embodiment of the present disclosure;
fig. 5 is a block diagram of a server according to another embodiment of the present application;
fig. 6 is a block diagram of a server according to another embodiment of the present application;
fig. 7 is a block diagram of a server according to another embodiment of the present application.
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.
It should be noted that the words "first", "second", and the like are used in the embodiments of the present application to distinguish the same items or similar items having substantially the same functions and actions. For example, the first server and the second server are only used for distinguishing different servers, and the sequence order of the servers is not limited. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
Additionally, the words "exemplary" or "such as" are used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
The service acquisition method related to the embodiment of the application can be applied to an intelligent office scene, so that employees on business trip can acquire the service provided by the server in the internal network (namely the second network) of the company through the terminal equipment (namely the terminal equipment in the first network), and the construction of an intelligent city is promoted.
Referring to fig. 1, fig. 1 is a schematic view of a scenario in which a service acquisition method according to an embodiment of the present disclosure is applied. As shown in fig. 1, the first server 11 is a node device in a first network, the second server 12 is a node device in a second network, and the first network and the second network are different networks.
In one possible implementation, the first network may be the internet (i.e., an extranet); the second network may be any local area network (i.e., intranet), such as a local area network within a company.
In another possible implementation, both the first network and the second network may be blockchains (blockchains). Accordingly, the first server 11 may be any blockchain node device in the first network, and the second server 12 may be any blockchain node device in the second network. It should be noted that the blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. The blockchain is essentially a decentralized database, which is a string of data blocks associated by using cryptography, each data block contains information of a batch of network transactions, and the information is used for verifying the validity (anti-counterfeiting) of the information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
In the embodiment of the present application, the first server is configured with a first universal interface 111. The target terminal device 13 in the first network may directly obtain the service provided by the first server 11 from the first server 11 by calling the first generic interface 111. Specifically, the target terminal device 13 in the first network may register a target account in the first server 11, and log in the first server 11 by logging in the target account, so as to obtain the service provided by the first server 11. Generally, when the target terminal device 13 logs in the target account for the first time, the target terminal device 13 needs to submit the account name and the password of the target account to the first server 11 to request to log in the target account. The first server 11 may return a unique token (token) for the target terminal device 13 if the target terminal device 13 successfully logs in. The target terminal device may store the target account and the token corresponding to the target account in an associated manner, and only the token needs to be carried when the subsequent target terminal device 13 requests to obtain a service from the first server 11, and the target account does not need to be repeatedly logged in.
The target terminal device 13 may be any terminal device in the first network. In a specific application, the target terminal device 13 may be an electronic device such as a mobile phone, a tablet computer, or a notebook computer.
In the embodiment of the application, a preset communication channel is established between the first server and the second server, and the first server and the second server can communicate through the preset communication channel. Illustratively, the preset communication channel may be a communication channel established based on firewall technology.
In particular, the second server 12 is provided with a second universal interface 121. The first server 11 may enable communication with the second server 12 by calling the second universal interface 121.
Since the target terminal device 13 in the first network and the second server 12 in the second network are in different networks, the target terminal device 13 cannot directly communicate with the second server 12, and thus cannot directly acquire the service provided by the second server 12 from the second server 12. When the target terminal device 13 needs to acquire the service provided by the second server 12, the target terminal device 13 may send a service acquisition request for the target service provided by the second server 12 to the first server 11 by calling the first generic interface 111. After receiving the service acquisition request, the first server 11 may call the second universal interface 121 to forward the service acquisition request to the second server 12. After receiving the service acquisition request, the second server 12 may call a service interface corresponding to the target service to obtain a response result for the service acquisition request, and return the response result to the first server 11 through the second generic interface 121, and the first server 11 may return the response result to the target terminal device 13 through the first generic interface 111.
In the embodiment of the application, the first universal interface and the second universal interface are both software interfaces. Illustratively, the first generic Interface and the second generic Interface may be Application Programming Interfaces (APIs).
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of a service acquisition method according to an embodiment of the present application.
As shown in fig. 2, the service acquisition method may include S21 to S27, which are detailed as follows:
s21: and the first server receives a service acquisition request from the target terminal equipment in the first network through the first general interface.
When the target terminal device in the first network needs to acquire the target service in the second server, the target terminal device may generate a service acquisition request based on the first token and the identifier of the target service to be requested, and call the first general interface of the first server to send the service acquisition request to the first server.
The service acquisition request is used for requesting a target service provided by the second server, and the service acquisition request carries the first token and the identifier of the target service.
The first token is a token corresponding to a target account registered in the first server by a target user initiating a service acquisition request. The identification of the target service may be the name or number of the target service, etc.
After the target terminal device sends the service acquisition request to the first server, the first server receives the service acquisition request from the target terminal device through the first general interface of the first server.
S22: and the first server verifies the validity of the service acquisition request according to the first token, and calls a second general interface of the second server to send the service acquisition request to the second server after determining that the service acquisition request is valid.
After receiving the service acquisition request from the target terminal device, the first server extracts a first token from the service acquisition request, and verifies the validity of the service acquisition request based on the first token. If the service acquisition request is valid, the target user initiating the service acquisition request registers a target account in the first server, and the target account is currently valid; the invalid service acquisition request indicates that the target user initiating the service acquisition request has not registered an account in the first server, or the target user has registered a target account in the first server but the target account is currently invalid.
By way of example and not limitation, the first server may have stored therein a token list for storing all tokens issued by the first server. Based on this, after the first server extracts the first token from the service acquisition request, whether the token list includes the first token can be judged, and if the first server judges that the token list includes the first token, the service acquisition request is determined to be valid; and if the first server judges that the token list does not comprise the first token, determining that the service acquisition request is invalid.
In a possible implementation manner, after determining that the service acquisition request is valid, the first server may call a second general interface of the second server to send the service acquisition request to the second server.
In another possible implementation, the first server does not forward the service acquisition request to the second server when determining that the service acquisition request is invalid.
S23: the second server receives a service acquisition request from the first server in the first network through the second universal interface.
S24: and the second server determines a target service interface corresponding to the target service based on the identification of the target service.
In a possible implementation manner, the second server may store a correspondence between the identifier of each preset service provided by the second server and the service interface corresponding to each preset service. Based on this, after receiving the service acquisition request from the first server, the second server may determine a target service interface corresponding to the target service in the following manner:
and determining a target service interface corresponding to the target service based on the identification of the target service and the corresponding relation between the identification of each preset service and the service interface corresponding to each preset service.
S25: and the second server calls the target service interface to obtain a response result aiming at the service acquisition request and sends the response result to the first server.
In the embodiment of the application, after the second server determines the target service interface, the second server calls the target service interface. After the second server calls the target service interface, a response result fed back by the target service interface and aiming at the service acquisition request can be obtained.
In a specific embodiment of the present application, the service acquisition request further carries a calling mode and a calling parameter of the service interface. Based on this, the second server may invoke the target service interface in a manner of invoking the service interface based on the invocation parameter of the service interface carried in the service acquisition request.
After the second server obtains the response result for the service acquisition request, the second server can send the response result for the service acquisition request to the first server through the second general interface.
S26: and the first server receives a response result returned by the second server and aiming at the service acquisition request.
S27: and the first server sends the response result to the target terminal equipment.
The first server receives a response result aiming at the service acquisition request, and can return the response result aiming at the service acquisition request to the target terminal equipment through the first general interface.
As can be seen from the above, in the service acquiring method provided in this embodiment, the first general interface is configured for the first server in the first network, so that no matter which service provided by the second server needs to be acquired by the target terminal device in the first network, the target terminal device can call the first general interface to send the service acquiring request for the target service provided by the second server to the first server, and the first server can forward the service acquiring request to the second server, so that the target terminal device acquires the target service provided by the second server. Compared with the prior art that a plurality of different service interfaces need to be configured in the first server, in the embodiment of the application, no matter how many services are provided by the second server, any service provided by the second server can be obtained only by configuring one first general interface in the first server, so that the redundancy of codes in the first server is avoided, and the programming cost for writing the service interfaces is reduced.
Referring to fig. 3, fig. 3 is a flowchart illustrating an implementation of a service acquisition method according to another embodiment of the present application. As shown in fig. 3, with respect to the embodiment corresponding to fig. 2, in the service acquiring method provided in this embodiment, S22 may specifically include S221 to S222. The details are as follows:
s221: after determining that the service acquisition request is valid, the first server updates the service acquisition request, deletes the first token in the service acquisition request, and adds the identity of the target user in the service acquisition request to obtain the updated service acquisition request.
S222: and the first server calls the second universal interface to send the updated service acquisition request to the second server.
In this embodiment, in order to ensure that only a user authorized by the second server can acquire the service provided by the second server, and further improve the security of data in the second server, in a possible implementation manner, the first server may update the service acquisition request after determining that the service acquisition request is valid, add an identity of the target user in the second server to the service acquisition request, and obtain the updated service acquisition request, where the updated service acquisition request includes the identity of the target user in addition to the identity of the target service.
The identity of the target user in the second server may be provided to the first server when the target user registers the target account with the first server. The first server can store the target account number registered by the target user and the identity of the target user in the second server in an associated manner.
The identity of the target user in the second server may be a user name, a mobile phone number or an identity card number registered by the target user in the second server.
In another possible implementation manner, in order to improve communication efficiency, when the service acquisition request is updated, the first server adds the identity of the target user in the second server to the service acquisition request, and may also delete the first token in the service acquisition request, so as to obtain the updated service acquisition request. Therefore, the data size of the service acquisition request can be reduced, so that the first server occupies less communication resources when sending the service acquisition request to the second server, and the communication efficiency is improved.
Referring to fig. 3, in another embodiment of the present application, when S22 includes S221 to S222, S24 may specifically include S241 to S242, which are detailed as follows:
s241: and the second server performs identity verification on the target user based on the identity of the target user.
S242: and the second server determines a target service interface corresponding to the target service based on the identification of the target service after the identity verification is passed.
In this embodiment, the storage of the second server may store the identity of each authorized user in advance. For example, the user authorized by the second server may be a user who has registered an account in the second server and the account is currently in a valid state.
After receiving the service acquisition request from the first server, the second server may extract the identity of the target user from the service acquisition request, and detect whether the identity of the target user is stored in its memory. Specifically, if the second server detects that the identity of the target user is stored in the memory of the second server, the identity of the target user is determined to be verified; and if the second server detects that the identity of the target user is not stored in the memory of the second server, determining that the identity verification of the target user fails.
And the second server determines a target service interface corresponding to the target service based on the identification of the target service after determining that the identity verification of the target user passes.
As can be seen from the above, the service obtaining method provided in this embodiment can ensure that only the user authorized by the second server can obtain the service provided by the second server, so that the security of the data in the second server can be improved.
Referring to fig. 4, fig. 4 is a block diagram of a server according to an embodiment of the present disclosure. The server in this embodiment is a first server in the first network, and the first server 40 includes units for executing S21 to S22 and S26 to S27 in the embodiment corresponding to fig. 2 and S221 to S222 in the embodiment corresponding to fig. 3. Please refer to fig. 2 and 3 and the related descriptions of the embodiments corresponding to fig. 2 and 3. For convenience of explanation, only the portions related to the present embodiment are shown. As shown in fig. 4, the first server 40 includes: a first receiving unit 41, a first transmitting unit 42, a second receiving unit 43, and a second transmitting unit 44. Wherein:
the first receiving unit 41 is configured to receive a service acquisition request from a target terminal device in the first network through the first general interface; the service acquisition request carries a first token and an identifier of a target service to be requested, and the target service is a service provided by a second server in a second network.
The first sending unit 42 is configured to verify validity of the service acquisition request according to the first token, and after determining that the service acquisition request is valid, invoke a second universal interface of the second server to send the service acquisition request to the second server.
The second receiving unit 43 is configured to receive a response result returned by the second server for the service acquisition request.
The second sending unit 44 is configured to send the response result to the target terminal device.
As an embodiment of the present application, the first sending unit 42 specifically includes a request processing unit and an interface calling unit. Wherein:
the request processing unit is used for updating the service acquisition request after determining that the service acquisition request is valid, deleting the first token in the service acquisition request, and adding the identity of a target user in the service acquisition request to obtain the updated service acquisition request; the target user is the user who initiates the service acquisition request.
The interface calling unit is used for calling the second universal interface to send the updated service acquisition request to the second server.
As an embodiment of the present application, the identity of the target user is the identity of the target user in the second server.
It should be noted that, because the above-mentioned information interaction between the units, the execution process, and the like are based on the same concept, and the specific functions and technical effects thereof are based on the same concept, reference may be made to the method embodiment specifically, and details are not described here.
Fig. 5 is a block diagram of a server according to another embodiment of the present application. The server in this embodiment is a first server in a first network, and as shown in fig. 5, the first server 50 includes: a processor 51, a memory 52 and a computer program 53 stored in the memory 52 and operable on the processor 51, for example a program corresponding to a service acquisition method. The processor 51, when executing the computer program 53, implements the steps in the various service acquisition method embodiments described above, such as S21-S22 and S27-S28 shown in fig. 2, or S221-S222 shown in fig. 3. Alternatively, when the processor 51 executes the computer program 53, the functions of the units in the embodiment corresponding to fig. 4, for example, the functions of the units 41 to 43 shown in fig. 4, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 4, which is not repeated herein.
Illustratively, the computer program 53 may be divided into one or more units, which are stored in the memory 52 and executed by the processor 51 to accomplish the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 53 in the first server 50. For example, the computer program 53 may be divided into a first receiving unit, a first transmitting unit, a second receiving unit, and a second transmitting unit, and the specific functions of the units are as described above.
Those skilled in the art will appreciate that fig. 5 is merely an example of the first server 50 and does not constitute a limitation of the first server 50, that the first server 50 may include more or less elements than those shown, or some elements may be combined, or different elements, for example, the first server 50 may also include input output devices, network access devices, buses, etc.
The Processor 51 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 52 may be an internal storage unit of the first server 50, such as a hard disk or a memory of the first server 50. The memory 52 may also be an external storage device of the first server 50, such as a plug-in hard disk provided on the first server 50, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 52 may also include both an internal storage unit of the first server 50 and an external storage device. The memory 52 is used for storing said computer programs and other programs and data required by the first server 50. The memory 52 may also be used to temporarily store data that has been output or is to be output.
Referring to fig. 6, fig. 6 is a block diagram of a server according to another embodiment of the present disclosure. The server in this embodiment is a second server in the second network, and the second server 60 includes units for executing S23 to S25 in the embodiment corresponding to fig. 2. Please refer to fig. 2 and the related description of the embodiment corresponding to fig. 2. For convenience of explanation, only the portions related to the present embodiment are shown. As shown in fig. 6, the second server 60 includes: a third receiving unit 61, a first determining unit 62 and a service managing unit 63. Wherein:
the third receiving unit 61 is configured to receive a service acquisition request from a first server in the first network through the second universal interface; the service acquisition request carries an identifier of a target service to be requested.
The first determining unit 62 is configured to determine a target service interface corresponding to the target service based on the identifier of the target service.
The service management unit 63 is configured to invoke the target service interface, obtain a response result for the service acquisition request, and send the response result to the first server.
As an embodiment of the present application, the first determining unit 62 is specifically configured to:
and determining a target service interface corresponding to the target service based on the identification of the target service and the corresponding relation between the identification of each preset service and the service interface corresponding to each preset service.
As an embodiment of the present application, the service acquisition request further carries an identity of a target user that initiated the service acquisition request; accordingly, the first determination unit 62 includes an identity verification unit and an interface determination unit. Wherein:
the identity verification unit is used for verifying the identity of the target user based on the identity of the target user.
And the interface determining unit is used for determining a target service interface corresponding to the target service based on the identification of the target service after the identity verification is passed.
It should be noted that, because the above-mentioned information interaction between the units, the execution process, and the like are based on the same concept, and the specific functions and technical effects thereof are based on the same concept, reference may be made to the method embodiment specifically, and details are not described here.
Fig. 7 is a block diagram of a server according to another embodiment of the present application. The server in this embodiment is a second server in a second network, and as shown in fig. 7, the second server 70 includes: a processor 71, a memory 72, and a computer program 73, such as a program corresponding to a service acquisition method, stored in the memory 72 and operable on the processor 71. The processor 71, when executing the computer program 73, implements the steps in the various service acquisition method embodiments described above, such as S23-S25 shown in fig. 2. Alternatively, when the processor 71 executes the computer program 73, the functions of the units in the embodiment corresponding to fig. 6, for example, the functions of the units 61 to 63 shown in fig. 6, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 6, which is not repeated herein.
Illustratively, the computer program 73 may be divided into one or more units, which are stored in the memory 72 and executed by the processor 71 to complete the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 73 in the second server 70. For example, the computer program 73 may be divided into a third receiving unit, a first determining unit, and a service managing unit, and the specific functions of each unit are as described above.
Those skilled in the art will appreciate that fig. 7 is merely an example of the second server 70 and does not constitute a limitation of the second server 70, that the second server 70 may include more or less components than those shown, or some components may be combined, or different components, for example, the second server 70 may also include input-output devices, network access devices, buses, etc.
The Processor 71 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 72 may be an internal storage unit of the second server 70, such as a hard disk or a memory of the second server 70. The memory 72 may also be an external storage device of the second server 70, such as a plug-in hard disk provided on the second server 70, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 72 may also include both an internal storage unit of the second server 70 and an external storage device. The memory 72 is used for storing the computer program and other programs and data required by the second server 70. The memory 72 may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A service acquisition method is applied to a first server in a first network, wherein the first server is provided with a first general interface; the service acquisition method comprises the following steps:
receiving a service acquisition request from a target terminal device in the first network through the first general interface; the service acquisition request carries a first token and an identifier of a target service to be requested, wherein the target service is a service provided by a second server in a second network;
verifying the validity of the service acquisition request according to the first token, and calling a second universal interface of the second server to send the service acquisition request to the second server after the service acquisition request is determined to be valid;
receiving a response result returned by the second server and aiming at the service acquisition request;
and sending the response result to the target terminal equipment.
2. The service acquisition method according to claim 1, wherein the invoking the second common interface of the second server to send the service acquisition request to the second server after determining that the service acquisition request is valid comprises:
after the service acquisition request is determined to be valid, updating the service acquisition request, deleting the first token in the service acquisition request, and adding an identity of a target user in the service acquisition request to obtain the updated service acquisition request; the target user is a user initiating the service acquisition request;
and calling the second universal interface to send the updated service acquisition request to the second server.
3. The service acquisition method according to claim 2, wherein the identity of the target user is the identity of the target user in the second server.
4. A service acquisition method is applied to a second server in a second network, wherein the second server is provided with a second universal interface; the service acquisition method comprises the following steps:
receiving a service acquisition request from a first server in a first network through the second universal interface; the service acquisition request carries an identifier of a target service to be requested;
determining a target service interface corresponding to the target service based on the identification of the target service;
and calling the target service interface to obtain a response result aiming at the service acquisition request, and sending the response result to the first server.
5. The service acquisition method according to claim 4, wherein the determining a target service interface corresponding to the target service based on the identifier of the target service includes:
and determining a target service interface corresponding to the target service based on the identification of the target service and the corresponding relation between the identification of each preset service and the service interface corresponding to each preset service.
6. The service acquisition method according to claim 4, wherein the service acquisition request further carries an identity of a target user initiating the service acquisition request; correspondingly, the determining a target service interface corresponding to the target service based on the identifier of the target service includes:
performing identity verification on the target user based on the identity of the target user;
and determining a target service interface corresponding to the target service based on the identification of the target service after the identity verification is passed.
7. The service acquisition method according to any one of claims 1 to 6, wherein the first network and the second network are both blockchains; correspondingly, the first server is any blockchain node device in the first network, and the second server is any blockchain node device in the second network.
8. A server, wherein the server is a first server in a first network, wherein the first server is configured with a first generic interface; the first server includes:
a first receiving unit, configured to receive, through the first generic interface, a service acquisition request from a target terminal device in the first network; the service acquisition request carries a first token and an identifier of a target service to be requested, wherein the target service is a service provided by a second server in a second network;
the first sending unit is used for verifying the validity of the service acquisition request according to the first token and calling a second general interface of the second server to send the service acquisition request to the second server after the service acquisition request is determined to be valid;
a second receiving unit, configured to receive a response result returned by the second server for the service acquisition request;
a second sending unit, configured to send the response result to the target terminal device;
or the server is a second server in a second network, and the second server is configured with a second universal interface; the second server includes:
a third receiving unit, configured to receive, through the second universal interface, a service acquisition request from a first server in a first network; the service acquisition request carries an identifier of a target service to be requested;
a first determining unit, configured to determine, based on the identifier of the target service, a target service interface corresponding to the target service;
and the service management unit is used for calling the target service interface, obtaining a response result aiming at the service acquisition request and sending the response result to the first server.
9. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 3 when executing the computer program; alternatively, the processor, when executing the computer program, implements the steps of the method of any of claims 4 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3; alternatively, the computer program realizes the steps of the method according to any one of claims 4 to 7 when executed by a processor.
CN202110736369.9A 2021-06-30 2021-06-30 Service acquisition method, server and computer readable storage medium Active CN113472781B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110736369.9A CN113472781B (en) 2021-06-30 2021-06-30 Service acquisition method, server and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110736369.9A CN113472781B (en) 2021-06-30 2021-06-30 Service acquisition method, server and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113472781A true CN113472781A (en) 2021-10-01
CN113472781B CN113472781B (en) 2023-11-03

Family

ID=77876526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110736369.9A Active CN113472781B (en) 2021-06-30 2021-06-30 Service acquisition method, server and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113472781B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023231413A1 (en) * 2022-05-31 2023-12-07 杭州数梦工场科技有限公司 Service processing method, apparatus, cascade system, electronic device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5442791A (en) * 1992-03-31 1995-08-15 Aggregate Computing, Inc. Integrated remote execution system for a heterogenous computer network environment
JP2007072745A (en) * 2005-09-07 2007-03-22 Nippon Telegraph & Telephone East Corp Network service management system and network service management method
CN102035904A (en) * 2010-12-10 2011-04-27 北京中科大洋科技发展股份有限公司 Method for converting TCP network communication server into client
CN109120597A (en) * 2018-07-18 2019-01-01 阿里巴巴集团控股有限公司 Proof of identity, login method, device and computer equipment
CN109492374A (en) * 2018-09-26 2019-03-19 平安医疗健康管理股份有限公司 System login method, device, server and the storage medium of identity-based verifying
CN109525592A (en) * 2018-12-14 2019-03-26 平安证券股份有限公司 Data sharing method, device, equipment and computer readable storage medium
CN109618119A (en) * 2018-10-31 2019-04-12 视联动力信息技术股份有限公司 Method and device for business processing
CN110099104A (en) * 2019-04-12 2019-08-06 平安科技(深圳)有限公司 Document transmission method, system and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5442791A (en) * 1992-03-31 1995-08-15 Aggregate Computing, Inc. Integrated remote execution system for a heterogenous computer network environment
JP2007072745A (en) * 2005-09-07 2007-03-22 Nippon Telegraph & Telephone East Corp Network service management system and network service management method
CN102035904A (en) * 2010-12-10 2011-04-27 北京中科大洋科技发展股份有限公司 Method for converting TCP network communication server into client
CN109120597A (en) * 2018-07-18 2019-01-01 阿里巴巴集团控股有限公司 Proof of identity, login method, device and computer equipment
CN109492374A (en) * 2018-09-26 2019-03-19 平安医疗健康管理股份有限公司 System login method, device, server and the storage medium of identity-based verifying
CN109618119A (en) * 2018-10-31 2019-04-12 视联动力信息技术股份有限公司 Method and device for business processing
CN109525592A (en) * 2018-12-14 2019-03-26 平安证券股份有限公司 Data sharing method, device, equipment and computer readable storage medium
CN110099104A (en) * 2019-04-12 2019-08-06 平安科技(深圳)有限公司 Document transmission method, system and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023231413A1 (en) * 2022-05-31 2023-12-07 杭州数梦工场科技有限公司 Service processing method, apparatus, cascade system, electronic device and storage medium

Also Published As

Publication number Publication date
CN113472781B (en) 2023-11-03

Similar Documents

Publication Publication Date Title
CN109981679B (en) Method and apparatus for performing transactions in a blockchain network
CN109146679B (en) Intelligent contract calling method and device based on block chain and electronic equipment
CN112087502B (en) Method, device and equipment for processing request and storage medium
CN101729541B (en) Method and system for accessing resources of multi-service platform
CN112818325A (en) Method for realizing API gateway independent authentication based on application
CN111176794A (en) Container management method and device and readable storage medium
CN110162994A (en) Authority control method, system, electronic equipment and computer readable storage medium
CN112118269A (en) Identity authentication method, system, computing equipment and readable storage medium
JP2022525551A (en) Preventing erroneous transmission of copies of data records to distributed ledger systems
CN111260475A (en) Data processing method, block chain node point equipment and storage medium
CN111709860A (en) Homote advice processing method, device, equipment and storage medium
CN109558710B (en) User login method, device, system and storage medium
CN113472781B (en) Service acquisition method, server and computer readable storage medium
KR20200125279A (en) User Identification Method Using Block Chain and System thereof
CN112507668A (en) Project data storage certificate method, storage certificate system, terminal equipment and readable storage medium
US20100222022A1 (en) Communication method, communication system and access method to service provider base
CN113961600A (en) Data query method and device, computer equipment and storage medium
JP5636394B2 (en) Information processing apparatus, information processing method, and program
CN114493565A (en) Account association method and account association management system
CN110585717A (en) Information processing method and device
CN115987683B (en) Node access control method, device, equipment and medium in block chain network
CN112311716A (en) Data access control method and device based on openstack and server
CN117040930B (en) Resource processing method, device, product, equipment and medium of block chain network
CN114362960B (en) Resource account data supervision method and device, computer equipment and medium
US20240104223A1 (en) Portable verification context

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