CN113806037A - Service calling method and device, storage medium and electronic equipment - Google Patents

Service calling method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113806037A
CN113806037A CN202110797152.9A CN202110797152A CN113806037A CN 113806037 A CN113806037 A CN 113806037A CN 202110797152 A CN202110797152 A CN 202110797152A CN 113806037 A CN113806037 A CN 113806037A
Authority
CN
China
Prior art keywords
request
service
calling
response
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110797152.9A
Other languages
Chinese (zh)
Inventor
向婷
黎志光
王坚梁
邹祖来
彭霄
刘辉军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yuanguang Software Co Ltd
Original Assignee
Yuanguang Software 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 Yuanguang Software Co Ltd filed Critical Yuanguang Software Co Ltd
Priority to CN202110797152.9A priority Critical patent/CN113806037A/en
Publication of CN113806037A publication Critical patent/CN113806037A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Abstract

The embodiment of the application discloses a service calling method, a service calling device, a storage medium and electronic equipment, and belongs to the field of network communication. The method comprises the following steps: receiving a first call request from a service system; determining configuration parameters associated with the configuration scheme identifier; the configuration parameters comprise service provider identification, service type, service version number and return parameter type; converting the first calling request into a second calling request based on the conversion rule associated with the configuration scheme identifier; sending a second calling request to a target service corresponding to the configuration scheme identifier; receiving a second calling response returned by the target service in response to the second calling request; converting the second call response into the first call response according to the conversion rule; and sending the first calling response to the service system, so that the service system does not need to develop different calling interfaces aiming at different part-of-speech analysis services, and the complexity and the development cost of the service system are reduced.

Description

Service calling method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of network communications, and in particular, to an API call, an apparatus, a storage medium, and an electronic device.
Background
In natural language processing, services are common methods, and the services are used for performing word segmentation and part-of-speech tagging on sentences. An API (Application Programming Interface) is used to open the capability of a service to the outside, and the service provides the capability of itself to an API caller in response to an API call request. A business system may deploy services from multiple different vendors simultaneously, such as: the service system can call services of different manufacturers according to different application scenes, and the service system needs to develop and call interfaces aiming at the services of different manufacturers, so that the complexity and the development cost of the service system can be increased.
Disclosure of Invention
In order to solve the technical problems, the application provides a service calling method, a service calling device, a storage medium and an electronic device, and solves the problems that in the prior art, when a business system calls a plurality of services, the interface complexity is high and the development cost is high.
In a first aspect, the present application provides an API call request, including:
receiving a first call request from a service system; the first call request carries an input statement and a configuration scheme identifier;
determining configuration parameters associated with the configuration scheme identifier; the configuration parameters comprise service provider identification, service type, service version number and return parameter type;
converting the first calling request into a second calling request based on the conversion rule associated with the configuration scheme identification;
sending the second calling request to a target service corresponding to the configuration scheme identifier; wherein the target service is one of the plurality of services;
receiving a second calling response returned by the target service in response to the second calling request; the second call response carries a plurality of participles and part-of-speech indicators of the participles;
converting the second call response into a first call response according to the conversion rule;
and sending the first calling response to the service system.
In a second aspect, the present application provides a service invocation device, which is applied to a plurality of services, and includes: a transceiving unit and a processing unit;
the receiving and sending unit is used for receiving a first calling request from a service system; the first call request carries an input statement and a configuration scheme identifier;
the processing unit is used for determining configuration parameters associated with the configuration scheme identifier; the configuration parameters comprise service provider identification, service type, service version number and return parameter type;
the processing unit is further configured to convert the first invocation request into a second invocation request based on the conversion rule associated with the configuration scheme identifier;
the transceiver unit is further configured to send the second invocation request to a target service corresponding to the configuration scheme identifier; wherein the target service is one of the plurality of services;
the transceiver unit is further configured to receive a second invocation response returned by the target service in response to the second invocation request; the second call response carries a plurality of participles and part-of-speech indicators of the participles;
the processing unit is further configured to convert the second call response into a first call response according to the conversion rule;
the transceiver unit is further configured to send the first call response to the service system.
In another aspect, the present application provides an apparatus, which may implement the distributed task scheduling method of the first aspect or the second aspect. The apparatus may be a server or a terminal device, for example. The above-described method may be implemented by software, hardware, or by executing corresponding software by hardware.
In one possible implementation manner, the structure of the apparatus includes a processor, a memory; the processor is configured to support the apparatus to perform corresponding functions in the application testing method. The memory is used for coupling with the processor, which holds the necessary programs (instructions) and/or data for the device. Optionally, the apparatus may further include a communication interface for supporting communication between the apparatus and other network elements.
In another possible implementation manner, the apparatus may include unit modules for performing corresponding actions in the above-described method.
In yet another possible implementation, the wireless communication device includes a processor and a transceiver, the processor is coupled to the transceiver, and the processor is configured to execute a computer program or instructions to control the transceiver to receive and transmit information; the processor is further configured to implement the above-described method when the processor executes the computer program or instructions.
Yet another aspect of the present application provides an apparatus, comprising: a memory and a processor; wherein the memory stores a set of program codes, and the processor is configured to call the program codes stored in the memory and execute the method of the aspects.
Yet another aspect of the present application provides a computer-readable storage medium having stored therein instructions, which when executed on a computer, cause the computer to perform the method of the above-described aspects.
Yet another aspect of the present application provides a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of the above-described aspects.
According to the embodiment, when the business system calls a plurality of services, the calling request from the business system is converted into the format matched with the target service, and the calling response from the target service is converted into the format matched with the business system, so that the business system can access different services by using uniform parameters and parameter values, the business system does not need to develop different calling interfaces aiming at different part-of-speech analysis services, and the complexity and the development cost of the business system are reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of a system architecture provided by an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for invoking a service according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an apparatus according to an embodiment of the present disclosure;
fig. 4 is another schematic structural diagram of an apparatus provided in 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. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance. It will be apparent to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
Fig. 1 shows an exemplary system architecture of a calling method of a service or a calling device of a service that can be applied to the present application.
As shown in FIG. 1, the system architecture may include a service system 11, a service invocation device 21 (hereinafter, referred to as invocation device 21), and nodes 31 to 3n, where n is an integer greater than 1. Services are deployed on each node, and multiple services may belong to different service providers or versions. The service system 11, the invoking device 21 and the nodes communicate with each other via a network, which may include various types of wired or wireless communication links, such as: the wired communication link includes an optical fiber, a twisted pair wire, or a coaxial cable, and the WIreless communication link includes a bluetooth communication link, a WIreless-FIdelity (Wi-Fi) communication link, or a microwave communication link, etc. It is understood that one node may deploy one service or multiple services.
It should be noted that, the method for calling the service provided in the embodiment of the present application is generally executed by the server, and accordingly, the device for calling the service is generally disposed in the server.
It should be noted that the service system may be hardware or software. When the service system is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the business system is software, it may be implemented as a plurality of software or software modules (for example, to provide distributed services), or may be implemented as a single software or software module, and is not limited specifically herein.
It should be understood that the number of business systems, networks, and servers in fig. 1 is merely illustrative. There may be any number of business systems, networks, and servers, as desired for an implementation.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Referring to fig. 2, fig. 2 is a schematic flowchart of a method for calling a service provided in an embodiment of the present application, where in the embodiment of the present application, the method includes:
s201, receiving a first calling request from a service system.
The first call request carries an input statement and a configuration scheme identifier, the service system is an initiator of the first call request, and the service system can be a service or an application program. The input statement represents a statement to be lexical analyzed, the configuration scheme identifier represents a unique representation of a configuration scheme, the configuration scheme represents a policy for a business system to invoke a service, and the configuration scheme may be represented using configuration parameters.
S202, determining configuration parameters associated with the configuration scheme identifier.
The calling device is deployed with a plurality of configuration schemes, different configuration schemes have different configuration scheme identifiers, each configuration scheme identifier is associated with a configuration parameter, the configuration parameters include a service provider identifier, a service type, a service version number, and a return parameter type, and the service provider identifier represents an identifier of a vendor providing a service, for example: the service provider is hundredths, identified as "baidu", and the service provider is ali, identified as "ali". The service type representation comprises word segmentation, lexical analysis or part of speech tagging and the like. The service version number indicates the version of the service, and the service provider can provide different versions of the service. The return parameter type indicates the type of parameter that the business system specifies to return for the selected service. The calling device prestores or preconfigures the mapping relation between the configuration scheme identifier and the configuration parameters, and determines the configuration parameters associated with the configuration scheme identifier according to the mapping relation.
S203, based on the associated conversion rule of the configuration scheme identification, the first calling request is converted into a second calling request.
The calling device converts the calling request of the business system into a format matched with the target service according to the calling request of the business system because the calling request has different formats due to the services provided by different manufacturers. The calling device prestores or preconfigures a mapping relation between the configuration scheme identifier and the conversion rule, determines a corresponding conversion rule according to the mapping relation, and converts the first calling request into the second calling request, wherein the conversion comprises the conversion of a field in the first calling request and a parameter value of the field.
In one or more possible embodiments, converting the first invocation request into the second invocation request based on the configuration schema identifying the associated conversion rule includes:
acquiring a request conversion mapping table associated with the configuration scheme identifier;
extracting a first request parameter carried in the first calling request and a first parameter value of the first request parameter;
according to the request conversion mapping table, inquiring a second request parameter mapped by the first request parameter and a second parameter value mapped by the first parameter value;
and generating a second calling request according to the second request parameter and the second parameter value.
The request conversion mapping table includes a parameter mapping relationship and a parameter value mapping relationship, and the number of the first request parameters carried in the first invocation request is one or more, for example: when the service is a lexical analysis service, the first request parameter may be a version, a service provider name, an input statement, and the like. In addition to using the request conversion mapping table to convert the first request parameter into the second request parameter, the application may also use a regular expression or a machine learning model or other methods for conversion, which is not limited in the application.
And S204, sending a second calling request to the target service corresponding to the configuration scheme identifier.
The service system can use the calling requests with uniform format to call different services without developing different calling interfaces aiming at different services, thereby reducing the complexity of the service system.
And S205, receiving a second calling response returned by the target service in response to the second calling request.
When the target service receives the second calling request, the lexical analysis is carried out on the input sentence to obtain a lexical analysis result, the lexical analysis result comprises a plurality of participles obtained after the lexical analysis is carried out on the input sentence and the part of speech of each participle, the target service generates a second calling response according to the lexical analysis result, and then the second calling response is returned to the calling device.
And S206, converting the second call response into the first call response according to the conversion rule.
The calling device converts the calling response of the target service into a format matched with a service system according to the calling response of the target service because the calling response has different formats due to the services provided by different manufacturers. The calling device prestores or preconfigures a mapping relation between the configuration scheme identifier and the conversion rule, determines a corresponding conversion rule according to the mapping relation, and converts the second calling response into the second calling request, wherein the conversion comprises the conversion of the field in the first calling request and the parameter value of the field.
In one or more possible embodiments, converting the second invocation request into the first invocation request according to a conversion rule includes:
acquiring a response conversion mapping table associated with the configuration scheme identifier;
extracting a second response parameter carried in the second call response and a third parameter value of the second response parameter;
inquiring a first response parameter mapped with the second response parameter and a fourth parameter value mapped with the fourth parameter value according to the response conversion mapping table;
and generating a first calling response according to the first response parameter and the fourth parameter value.
The response conversion mapping table includes a parameter mapping relationship and a parameter value mapping relationship, and the number of parameters carried in the second call response is one or more, for example: when the service is a lexical analysis service, the first response parameter may be a part of speech, a word segmentation result, or the like, and in addition to converting the first request parameter into the second request parameter by using the response conversion mapping table, the conversion may be performed by using a regular expression or a machine learning model or in other manners, which is not limited in the present application.
For example: when the service is lexical analysis service, the input statement of the business system is 'open report', the business system can select services of different manufacturers such as Baidu, Tencent, Hua Wei and far-reaching light to carry out lexical analysis on the input statement, and the same manufacturer can have different versions of service due to different algorithm models. The business system selects a manufacturer and a version generation configuration scheme, and then calls the service to transmit an input statement of opening a report. After the service analyzes the input statement, returning a calling response, wherein the lexical analysis result in the calling response comprises: the 'open' is a verb, but different manufacturers may have parameter values of different parts of speech such as 'V common verb', 'vd verb', 'vn name verb', 'VV verb', etc., which affect subsequent processing of the business system, and the calling device returns and processes parameter values with different parts of speech parameter value descriptions unified, for example: the V common verb, the vd verb, the vn first verb and the VV verb are all united as a V verb. Therefore, the business system can convert the calling responses of different types of the part of speech analysis services into calling responses of a uniform type, the business system does not need to develop different calling interfaces aiming at different part of speech analysis services, and the complexity of the business system is reduced.
And S207, sending a first call response to the service system.
And the calling device sends a first calling response to the service system.
In one or more possible embodiments, before receiving the first invocation request from the business system, the method further includes:
configuring a calling address, an account and authentication information of each service;
configuring multiple sets of configuration parameters, and setting different configuration parameters for each set of configuration parameters.
The calling address represents an address of the service, the account represents an account and a password of a node where the login service analysis service is located, and the authentication information represents information for verifying the identity validity of a caller of the service and comprises a secret key and a digital signature. Further, the calling device authenticates the data signature carried in the first calling request, when the authentication result is passed, the first calling request is converted, otherwise, a prompt message that the authentication is not passed is sent to the service system.
In one or more possible embodiments, before determining the configuration parameters associated with the configuration scheme identifier, the method further includes:
acquiring the number of current calling requests;
if the number of the current calling requests is larger than the preset number, sending a prompt message indicating that the service is unavailable to the service system;
and if the current request number is less than or equal to the preset number, executing the configuration parameter associated with the configuration scheme identifier.
The method comprises the steps that the resource quantity of calling devices is limited, therefore, the quantity of calling requests processed simultaneously is also limited, the calling devices are pre-stored or pre-configured with preset quantity, the calling devices acquire the current calling request quantity, when the current calling request quantity is larger than the preset quantity, a prompt message that service is unavailable is sent to a service system, and when the current calling request quantity is smaller than or equal to the preset quantity, configuration parameters related to configuration scheme identification are determined.
In one or more possible embodiments, before the calling device receives the first call request from the service system, the first call request is cached in the first queue, and before the first call response is sent to the service system, the first call response is cached in the second queue, so that data packet loss is avoided, and reliability of data packet processing is improved.
By implementing the embodiment of the application, when the business system calls a plurality of services, the calling request from the business system is converted into the format matched with the target service, and the calling response from the target service is converted into the format matched with the business system, so that the business system can access different services by using uniform parameters and parameter values, the business system does not need to develop different calling interfaces aiming at different part-of-speech analysis services, and the complexity and the development cost of the business system are reduced.
The above-mentioned figure 2 details the method of invoking a service. Correspondingly, the structure of a device in the embodiment of the application is schematically shown.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an apparatus 3 according to an embodiment of the present application, where the apparatus 3 is applied to a plurality of services, and the apparatus 7 may include a processing unit 301 and a transceiver unit 302.
The transceiver unit 302 is configured to receive a first invocation request from a service system; the first call request carries an input statement and a configuration scheme identifier;
the processing unit 301 is configured to determine a configuration parameter associated with the configuration scheme identifier; the configuration parameters comprise service provider identification, service type, service version number and return parameter type;
the processing unit 301 is further configured to convert the first invocation request into a second invocation request based on the conversion rule associated with the configuration scheme identifier;
the transceiver unit 302 is further configured to send the second invocation request to a target service corresponding to the configuration scheme identifier; wherein the target service is one of the plurality of services;
the transceiver unit 302 is further configured to receive a second invocation response returned by the target service in response to the second invocation request; the second call response carries a plurality of participles and part-of-speech indicators of the participles;
the processing unit 301 is further configured to convert the second call response into a first call response according to the conversion rule;
the transceiving unit 302 is further configured to send the first invocation response to the service system.
In one or more embodiments, the converting the first invocation request into a second invocation request based on the configuration schema identifying the associated conversion rule includes:
acquiring a request conversion mapping table associated with the configuration scheme identifier;
extracting a first request parameter and a first parameter value of the first request parameter carried in the first calling request;
inquiring a second request parameter mapped by the first request parameter and a second parameter value mapped by the first parameter value according to the request conversion mapping table;
and generating the second calling request according to the second request parameter and the second parameter value.
In one or more embodiments, the converting the second call response into the first call response according to the conversion rule includes:
acquiring a response conversion mapping table associated with the configuration scheme identifier;
extracting a second response parameter carried in the second call response and a third parameter value of the second response parameter;
inquiring a first response parameter mapped with the second response parameter and a fourth parameter value mapped with the fourth parameter value according to the response conversion mapping table;
and generating a first calling response according to the first response parameter and the fourth parameter value.
In one or more embodiments, processing unit 301 is further configured to:
configuring a calling address, an account and authentication information of each service;
configuring multiple sets of configuration parameters, and setting different configuration parameters for each set of configuration parameters.
In one or more embodiments, processing unit 301 is further configured to:
acquiring the number of current calling requests;
if the number of the current calling requests is larger than the preset number, sending a prompt message indicating that the service is unavailable to the service system;
and if the current request number is less than or equal to the preset number, executing the configuration parameter associated with the configuration scheme identifier.
In one or more embodiments, the first call request is cached in a first queue and the first call response is cached in a second queue.
In one or more embodiments, processing unit 301 is further configured to: and authenticating the digital signature carried in the first calling request, wherein the authentication result is that the digital signature passes.
The embodiment of the present application and the embodiment of the method in fig. 2 are based on the same concept, and the technical effects brought by the embodiment are also the same, and the specific process may refer to the description of the embodiment of the method in fig. 2, and will not be described again here.
The device 3 may be a server or a node, and the device 3 may also be a field-programmable gate array (FPGA), an application-specific integrated chip (asic), a system on chip (SoC), a Central Processing Unit (CPU), a Network Processor (NP), a digital signal processing circuit, a Micro Controller Unit (MCU), or a Programmable Logic Device (PLD) or other integrated chips, which implement related functions.
Fig. 4 is a schematic structural diagram of an apparatus provided in an embodiment of the present application, which is hereinafter referred to as an apparatus 4, where the apparatus 4 may be integrated in a server or a node, as shown in fig. 4, where the apparatus 4 includes: memory 402, processor 401, and transceiver 403.
The memory 402 may be a separate physical unit, and may be connected to the processor 401 and the transceiver 403 via a bus. The memory 402, processor 401, transceiver 403 may also be integrated, implemented in hardware, etc.
The memory 402 is used for storing a program implementing the above method embodiment, or various modules of the apparatus embodiment, which is called by the processor 401 to perform the operations of the above method embodiment.
Optionally, the device 4 further comprises an input device and an output device, the input device including but not limited to a keyboard, a mouse, a touch panel, a camera and a microphone; the output device includes, but is not limited to, a display screen.
Communication interfaces are used to send and receive various types of messages and include, but are not limited to, wireless interfaces or wired interfaces.
Alternatively, when part or all of the method for calling the service of the above embodiment is implemented by software, the apparatus may include only the processor. The memory for storing the program is located outside the device and the processor is connected to the memory by means of circuits/wires for reading and executing the program stored in the memory.
The processor may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP.
The processor may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The memory may include volatile memory (volatile memory), such as random-access memory (RAM); the memory may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD); the memory may also comprise a combination of memories of the kind described above.
The embodiment of the application also provides a computer storage medium, which stores a computer program, and the computer program is used for executing the service calling method provided by the embodiment.
Embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method for invoking a service provided by the above embodiments.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (10)

1. A method for calling a service, applied to a plurality of services, the method comprising:
receiving a first call request from a service system; the first call request carries an input statement and a configuration scheme identifier;
determining configuration parameters associated with the configuration scheme identifier; the configuration parameters comprise service provider identification, service type, service version number and return parameter type;
converting the first calling request into a second calling request based on the conversion rule associated with the configuration scheme identification;
sending the second calling request to a target service corresponding to the configuration scheme identifier; wherein the target service is one of the plurality of services;
receiving a second calling response returned by the target service in response to the second calling request;
converting the second call response into a first call response according to the conversion rule;
and sending the first calling response to the service system.
2. The method of claim 1, wherein converting the first invocation request into a second invocation request based on the associated conversion rule identified by the configuration scheme comprises:
acquiring a request conversion mapping table associated with the configuration scheme identifier;
extracting a first request parameter and a first parameter value of the first request parameter carried in the first calling request;
inquiring a second request parameter mapped by the first request parameter and a second parameter value mapped by the first parameter value according to the request conversion mapping table;
and generating the second calling request according to the second request parameter and the second parameter value.
3. The method according to claim 1 or 2, wherein the converting the second call response into the first call response according to the conversion rule comprises:
acquiring a response conversion mapping table associated with the configuration scheme identifier;
extracting a second response parameter carried in the second call response and a third parameter value of the second response parameter;
inquiring a first response parameter mapped with the second response parameter and a fourth parameter value mapped with the fourth parameter value according to the response conversion mapping table;
and generating a first calling response according to the first response parameter and the fourth parameter value.
4. The method of claim 3, wherein before receiving the first invocation request from the business system, further comprising:
configuring a calling address, an account and authentication information of each service;
configuring multiple sets of configuration parameters, and setting different configuration parameters for each set of configuration parameters.
5. The method according to claim 1, 2 or 4, wherein before determining the configuration parameters associated with the configuration scheme identifier, further comprising:
acquiring the number of current calling requests;
if the number of the current calling requests is larger than the preset number, sending a prompt message indicating that the service is unavailable to the service system;
and if the current request number is less than or equal to the preset number, executing the configuration parameter associated with the configuration scheme identifier.
6. The method of claim 5, wherein the first call request is cached in a first queue and the first call response is cached in a second queue.
7. The method of claim 6, wherein receiving the first invocation request from the business system further comprises:
and authenticating the digital signature carried in the first calling request, wherein the authentication result is that the digital signature passes.
8. An apparatus for invoking a service, applied to a plurality of services, the apparatus comprising: a transceiving unit and a processing unit;
the receiving and sending unit is used for receiving a first calling request from a service system; the first call request carries an input statement and a configuration scheme identifier;
the processing unit is used for determining configuration parameters associated with the configuration scheme identifier; the configuration parameters comprise service provider identification, service type, service version number and return parameter type;
the processing unit is further configured to convert the first invocation request into a second invocation request based on the conversion rule associated with the configuration scheme identifier;
the transceiver unit is further configured to send the second invocation request to a target service corresponding to the configuration scheme identifier; wherein the target service is one of the plurality of services;
the transceiver unit is further configured to receive a second invocation response returned by the target service in response to the second invocation request;
the processing unit is further configured to convert the second call response into a first call response according to the conversion rule;
the transceiver unit is further configured to send the first call response to the service system.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to carry out the method steps according to any one of claims 1 to 7.
10. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 7.
CN202110797152.9A 2021-07-14 2021-07-14 Service calling method and device, storage medium and electronic equipment Pending CN113806037A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110797152.9A CN113806037A (en) 2021-07-14 2021-07-14 Service calling method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110797152.9A CN113806037A (en) 2021-07-14 2021-07-14 Service calling method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113806037A true CN113806037A (en) 2021-12-17

Family

ID=78893089

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110797152.9A Pending CN113806037A (en) 2021-07-14 2021-07-14 Service calling method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113806037A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114003647A (en) * 2021-12-31 2022-02-01 北京泰迪熊移动科技有限公司 Data processing method and device and computer readable storage medium
CN114598750A (en) * 2022-01-14 2022-06-07 浙江吉利控股集团有限公司 Data request processing method and device and storage medium
CN114840276A (en) * 2022-04-15 2022-08-02 北京百度网讯科技有限公司 Object calling method, device, equipment, storage medium and program product
CN114860834A (en) * 2022-06-01 2022-08-05 北京字节跳动网络技术有限公司 Processing method, device, equipment and storage medium of associated query request
CN115002210A (en) * 2022-06-06 2022-09-02 北京自如信息科技有限公司 Data processing method, platform, electronic device and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080103796A1 (en) * 2006-10-30 2008-05-01 Hitachi, Ltd. Business process operation method and system
WO2013064080A1 (en) * 2011-11-04 2013-05-10 华为技术有限公司 Service configuration method and device
US20170004508A1 (en) * 2015-06-30 2017-01-05 Cross Country Home Services, Inc. Systems and methods for efficiently handling appliance warranty service events
CN108632325A (en) * 2017-03-24 2018-10-09 中国移动通信集团浙江有限公司 A kind of call method and device of application
CN109005163A (en) * 2018-07-20 2018-12-14 珠海宏桥高科技有限公司 A kind of HTTP dynamic requests service calling method
CN109240838A (en) * 2018-09-20 2019-01-18 深圳市牛鼎丰科技有限公司 Interface call method, device, computer equipment and storage medium
CN110740103A (en) * 2019-09-02 2020-01-31 深圳壹账通智能科技有限公司 Service request processing method and device, computer equipment and storage medium
CN110784527A (en) * 2019-10-18 2020-02-11 三体云智能科技有限公司 Information management system and method
CN112532564A (en) * 2019-09-17 2021-03-19 中国移动通信集团广东有限公司 Service calling method and device and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080103796A1 (en) * 2006-10-30 2008-05-01 Hitachi, Ltd. Business process operation method and system
WO2013064080A1 (en) * 2011-11-04 2013-05-10 华为技术有限公司 Service configuration method and device
US20170004508A1 (en) * 2015-06-30 2017-01-05 Cross Country Home Services, Inc. Systems and methods for efficiently handling appliance warranty service events
CN108632325A (en) * 2017-03-24 2018-10-09 中国移动通信集团浙江有限公司 A kind of call method and device of application
CN109005163A (en) * 2018-07-20 2018-12-14 珠海宏桥高科技有限公司 A kind of HTTP dynamic requests service calling method
CN109240838A (en) * 2018-09-20 2019-01-18 深圳市牛鼎丰科技有限公司 Interface call method, device, computer equipment and storage medium
CN110740103A (en) * 2019-09-02 2020-01-31 深圳壹账通智能科技有限公司 Service request processing method and device, computer equipment and storage medium
CN112532564A (en) * 2019-09-17 2021-03-19 中国移动通信集团广东有限公司 Service calling method and device and electronic equipment
CN110784527A (en) * 2019-10-18 2020-02-11 三体云智能科技有限公司 Information management system and method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114003647A (en) * 2021-12-31 2022-02-01 北京泰迪熊移动科技有限公司 Data processing method and device and computer readable storage medium
CN114598750A (en) * 2022-01-14 2022-06-07 浙江吉利控股集团有限公司 Data request processing method and device and storage medium
CN114598750B (en) * 2022-01-14 2024-01-30 浙江吉利控股集团有限公司 Data request processing method, device and storage medium
CN114840276A (en) * 2022-04-15 2022-08-02 北京百度网讯科技有限公司 Object calling method, device, equipment, storage medium and program product
CN114860834A (en) * 2022-06-01 2022-08-05 北京字节跳动网络技术有限公司 Processing method, device, equipment and storage medium of associated query request
CN114860834B (en) * 2022-06-01 2024-03-26 北京字节跳动网络技术有限公司 Processing method, device, equipment and storage medium of association query request
CN115002210A (en) * 2022-06-06 2022-09-02 北京自如信息科技有限公司 Data processing method, platform, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN113806037A (en) Service calling method and device, storage medium and electronic equipment
CN110276074B (en) Distributed training method, device, equipment and storage medium for natural language processing
CN111708702A (en) Simulation test method, client, server, system and readable storage medium
CN113141405B (en) Service access method, middleware system, electronic device, and storage medium
CN112732572A (en) Service testing method, device and system, storage medium and electronic device
CN113360301B (en) Message transmission system and method
CN109684008A (en) Card rendering method, device, terminal and computer readable storage medium
CN112667415B (en) Data calling method and device, readable storage medium and electronic equipment
CN111597110A (en) Page testing method and device, electronic equipment and storage medium
CN113360300A (en) Interface calling link generation method, device, equipment and readable storage medium
CN110750295B (en) Information processing method, device, electronic equipment and storage medium
CN112650689A (en) Test method, test device, electronic equipment and storage medium
WO2023169193A1 (en) Method and device for generating smart contract
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
WO2023116647A1 (en) Software in-the-loop testing method and apparatus, electronic device system, and storage medium
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN112052152A (en) Simulation test method and device
CN112765038B (en) Distributed cluster software testing method, device, equipment and storage medium
CN114675876A (en) Business processing method and device, electronic equipment and storage medium
CN111488286B (en) Method and device for independently developing Android modules
CN114356774A (en) Target service test method, device, equipment and storage medium
CN113742235A (en) Method and device for checking codes
CN113590352A (en) Data calling method, device, equipment and readable storage medium
CN112948195A (en) Interface testing method and device, electronic equipment and storage medium
CN112261051B (en) User registration method, device and system

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