[go: up one dir, main page]

CN111176859A - Service calling method and device and electronic equipment - Google Patents

Service calling method and device and electronic equipment Download PDF

Info

Publication number
CN111176859A
CN111176859A CN201911179261.3A CN201911179261A CN111176859A CN 111176859 A CN111176859 A CN 111176859A CN 201911179261 A CN201911179261 A CN 201911179261A CN 111176859 A CN111176859 A CN 111176859A
Authority
CN
China
Prior art keywords
access
code
target service
service
access request
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
CN201911179261.3A
Other languages
Chinese (zh)
Other versions
CN111176859B (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.)
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Cloud Computing Beijing 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 Tencent Cloud Computing Beijing Co Ltd filed Critical Tencent Cloud Computing Beijing Co Ltd
Priority to CN201911179261.3A priority Critical patent/CN111176859B/en
Publication of CN111176859A publication Critical patent/CN111176859A/en
Application granted granted Critical
Publication of CN111176859B publication Critical patent/CN111176859B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • G06F9/548Object oriented; Remote method invocation [RMI]

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

本申请的实施例提供了一种服务的调用方法及装置,应用于代理平台,包括:获取请求方基于接入代码而发起的访问请求,所述接入代码是所述代理平台根据目标服务的配置信息生成的;根据所述访问请求调用所述代理平台中的软件开发工具包;通过所述软件开放工具包,控制将所述访问请求转发至所述目标服务对应的服务提供方,以进行所述目标服务的调用。通过代理平台实现了自动生成代码,提高了目标服务的接入效率,而且通过代理平台实现了各个目标服务的调用控制。

Figure 201911179261

The embodiments of the present application provide a method and device for invoking a service, which are applied to a proxy platform, including: acquiring an access request initiated by a requester based on an access code, where the access code is the proxy platform according to a target service. configuration information is generated; the software development toolkit in the proxy platform is invoked according to the access request; the access request is controlled to be forwarded to the service provider corresponding to the target service through the software open toolkit, so as to carry out The invocation of the target service. The automatic code generation is realized through the proxy platform, the access efficiency of the target service is improved, and the call control of each target service is realized through the proxy platform.

Figure 201911179261

Description

Service calling method and device and electronic equipment
Technical Field
The application relates to the technical field of computers, in particular to a service calling method and device and electronic equipment.
Background
In software development, it is often necessary to call services provided by other existing applications to implement specific functions, such as weather queries, express queries, and the like.
For realizing the service call, basic information of the called service, request protocol and access protocol, address and other services is indicated in the service document of the service provider.
However, since the service document of the service provider cannot be directly applied to the requester, in order to implement the service invocation, it is necessary to develop an access code for the service to be invoked, so that the access code accesses the service of the service provider and invokes the service when the requester is run.
In the existing service calling, because an engineer needs to compile an access code for a service to be called, the workload is large, and the service access efficiency is low.
Disclosure of Invention
Embodiments of the present application provide a service calling method, a service calling device, and an electronic device, so that problems of a large workload and low service access efficiency caused by requiring an engineer to manually write an access code in the prior art can be solved at least to a certain extent.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of an embodiment of the present application, there is provided a service invocation method applied to a proxy platform, where the method includes:
acquiring an access request initiated by a requester based on an access code, wherein the access code is generated by the agent platform according to the configuration information of the target service;
calling a software development kit in the proxy platform according to the access request;
and controlling to forward the access request to a service provider corresponding to the target service through the software open toolkit so as to call the target service.
According to an aspect of an embodiment of the present application, there is provided an apparatus for invoking a service, which is applied to a proxy platform, the apparatus including:
the access request acquisition module is used for acquiring an access request initiated by a requester based on an access code, wherein the access code is generated by the agent platform according to the configuration information of the target service;
the calling module is used for calling the software development kit in the proxy platform according to the access request;
and the forwarding control module is used for controlling to forward the access request to a service provider corresponding to the target service through the software open toolkit so as to call the target service.
According to an aspect of an embodiment of the present application, there is provided an electronic device including:
a processor; and
a memory having computer readable instructions stored thereon which, when executed by the processor, implement a method as described above.
In the technical scheme provided by some embodiments of the application, the access code is correspondingly generated for the target service according to the configuration information of the target service through the proxy platform, and an engineer does not need to write the access code manually for the target service, so that the calling efficiency of the target service is improved. Meanwhile, the requester sends the access request initiated based on the access code to the proxy platform, the proxy platform controls the forwarding of the access request to the service provider, and the information forwarding between the requester and the service provider is realized through the proxy platform, so that the calling control between the requester and the service provider is facilitated through the proxy platform, and the compiling of the calling control code on the service provider is not required to be realized for different service providers, the workload is further reduced, and the calling efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 shows a schematic diagram of an exemplary system architecture to which aspects of embodiments of the present application may be applied;
FIG. 2 is a flow diagram illustrating a method of invoking a service according to one embodiment of the present application;
FIG. 3 is a flow chart illustrating steps prior to step 210 according to one embodiment of the present application;
FIG. 4 is a flow diagram of step 250 of the corresponding embodiment of FIG. 2 in one embodiment;
FIG. 5 is a flow diagram of step 250 of the corresponding embodiment of FIG. 2 in another embodiment;
FIG. 6 is a flow diagram of steps in one embodiment after step 250 of the corresponding embodiment of FIG. 2;
FIG. 7 is a block diagram illustrating a means for invoking a service according to one embodiment of the present application;
FIG. 8 is a block diagram illustrating a proxy platform according to one embodiment;
FIG. 9 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied.
As shown in fig. 1, the system architecture may include a requestor 110, a proxy platform 130, and a service provider 150.
The invocation of a service refers to an application (say application a) invoking a service provided by another application (say application B). The platform where the application program initiating the access request is located is a requester, and the platform where the application program providing the service is located is a service provider. In the above example, the platform where the application a is located is the requester, and the platform where the application B is located is the service provider.
In the solution of the present application, the requester 110 establishes a communication connection with the agent platform 130, and the agent platform 130 establishes a communication connection with the service provider 150. To invoke a service provided by the service provider 150, the requestor 110 needs to send an access request to the proxy platform 130, and then the proxy platform 130 forwards the access request to the service provider 150.
That is, in the process of the requester 110 invoking the service provided by the service provider 150, the information transfer between the requester 110 and the service provider 150 is forwarded by the proxy platform 130 serving as a transit platform.
The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
fig. 2 shows a flowchart of a method for invoking a service, which is applied to a proxy platform and can be performed by a device having a computing processing function, according to an embodiment of the present application. Referring to fig. 2, the method for invoking the service at least includes steps 210 to 250, which are described in detail as follows:
step 210, obtaining an access request initiated by the requester based on an access code, where the access code is generated by the agent platform according to the configuration information of the target service.
It is worth mentioning that the target service does not refer to a certain service in particular, but refers to the service to be invoked in general.
The target service that can be called may be a data service or a service provided by a target interface. The data service performs services such as data query and data insertion.
Similarly, a target interface does not refer specifically to an interface, but rather broadly refers to an interface that may be invoked.
In order to realize that a requester invokes a target service provided by a service provider by means of a proxy platform, basic information of the target service is configured in the proxy platform in advance. The basic information of the target service may include a service name, a gateway path, a backend address, a frequency limit (e.g., an access frequency upper limit), a request protocol, a response protocol, etc. of the target service, which are not particularly limited herein. In other embodiments, the basic information configured for the target service on the agent platform may also be set according to actual needs, for example, a limited access time period, etc.
For the service provided by the target service for the interface, the request protocol defines the contents of interface request parameters, parameter formats and the like, and similarly, the response protocol defines the contents of interface response parameters, parameter formats and the like.
The configuration information of the target service includes at least basic information configured for the target service on the agent platform. In other embodiments, the configuration information of the target service may also include a service identification on the agent platform of the target service, and the like.
In an embodiment, in order to configure the basic information corresponding to the target service, a configuration platform is provided in the agent platform, so that a user can configure the basic information of the target service through the configuration platform.
Specifically, the configuration platform provides an interactive client for a user, and the user inputs basic information of the target service through the interactive client, so that the configuration platform integrates the input basic information to obtain the basic information of the target service.
As described in the background, the code that runs on the requestor to implement the target service call is the access code.
In the scheme of the application, in order to avoid manual writing of the access code and improve the target service access efficiency, the proxy platform correspondingly generates the access code for realizing target service calling according to the configuration information of the target service.
That is, an access request initiated by a requestor to a proxy platform to invoke a target service is initiated by the requestor based on an access code generated by the proxy platform for the target service, the initiated access request being one of the results of the requestor running the access code generated by the proxy platform for the target service.
And step 230, calling a software development kit in the proxy platform according to the access request.
The agent platform includes a Software Development Kit (SDK) that integrates common functions in the service invocation process, such as access address, signature verification, network protocol, format encapsulation, etc. The software development kit is suitable for calling any target service, namely, the calling of any target service can be controlled through the software development kit.
And step 250, controlling to forward the access request to a service provider corresponding to the target service through the software open toolkit so as to call the target service.
As described above, the common function of making a service call is integrated in the software development kit, so that a call process of a control target service can be performed through the software development kit.
Call control between the requestor and the service provider is performed through a software development kit in the proxy platform. Therefore, in order to perform call control of the target service, developers of different service providers do not need to write codes for implementing call control respectively for the target service provided by the service provider, and the same software development kit is directly deployed in the proxy platform, so that call control of different target services can be implemented.
The access code is correspondingly generated for the target service according to the configuration information of the target service through the agent platform, and an engineer does not need to write the access code manually aiming at the target service, so that the calling efficiency of the target service is improved. Meanwhile, the requester sends the access request initiated based on the access code to the proxy platform, the proxy platform controls the forwarding of the access request to the service provider, and the information forwarding between the requester and the service provider is realized through the proxy platform, so that the calling control between the requester and the service provider is facilitated through the proxy platform, and the compiling of the calling control code on the service provider is not required to be realized for different service providers, the workload is further reduced, and the calling efficiency is improved.
In one embodiment, as shown in fig. 3, prior to step 210, the method further comprises:
at step 310, a code generation request is received, the code generation request indicating a target service to be accessed.
In order to generate an access code for a target service to be invoked, a code requester initiates a code generation request to a proxy platform. It can be understood that the code generation request at least indicates a target service to be accessed, so that the agent platform can correspondingly determine which target service needs to be targeted to generate the access code according to the received code generation request, thereby correspondingly obtaining the configuration information of the indicated target service according to the code application request.
Step 330, obtaining the configuration information of the target service according to the code generation request.
As described above, before initiating the access request of the target service, the basic information of the target service is configured in the proxy platform in advance, and the configuration information of the target service is correspondingly obtained and stored.
Step 350, generating an access code according to the configuration information.
Because the configuration information includes basic information of the target service, such as a request/response protocol, a back-end address, an access path, and the like, an access code can be generated for the target service correspondingly, so that when the access code runs, an access request can be sent to the proxy platform, and the proxy platform performs call control by calling a software development kit.
In one embodiment, the access code comprises an access protocol definition code, an object declaration code and a calling function, and the configuration information comprises an access protocol, an access path and a service identifier of the target service; step 350, comprising:
generating an access protocol definition code corresponding to the target service according to the access protocol of the target service; and
generating object declaration codes according to the address information of the agent platform, and indicating the agent platform to call the software development kit through the object declaration codes; and
and generating a calling function according to the access path and the service identifier of the target service.
The access protocol of the target service comprises a request protocol and a response protocol, wherein the request protocol specifies the content of a request initiating mode, request parameters and the like, and the response protocol defines the content of a response mode, response parameters and the like.
For example, for the service provided by the target service for the interface, the request protocol defines the content of the request initiation mode, the interface parameters, the type, and the like.
In one embodiment, since different access protocols are different, in order to adapt to different access protocols, the definition of parameters in the access protocol definition code is performed in a recursive definition manner.
In particular, the parameter definition is performed by the schema standard. In the schema standard, schema represents a collection of database objects, which may include multiple field classes. Each field object may itself be an object, with its own protocol, for example in the following code:
Figure BDA0002289344530000071
Figure BDA0002289344530000081
the segment of code defines a user structure, which, as indicated above, includes fields Name, Age, developer, Title, and Career. The Career field is a set of fields, which further includes a time field, a title field, and a Corp field.
Therefore, the definition of the complex access protocol can be performed in such a recursive manner. Specifically, structured protocols are described collectively by schema and field.
For example, in a schema, fields are defined as in table one:
list-schema
Field(s) Type (B) Means of
name string Data protocol name
desc string Description of data protocol
fields []field Data protocol field configuration
Wherein, the fields field in table one can also be an object, as shown in table two, the fields field further includes:
TABLE-two field
Figure BDA0002289344530000082
Therefore, by the mode of recursively defining the access protocol, the agent platform can be completely implemented according to the access protocol in the configuration information of the target service, and the complete consistency of configuration and actual application is ensured.
And object declaration code, namely performing object declaration for the target service, and indicating the agent platform software development kit when the object declaration code runs.
In one embodiment, the object declaration code is used by the address of the agent platform, the service identification of the target service, and the key of the code requester as parameters of the new sdk client object, and is declared by the var key. The generated object declaration code is as follows:
var(client=sdk.NewClient(A,B,C))
wherein, the parameter A is the address of the agent platform, the parameter B is the service identifier corresponding to the target service, and the parameter C is the key of the code requester.
In one embodiment, the code generation request further includes a code requestor identification, the method further comprising:
and performing authorization verification on the code requester according to the code requester identification.
If the code requestor passes the authorization verification, step 350 is performed.
In the embodiment, the agent platform stores the information of the authorized user in advance, so that the access code is generated according to the configuration information of the target service only when the code requester is the authorized user in the agent platform; otherwise, if the code requester fails the authorization verification, the generation of the access code for the code requester is denied.
In an embodiment, the generated access code further includes a code information list. The code information list is used as an annotation part in the access code, the code information list is convenient for a reader of the access code to know the basic information of the target service corresponding to the access code, and the code information list is not executed when the access code is executed. The code information list may be generated according to configuration information of the target service.
In one embodiment, the code information list includes a proxy platform address, an interface ID, an interface path, interface description information, a calling frequency, an interface attribute, an authorization object, a generation time, and the like.
In one embodiment, the software development kit includes signature verification code, and the configuration information includes a set of authorized access objects for the target service;
as shown in fig. 4, step 250 comprises:
and step 410, performing authorization verification on the requester according to the authorized access object set by running the signature verification code.
And signing the verification code, namely realizing the authorization verification function of the requester.
The set of authorized access objects is composed of corresponding identifications of the authorized access objects of the target service.
By operating the signature verification code, searching the identifier of the requester in the authorized access object set, and if the identifier of the requester is in the authorized access object set, indicating that the requester is an authorized access object served by a target, namely that the requester passes the authorization verification; otherwise, if the identifier of the requester is not found in the set of authorized access objects, the requester fails the authorization verification.
And step 430, if the requester passes the authorization verification, forwarding the access request to a service provider corresponding to the target service.
That is, the proxy platform forwards the access request to the service provider corresponding to the target service only when the requester passes the authorization verification.
In an embodiment, a signature code is included in a software development kit, an access request includes a gateway path, a request parameter and a key value corresponding to a requester, the gateway path, the request parameter and the key value are extracted from the access request by running the signature code, the gateway path, the request parameter and the key value are spliced, then a signature is performed through an HMACSHA1 algorithm to obtain a character string, and the character string is added to the access request, so that a service provider verifies information in the access request according to the character string after receiving the access request, and whether the information carried in the access request is tampered or not is guaranteed, and validity and accuracy of information transmission and data transmission are guaranteed.
In another embodiment, the software development kit includes access frequency defining code, as shown in fig. 5, step 250 includes:
and 510, acquiring historical frequency information of the requester accessing the target service by running the access frequency limiting code, and calculating the current access frequency according to the historical frequency information and the current access time.
The access frequency limiting code is a code for realizing the access frequency or time limiting function.
The frequency with which the requestor requests access to the target service is determined by running the access frequency limiting code.
The historical frequency information of the requester accessing the target service may be at least one of a historical access frequency and a historical number of accesses.
Then, based on the acquired historical frequency information and the current access time, the current access frequency can be obtained through corresponding calculation. Wherein the current access frequency may be the current access frequency, for example, 5 times/second, or the current access number, which is equal to the historical access number + 1.
In step 530, if the current access frequency meets the preset condition, the access request is forwarded to the service provider corresponding to the target service.
The preset condition may be an access frequency range, so that if the current access frequency is within the access frequency range, the current access frequency meets the preset condition.
By acquiring historical access frequency information and calculating the current access frequency, the access request is forwarded to a service provider corresponding to the target service only when the current access frequency meets a preset condition; otherwise, if the calculated current access frequency does not meet the preset condition, waiting and then calculating the current access frequency again according to the current time until the calculated current access frequency meets the preset condition, and further forwarding the access request to the service provider of the target service.
In another embodiment, the software development kit includes a signature verification code and an access frequency limiting code to perform authorization verification on the requester and to limit the access frequency, so that the access request is forwarded to the service provider of the target service only when the requester passes the authorization verification and the current access frequency meets a preset condition.
In one embodiment, the software development kit includes format encapsulation code, and before forwarding the access request to the service provider corresponding to the target service, the method further includes:
and encapsulating the access request according to the access protocol of the target service by operating the format encapsulation code.
As described above, for the target service, there is an agreed access protocol, so that any party needing to invoke the target service needs to perform information encapsulation according to the access protocol, and thus, the service provider of the target service can perform corresponding parsing when receiving a corresponding request.
In this embodiment, information is encapsulated by a format encapsulation code in a software development kit, an access request is encapsulated according to an access protocol of a target service, and a service provider of the target service can accurately analyze the encapsulated access request after receiving the encapsulated access request.
In one embodiment, the software development kit further includes a general API access function, a general insertion data function, a general overlay update function, a general part update function, a general deletion function, a general data reading function, and a general data lookup function, so as to provide a common function for calling each target service.
In one embodiment, as shown in fig. 6, after step 250, the method further comprises:
step 610, receiving response data returned by the service provider according to the received access request.
Step 630, forward the response data to the requestor.
Whether the target service invoked by the requestor is a service provided by the target interface or a data service, it is ultimately the result that needs to be returned by the target service implementation. I.e. response data
That is, the transfer of the response data needs to be performed by the proxy platform.
Further, prior to step 630, the response data is encapsulated according to the protocol of the requestor by format encapsulation code in the software development kit.
Embodiments of the apparatus of the present application are described below, which may be used to perform the methods of the above-described embodiments of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method described above in the present application.
Fig. 7 is a block diagram illustrating a service invocation apparatus 700 according to an exemplary embodiment, where the service invocation apparatus 700 may be configured in the proxy platform of fig. 1, and with reference to fig. 7, the apparatus includes:
an access request obtaining module 710, configured to obtain an access request initiated by a requestor based on an access code, where the access code is generated by the agent platform according to the configuration information of the target service.
And the calling module 730 is used for calling the software development kit in the proxy platform according to the access request.
And a forwarding control module 750, configured to control, through the software opening toolkit, to forward the access request to a service provider corresponding to the target service, so as to perform invocation of the target service.
In one embodiment, the apparatus further comprises:
and the code generation request receiving module is used for receiving a code generation request, and the code generation request indicates the target service to be accessed.
And the configuration information acquisition module is used for acquiring the configuration information of the target service according to the code generation request.
And the access code generating module is used for generating an access code according to the configuration information.
In one embodiment, the access code comprises an access protocol definition code, an object declaration code and a calling function, and the configuration information comprises an access protocol, an access path and a service identifier of the target service; an access code generation module comprising:
a first generating unit for generating an access protocol definition code corresponding to a target service according to an access protocol of the target service; and
the second generation unit is used for generating object declaration codes according to the address information of the proxy platform and indicating the proxy platform to call the software development kit through the object declaration codes; and
and the third generation unit is used for generating a calling function according to the access path and the service identifier of the target service.
In one embodiment, the software development kit includes signature verification code, and the configuration information includes a set of authorized access objects for the target service; the forwarding control module 750 includes:
and the authorization verification unit is used for performing authorization verification on the requester according to the authorized access object set by operating the signature verification code.
And the first forwarding unit is used for forwarding the access request to a service provider corresponding to the target service if the requester passes the authorization verification.
In one embodiment, the software development kit includes access frequency defining code, and the forwarding control module 750 includes:
and the current access time calculating unit is used for acquiring historical frequency information of the target service accessed by the requester by running the access frequency limiting code and calculating the current access frequency according to the historical frequency information and the current access time.
And the second forwarding unit is used for forwarding the access request to a service provider corresponding to the target service if the current access frequency meets a preset condition.
In one embodiment, the software development kit includes format encapsulation code, the apparatus further comprising:
and the packaging module is used for packaging the access request according to the access protocol of the target service by operating the format packaging code.
In one embodiment, the apparatus further comprises:
and the response data receiving module is used for receiving response data returned by the service provider according to the received access request.
And the response data forwarding module is used for forwarding the response data to the requester.
In an embodiment, the target service includes at least one of a data service and a service provided by the target interface.
The implementation process of the function and the action of each module in the device is specifically detailed in the implementation process of the corresponding step in the service calling method, and is not described herein again.
It is understood that these modules may be implemented in hardware, software, or a combination of both. When implemented in hardware, these modules may be implemented as one or more hardware modules, such as one or more application specific integrated circuits. When implemented in software, the modules may be implemented as one or more computer programs executing on one or more processors.
Fig. 8 is a block diagram illustrating a proxy platform according to an exemplary embodiment, which includes a code generation module 810, a configuration platform 830, and a storage module 850, as shown in fig. 8.
The agent platform can generate an access code aiming at the data service and the service provided by the interface, wherein the access code generated for the service provided by the interface is called the interface code; the access codes generated for the data service are referred to as data codes. As shown in fig. 8, the code generation module 810 includes an interface code generator 811 for generating an interface code and a data code generator 813 for generating a data code.
The configuration platform 830 is used for basic information configuration, such as configuration, of the target service. As shown in fig. 8, the configuration platform 830 includes an interface configuration platform 831 and a data service configuration platform 833. The interface configuration platform 831 is configured to configure basic information of services provided by an interface, where the basic information of the services provided by the interface includes an interface name, a gateway path, a backend address, a frequency limit, a structured request protocol/response protocol, and the like. The data service configuration platform 833 is used to configure basic information for a data service, such as a structured data service protocol.
The storage module 850 is used for performing data of the agent platform, such as configuration information of each target service. Further, the storage module 850 may store the low-level data based on mongodb, or may store the data using any relational, document-type, or kv-type databases, such as mysql, postgresql, and the like, which is not limited herein.
In a specific embodiment, the agent platform may be developed based on the golang language, or may be developed by other programming languages, such as python, Java, c + +, and other high-level programming languages.
Further, the agent platform may be based on HTTP protocol + json format, or based on a combination of UDP/TCP protocol and any format such as protobuf, xml, formdata, and the like, and may also be a combination of other protocols and formats, which is not limited herein.
FIG. 9 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
It should be noted that the computer system 900 of the electronic device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiments.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901, which can perform various appropriate actions and processes, such as executing the method in the above-described embodiment, according to a program stored in a Read-Only Memory (ROM) 902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for system operation are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An Input/Output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage portion 908 including a hard disk and the like; and a communication section 909 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Reference herein to "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1.一种服务的调用方法,应用于代理平台,所述方法包括:1. a method for invoking a service, applied to a proxy platform, the method comprising: 获取请求方基于接入代码而发起的访问请求,所述接入代码是所述代理平台根据目标服务的配置信息生成的;Obtain the access request initiated by the requesting party based on the access code, the access code is generated by the proxy platform according to the configuration information of the target service; 根据所述访问请求调用所述代理平台中的软件开发工具包;Call the software development kit in the agent platform according to the access request; 通过所述软件开放工具包,控制将所述访问请求转发至所述目标服务对应的服务提供方,以进行所述目标服务的调用。The access request is controlled to be forwarded to a service provider corresponding to the target service through the software open toolkit, so as to call the target service. 2.根据权利要求1所述的方法,其特征在于,所述获取请求方基于接入代码而发起的访问请求之前,所述方法还包括:2. The method according to claim 1, wherein, before the acquiring the access request initiated by the requesting party based on the access code, the method further comprises: 接收代码生成请求,所述代码生成请求指示了待访问的目标服务;receiving a code generation request indicating the target service to be accessed; 根据所述代码生成请求获取所述目标服务的配置信息;Obtain the configuration information of the target service according to the code generation request; 根据所述配置信息生成所述接入代码。The access code is generated according to the configuration information. 3.根据权利要求2所述的方法,其特征在于,所述接入代码包括访问协议定义代码、对象声明代码和调用函数,所述配置信息包括所述目标服务的访问协议、访问路径和服务标识;3. The method according to claim 2, wherein the access code comprises an access protocol definition code, an object declaration code and a calling function, and the configuration information comprises an access protocol, an access path and a service of the target service identification; 所述根据所述配置信息生成所述接入代码,包括:The generating the access code according to the configuration information includes: 根据所述目标服务的访问协议生成对应于所述目标服务的访问协议定义代码;以及generating an access protocol definition code corresponding to the target service according to the access protocol of the target service; and 根据所述代理平台的地址信息生成所述对象声明代码,通过所述对象声明代码来指示所述代理平台调用所述软件开发工具包;以及The object declaration code is generated according to the address information of the proxy platform, and the proxy platform is instructed to invoke the software development kit through the object declaration code; and 根据所述访问路径和所述目标服务的服务标识生成所述调用函数。The calling function is generated according to the access path and the service identifier of the target service. 4.根据权利要求1所述的方法,其特征在于,所述软件开发工具包中包括签名验证代码,所述配置信息包括所述目标服务的授权访问对象集合;4. The method according to claim 1, wherein the software development kit includes a signature verification code, and the configuration information includes an authorized access object set of the target service; 所述通过所述软件开放工具包,控制将所述访问请求转发至所述目标服务对应的服务提供方,包括:The controlling forwarding of the access request to the service provider corresponding to the target service through the software open toolkit includes: 通过运行所述签名验证代码,根据所述授权访问对象集合对所述请求方进行授权验证;Perform authorization verification on the requester according to the authorized access object set by running the signature verification code; 若所述请求方通过授权验证,则将所述访问请求转发至所述目标服务对应的服务提供方。If the requester passes the authorization verification, the access request is forwarded to the service provider corresponding to the target service. 5.根据权利要求1所述的方法,其特征在于,所述软件开发工具包中包括访问频次限定代码,通过所述软件开放工具包将所述访问请求转发至所述目标服务对应的服务提供方,包括:5 . The method according to claim 1 , wherein the software development kit includes access frequency limiting code, and the access request is forwarded to the service provider corresponding to the target service through the software open tool kit. 6 . party, including: 通过运行所述访问频次限定代码,获取所述请求方访问所目标服务的历史频次信息,通过所述历史频次信息和当前的访问时间计算当前访问频次;Obtaining the historical frequency information of the requester accessing the target service by running the access frequency limiting code, and calculating the current access frequency according to the historical frequency information and the current access time; 若所述当前访问频次满足预设条件,则将所述访问请求转发至所述目标服务对应的服务提供方。If the current access frequency satisfies a preset condition, the access request is forwarded to a service provider corresponding to the target service. 6.根据权利要求4或5所述的方法,其特征在于,所述软件开发工具包包括格式封装代码,所述将所述访问请求转发至所述目标服务对应的服务提供方之前,所述方法还包括:6. The method according to claim 4 or 5, wherein the software development kit comprises a format encapsulation code, and before the access request is forwarded to the service provider corresponding to the target service, the Methods also include: 通过运行所述格式封装代码,按照所述目标服务的访问协议对所述访问请求进行封装。By running the format encapsulation code, encapsulate the access request according to the access protocol of the target service. 7.根据权利要求1所述的方法,其特征在于,所述通过所述软件开放工具包,控制将所述访问请求转发至所述目标服务对应的服务提供方之后,所述方法还包括:7 . The method according to claim 1 , wherein after the access request is controlled to be forwarded to the service provider corresponding to the target service through the software open toolkit, the method further comprises: 8 . 接收所述服务提供方根据所接收到的所述访问请求而返回的响应数据;receiving response data returned by the service provider according to the received access request; 将所述响应数据转发至所述请求方。The response data is forwarded to the requester. 8.根据权利要求1所述的方法,其特征在于,所述目标服务包括数据服务和目标接口所提供服务中的至少一种。8. The method according to claim 1, wherein the target service comprises at least one of a data service and a service provided by a target interface. 9.一种服务的调用装置,应用于代理平台,其特征在于,所述装置包括:9. A device for invoking a service, applied to a proxy platform, wherein the device comprises: 访问请求获取模块,用于获取请求方基于接入代码而发起的访问请求,所述接入代码是所述代理平台根据目标服务的配置信息生成的;an access request acquiring module, configured to acquire an access request initiated by a requester based on an access code, the access code being generated by the proxy platform according to the configuration information of the target service; 调用模块,用于根据所述访问请求调用所述代理平台中的软件开发工具包;a calling module for calling a software development kit in the proxy platform according to the access request; 转发控制模块,用于通过所述软件开放工具包,控制将所述访问请求转发至所述目标服务对应的服务提供方,以进行所述目标服务的调用。A forwarding control module, configured to control forwarding of the access request to a service provider corresponding to the target service through the software open toolkit, so as to call the target service. 10.一种电子设备,其特征在于,包括:10. An electronic device, comprising: 处理器;及processor; and 存储器,所述存储器上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时实现如权利要求1至8中任一项所述的方法。a memory having computer readable instructions stored thereon, the computer readable instructions implementing the method of any one of claims 1 to 8 when executed by the processor.
CN201911179261.3A 2019-11-26 2019-11-26 Service calling method, device and electronic device Active CN111176859B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911179261.3A CN111176859B (en) 2019-11-26 2019-11-26 Service calling method, device and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911179261.3A CN111176859B (en) 2019-11-26 2019-11-26 Service calling method, device and electronic device

Publications (2)

Publication Number Publication Date
CN111176859A true CN111176859A (en) 2020-05-19
CN111176859B CN111176859B (en) 2024-10-15

Family

ID=70651984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911179261.3A Active CN111176859B (en) 2019-11-26 2019-11-26 Service calling method, device and electronic device

Country Status (1)

Country Link
CN (1) CN111176859B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770183A (en) * 2020-06-30 2020-10-13 山东浪潮通软信息科技有限公司 Data interaction method and electronic equipment
CN112685050A (en) * 2020-12-31 2021-04-20 北京配天技术有限公司 Deployment method of TensorFlow under Windows system
CN113468067A (en) * 2021-07-21 2021-10-01 建信金融科技有限责任公司 Application program debugging method and device, electronic equipment and computer readable medium
CN113505009A (en) * 2021-07-26 2021-10-15 京东方科技集团股份有限公司 Application service method and system based on access of multiple subsystems and computer equipment
CN114051058A (en) * 2021-09-27 2022-02-15 北京旷视科技有限公司 Interface calling method, platform, electronic equipment and computer storage medium
CN114296786A (en) * 2021-12-30 2022-04-08 杭州数梦工场科技有限公司 Service management method and device
CN114327941A (en) * 2021-12-22 2022-04-12 杭州数梦工场科技有限公司 A service providing method and device
CN114816569A (en) * 2022-04-14 2022-07-29 工银科技有限公司 Dynamic loading method and device
CN117707744A (en) * 2024-02-05 2024-03-15 北京卓信智恒数据科技股份有限公司 DSM data service management method, device, electronic equipment and medium
WO2024109405A1 (en) * 2022-11-25 2024-05-30 深圳Tcl新技术有限公司 Method and apparatus for supporting access to plurality of cloud servers, and storage medium and device

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080082986A1 (en) * 2006-10-02 2008-04-03 Salesforce.Com, Inc. Api method and system for providing access to an external service via an application services platform
CN103503419A (en) * 2011-03-11 2014-01-08 高通股份有限公司 System and method using a web proxy-server to access a device having an assigned network address
CN103535012A (en) * 2011-03-11 2014-01-22 高通股份有限公司 System and method using a client-local proxy-server to access a device having an assigned network address
CN104283841A (en) * 2013-07-02 2015-01-14 阿里巴巴集团控股有限公司 Method, device and system for carrying out service access control on third-party application
CN105635151A (en) * 2015-12-31 2016-06-01 深圳中兴网信科技有限公司 Open platform access method and open platform access system
CN107784221A (en) * 2016-08-30 2018-03-09 阿里巴巴集团控股有限公司 Authority control method, service providing method, device, system and electronic equipment
CN108156022A (en) * 2017-12-04 2018-06-12 北京奇艺世纪科技有限公司 A kind of service calling method, device and electronic equipment
CN109710236A (en) * 2018-12-30 2019-05-03 北京字节跳动网络技术有限公司 Business development and implementation method, device, platform and medium based on shared service
CN109992254A (en) * 2017-12-29 2019-07-09 阿加利科公司 The service broker of Cloud Foundry platform
CN110225131A (en) * 2019-06-19 2019-09-10 广州小鹏汽车科技有限公司 A kind of service calling method and device
CN110399233A (en) * 2019-06-28 2019-11-01 口碑(上海)信息技术有限公司 The processing method and processing device of remote procedure call

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080082986A1 (en) * 2006-10-02 2008-04-03 Salesforce.Com, Inc. Api method and system for providing access to an external service via an application services platform
CN103503419A (en) * 2011-03-11 2014-01-08 高通股份有限公司 System and method using a web proxy-server to access a device having an assigned network address
CN103535012A (en) * 2011-03-11 2014-01-22 高通股份有限公司 System and method using a client-local proxy-server to access a device having an assigned network address
CN104283841A (en) * 2013-07-02 2015-01-14 阿里巴巴集团控股有限公司 Method, device and system for carrying out service access control on third-party application
CN105635151A (en) * 2015-12-31 2016-06-01 深圳中兴网信科技有限公司 Open platform access method and open platform access system
CN107784221A (en) * 2016-08-30 2018-03-09 阿里巴巴集团控股有限公司 Authority control method, service providing method, device, system and electronic equipment
CN108156022A (en) * 2017-12-04 2018-06-12 北京奇艺世纪科技有限公司 A kind of service calling method, device and electronic equipment
CN109992254A (en) * 2017-12-29 2019-07-09 阿加利科公司 The service broker of Cloud Foundry platform
CN109710236A (en) * 2018-12-30 2019-05-03 北京字节跳动网络技术有限公司 Business development and implementation method, device, platform and medium based on shared service
CN110225131A (en) * 2019-06-19 2019-09-10 广州小鹏汽车科技有限公司 A kind of service calling method and device
CN110399233A (en) * 2019-06-28 2019-11-01 口碑(上海)信息技术有限公司 The processing method and processing device of remote procedure call

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WANG, Y 等: "Real-time scheduling for multi-agent call center automation", LECTURE NOTES IN ARTIFICIAL INTELLIGENCE, 1 January 2000 (2000-01-01) *
刘苒苒;: "基于移动Agent的Web服务安全访问机制研究", 装备维修技术, no. 04, 15 December 2007 (2007-12-15) *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770183A (en) * 2020-06-30 2020-10-13 山东浪潮通软信息科技有限公司 Data interaction method and electronic equipment
CN112685050A (en) * 2020-12-31 2021-04-20 北京配天技术有限公司 Deployment method of TensorFlow under Windows system
CN113468067B (en) * 2021-07-21 2022-12-13 中国建设银行股份有限公司 Application program debugging method and device, electronic equipment and computer readable medium
CN113468067A (en) * 2021-07-21 2021-10-01 建信金融科技有限责任公司 Application program debugging method and device, electronic equipment and computer readable medium
CN113505009A (en) * 2021-07-26 2021-10-15 京东方科技集团股份有限公司 Application service method and system based on access of multiple subsystems and computer equipment
CN114051058A (en) * 2021-09-27 2022-02-15 北京旷视科技有限公司 Interface calling method, platform, electronic equipment and computer storage medium
CN114051058B (en) * 2021-09-27 2024-03-26 北京旷视科技有限公司 Interface calling method, platform, electronic equipment and computer storage medium
CN114327941A (en) * 2021-12-22 2022-04-12 杭州数梦工场科技有限公司 A service providing method and device
CN114296786A (en) * 2021-12-30 2022-04-08 杭州数梦工场科技有限公司 Service management method and device
CN114816569A (en) * 2022-04-14 2022-07-29 工银科技有限公司 Dynamic loading method and device
WO2024109405A1 (en) * 2022-11-25 2024-05-30 深圳Tcl新技术有限公司 Method and apparatus for supporting access to plurality of cloud servers, and storage medium and device
CN117707744A (en) * 2024-02-05 2024-03-15 北京卓信智恒数据科技股份有限公司 DSM data service management method, device, electronic equipment and medium
CN117707744B (en) * 2024-02-05 2024-04-19 北京卓信智恒数据科技股份有限公司 DSM data service management method, device, electronic equipment and medium

Also Published As

Publication number Publication date
CN111176859B (en) 2024-10-15

Similar Documents

Publication Publication Date Title
CN111176859A (en) Service calling method and device and electronic equipment
EP3502896B1 (en) Generation of an adapters configuration user interface using a data structure
CN113238740B (en) Code generation method, code generation device, storage medium and electronic device
CN112232961B (en) Data processing method, device and electronic device based on blockchain system
CN114356341B (en) A data processing method, device, equipment, storage medium and product
CN109194714B (en) A copywriting push method, device, terminal device and storage medium
CN110895471A (en) Installation package generation method, device, medium and electronic equipment
CN111813441B (en) Intelligent contract issuing method and device, computer readable medium and electronic equipment
CN110858202A (en) Method and device for generating where clause in database query statement
CN115599386A (en) Code generation method, device, equipment and storage medium
CN115374207A (en) Business processing method and device, electronic device, and computer-readable storage medium
CN113055410B (en) Cloud resource management method, device, equipment, system and readable storage medium
CN116974646A (en) Plug-in generation method, device, electronic device and storage medium
CN114816361A (en) Method, device, equipment, medium and program product for generating splicing project
CN113709171A (en) Method and device for cross-component state communication
CN116991410A (en) Data access detection method, device, storage medium, equipment and product
CN116828073A (en) Message conversion method, device, electronic equipment and computer readable storage medium
CN112433752B (en) Page analysis method, device, medium and electronic equipment
CN116781586A (en) A gRPC traffic analysis method, device, equipment and medium
WO2023083071A1 (en) View interaction method and apparatus, electronic device, and computer readable medium
CN116051218A (en) Client billing method and system based on embedded browser
CN115858344A (en) Application testing method, device and system
CN111580799A (en) Domain specific language script assembling method and system
CN120316822B (en) A method and apparatus for isolating and processing sensitive information of AI objects
CN113765868B (en) A business processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TG01 Patent term adjustment
TG01 Patent term adjustment