CN113570435A - Method and terminal for deducting remaining use times of data service API (application program interface) commodities - Google Patents

Method and terminal for deducting remaining use times of data service API (application program interface) commodities Download PDF

Info

Publication number
CN113570435A
CN113570435A CN202110860992.5A CN202110860992A CN113570435A CN 113570435 A CN113570435 A CN 113570435A CN 202110860992 A CN202110860992 A CN 202110860992A CN 113570435 A CN113570435 A CN 113570435A
Authority
CN
China
Prior art keywords
information
commodity
api
target processing
data service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110860992.5A
Other languages
Chinese (zh)
Other versions
CN113570435B (en
Inventor
廖炳才
杜江磊
邓硕
张艺贝
吴会才
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Shuxin Technology Co ltd
Original Assignee
Shenzhen Shuxin 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 Shenzhen Shuxin Technology Co ltd filed Critical Shenzhen Shuxin Technology Co ltd
Priority to CN202110860992.5A priority Critical patent/CN113570435B/en
Publication of CN113570435A publication Critical patent/CN113570435A/en
Application granted granted Critical
Publication of CN113570435B publication Critical patent/CN113570435B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • G06F16/24578Query processing with adaptation to user needs using ranking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Finance (AREA)
  • Data Mining & Analysis (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method for deducting the residual use times of API (application program interface) commodities of data service, which comprises the steps of obtaining the use request information of a plurality of API commodities; authenticating a plurality of use request messages in parallel; acquiring target processing information for each authenticated use request information; and executing the remaining use number deduction processing according to the target processing information. The invention also discloses a terminal device. The invention at least solves the technical problems of improving the deduction accuracy of commodity use times and improving the information resource sharing safety in a high concurrency environment.

Description

Method and terminal for deducting remaining use times of data service API (application program interface) commodities
Technical Field
The invention relates to the technical field of information processing. More particularly, the invention relates to a method and a terminal for reducing the residual use times of data service API commodities.
Background
Many network platforms need data support in the using process, and most platforms do not have data resources, so that the use permission of data service needs to be purchased from data service providers (the data service providers can be platforms such as an extremely-fast data service platform, a development house, an Ariicloud API market and a Baidu API mall). Data service providers typically open data services to the outside in the form of an API (Application Programming Interface) and provide Interface services to users in the form of request-response. The user only needs to purchase the corresponding API commodity in the system of the data service provider, and the data service in the system can be used. However, in the high concurrency situation, the system is easy to generate phenomena that the use times of purchased commodities are reduced, and the information resource sharing has potential safety hazards.
Disclosure of Invention
It is an object of the present invention to at least solve the above problems and to provide corresponding advantages.
Another object of the present invention is to provide a method and a terminal for deducting the remaining usage times of API commodities in a data service, which at least solve the technical problems of how to improve the accuracy of deducting the usage times of commodities and improve the security of information resource sharing in a high concurrency environment. The invention is mainly realized by the technical scheme in the following aspects:
< first aspect of the invention >
The first aspect provides a method for reducing the remaining use times of a data service API commodity, which is applied to a high concurrency environment, and comprises the following steps:
acquiring use request information of a plurality of API commodities;
authenticating a plurality of use request messages in parallel;
acquiring target processing information for each authenticated use request information;
and executing the remaining use number deduction processing according to the target processing information.
In the first aspect of the present invention, in the high concurrency request, the request is processed synchronously, that is, in the use request information of the API commodities, the use request information is authenticated in parallel, if the authentication passes, the target processing information is obtained for each authenticated use request information, and the remaining use number deduction processing is executed according to the target processing information, wherein the deduction processing adopts a distributed lock manner to perform high concurrency control, so that the technical problem of how to improve the deduction accuracy of the commodity use number in the high concurrency environment can be solved.
In addition, in the method for deducting the remaining usage times of the data service API commodity, the usage request information of each API commodity needs to be authenticated to be capable of deducting the remaining usage times, so that the technical problem of how to improve the information resource sharing safety in a high concurrency environment can be solved.
In some embodiments, the authentication item includes: user behavior state, commodity package information, subscription relationship, commodity key, API address information and residual use times.
In some embodiments, the authentication item further includes:
and matching the API address information with the subscription relationship.
In some embodiments, the authentication item further includes:
and matching the signing relationship with the commodity package information.
In some embodiments, the authentication item further includes:
the size of the remaining number of uses.
In some embodiments, before the step of obtaining the usage request information of the API commodities, the method for deducting the remaining usage times of the data service API commodity further includes:
acquiring purchase request information;
and generating a corresponding signing relationship and a commodity key according to the purchase request information.
In some embodiments, after the step of performing the remaining usage number deduction processing according to the target processing information, the method for deducting the remaining usage number of the data service API commodity further includes:
generating a corresponding queue number according to a preset algorithm;
and the target processing information enters a corresponding message queue according to the queue number.
In some aspects, the calculation formula of the predetermined algorithm may be a number of contract relation% message queues.
In some technical solutions, after the step of entering the target processing information into the corresponding message queue according to the queue number, the method for reducing the remaining number of times of use of the data service API commodity further includes:
and asynchronously executing the target processing information in the message queue and storing the target processing information in the database.
< second aspect of the invention >
A second aspect provides a terminal device comprising a processor and a memory; the memory is configured to store computer program instructions for controlling the processor to operate so as to execute the method for deducting the remaining usage number of the data service API commodity according to the first aspect of the present invention.
Through the technical scheme, the terminal equipment is used for operating the method for deducting the residual using times of the data service API commodity, so that the error of deducting the residual using times of the commodity can be effectively avoided, and the deducting accuracy is improved; and the security of information resource sharing can be improved.
The technical scheme provided by the invention can at least realize the following technical effects:
in some technical solutions, the method for deducting the remaining usage times of API commodities for data services provided by the present invention authenticates a plurality of usage request information in parallel in the usage request information of a plurality of API commodities, obtains target processing information for each authenticated usage request information if the authentication is passed, and executes a deduction process of the remaining usage times according to the target processing information, wherein the deduction process employs a distributed lock mode to perform high-concurrency control. Therefore, the method for deducting the residual using times of the API commodity in the data service can avoid the error of deducting the residual using times of the commodity and improve the deducting accuracy in a high-concurrency environment.
In the method for reducing the remaining usage times of the API commodity for data service provided by the present invention, the usage request information of each API commodity needs to be authenticated to reduce the remaining usage times, which means that only the request information meeting the authentication standard is possible to access the information resource, thereby improving the security of information resource sharing.
In some technical solutions, the method for deducting the remaining usage times of the API commodity for data service provided by the present invention further includes generating a corresponding queue number according to a predetermined algorithm; and the target processing information enters a corresponding message queue according to the queue number. Thereby, the order in which the target processing information is executed can be improved, so that the target processing information can be executed in time order.
In some technical solutions, the method for reducing the remaining usage times of the API commodity for data service provided by the present invention further includes asynchronously executing the target processing information in the message queue and storing the target processing information in the database, so that ordered storage of the target processing information can be realized, and a phenomenon of disordered data storage is avoided.
In some technical schemes, the terminal device provided by the invention is used for operating the method for deducting the residual using times of the data service API commodity, so that the error of deducting the residual using times of the commodity can be effectively avoided, and the deduction accuracy is improved; and the security of information resource sharing can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a flow diagram of a method for reducing remaining usage of data service API merchandise in accordance with certain embodiments of the present invention;
FIG. 2 is a flow diagram of a method for reducing remaining usage of data service API merchandise in accordance with further embodiments of the present invention;
FIG. 3 is a flow chart of a method for reducing remaining usage of API commodity in accordance with the present invention in further embodiments;
FIG. 4 is a flow chart of the present invention for target processing information from an incoming message queue to storage in a database;
FIG. 5 is a block diagram of a method for reducing remaining usage of data service API merchandise in accordance with further embodiments of the present invention;
fig. 6 is a block diagram of a terminal device of the present invention in some embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly and completely apparent, the technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. 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 application.
The terms "first" and "second" and the like in the description of the embodiments of the present application are used for distinguishing different objects, and are not used for describing a specific order of the objects. For example, the first message queue and the second message queue are for distinguishing different message queues, rather than for describing a particular order of message queues.
In the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
< method for reducing remaining usage count of API product for data service >
The method for reducing the residual use times of the Data Service API commodity is applied to a DSOP (Data Service Operating Platform) Platform, and the DSOP Platform integrates a distributed Redis (Remote Dictionary Service) cluster environment. Redis is a memory database which can provide high-speed access, rich data type support and high concurrent read-write capability, can quickly process and store huge high concurrent access amount and mass data of data service websites, and solves the problems of website crash and service pause caused by excessive instantaneous concurrent access amount. The distributed Redis cluster is a distributed database system which is constructed by utilizing a redundant Redis database and has data redundancy and fault tolerance, and all excellent performances of the Redis database are achieved.
Based on the distributed Redis cluster environment, the method for deducting the residual using times of the API commodity provided by the invention can improve the deducting accuracy of the using times of the commodity and the sharing safety of information resources in a high-concurrency scene.
It should be noted that the data service may be consistent with the meaning of the information resource.
Specifically, as shown in fig. 1, a flowchart of a method for deducting the remaining usage times of API goods for data services provided by the present invention is applied to a high concurrency environment, and in fig. 1, the method includes:
s101, obtaining the use request information of a plurality of API commodities.
Specifically, the use request information of the API commodity of the plurality of user clients may be acquired. It will be readily appreciated that at the same time, a user client may send a request for use of an API commodity to the DSOP platform.
The API commodity is characterized in that after the data service API resources are packaged into more detailed introduction information, the more detailed introduction information is displayed to a user client side in the form of the commodity for the user to check and order online. The basic information of the API commodity includes a commodity name, a commodity profile, a commodity classification, and an API resource.
The API commodity use request includes at least Host (Host and port in initial URL), method (e.g., POST), commodity key, Content-Type (for indicating MIME Type to which Content belongs), and user information. The request for use of the API commodity may be an HTTP request. The user information includes a user behavior state and a user account.
S102, a plurality of use request messages are authenticated in parallel.
It should be noted that the items of authentication include user behavior state, package information of goods, subscription relationship, goods key, API address information, and remaining number of usage times.
In particular, the user behavior state may be marked as both normal and disabled. For example, the user behavior status may be marked as disabled when the user has violations or other behaviors that do not comply with the DSOP platform. The user behavior state may be stored in a database. When authentication is required, the user behavior state information corresponding to the user can be inquired from the database for judgment. And when the user behavior state is detected to be a normal state, the authentication is passed.
The authentication of the package information of the commodity can be realized by judging the existence state of the package information of the commodity. Specifically, when the package information of the commodity exists, the authentication is passed. It should be understood that when a user purchases an API commodity in a user client, a certain commodity package is necessarily selected, and information of the commodity package after being purchased can be stored in the database. When authentication is required, commodity package information corresponding to the user can be inquired from the database for judgment.
The authentication of the subscription relationship may be achieved by determining the presence status of the subscription relationship. Specifically, when the subscription relationship exists, the authentication is passed. After the user purchases the API commodity, the DSOP platform generates a corresponding signing relationship and stores the signing relationship in the database. The subscription relationship may be an id (identity document) identification. When authentication is required, the subscription relationship corresponding to the user can be inquired from the database for judgment.
The authentication of the commodity key can be realized by judging the verification result of the commodity key. Specifically, when the verification result of the commodity key is correct, the authentication is passed. After the user purchases the API commodity, the DSOP platform generates a corresponding commodity key and stores the commodity key in the database. When authentication is required, the commodity key corresponding to the user can be inquired from the database for judgment. The manner of the verification is set by those skilled in the art, and is not limited herein.
The authentication of the API address information can be realized by judging the comparison result of the API address information. Specifically, when the comparison result of the API address information is consistent, the authentication is passed. The API commodity purchased by the user contains API address information. The API address information may be consistent with the aforementioned Host. When authentication is required, Host can be extracted from the use request of the API commodity, and API address information corresponding to the user in the database is judged.
The authentication of the remaining number of uses may be performed by determining the number of remaining uses. Specifically, if the number of the remaining number of times of use is greater than 0, that is, the remaining number of times of use can be deducted, the authentication is passed. And after the user purchases the API commodity, storing and storing corresponding commodity package information in a database, wherein the commodity package information comprises the residual using times. When authentication is required, the remaining number of usage times corresponding to the user can be queried from the database for judgment.
The authentication of the API address information and the subscription relationship may be implemented by determining a matching state of the API address information and the subscription relationship. Specifically, when the API address information matches the subscription relationship, the authentication is passed. The API address information corresponding to the user information and the subscription relationship may be queried from a database for a determination. The standard for matching the API address information with the subscription relationship may be set by a person skilled in the art according to actual requirements.
The authentication of the subscription relationship and the commodity package information can be realized by judging the matching state of the subscription relationship and the commodity package information. Specifically, when the subscription relationship is matched with the commodity package information, the authentication is passed. The contract signing relationship corresponding to the user information and the commodity package information can be inquired from a database for judgment. The standard for matching the contract relationship with the package information of the commodity can be set by a person skilled in the art according to actual needs.
The authentication of the goods on the shelf can be realized by judging the goods on the shelf state. Specifically, when the commodity is in the shelf-on state, the authentication is passed.
In some embodiments, the authenticated items may include all of the aforementioned items, that is, the user behavior state, the package information, the subscription relationship, the commodity key, the API address information, the remaining number of usage times, the matching relationship between the API address information and the subscription relationship, the matching relationship between the subscription relationship and the package information, the size of the remaining number of usage times, and the commodity shelf information. And the next operation can be carried out only when the authenticated items pass.
S103, acquiring target processing information for each authenticated use request information.
The target processing information at least comprises corresponding use request information and the remaining number of uses.
And S104, executing the residual use times deduction processing according to the target processing information.
It should be understood that the remaining number of uses in the target processing information must be a value greater than 0. The deduction process may be an operation of subtracting 1 from the remaining number of uses.
In the above embodiment, in the high concurrency request, the request is processed synchronously, that is, in the use request information of the API commodities, the use request information is authenticated in parallel, if the authentication passes, the target processing information is obtained for each authenticated use request information, and the remaining use number deduction processing is executed according to the target processing information, wherein the deduction processing adopts a distributed lock mode to perform high concurrency control, so that the technical problem of how to improve the deduction accuracy of the commodity use number in the high concurrency environment can be solved.
In addition, in the method for deducting the remaining usage times of the data service API commodity, the usage request information of each API commodity needs to be authenticated to be capable of deducting the remaining usage times, so that the technical problem of how to improve the information resource sharing safety in a high concurrency environment can be solved.
In some embodiments, as shown in fig. 2, the method for deducting the remaining usage times of the data service API commodity includes:
s201, obtaining purchase request information.
Specifically, the purchase request information of the user client may be acquired. The purchase request information may be request information for purchasing an API commodity. It should be understood by those skilled in the art that the corresponding purchase request information can be obtained only when the corresponding API commodity is in a selling state.
The purchase request information at least comprises user information and commodity package information. Wherein the user information comprises a user account; the package information includes any one of 0 yuan/10 times, 10 yuan/30 times, 100 yuan/500 times, 30000 yuan/month, and 200000 yuan/year. Of course, in other embodiments, the package information may include other package information, and is not limited to the aforementioned exemplary 0 yuan/10 times, 10 yuan/30 times, 100 yuan/500 times, 30000 yuan/month, and 200000 yuan/year. It will be understood by those skilled in the art that the packages for Bay and Bay, i.e., packages for 30000 Yuan/month and 200000 Yuan/year, do not perform the remaining usage deduction process.
And S202, generating a corresponding signing relationship and a commodity key according to the purchase request information.
It should be appreciated that when purchase request information is obtained, a corresponding subscription relationship may be generated. The relationship between the subscription relationship and the user information is a one-to-one relationship, that is, one subscription relationship corresponds to one user information; the relationship between the user information and the subscription relationship is a one-to-many relationship, that is, one user information may correspond to a plurality of subscription relationships.
The goods key may be a unique identification of the user purchasing the corresponding API goods.
S203, obtaining the use request information of a plurality of API commodities.
Step S203 is the same as step S101 herein, and can be understood and implemented by referring to the description of step S101, which is not described herein again.
S204, authenticating the multiple use request messages in parallel.
The step S204 is the same as the step S102, and can be understood and implemented by referring to the description of the step S102, which is not described herein again.
S205, target processing information is obtained for each authenticated use request message.
Step S205 is the same as step S103 herein, and can be understood and implemented by referring to the description of step S103, which is not described herein again.
And S206, executing the residual use times deduction processing according to the target processing information.
Step S206 is the same as step S104 herein, and can be understood and implemented by referring to the description of step S104, which is not described herein again.
In some embodiments, as shown in fig. 3, the method for deducting the remaining usage number of the data service API commodity includes:
s301, obtaining the purchase request information.
Step S301 is the same as step S201 herein, and can be understood and implemented by referring to the description of step S201, which is not described herein again.
And S302, generating a corresponding signing relationship and a commodity key according to the purchase request information.
The step S302 is the same as the step S202 herein, and can be understood and implemented by referring to the description of the step S202, which is not described herein again.
S303, obtaining the use request information of a plurality of API commodities.
Step S303 is the same as step S101 herein, and can be understood and implemented by referring to the description of step S101, which is not described herein again.
S304, a plurality of use request messages are authenticated in parallel.
The step S304 is the same as the step S102 herein, and can be understood and implemented by referring to the description of the step S102, which is not described herein again.
S305, target process information is acquired for each authenticated use request information.
Step S305 is the same as step S103 herein, and can be understood and implemented by referring to the description of step S103, which is not described herein again.
And S306, executing the residual use times deduction processing according to the target processing information.
The step S306 is the same as the step S104 herein, and can be understood and implemented by referring to the description of the step S104, which is not described herein again.
And S307, generating a corresponding queue number according to a preset algorithm.
The calculation formula of the predetermined algorithm may be the number of contract relation% message queues.
In the calculation method of the predetermined algorithm, "%" is a remainder symbol in the computer programming calculation method.
And S308, the target processing information enters a corresponding message queue according to the queue number.
The message queue may be a FIFO (First Input First Output, i.e. First in First out queue). The number of message queues may be set by a person skilled in the art according to the actual requirements.
In this embodiment of the present application, an exemplary process of entering the target processing information into the corresponding message queue according to the queue number may be implemented by referring to a flowchart shown in fig. 4:
in fig. 4, message queue 420 includes a first message queue 421, a second message queue 422, and a third message queue 423. The queue number corresponding to the first message queue 421 is 0, the queue number corresponding to the second message queue 422 is 1, and the queue number corresponding to the third message queue 423 is 2. When the contract relationship of the target processing message 410 is 31, the corresponding queue number is 1 according to the predetermined algorithm, and the target processing message 410 enters the second message queue 422.
Note that, in fig. 4, a dotted line corresponding to the target processing information 410 represents that the target processing information 410 may enter a message queue corresponding to the dotted line, but does not enter the message queue; the solid line corresponding to the target processing information 410 is the message queue that the target processing information 410 actually enters.
In some embodiments, as shown in fig. 5, the method for deducting the remaining usage number of the data service API commodity includes:
s501, obtaining purchase request information.
Step S501 is the same as step S201 herein, and can be understood and implemented by referring to the description of step S201, which is not described herein again.
And S502, generating a corresponding signing relationship and a commodity key according to the purchase request information.
Step S502 is the same as step S202 herein, and can be understood and implemented by referring to the description of step S202, which is not described herein again.
S503, obtaining the use request information of a plurality of API commodities.
Step S503 is the same as step S101 herein, and can be understood and implemented by referring to the description of step S101, which is not described herein again.
S504, a plurality of use request information are authenticated in parallel.
Step S504 is the same as step S102 herein, and can be understood and implemented by referring to the description of step S102, which is not described herein again.
And S505, acquiring target processing information for each authenticated use request message.
Step S505 is the same as step S103 herein, and can be understood and implemented by referring to the description of step S103, which is not described herein again.
And S506, executing the residual use times deduction processing according to the target processing information.
The step S506 is the same as the step S104 herein, and can be understood and implemented by referring to the description of the step S104, which is not described herein again.
And S507, generating a corresponding queue number according to a preset algorithm.
Step S507 is the same as step S307 herein, and can be understood and implemented by referring to the description of step S307, which is not described herein again.
And S508, the target processing information enters a corresponding message queue according to the queue number.
The step S508 is the same as the step S308 herein, and can be understood and implemented by referring to the description of the step S308, which is not described herein again.
And S509, asynchronously executing the target processing information in the message queue and storing the target processing information in the database.
The asynchronous meaning may be consistent with the asynchronous processing meaning of computer multithreading. In the embodiment of the present application, since the target processing information in the asynchronous execution message queue is stored in the database and runs in the distributed Redis cluster environment, the storage may use an asynchronous replication mode for data storage.
An exemplary operation of step S509 may refer to fig. 4:
in fig. 4, the DSOP platform reads the target processing information of each message queue in the message queue 420 for asynchronous execution, and stores the corresponding execution information into the database 430 after the asynchronous execution is completed. Wherein the execution information includes a current time of access.
< terminal device >
Fig. 6 is a block diagram of a terminal device provided by the present invention, in fig. 6, the terminal device 600 includes a processor 601, a memory 602, an interface device 603, a communication device 604, a display device 605, an input device 606, a speaker 607, a microphone 608, and a computer program stored on the memory 602 and operable on the processor 601, and when the processor 601 executes the computer program, the method for reducing the number of remaining uses of the data service API commodity according to any of the foregoing embodiments of the present invention is implemented.
Although a plurality of devices are shown for each terminal apparatus 600 in fig. 6, the present invention may relate to only some of the devices.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (10)

1. The method for deducting the residual use times of the data service API commodity is characterized by comprising the following steps:
acquiring use request information of a plurality of API commodities;
authenticating a plurality of use request messages in parallel;
acquiring target processing information for each authenticated use request information;
and executing the remaining use number deduction processing according to the target processing information.
2. The method of claim 1, wherein the authentication item comprises: user behavior state, commodity package information, subscription relationship, commodity key, API address information and residual use times.
3. The method of claim 2, wherein the authentication further comprises:
and matching the API address information with the subscription relationship.
4. The method of claim 2, wherein the authentication further comprises:
and matching the signing relationship with the commodity package information.
5. The method of claim 2, wherein the authentication further comprises:
the size of the remaining number of uses.
6. The method of claim 1, wherein before the step of obtaining the usage request information of the API commodities, the method further comprises:
acquiring purchase request information;
and generating a corresponding signing relationship and a commodity key according to the purchase request information.
7. The method of claim 1, further comprising, after the step of performing the remaining usage count reduction process based on the target process information:
generating a corresponding queue number according to a preset algorithm;
and the target processing information enters a corresponding message queue according to the queue number.
8. The method of claim 7, wherein the predetermined algorithm is calculated as the number of contract% message queues.
9. The method of claim 7, wherein after the step of entering the target processing information into the corresponding message queue according to the queue number, the method of reducing the remaining usage number of the data service API commodity further comprises:
and asynchronously executing the target processing information in the message queue and storing the target processing information in the database.
10. A terminal device, comprising a processor and a memory; the memory is configured to store computer program instructions for controlling the processor to operate to perform the method of deducting a number of remaining uses of a data service API commodity of any of claims 1 to 9.
CN202110860992.5A 2021-07-29 2021-07-29 Method and terminal for deducting remaining use times of data service API commodity Active CN113570435B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110860992.5A CN113570435B (en) 2021-07-29 2021-07-29 Method and terminal for deducting remaining use times of data service API commodity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110860992.5A CN113570435B (en) 2021-07-29 2021-07-29 Method and terminal for deducting remaining use times of data service API commodity

Publications (2)

Publication Number Publication Date
CN113570435A true CN113570435A (en) 2021-10-29
CN113570435B CN113570435B (en) 2024-06-07

Family

ID=78168751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110860992.5A Active CN113570435B (en) 2021-07-29 2021-07-29 Method and terminal for deducting remaining use times of data service API commodity

Country Status (1)

Country Link
CN (1) CN113570435B (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060253856A1 (en) * 2005-04-13 2006-11-09 Carl Hu Fault tolerant distributed lock management
CN101594227A (en) * 2008-05-30 2009-12-02 华为技术有限公司 The method of data encryption and deciphering, device and communication system
CN102497269A (en) * 2011-12-13 2012-06-13 深圳市同洲视讯传媒有限公司 Bill authentication method and bill authentication system
CN107733842A (en) * 2016-11-08 2018-02-23 北京奥斯达兴业科技有限公司 Method for authenticating and device based on cloud platform
CN107832159A (en) * 2017-11-10 2018-03-23 郑州云海信息技术有限公司 Manage the method and computer-readable recording medium of distributed lock
CN108881448A (en) * 2018-06-27 2018-11-23 杭州贝购科技有限公司 The processing method and processing device of API request
CN109120727A (en) * 2018-10-31 2019-01-01 苏州友教习亦教育科技有限公司 Distributed message supplying system
US20190294527A1 (en) * 2018-03-23 2019-09-26 Lendingclub Corporation Unified ui/ux and api testing of web applications
CN111028009A (en) * 2019-12-10 2020-04-17 中国银行股份有限公司 Method and device for processing retrievable service entity
CN111209060A (en) * 2018-11-21 2020-05-29 中国移动通信集团广东有限公司 Capability development platform processing method and device
CN111897721A (en) * 2020-07-14 2020-11-06 重庆长安汽车股份有限公司 Automatic test method of API interface and storage medium
CN112101955A (en) * 2020-11-16 2020-12-18 北京快成科技股份公司 Concurrent payment method, system and device
CN112667414A (en) * 2020-12-23 2021-04-16 平安普惠企业管理有限公司 Message queue-based message consumption method and device, computer equipment and medium
CN112835722A (en) * 2021-01-29 2021-05-25 卓望数码技术(深圳)有限公司 Service processing method, electronic device and computer readable storage medium
CN112995165A (en) * 2021-02-10 2021-06-18 北京金山云网络技术有限公司 Resource access authentication method and device, storage medium and electronic equipment

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060253856A1 (en) * 2005-04-13 2006-11-09 Carl Hu Fault tolerant distributed lock management
CN101594227A (en) * 2008-05-30 2009-12-02 华为技术有限公司 The method of data encryption and deciphering, device and communication system
CN102497269A (en) * 2011-12-13 2012-06-13 深圳市同洲视讯传媒有限公司 Bill authentication method and bill authentication system
CN107733842A (en) * 2016-11-08 2018-02-23 北京奥斯达兴业科技有限公司 Method for authenticating and device based on cloud platform
CN107832159A (en) * 2017-11-10 2018-03-23 郑州云海信息技术有限公司 Manage the method and computer-readable recording medium of distributed lock
US20190294527A1 (en) * 2018-03-23 2019-09-26 Lendingclub Corporation Unified ui/ux and api testing of web applications
CN108881448A (en) * 2018-06-27 2018-11-23 杭州贝购科技有限公司 The processing method and processing device of API request
CN109120727A (en) * 2018-10-31 2019-01-01 苏州友教习亦教育科技有限公司 Distributed message supplying system
CN111209060A (en) * 2018-11-21 2020-05-29 中国移动通信集团广东有限公司 Capability development platform processing method and device
CN111028009A (en) * 2019-12-10 2020-04-17 中国银行股份有限公司 Method and device for processing retrievable service entity
CN111897721A (en) * 2020-07-14 2020-11-06 重庆长安汽车股份有限公司 Automatic test method of API interface and storage medium
CN112101955A (en) * 2020-11-16 2020-12-18 北京快成科技股份公司 Concurrent payment method, system and device
CN112667414A (en) * 2020-12-23 2021-04-16 平安普惠企业管理有限公司 Message queue-based message consumption method and device, computer equipment and medium
CN112835722A (en) * 2021-01-29 2021-05-25 卓望数码技术(深圳)有限公司 Service processing method, electronic device and computer readable storage medium
CN112995165A (en) * 2021-02-10 2021-06-18 北京金山云网络技术有限公司 Resource access authentication method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN113570435B (en) 2024-06-07

Similar Documents

Publication Publication Date Title
CN111080295B (en) Electronic contract processing method and device based on blockchain
US11328331B2 (en) Methods, devices, and systems for sending and receiving virtual goods
JP6800147B2 (en) Methods, devices, terminals and servers for verifying the security of service operations
KR20160006185A (en) Two factor authentication
US11157902B1 (en) Token generation in providing a secure credit card payment service without storing credit card data on merchant servers
CN108173938A (en) Server load shunt method and device
US20090328163A1 (en) System and method using streaming captcha for online verification
US9449319B1 (en) Conducting transactions with dynamic passwords
CN111343168B (en) Identity authentication method and device, computer equipment and readable storage medium
CN111161085B (en) Service request processing method, device, electronic equipment and computer readable medium
AU2020205279A1 (en) Systems and methods for use in authenticating users in connection with network transactions
CN105100029B (en) The method and apparatus that authentication is carried out to user
CN108833265A (en) Message treatment method, device, server and storage medium
CN109544131A (en) A kind of game merchandise control method and device
CN109525552B (en) Dynamic code synchronous process capacity expansion method, dynamic code generator and storage medium
CN112637222A (en) Request processing method and device
CN113570435B (en) Method and terminal for deducting remaining use times of data service API commodity
US20170169211A1 (en) One kind of website passwords generating method and apparatus
CN107613496B (en) Queuing method, system and authentication server
CN116205654A (en) Method, device, electronic equipment and storage medium for verifying transaction data
CN114422586B (en) Event notification method, event notification device, computer equipment and storage medium
CN110781523B (en) Method and apparatus for processing information
CN114461912A (en) Information processing method and device, electronic equipment and storage medium
CN113541957A (en) Business supervision method, device and equipment based on block chain
CN105719079B (en) Information generation method and device

Legal Events

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