CN113570435B - Method and terminal for deducting remaining use times of data service API commodity - Google Patents

Method and terminal for deducting remaining use times of data service API commodity Download PDF

Info

Publication number
CN113570435B
CN113570435B CN202110860992.5A CN202110860992A CN113570435B CN 113570435 B CN113570435 B CN 113570435B CN 202110860992 A CN202110860992 A CN 202110860992A CN 113570435 B CN113570435 B CN 113570435B
Authority
CN
China
Prior art keywords
commodity
information
api
remaining
deduction
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.)
Active
Application number
CN202110860992.5A
Other languages
Chinese (zh)
Other versions
CN113570435A (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

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)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Computational Linguistics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a deduction method for the remaining use times of a data service API commodity, which comprises the steps of obtaining the use request information of a plurality of API commodities; authenticating a plurality of using request information in parallel; acquiring target processing information for each authenticated use request information; and executing the deduction processing of the residual use times 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 the commodity use times and the information resource sharing safety under the high concurrency environment.

Description

Method and terminal for deducting remaining use times of data service API commodity
Technical Field
The invention relates to the technical field of information processing. More particularly, the invention relates to a deduction method and a terminal for remaining use times of data service API commodity.
Background
Many network platforms need data support in the use process, and as most of the platforms have no data resource, the use permission of the data service needs to be purchased from a data service provider (the data service provider can be a platform such as a very fast data, a development house, an ali cloud API market, a hundred degree API market and the like). The data service provider typically opens the data service to the outside in the form of an API (Application Programming Interface, application program interface) to provide the interface service to the user in the form of a request-response. The user can use the data service in the system only by purchasing the corresponding API commodity in the system of the data service provider. However, the system is easy to generate errors of deduction of the number of times of use of purchased commodities and has potential safety hazards in information resource sharing under the condition of high concurrency.
Disclosure of Invention
It is an object of the present invention to solve at least the above problems and to provide corresponding advantages.
The invention further aims to provide a deduction method and a terminal for the remaining use times of the commodity of the data service API, which at least solve the technical problems of how to improve the deduction accuracy of the use times of the commodity and the sharing safety of information resources under a high concurrency environment. The invention is realized mainly by the following technical proposal:
< first aspect of the invention >
The first aspect provides a deduction method for remaining use times of data service API commodity, applied to a high concurrency environment, the method comprising:
Acquiring use request information of a plurality of API commodities;
Authenticating a plurality of using request information in parallel;
Acquiring target processing information for each authenticated use request information;
and executing the deduction processing of the residual use times according to the target processing information.
In the first aspect of the present invention, in a high concurrency request, a request is synchronously processed, that is, in application request information of a plurality of API commodities, a plurality of application request information are authenticated in parallel, if the authentication is passed, target processing information is obtained for each application request information passing the authentication, and remaining application frequency deduction processing is executed according to the target processing information, where the deduction processing adopts a distributed lock mode to perform high concurrency control, thereby solving the technical problem of how to improve deduction accuracy of commodity application frequency in a high concurrency environment.
In addition, in the deduction method for the remaining use times of the data service API commodity, the use request information of each API commodity can be deducted only through authentication processing, 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 item of authentication includes: user behavior state, commodity package information, subscription relationship, commodity key, API address information and the number of remaining uses.
In some embodiments, the authentication item further includes:
Matching relation between API address information and subscription relation.
In some embodiments, the authentication item further includes:
matching relation between subscription relation and commodity package information.
In some embodiments, the authentication item further includes:
The number of remaining uses.
In some embodiments, before the step of obtaining the usage request information of the plurality of API commodities, the deduction method of the remaining usage times of the data service API commodity further includes:
Acquiring purchase request information;
and generating a corresponding subscription relation and commodity key according to the purchase request information.
In some embodiments, after the step of performing the remaining usage count deduction process according to the target processing information, the method for deducting the remaining usage count 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 embodiments, the calculation formula of the predetermined algorithm may be the number of subscription% 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 deduction method of the remaining usage times of the data service API commodity further includes:
the target processing information in the message queue is asynchronously executed and stored 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 to perform the deduction method of the remaining number of uses 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 running the deduction method of the remaining use times of the data service API commodity, so that the error of deducting the remaining use times of the commodity can be effectively avoided, and the deduction accuracy is improved; and the security of information resource sharing can be improved.
The technical scheme provided by the invention at least can realize the following technical effects:
In some technical schemes, the deduction method for the remaining use times of the data service API commodity provided by the invention is characterized in that in the use request information of a plurality of API commodities, a plurality of use request information are authenticated in parallel, if the authentication is passed, target processing information is obtained for each authenticated use request information, and the deduction processing for the remaining use times is executed according to the target processing information, wherein the deduction processing adopts a distributed lock mode to carry out high-concurrency control. In this way, the deduction method for the remaining use times of the data service API commodity provided by the invention can avoid the error of deducting the remaining use times of the commodity and improve the deduction accuracy under the high concurrence environment.
In addition, in the deduction method for the remaining use times of the data service API commodity, the remaining use times of each API commodity can be deducted only by authentication processing on the use request information of each API commodity, which means that only the request information meeting the authentication standard can possibly access the information resource, thereby improving the safety of information resource sharing.
In some technical schemes, the deduction method for the remaining use times of the data service API commodity provided by the invention further comprises the step of 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. 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 schemes, the deduction method for the remaining use times of the data service API commodity further comprises asynchronously executing the target processing information in the message queue and storing the target processing information in the database, so that the ordered storage of the target processing information can be realized, and the phenomenon of messy data storage is avoided.
In some technical schemes, the terminal equipment provided by the invention is used for running the deduction method of the remaining use times of the data service API commodity, so that the error of deducting the remaining use 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 that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a deduction method of remaining usage times of a data service API commodity according to the present invention in some embodiments;
FIG. 2 is a flow chart of a deduction method of remaining usage times of a commodity of the data service API according to the present invention in other embodiments;
FIG. 3 is a flow chart of a deduction method of remaining usage times of a data service API commodity according to the present invention in still other embodiments;
FIG. 4 is a flow chart of the present invention for storing target processing information from an incoming message queue to a database;
FIG. 5 is a block diagram of a deduction method of remaining usage times of a data service API commodity according to the present invention in still other embodiments;
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 application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms "first" and "second" and the like in the description of embodiments of the present application are used for distinguishing between different objects and not for describing a particular sequential order of objects. For example, the first message queue and the second message queue are used to distinguish between different message queues, rather than to describe a particular order of message queues.
In embodiments of the application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts 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 that are expressly listed or inherent to such process, method, article, or apparatus.
< Method for deducting remaining usage times of data service API commodity >
The deduction method of the remaining use times of the data service API commodity is applied to a DSOP (DATA SERVICE Operating Platform, data service operation platform) platform, and the DSOP platform integrates a distributed Redis (Remote Dictionary Server, remote dictionary service) cluster environment. Redis is a memory database which can provide high-speed access, abundant data type support and high concurrency read-write capability, can rapidly process and store huge high concurrency access quantity and massive data of a data service website, and solves the problems of website collapse and service suspension caused by overlarge instantaneous concurrency access quantity. The distributed Redis cluster is a distributed database system with data redundancy and fault tolerance constructed by using a redundant Redis database, and has all the excellent performances of the Redis database.
The deduction method of the remaining use times of the commodity of the data service API provided by the invention can improve the deduction accuracy of the use times of the commodity and the sharing safety of information resources under a high concurrency scene based on the distributed Redis cluster environment.
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 deduction method for remaining use times of a data service API commodity provided by the present invention is applied to a high concurrency environment, and in fig. 1, the method includes:
s101, acquiring use request information of a plurality of API commodities.
Specifically, the usage request information of the API commodity of the plurality of user clients may be acquired. It is readily understood that a user client may send a request for use of an API commodity to the DSOP platform at the same time.
The API commodity refers to the form of showing the API resource to a user client for the user to check and order online after the data service API resource is packaged into more detailed introduction information. The basic information of the API commodity includes commodity name, commodity introduction, commodity classification, and an API resource.
The application request of the API commodity at least includes a Host (Host and port in the initial URL), a method (for example, POST), a commodity key, a Content-Type (for representing a MIME Type to which the 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, authenticating a plurality of using request information in parallel.
It should be noted that, the authentication items include user behavior state, commodity package information, subscription relationship, commodity key, API address information and remaining usage times.
In particular, the user behavior state may be marked as both normal and disabled. For example, when the user has an offence or other behavior that does not conform to the DSOP platform, the user behavior status may be marked as disabled. The user behavior state may be stored in a database. When authentication is needed, the user behavior state information corresponding to the user can be queried from the database to judge. And when the user behavior state is detected to be in a normal state, passing authentication.
Authentication of the commodity package information can be achieved by judging the existence state of the commodity package information. Specifically, when the commodity package information exists, authentication is passed. It should be appreciated that when a user purchases an API commodity in the user's client, the user must select a commodity package whose information may be stored in the database after purchase. And when authentication is needed, inquiring commodity package information corresponding to the user from the database to judge.
Authentication of the subscription may be achieved by determining the presence status of the subscription. Specifically, when the subscription exists, authentication passes. After the user purchases the API commodity, the DSOP platform generates a corresponding subscription relationship and stores the subscription relationship in the database. The subscription may be a ID (Identity Document) identification. When authentication is needed, the subscription relation corresponding to the user can be queried from the database to judge.
Authentication of the commodity key can be achieved 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. And when authentication is needed, inquiring a commodity key corresponding to the user from the database to judge. The manner of verification is set by those skilled in the art and is not limited herein.
Authentication of the API address information can be achieved 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 previously mentioned Host. When authentication is needed, a Host can be extracted from the application request of the API commodity, and the API address information corresponding to the user in the database is judged.
Authentication for the remaining number of uses may be achieved by determining the number of remaining uses. Specifically, if the number of the remaining usage times is greater than 0, that is, the remaining usage times may be deducted, authentication is passed. And after the user purchases the API commodity, storing and storing corresponding commodity package information, wherein the commodity package information comprises the residual use times. When authentication is needed, the remaining use times corresponding to the user can be queried from the database to judge.
Authentication of the API address information and the subscription relationship can be achieved by judging the matching state of the API address information and the subscription relationship. Specifically, when the API address information matches the subscription, authentication is passed. And inquiring the API address information corresponding to the user information from a database to judge the subscription relationship. The criteria for matching the API address information with the subscription relationship may be set by those skilled in the art according to actual requirements.
Authentication of the subscription relationship and the commodity package information can be achieved 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, authentication is passed. And inquiring the subscription relation corresponding to the user information from a database and judging the commodity package information. The standards for matching the subscription relationship with the commodity package information can be set by those skilled in the art according to actual requirements.
Authentication for the loading of the commodity can be realized by judging the loading state of the commodity. Specifically, when the commodity is in the on-shelf state, authentication is passed.
In some embodiments, the authenticated items may include all the foregoing items, namely, a user behavior state, commodity package information, a subscription relationship, a commodity key, API address information, a number of remaining uses, a matching relationship of the API address information and the subscription relationship, a matching relationship of the subscription relationship and the commodity package information, a size of the number of remaining uses, and commodity shelf information. Only when the above-mentioned authenticated items pass, the next operation can be performed.
S103, obtaining target processing information for each authenticated use request information.
The target processing information at least comprises corresponding use request information and the residual use times.
S104, performing remaining use times deduction processing according to the target processing information.
It should be understood that the number of remaining uses in the target process information must be a number greater than 0. The deduction process may be to perform a 1-reduction operation on the remaining number of uses.
In the above embodiment, in the high concurrency request, the request is synchronously processed, that is, in the use request information of the plurality of API commodities, the plurality of use request information are authenticated in parallel, if the authentication passes, the target processing information is obtained for each use request information passing the authentication, and the remaining use times deduction processing is executed according to the target processing information, where the deduction processing adopts the distributed lock mode to perform the high concurrency control, thereby solving the technical problem of how to improve the deduction accuracy of the commodity use times in the high concurrency environment.
In addition, in the deduction method for the remaining use times of the data service API commodity, the use request information of each API commodity can be deducted only through authentication processing, 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 deduction method for the remaining usage times of the data service API commodity includes:
S201, acquiring purchase request information.
Specifically, purchase request information of the user client may be acquired. The purchase request information may be request information for purchasing an API commodity. It will be appreciated by those skilled in the art that the corresponding purchase request information can be obtained only when the corresponding API commodity is in a sold state.
The purchase request information at least comprises user information and commodity package information. Wherein the user information comprises a user account; the commodity package information includes any one of 0/10, 10/30, 100/500, 30000/month and 200000/year. Of course, in other embodiments, the commodity package information may include other package information and is not limited to the foregoing exemplary 0/10, 10/30, 100/500, 30000/month, and 200000/year. It will be appreciated by those skilled in the art that package of month and year, i.e., 30000 yuan/month and 200000 yuan/year packages, do not perform the remaining use count deduction process.
S202, generating a corresponding subscription relation 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. Wherein, the relationship between the subscription relationship and the user information is a one-to-one relationship, namely, one subscription relationship corresponds to one user information; the relationship between the user information and the subscription relationship is a one-to-many relationship, i.e. one user information can correspond to a plurality of subscription relationships.
The commodity key may be a unique identification of the commodity for which the user purchased the corresponding API.
S203, acquiring the use request information of the plurality of API commodities.
The step S203 is the same as the step S101, and the description of the step S101 may be understood and implemented with reference to the foregoing, which is not described herein.
S204, authenticating a plurality of using request information in parallel.
The step S204 is the same as the step S102, and the description of the step S102 may be understood and implemented with reference to the foregoing, which is not repeated herein.
S205, obtaining target processing information for each authenticated use request information.
The step S205 is the same as the step S103 herein, and the description of the step S103 may be understood and implemented with reference to the foregoing, which is not described herein.
S206, performing remaining use times deduction processing according to the target processing information.
The step S206 is the same as the step S104 herein, and the description of the step S104 may be understood and implemented with reference to the foregoing, which is not described herein.
In some embodiments, as shown in fig. 3, the deduction method of the remaining usage times of the data service API commodity includes:
s301, acquiring purchase request information.
The step S301 is the same as the step S201 herein, and the description of the step S201 may be understood and implemented with reference to the foregoing, which is not described herein.
S302, generating a corresponding subscription relation and a commodity key according to the purchase request information.
The step S302 is the same as the step S202 herein, and the description of the step S202 may be understood and implemented with reference to the foregoing, which is not described herein.
S303, acquiring the use request information of a plurality of API commodities.
The step S303 is the same as the step S101, and the description of the step S101 may be understood and implemented with reference to the foregoing, which is not described herein.
S304, authenticating a plurality of using request information in parallel.
The step S304 is the same as the step S102, and the description of the step S102 may be understood and implemented with reference to the foregoing, which is not repeated herein.
S305, acquiring target processing information for each authenticated use request information.
The step S305 is the same as the step S103 herein, and the description of the step S103 may be understood and implemented with reference to the foregoing, which is not described herein.
S306, performing remaining use times deduction processing according to the target processing information.
The step S306 is the same as the step S104 herein, and the description of the step S104 may be understood and implemented with reference to the foregoing, which is not described herein.
S307, generating a corresponding queue number according to a preset algorithm.
The calculation formula of the predetermined algorithm may be the number of sign-up% message queues.
The "%" in the calculation method of the predetermined algorithm is the remainder symbol in the computer programming calculation method.
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., a first-in first-out queue). The number of message queues may be set by those skilled in the art according to actual needs.
In an embodiment of the present application, an exemplary flow of the target processing information entering the corresponding message queue according to the queue number may be implemented with reference to the flowchart shown in fig. 4:
In fig. 4, the 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 subscription relationship of the target processing information 410 is 31, the corresponding queue number is calculated to be 1 according to the predetermined algorithm, and the target processing information 410 enters the second message queue 422.
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 into which the target processing information 410 actually enters.
In some embodiments, as shown in fig. 5, the deduction method of the remaining usage times of the data service API commodity includes:
s501, acquiring purchase request information.
The step S501 is the same as the step S201 herein, and the description of the step S201 may be understood and implemented with reference to the foregoing, which is not described herein.
S502, generating a corresponding subscription relation and a commodity key according to the purchase request information.
The step S502 is the same as the step S202 herein, and the description of the step S202 may be understood and implemented with reference to the foregoing, which is not repeated herein.
S503, acquiring the use request information of a plurality of API commodities.
The step S503 is the same as the step S101, and the description of the step S101 may be understood and implemented with reference to the foregoing, which is not described herein.
S504, authenticating a plurality of using request information in parallel.
The step S504 is the same as the step S102, and the description of the step S102 may be understood and implemented with reference to the foregoing, which is not repeated herein.
S505, obtaining target processing information for each authenticated use request information.
The step S505 is the same as the step S103 herein, and the description of the step S103 may be understood and implemented with reference to the foregoing, which is not described herein.
S506, performing remaining use times deduction processing according to the target processing information.
The step S506 is the same as the step S104, and the description of the step S104 may be understood and implemented with reference to the foregoing, which is not described herein.
S507, generating a corresponding queue number according to a preset algorithm.
The step S507 is the same as the step S307 herein, and the description of the step S307 may be understood and implemented with reference to the foregoing, which is not repeated herein.
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 the description of the step S308 may be understood and implemented with reference to the foregoing, which is not described herein.
S509, asynchronously executing target processing information in the message queue and storing the target processing information in a database.
The asynchronous meaning may be consistent with the asynchronous processing meaning of computer multithreading. In the embodiment of the application, the target processing information in the asynchronous execution message queue is stored in the database to run in the distributed Redis cluster environment, so that the storage can adopt 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 queues 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 according to 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 in the memory 602 and executable on the processor 601, where the processor 601 implements a method for deducting the remaining number of uses of the data service API commodity according to any of the foregoing embodiments of the present invention when executing the computer program.
Although a plurality of devices are shown for the terminal apparatus 600 in fig. 6, the present invention may relate to only some of the devices.
The foregoing description of embodiments of the invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or 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 various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvements 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 (6)

1. The deduction method of the remaining use times of the data service API commodity based on the distributed Redis cluster environment is characterized by being applied to a DSOP platform, and comprises the following steps:
Acquiring purchase request information;
Generating a corresponding subscription relation and a commodity key according to the purchase request information;
Acquiring using request information of a plurality of API commodities according to a plurality of user clients, wherein the API commodities are purchased commodities by a user, the using request information comprises user information and Host information, and the user information comprises user behavior states;
acquiring API address information corresponding to each API commodity;
Authenticating each of the plurality of use request information in parallel; wherein authenticating each usage request message includes: determining whether authentication is passed or not according to the user behavior state, the consistency of the Host information of the use request information and the API address information of the API commodity, and the matching state of the API address information and the subscription relation;
obtaining target processing information containing corresponding residual using times for each using request information passing authentication;
performing remaining use count deduction processing according to the target processing information; the deduction processing adopts a distributed lock mode to control high concurrency;
Generating a corresponding queue number according to a preset algorithm;
the target processing information enters a corresponding message queue according to the queue number;
the target processing information in the message queue is asynchronously executed and stored in the database.
2. The method for deducting the remaining number of uses of the commodity according to claim 1, wherein said authenticated item further comprises: commodity package information, subscription relationship, commodity key, API address information and residual use times.
3. The method for deducting the remaining number of uses of the commodity according to claim 1, wherein said authenticated item further comprises:
matching relation between subscription relation and commodity package information.
4. The method for deducting the remaining number of uses of the commodity according to claim 1, wherein said authenticated item further comprises:
The number of remaining uses.
5. The deduction method for remaining usage times of the data service API commodity according to claim 1, wherein said predetermined algorithm has a calculation formula as follows: the sign-up relationship is the number of message queues, wherein the% is the remainder sign in the computer programming calculation mode.
6. Terminal equipment, characterized by comprising a processor and a memory; the memory is for storing computer program instructions for controlling the processor to operate to perform the deduction method of remaining usage of a data service API commodity of any one of claims 1-5.
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 CN113570435A (en) 2021-10-29
CN113570435B true 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 (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7426653B2 (en) * 2005-04-13 2008-09-16 Progress Software Corporation Fault tolerant distributed lock management
US10467127B2 (en) * 2018-03-23 2019-11-05 Lendingclub Corporation Unified UI/UX and API testing of web applications

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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
CN113570435A (en) 2021-10-29

Similar Documents

Publication Publication Date Title
CN111080295B (en) Electronic contract processing method and device based on blockchain
CN108173938A (en) Server load shunt method and device
US9356986B2 (en) Distributed stream processing
CN111343168B (en) Identity authentication method and device, computer equipment and readable storage medium
CN110474903B (en) Trusted data acquisition method and device and block link point
CN107797854B (en) Transaction file processing method and device, storage medium and computer equipment
CN111161085B (en) Service request processing method, device, electronic equipment and computer readable medium
CN108491304B (en) electronic device, business system risk control method and storage medium
CN110599277A (en) Inventory deduction method and device
CN111427915A (en) Information processing method and device, storage medium and electronic equipment
CN114637611A (en) Information processing method and device based on message queue and computer equipment
CN113761565B (en) Data desensitization method and device
CN113570435B (en) Method and terminal for deducting remaining use times of data service API commodity
CN103780592A (en) Method and apparatus for determining being stolen of user account
CN107613496B (en) Queuing method, system and authentication server
CN114422586B (en) Event notification method, event notification device, computer equipment and storage medium
CN110781523B (en) Method and apparatus for processing information
CN114363268A (en) Message delay consumption method and related product
CN114461912A (en) Information processing method and device, electronic equipment and storage medium
CN113407339A (en) Resource request feedback method and device, readable storage medium and electronic equipment
CN111125250A (en) Method and device for storing internet evaluation data on block chain
CN109741078A (en) One kind is towards retrospective Internet of Things storage system and method
CN112288990A (en) Method, system, medium and device for generating internet of things event based on internet of things data
CN117670330B (en) Block chain-based transaction processing method and device, electronic equipment and storage medium
CN111401840B (en) Method, apparatus, device and computer readable medium for generating guarantor information

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