CN110705978A - Interface service method and device - Google Patents

Interface service method and device Download PDF

Info

Publication number
CN110705978A
CN110705978A CN201910814880.9A CN201910814880A CN110705978A CN 110705978 A CN110705978 A CN 110705978A CN 201910814880 A CN201910814880 A CN 201910814880A CN 110705978 A CN110705978 A CN 110705978A
Authority
CN
China
Prior art keywords
interface service
response code
user
preset
charging
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
CN201910814880.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.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart Technology 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 OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201910814880.9A priority Critical patent/CN110705978A/en
Publication of CN110705978A publication Critical patent/CN110705978A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/14Payment architectures specially adapted for billing systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/03Credit; Loans; Processing thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The embodiment of the invention provides an interface service method, which comprises the following steps: receiving a calling request of a user for calling interface service; acquiring a response body from a server according to the calling request; analyzing a response code and the node position of the response code in the response body according to the response body; matching the response code and the node position with a preset response code in a preset response code configuration table and a preset node position of the preset response code respectively; judging whether the calling request is a charge according to a matching result; when the calling request is charging, acquiring a pre-configured charging rule aiming at the interface service; and charging the user according to the charging rule and sending a charging result to the user terminal of the user. The embodiment of the invention can automatically complete charging without rewriting codes, thereby greatly improving the development efficiency and the quality of the codes.

Description

Interface service method and device
Technical Field
The present invention relates to the field of communications, and in particular, to an interface service method, an interface service apparatus, a computer device, and a readable storage medium.
Background
In current loan scenarios, it is often necessary to bill for the interface or service invoked. In the prior art, when related services need to be charged, developers need to write a set of charging logic and charging rules, and the existing charging development has a lot of repetitive work, so that the time and the labor are consumed, the code requirements on the developers are high, and leaks are easy to generate. Therefore, the invention aims to solve the problems of complex interface service development, time and labor consumption and low code quality.
Disclosure of Invention
In view of the above, it is desirable to provide an interface service method, an interface service apparatus, a computer device and a computer readable storage medium, which can automatically complete charging without rewriting codes and improve development efficiency and code quality.
In order to achieve the above object, an embodiment of the present invention provides an interface service method, where the method includes:
receiving a calling request of a user for calling interface service;
acquiring a response body from a server according to the calling request;
analyzing a response code and the node position of the response code in the response body according to the response body;
matching the response code and the node position with a preset response code in a preset response code configuration table and a preset node position of the preset response code respectively;
judging whether the calling request is a charge according to a matching result;
when the calling request is charging, acquiring a pre-configured charging rule aiming at the interface service; and
and charging the user according to the charging rule, and sending a charging result to a user terminal of the user.
Optionally, before the step of matching the response code and the node position with a preset response code in a pre-configured response code configuration table and a preset node position of the preset response code, the method further includes the steps of:
acquiring a preset node position of the preset response code, the preset response code and a calling request description of the preset response code, which are configured in advance by a user; and
and establishing the response code configuration table according to the preset node position, the preset response code and the calling request description.
Optionally, the step of obtaining a pre-configured charging rule for the interface service when the invocation request is charging further includes the steps of:
acquiring a settlement type of the interface service and a fee for calling the interface service once, wherein the settlement type at least comprises: monthly, secondary and/or quartet knots;
when the settlement type is monthly or quarterly, the charging rules include: the total cost in a preset time period is the number of times of calling the interface service in the preset time period and the cost of calling the interface service at a single time;
and when the settlement type is monthly or quarterly, the charging rule is that the cost is the cost for calling the interface service once.
Optionally, the step of charging the user according to the charging rule and sending a charging result to the user terminal of the user further includes the steps of:
judging whether the user needs to be charged according to the preset time period;
when the user needs to be charged, identifying user information for initiating the call request, wherein the user information comprises: the account and password of the user;
counting the times of calling the interface service by the user in the preset time period; and
and calculating the total cost of the user used in the preset time period according to the cost of calling the interface service once and the frequency according to the charging rule.
In order to achieve the above object, an embodiment of the present invention further provides an interface service apparatus, including:
the receiving module is used for receiving a calling request of a user for calling the interface service;
the obtaining module is used for obtaining a response body from the server according to the calling request;
the analysis module is used for analyzing the response code and the node position of the response code in the response body according to the response body;
the matching module is used for respectively matching the response code and the node position with a preset response code in a preset response code configuration table and a preset node position of the preset response code;
the judging module is used for judging whether the calling request is a charge according to the matching result;
the obtaining module is further configured to obtain a pre-configured charging rule for the interface service when the call request is charging; and
and the charging module is used for charging the user according to the charging rule and sending a charging result to the user terminal of the user.
Optionally, the obtaining module is further configured to obtain a preset node position of the preset response code, and a call request description of the preset response code, where the preset node position is configured by a user in advance.
Optionally, the interface service apparatus further includes an establishing module, configured to establish the response code configuration table according to the preset node position, the preset response code, and the call request specification.
Optionally, the obtaining module is further configured to:
acquiring a settlement type of the interface service and a fee for calling the interface service once, wherein the settlement type at least comprises: monthly, secondary and/or quartet knots;
when the settlement type is monthly or quarterly, the charging rules include: the total cost in a preset time period is the number of times of calling the interface service in the preset time period and the cost of calling the interface service for a single time;
and when the settlement type is monthly or quarterly, the charging rule is that the cost is the cost for calling the interface service once.
Optionally, the interface service device further includes:
the judging module is also used for judging whether the user needs to be charged according to the preset time period;
an identifying module, configured to identify, when the user needs to be charged, user information that initiates the invocation request, where the user information includes: the account and password of the user;
the counting module is used for counting the times of calling the interface service by the user in the preset time period; and
and the charging module is further used for calculating the total cost of the user used in the preset time period according to the charging rule by the cost for calling the interface service once and the frequency.
To achieve the above object, an embodiment of the present invention further provides a computer device, a memory of the computer device, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the interface service method as described above.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is executable by at least one processor to cause the at least one processor to execute the steps of the interface service method as described above.
According to the interface service method, the interface service device, the computer equipment and the readable storage medium provided by the embodiment of the invention, by receiving a call request of a user for calling an interface service, a response body is obtained according to the call request, a response code and a node position of the response code in the response body are analyzed according to the response body, whether the call request is charging or not is judged according to a pre-configured response code configuration table, when the call request is charging, a pre-configured charging rule aiming at the interface service is obtained, and the user is charged according to the charging rule. The embodiment of the invention can automatically complete charging by configuring the charging rule of the interface without rewriting codes, thereby greatly improving the development efficiency and the quality of the codes.
Drawings
Fig. 1 is a flowchart illustrating steps of an interface service method according to a first embodiment of the present invention.
Fig. 2 is a schematic diagram of a hardware architecture of an interface service device according to a second embodiment of the present invention.
Fig. 3 is a schematic diagram of program modules of an interface service system according to a third embodiment of the present invention.
Reference numerals:
Figure BDA0002186097410000041
Figure BDA0002186097410000051
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention 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 invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Example one
Referring to fig. 1, a flowchart illustrating steps of an interface service method according to a first embodiment of the invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. It should be noted that the present embodiment is exemplarily described with the interface service apparatus 2 as an execution subject. The method comprises the following specific steps:
step S100, receiving a call request of a user for calling an interface service.
Specifically, when a user a initiates a call request for a service a (i.e., an interface service a), the interface service apparatus 2 receives the call request initiated by the user a for calling the interface service a.
And step S102, acquiring a response body from the server according to the calling request.
Specifically, when the user a clicks the service a of the terminal, the terminal initiates a call request for calling the interface service a to the server through an http protocol, and the server receives the call request and then responds to the call request. According to the response result, the interface service device 2 obtains the response body (for example: response/result/response. data) from the server.
And step S104, analyzing the response code according to the response body and the node position of the response code in the response body.
Specifically, when the responder is "response/result/response.code", it is analyzed that the response code is "response.code" according to the preset structure type of the responder, and the content "response/result/" of the response code "response.code" before the responder "response/result/response.code" is the node position of the response code "response/result/response.code" in the responder.
And step S106, matching the response code and the node position with a preset response code in a preset response code configuration table and a preset node position of the preset response code respectively.
In a preferred embodiment, before matching the response code and the node position with the user-configured response code and the user-configured response code node position table, respectively, the interface service device 2 obtains the user-configured response code node position, the response code, and the invocation request specification of the response code, and then establishes the response code configuration table according to the response code node position, the response code, and the invocation request specification.
Specifically, before matching the response code and the node position with the user-configured response code and the node position table of the response code, the configuration user configures the response code "000" at the "response/result/" node position as charging, configures the response code "1 xx" as an error request, and configures the response code "5 xx" as a server error; configure response code "00" at "response. data/" node location as billing, response code "1 x" as error request, response code "5 x" as server error. And then, acquiring configuration information of different response codes of different node positions of a user, and establishing a response code configuration table to enable the response codes, the node positions of the response codes in a response body and the calling request descriptions to be in one-to-one correspondence.
When the response code is analyzed from the responder to be '000' and the node position of the response code '000' in the responder is 'response/result/', the response code '000' and the node position 'response/result/' are matched with the response code stored in the response code configuration table and the node position of the response code, so as to find the response code '000' and the node position of the response code '000' in the responder.
Step S108, judging whether the calling request is charging according to the matching result, if the calling request is charging, executing step S110, otherwise executing step S100.
Specifically, since the calling request with the response code "000" and the response code "000" at the node position of the responder in the response code configuration table is explained as charging, it is determined that the calling request is charging.
Step S110, obtaining a pre-configured charging rule for the interface service.
Illustratively, the interface service device 2 is pre-provisioned with a fee for a single invocation of the interface service and a fee settlement type, wherein the settlement type includes but is not limited to: monthly, secondary, and/or quarterly knots. When the settlement type is monthly or quarterly, the charging rules include: the total cost in a preset time period is the number of times of calling the interface service in the preset time period and the cost of calling the interface service at a single time. And when the calling request of the interface service is judged to be charging, acquiring the charging rule, and charging the user according to the charging rule. And when the settlement type is secondary settlement, the charging rule indicates that the cost is the cost for calling the interface service once.
It should be noted that, according to an actual scenario, since the charge for the interface service invocation by the user may be the charge generated by the user invoking the interface service within a period of time, that is, the user may invoke the interface service multiple times within the period of time, and the invocation of the interface service is charged according to the number of times, the total charge for the user invoking the interface service within the period of time needs to be integrated.
Step S112, charging the user according to the charging rule, and sending the charging result to the user terminal of the user.
In a preferred embodiment, when the user needs to be charged, identifying user information that initiates the invocation request, wherein the user information includes: the account number and the password of the user. Then, counting the times of the user calling the interface service in the preset time period, and calculating the cost of calling the interface service once and the times according to the charging rule to obtain the total cost of calling the interface service by the user in the preset time period. It should be noted that if the preset time period is not over, for example, the settlement type is a monthly settlement, and the time for the user to call the interface service is a month, no charging operation is performed. And if the time node at the end of the month is reached, performing charging statistics on the interface service called by the user in the month time period at the beginning of the next month no matter whether the user calls the interface service at the time node at the end of the month or not.
In one embodiment, if the settlement type of the charging rule is monthly settlement and the charging is performed for each month, the fee for calling the interface service once is 10 yuan. The total cost of the user a in a month is 10 times the user called the interface service in the month. And after the total cost in the month is calculated, sending the total cost to the user A terminal, and directly paying by the user A according to the calculated total cost.
In another embodiment, it is also possible to add a value before the user a initiates the call request by a knot, and the interface service apparatus 2 directly deducts the fee for calling the interface service from the balance every time the user a initiates the call request. Of course, the method may be a circumferential knot, a quaternary knot, etc., and is not limited herein.
By the embodiment of the invention, charging can be automatically completed by configuring the charging rule of the interface service without rewriting codes, thereby greatly improving the development efficiency and the quality of the codes.
Example two
Referring to fig. 2, a hardware architecture diagram of an interface service device according to a second embodiment of the present invention is shown. The interface service 2 includes, but is not limited to, a memory 21, a process 22, and a network interface 23 communicatively coupled to each other via a system bus, and FIG. 2 illustrates only the interface service 2 having components 21-23, but it is to be understood that not all of the illustrated components are required and that more or fewer components may alternatively be implemented.
The memory 21 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 21 may be an internal storage unit of the interface service device 2, such as a hard disk or a memory of the interface service device 2. In other embodiments, the memory may also be an external storage device of the interface service apparatus 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the interface service apparatus 2. Of course, the memory 21 may also comprise both an internal storage unit of the interface service 2 and an external storage device thereof. In this embodiment, the memory 21 is generally used for storing an operating system installed in the interface service device 2 and various types of application software, such as program codes of the interface service system 20. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the interface service 2. In this embodiment, the processor 22 is configured to execute the program codes stored in the memory 21 or process data, for example, execute the interface service system 20.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is generally used for establishing a communication connection between the interface service device 2 and other electronic equipment. For example, the network interface 23 is used to connect the interface service apparatus 2 with an external terminal through a network, establish a data transmission channel and a communication connection between the interface service apparatus 2 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
EXAMPLE III
Referring to fig. 3, a schematic diagram of a program module of an interface service system according to a third embodiment of the present invention is shown. In the present embodiment, the interface service system 20 may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the present invention and implement the above-described interface service method. The program module referred to in the embodiments of the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than the program itself for describing the execution process of the interface service system 20 in the storage medium. The following description will specifically describe the functions of the program modules of the present embodiment:
the receiving module 201 is configured to receive a call request for a user to call an interface service.
Specifically, when a user a initiates a call request of a service a (i.e., an interface service a), the receiving module 201 receives the call request of the interface service a initiated by the user a.
An obtaining module 202, configured to obtain a response from the server according to the call request.
Specifically, when the user a clicks the service a of the terminal, the terminal initiates a call request for calling the interface service a to the server through an http protocol, and the server receives the call request and then responds to the call request. According to the response result, the obtaining module 202 obtains the response body (e.g. response/result/response. data) from the server.
And the analysis module 203 is configured to analyze the response code and the node position of the response code in the response body according to the response body.
Specifically, when the responder is "response/result/response.code", the parsing module 203 parses out that the response code is "response.code" according to the preset structure type of the responder, and the content "response/result/" of the response code "response.code" before the responder is "response/result/response.code" is the node position of the response code "response/result/response.code" in the responder.
A matching module 204, configured to match the response code and the node position with a preset response code in a pre-configured response code configuration table and a preset node position of the preset response code, respectively.
In a preferred embodiment, before matching the response code and the node position with the user-configured response code and the user-configured response code node position table, the obtaining module 202 obtains the user-configured response code node position, the response code, and the call request specification of the response code, and then the establishing module 207 establishes the response code configuration table according to the response code node position, the response code, and the call request specification.
Specifically, before matching the response code and the node position with the node position table of the response code and the response code configured by the user, the obtaining module 202 obtains configuration information of the user, where the configuration information is: configuring a response code '000' at a 'response/result/' node position as charging, configuring a response code '1 xx' as an error request, and configuring a response code '5 xx' as a server error; configure response code "00" at "response. data/" node location as billing, response code "1 x" as error request, response code "5 x" as server error. Then, the obtaining module 202 obtains configuration information of different response codes of different node positions of the user. Finally, the establishing module 207 establishes a response code configuration table so that the response code, the node position of the response code in the responder, and the calling request specification are in one-to-one correspondence.
When the response code "000" and the node position of the response code "000" in the responder are analyzed from the responder, "response/result/" respectively, the matching module 204 matches the response code "000" and the node position "response/result/" with the response code stored in the response code configuration table and the node position of the response code, so as to find the response code "000" and the node position of the response code "000" in the responder.
And the judging module 205 is configured to judge whether the call request is charging according to the matching result.
Specifically, since the calling request with the response code "000" and the response code "000" at the node position of the responder in the response code configuration table is interpreted as charging, the determining module 205 determines that the calling request is charging.
The obtaining module 202 is further configured to obtain a pre-configured charging rule for the interface service when the call request is charging.
Illustratively, the interface service device 2 is pre-provisioned with a fee for a single invocation of the interface service and a fee settlement type, wherein the settlement type includes but is not limited to: monthly, secondary, and/or quarterly knots. When the settlement type is monthly or quarterly, the charging rules include: the total cost in a preset time period is the number of times of calling the interface service in the preset time period and the cost of calling the interface service at a single time. And when the calling request of the interface service is judged to be charging, acquiring the charging rule, and charging the user according to the charging rule. And when the settlement type is secondary settlement, the charging rule indicates that the cost is the cost for calling the interface service once.
It should be noted that, according to an actual scenario, since the charge for the interface service invocation by the user may be the charge generated by the user invoking the interface service within a period of time, that is, the user may invoke the interface service multiple times within the period of time, and the invocation of the interface service is charged according to the number of times, the total charge for the user invoking the interface service within the period of time needs to be integrated.
And the charging module 206 is configured to charge the user according to the charging rule, and send a charging result to the user terminal of the user.
In a preferred embodiment, when the user needs to be charged, the identifying module 208 identifies the user information initiating the invocation request, wherein the user information includes: the account number and the password of the user. Then, the counting module 209 counts the number of times that the user invokes the interface service within the preset time period. Finally, the charging module 206 calculates the total cost of the interface service invoked by the user in the preset time period according to the charging rule for the cost and the frequency of the interface service invoked for a single time. It should be noted that if the preset time period is not over, for example, the settlement type is a monthly settlement, and the time for the user to call the interface service is a month, no charging operation is performed. And if the time node at the end of the month is reached, performing charging statistics on the interface service called by the user in the month time period at the beginning of the next month no matter whether the user calls the interface service at the time node at the end of the month or not.
In one embodiment, if the settlement type of the charging rule is monthly settlement and the charging is performed for each month, the fee for calling the interface service once is 10 yuan. The total cost of the user a in a month is 10 times the user called the interface service in the month. After the charging module 206 calculates the total charge in the month, the total charge is sent to the user a terminal, and the user a directly pays according to the calculated total charge.
In another embodiment, it is also possible to add a value before the user a initiates the call request by a knot, and the interface service apparatus 2 directly deducts the fee for calling the interface service from the balance every time the user a initiates the call request. Of course, the method may be a circumferential knot, a quaternary knot, etc., and is not limited herein.
By the embodiment of the invention, charging can be automatically completed by configuring the charging rule of the interface service without rewriting codes, thereby greatly improving the development efficiency and the quality of the codes.
The present invention also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) capable of executing programs, and the like. The computer device of the embodiment at least includes but is not limited to: memory, processor, etc. communicatively coupled to each other via a system bus.
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of this embodiment is used for storing the interface service system 20, and when being executed by a processor, the interface service method of the first embodiment is implemented.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An interface service method, comprising the steps of:
receiving a calling request of a user for calling interface service;
acquiring a response body from a server according to the calling request;
analyzing a response code and the node position of the response code in the response body according to the response body;
matching the response code and the node position with a preset response code in a preset response code configuration table and a preset node position of the preset response code respectively;
judging whether the calling request is a charge according to a matching result;
when the calling request is charging, acquiring a pre-configured charging rule aiming at the interface service; and
and charging the user according to the charging rule, and sending a charging result to a user terminal of the user.
2. The interface service method according to claim 1, wherein before the step of matching the response code and the node position with a preset response code in a pre-configured response code configuration table and a preset node position of the preset response code, respectively, the method further comprises the steps of:
acquiring a preset node position of the preset response code, the preset response code and a calling request description of the preset response code, which are configured in advance by a user; and
and establishing the response code configuration table according to the preset node position, the preset response code and the calling request description.
3. The interface service method according to claim 1, wherein the step of obtaining a pre-configured charging rule for the interface service when the invocation request is charging further comprises the steps of:
acquiring a settlement type of the interface service and a fee for calling the interface service once, wherein the settlement type at least comprises: monthly, secondary and/or quartet knots;
when the settlement type is monthly or quarterly, the charging rules include: the total cost in a preset time period is the number of times of calling the interface service in the preset time period and the cost of calling the interface service for a single time;
and when the settlement type is monthly or quarterly, the charging rule is that the cost is the cost for calling the interface service once.
4. The interface service method of claim 3, wherein the step of charging the user according to the charging rule and transmitting a charging result to the user terminal of the user further comprises the steps of:
judging whether the user needs to be charged according to the preset time period;
when the user needs to be charged, identifying user information for initiating the call request, wherein the user information comprises: the account and password of the user;
counting the times of calling the interface service by the user in the preset time period; and
and calculating the total cost of the user used in the preset time period according to the cost of calling the interface service once and the frequency according to the charging rule.
5. An interface service apparatus, comprising:
the receiving module is used for receiving a calling request of a user for calling the interface service;
the obtaining module is used for obtaining a response body from the server according to the calling request;
the analysis module is used for analyzing the response code and the node position of the response code in the response body according to the response body;
the matching module is used for respectively matching the response code and the node position with a preset response code in a preset response code configuration table and a preset node position of the preset response code;
the judging module is used for judging whether the calling request is a charge according to the matching result;
the obtaining module is further configured to obtain a pre-configured charging rule for the interface service when the call request is charging; and
and the charging module is used for charging the user according to the charging rule and sending a charging result to the user terminal of the user.
6. The interface service apparatus of claim 5, further comprising:
the obtaining module is further configured to obtain a preset node position of the preset response code, the preset response code and a calling request description of the preset response code, which are configured in advance by a user; and
and the establishing module is used for establishing the response code configuration table according to the preset node position, the preset response code and the calling request specification.
7. The interface service apparatus of claim 5 wherein the obtaining module is further configured to:
acquiring a settlement type of the interface service and a fee for calling the interface service once, wherein the settlement type at least comprises: monthly, secondary and/or quartet knots;
when the settlement type is monthly or quarterly, the charging rules include: the total cost in a preset time period is the number of times of calling the interface service in the preset time period and the cost of calling the interface service for a single time;
and when the settlement type is monthly or quarterly, the charging rule is that the cost is the cost for calling the interface service once.
8. The interface service apparatus of claim 5, further comprising:
the judging module is also used for judging whether the user needs to be charged according to the preset time period;
an identifying module, configured to identify, when the user needs to be charged, user information that initiates the invocation request, where the user information includes: the account and password of the user;
the counting module is used for counting the times of calling the interface service by the user in the preset time period; and
and the charging module is further used for calculating the total cost of the user used in the preset time period according to the charging rule by the cost for calling the interface service once and the frequency.
9. A computer device, characterized by a computer device memory, a processor and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the interface service method according to any one of claims 1-4.
10. A computer-readable storage medium, in which a computer program is stored which is executable by at least one processor to cause the at least one processor to perform the steps of the interface service method according to any one of claims 1-4.
CN201910814880.9A 2019-08-30 2019-08-30 Interface service method and device Pending CN110705978A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910814880.9A CN110705978A (en) 2019-08-30 2019-08-30 Interface service method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910814880.9A CN110705978A (en) 2019-08-30 2019-08-30 Interface service method and device

Publications (1)

Publication Number Publication Date
CN110705978A true CN110705978A (en) 2020-01-17

Family

ID=69194101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910814880.9A Pending CN110705978A (en) 2019-08-30 2019-08-30 Interface service method and device

Country Status (1)

Country Link
CN (1) CN110705978A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102170360A (en) * 2011-04-19 2011-08-31 北京神州数码思特奇信息技术股份有限公司 Mode matching method of rule engine and RETE network
CN105635227A (en) * 2014-11-05 2016-06-01 北京东土科技股份有限公司 Point to point communication method and system on the basis of serial server
CN106453489A (en) * 2016-08-31 2017-02-22 成都市和平科技有限责任公司 Self-help paper shredding system, apparatus and method with automatic charging function
CN106682978A (en) * 2016-12-30 2017-05-17 深圳南北互联网金融服务有限公司 Clearing and settling rule generating method and device
WO2018228334A1 (en) * 2017-06-12 2018-12-20 中兴通讯股份有限公司 Charging information transmission method, cmf entity and computer-readable storage medium
CN109327511A (en) * 2018-09-18 2019-02-12 网宿科技股份有限公司 A kind of data request method and server based on http protocol
CN109767201A (en) * 2018-12-14 2019-05-17 深圳壹账通智能科技有限公司 Online charging method, apparatus, computer equipment and storage medium
CN109787781A (en) * 2018-12-17 2019-05-21 深圳壹账通智能科技有限公司 Online charging method, apparatus, computer equipment and storage medium
CN109996201A (en) * 2018-01-02 2019-07-09 中国移动通信有限公司研究院 A kind of Network Access Method and the network equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102170360A (en) * 2011-04-19 2011-08-31 北京神州数码思特奇信息技术股份有限公司 Mode matching method of rule engine and RETE network
CN105635227A (en) * 2014-11-05 2016-06-01 北京东土科技股份有限公司 Point to point communication method and system on the basis of serial server
CN106453489A (en) * 2016-08-31 2017-02-22 成都市和平科技有限责任公司 Self-help paper shredding system, apparatus and method with automatic charging function
CN106682978A (en) * 2016-12-30 2017-05-17 深圳南北互联网金融服务有限公司 Clearing and settling rule generating method and device
WO2018228334A1 (en) * 2017-06-12 2018-12-20 中兴通讯股份有限公司 Charging information transmission method, cmf entity and computer-readable storage medium
CN109996201A (en) * 2018-01-02 2019-07-09 中国移动通信有限公司研究院 A kind of Network Access Method and the network equipment
CN109327511A (en) * 2018-09-18 2019-02-12 网宿科技股份有限公司 A kind of data request method and server based on http protocol
CN109767201A (en) * 2018-12-14 2019-05-17 深圳壹账通智能科技有限公司 Online charging method, apparatus, computer equipment and storage medium
CN109787781A (en) * 2018-12-17 2019-05-21 深圳壹账通智能科技有限公司 Online charging method, apparatus, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108520454B (en) Method and system for calling back orders in real time
CN110704521A (en) Interface data access method and system
CN107133064B (en) Page hot updating method and device for native application
CN111722947A (en) Service calling method and system
CN109962855A (en) A kind of current-limiting method of WEB server, current-limiting apparatus and terminal device
CN110308880B (en) Log printing method, system, computer device and computer readable storage medium
CN111813622B (en) Equipment monitoring method and device
CN104572054A (en) Capability calling method and capability calling equipment
CN111490947A (en) Data packet transmitting method, data packet receiving method, system, device and medium
CN112153152A (en) Management method and system of algorithm service interface
CN110727581A (en) Collapse positioning method and electronic equipment
CN104503768A (en) Call method and device for application programming interface (API)
CN107450909B (en) Processing method and device for software development kit integration validity check
CN113037510A (en) Charging method, charging device and computer readable storage medium
CN111159226A (en) Index query method and system
CN110166530B (en) Processing method based on micro-service return value, electronic device and computer equipment
CN109905407B (en) Management method, system, equipment and medium for accessing intranet based on VPN server
CN110705978A (en) Interface service method and device
CN109086091A (en) A kind of interface loading method, device and the equipment of software development kit
CN108616870B (en) Method and device for identifying terminal customized preferentially
CN112241362A (en) Test method, test device, server and storage medium
CN114722108A (en) Customer service data processing method and device, electronic equipment and storage medium
CN112732547B (en) Service testing method and device, storage medium and electronic equipment
CN114500640A (en) Message generation method, message transmission device, electronic equipment and medium
CN109041058B (en) WIFI hotspot connection 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