CN114553433A - Third-party platform access method, device, electronic equipment and medium - Google Patents

Third-party platform access method, device, electronic equipment and medium Download PDF

Info

Publication number
CN114553433A
CN114553433A CN202210139168.5A CN202210139168A CN114553433A CN 114553433 A CN114553433 A CN 114553433A CN 202210139168 A CN202210139168 A CN 202210139168A CN 114553433 A CN114553433 A CN 114553433A
Authority
CN
China
Prior art keywords
access token
token information
party platform
target
historical
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
CN202210139168.5A
Other languages
Chinese (zh)
Other versions
CN114553433B (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210139168.5A priority Critical patent/CN114553433B/en
Publication of CN114553433A publication Critical patent/CN114553433A/en
Application granted granted Critical
Publication of CN114553433B publication Critical patent/CN114553433B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/321Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
    • H04L9/3213Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0807Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/108Network architectures or network communication protocols for network security for controlling access to devices or network resources when the policy decisions are valid for a limited amount of time
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a third-party platform access method, a third-party platform access device, electronic equipment and a readable storage medium, wherein the method comprises the following steps: responding to an access instruction aiming at a target third-party platform, and generating a first access token application request aiming at the target third-party platform; sending the first access token application request to the game server; receiving one of first historical access token information, second historical access token information and latest access token information which are returned by the game server and aim at the target third-party platform; and accessing the target third-party platform by adopting the first historical access token information or the second historical access token information or the latest access token information. According to the embodiment of the invention, the game client directly accesses the third-party platform to be optimized to access the third-party platform through the central server, so that the access frequency aiming at the third-party platform can be greatly reduced.

Description

Third-party platform access method, device, electronic equipment and medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a third-party platform access method, a third-party platform access device, an electronic device, and a computer-readable storage medium.
Background
The game development can be generally divided into a server and a client, and in the game development, the client often needs to access a third-party platform, for example, a third-party live platform or a third-party payment platform in the game. The existing access method is that a client directly calls a third-party platform interface to be in butt joint with a third-party platform server, and the method is suitable for most situations, but if the third-party platform has limitation on access frequency, and when game players increase, the client used by each game player needs to call the third-party platform interface, the access frequency of the third-party platform can reach the upper limit, and the third-party service cannot be normally used.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a third party platform access method and a corresponding third party platform access apparatus, an electronic device, and a computer readable storage medium that overcome or at least partially solve the above problems.
The embodiment of the invention discloses a third-party platform access method, which is applied to a game client, wherein the game client is in communication connection with a game server, the game server is in communication connection with a central server, and the method comprises the following steps:
responding to an access instruction aiming at a target third-party platform, and generating a first access token application request aiming at the target third-party platform;
sending the first access token application request to the game server;
receiving one of first historical access token information, second historical access token information and latest access token information which are returned by the game server and aim at the target third-party platform; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements;
and accessing the target third-party platform by adopting the first historical access token information or the second historical access token information or the latest access token information.
Optionally, the receiving one of first historical access token information, second historical access token information, and latest access token information for the target third-party platform returned by the game server includes:
if the first historical access token information aiming at the target third-party platform in the first local cache data of the game server is inquired to be in the validity period, receiving the first historical access token information aiming at the target third-party platform sent by the game server; and the game server inquires that the first historical access token information aiming at the target third-party platform in the first local cache data is sent after the first historical access token information is valid.
Optionally, the receiving one of first historical access token information, second historical access token information, and latest access token information for the target third-party platform returned by the game server includes:
if the first historical access token information aiming at the target third-party platform in the first local cache data of the game server is not in the validity period and the second historical access token information aiming at the target third-party platform in the second local cache data of the central server is in the validity period, receiving the second historical access token information aiming at the target third-party platform forwarded by the game server; and the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is sent after the second historical access token information is valid.
Optionally, the receiving one of first historical access token information, second historical access token information, and latest access token information for the target third-party platform returned by the game server includes:
if the first historical access token information aiming at the target third-party platform in the first local cache data of the game server is not in the validity period and the second historical access token information aiming at the target third-party platform in the second local cache data of the central server is not in the validity period, receiving the latest access token information aiming at the target third-party platform forwarded by the game server; the latest access token information is provided for the target third-party platform according to the received second access token application request; and the second access token application request is generated and sent after the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is not in the valid period.
Optionally, the generating a first access token application request for a target third-party platform in response to an access instruction for the target third-party platform includes:
determining, in response to the access instruction for the target third party platform, an access type of the target third party platform;
if the access type is a first access type, generating a first access token application request aiming at the target third-party platform; the first access type is a type having an access frequency limit.
The embodiment of the invention also discloses a third-party platform access method, which is applied to a game server, wherein the game server is in communication connection with a plurality of game clients, and is in communication connection with a central server, and the method comprises the following steps:
receiving a first access token application request aiming at a target third-party platform, which is sent by the game client; the first access token application request is generated by the game client in response to an access instruction for the target third party platform;
inquiring first historical access token information aiming at the target third-party platform in first local cache data of the game server according to the first access token application request, and judging whether the first historical access token information is in the validity period;
returning one of first historical access token information, second historical access token information and latest access token information aiming at the target third-party platform to the game client according to a first judgment result so that the game client accesses the target third-party platform by adopting the first historical access token information or the second historical access token information or the latest access token information; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
Optionally, the returning, to the game client according to the first determination result, one of first historical access token information, second historical access token information, and latest access token information for the target third-party platform includes:
and if the first historical access token information is in the validity period, sending the first historical access token information aiming at the target third-party platform to the game client.
Optionally, the returning, to the game client according to the first determination result, one of first historical access token information, second historical access token information, and latest access token information for the target third-party platform includes:
if the first historical access token information is not in the validity period, forwarding the first access token application request to the central server;
receiving one of the second historical access token information and the latest access token information for the target third party platform returned by the central server;
forwarding one of the second historical access token information and the most recent access token information for the target third party platform to the game client.
Optionally, the receiving one of the second historical access token information and the latest access token information for the target third-party platform returned by the central server includes:
if the second historical access token information aiming at the target third-party platform in the second local cache data of the central server is inquired to be in the validity period, receiving the second historical access token information aiming at the target third-party platform sent by the central server; and the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is sent after the second historical access token information is valid.
Optionally, the receiving one of the second historical access token information and the latest access token information for the target third-party platform returned by the central server includes:
if the second historical access token information aiming at the target third-party platform in the second local cache data of the central server is not in the validity period, receiving the latest access token information aiming at the target third-party platform forwarded by the central server; the latest access token information is provided for the target third-party platform according to the received second access token application request; and the second access token application request is generated and sent after the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is not in the valid period.
Optionally, after receiving the latest access token information for the target third-party platform forwarded by the central server, the method further includes:
updating the latest access token information into the first local cache data.
The embodiment of the invention also discloses a third-party platform access method, which is applied to a central server, wherein the central server is in communication connection with a game server, the game server is in communication connection with a plurality of game clients, and the method comprises the following steps:
receiving a first access token application request aiming at a target third-party platform forwarded by the game server; the first access token application request is generated by the game client in response to an access instruction aiming at the target third-party platform, and is forwarded by the game server after inquiring that first historical access token information aiming at the target third-party platform in first local cache data is not in a valid period;
inquiring second historical access token information aiming at the target third-party platform in second local cache data of the central server according to the first access token application request, and judging whether the second historical access token information is in the validity period;
returning one of second historical access token information and latest access token information aiming at the target third-party platform to the game server according to a second judgment result, so that after the game server forwards the second historical access token information or the latest access token information to the game client, the game client accesses the target third-party platform by adopting the second historical access token information or the latest access token information; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
Optionally, the returning one of second historical access token information and latest access token information for the target third-party platform to the game server according to a second determination result includes:
and if the second historical access token information is in the validity period, sending the second historical access token information aiming at the target third-party platform to the game server.
Optionally, the returning, to the game server according to a second determination result, one of second historical access token information and latest access token information for the target third-party platform includes:
if the second historical access token information is not in the validity period, generating and sending a second access token application request aiming at the target third-party platform to the target third-party platform;
and receiving the latest access token information aiming at the second access token application request returned by the target third-party platform, and forwarding the latest access token information aiming at the target third-party platform to the game server.
Optionally, after receiving the latest access token information returned by the target third-party platform for the second access token application request, the method further includes:
and updating the latest access token information into the second local cache data, and recording the updating time.
The embodiment of the invention also discloses a third party platform access device, which is applied to a game client, wherein the game client is in communication connection with a game server, the game server is in communication connection with a central server, and the device comprises:
the generation module is used for responding to an access instruction aiming at a target third-party platform and generating a first access token application request aiming at the target third-party platform;
a sending module, configured to send the first access token application request to the game server;
the first receiving module is used for receiving one of first historical access token information, second historical access token information and latest access token information which are returned by the game server and aim at the target third-party platform; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements;
and the access module is used for accessing the target third-party platform by adopting the first historical access token information or the second historical access token information or the latest access token information.
Optionally, the first receiving module includes:
the first receiving submodule is used for receiving the first historical access token information which is sent by the game server and aims at the target third-party platform if the first historical access token information which aims at the target third-party platform in the first local cache data of the game server is inquired to be in the validity period; and the game server inquires that the first historical access token information aiming at the target third-party platform in the first local cache data is sent after the first historical access token information is valid.
Optionally, the first receiving module includes:
a second receiving submodule, configured to receive second historical access token information, which is forwarded by the game server and is intended for the target third-party platform, if it is queried that the first historical access token information, which is intended for the target third-party platform, in the first local cache data of the game server is not in a validity period and it is queried that the second historical access token information, which is intended for the target third-party platform, in the second local cache data of the central server is in a validity period; and the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is sent after the second historical access token information is valid.
Optionally, the first receiving module includes:
a third receiving submodule, configured to receive the latest access token information for the target third-party platform forwarded by the game server if it is found that the first historical access token information for the target third-party platform in the first local cache data of the game server is not in a validity period and it is found that the second historical access token information for the target third-party platform in the second local cache data of the central server is not in a validity period; the latest access token information is provided for the target third-party platform according to the received second access token application request; and the second access token application request is generated and sent after the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is not in the valid period.
Optionally, the generating module includes:
a determining submodule, configured to determine, in response to the access instruction for the target third-party platform, an access type of the target third-party platform;
the generation submodule is used for generating the first access token application request aiming at the target third-party platform if the access type is a first access type; the first access type is a type having an access frequency limit.
The embodiment of the invention also discloses a third party platform access device, which is applied to a game server, wherein the game server is in communication connection with a plurality of game clients, and is in communication connection with a central server, and the device comprises:
the second receiving module is used for receiving a first access token application request aiming at a target third-party platform and sent by the game client; the first access token application request is generated by the game client in response to an access instruction for the target third party platform;
the first query module is used for querying first historical access token information aiming at the target third-party platform in first local cache data of the game server according to the first access token application request and judging whether the first historical access token information is in the validity period;
a first returning module, configured to return one of first historical access token information, second historical access token information, and latest access token information for the target third-party platform to the game client according to a first determination result, so that the game client accesses the target third-party platform by using the first historical access token information, the second historical access token information, or the latest access token information; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
Optionally, the first returning module includes:
and the first sending submodule is used for sending the first historical access token information aiming at the target third-party platform to the game client side if the first historical access token information is in the validity period.
Optionally, the first returning module includes:
the second sending submodule is used for forwarding the first access token application request to the central server if the first historical access token information is not in the validity period;
a fourth receiving submodule, configured to receive one of the second historical access token information and the latest access token information, which is returned by the central server and is for the target third-party platform;
a third sending submodule, configured to forward one of the second historical access token information and the latest access token information for the target third-party platform to the game client.
Optionally, the fourth receiving sub-module includes:
a first receiving unit, configured to receive second historical access token information, which is sent by the central server and is intended for the target third-party platform, if it is found that the second historical access token information, which is intended for the target third-party platform, in second local cache data of the central server is in a validity period; and the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is sent after the second historical access token information is valid.
Optionally, the fourth receiving sub-module includes:
a second receiving unit, configured to receive the latest access token information for the target third-party platform forwarded by the central server if it is found that the second historical access token information for the target third-party platform in the second local cache data of the central server is not in the validity period; the latest access token information is provided for the target third-party platform according to the received second access token application request; and the second access token application request is generated and sent after the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is not in the valid period.
Optionally, the apparatus further comprises:
and the first updating module is used for updating the latest access token information into the first local cache data.
The embodiment of the invention also discloses a third-party platform access device, which is applied to a central server, wherein the central server is in communication connection with a game server, the game server is in communication connection with a plurality of game clients, and the device comprises:
the third receiving module is used for receiving a first access token application request which is forwarded by the game server and aims at a target third-party platform; the first access token application request is generated by the game client in response to an access instruction aiming at the target third-party platform, and is forwarded by the game server after inquiring that first historical access token information aiming at the target third-party platform in first local cache data is not in a valid period;
the second query module is used for querying second historical access token information aiming at the target third-party platform in second local cache data of the central server according to the first access token application request and judging whether the second historical access token information is in the validity period;
a second returning module, configured to return one of second historical access token information and latest access token information for the target third-party platform to the game server according to a second determination result, so that after the game server forwards the second historical access token information or the latest access token information to the game client, the game client accesses the target third-party platform by using the second historical access token information or the latest access token information; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
Optionally, the second returning module includes:
and the fourth sending submodule is used for sending the second historical access token information aiming at the target third-party platform to the game server if the second historical access token information is in the validity period.
Optionally, the second returning module includes:
a fifth sending submodule, configured to generate and send a second access token application request for the target third-party platform to the target third-party platform if the second historical access token information is not in the validity period;
and the fifth receiving submodule is used for receiving the latest access token information which is returned by the target third-party platform and aims at the second access token application request, and forwarding the latest access token information aiming at the target third-party platform to the game server.
Optionally, the apparatus further comprises:
and the second updating module is used for updating the latest access token information into the second local cache data and recording the updating time.
The embodiment of the invention also discloses an electronic device, which comprises: a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program when executed by the processor implementing the steps of a third party platform access method as described above.
The embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the third party platform access method are realized.
The embodiment of the invention has the following advantages:
in the embodiment of the present invention, when a game client needs to access a third party platform, first historical access token information for the third party platform may be acquired from a game server in communication connection with the game client, or second historical access token information for the third party platform may be acquired from a central server in communication connection with the game server, and when the first historical access token information and the second historical access token information do not meet a requirement, the central server may acquire latest access token information from the third party platform. By adopting the method, a third-party platform access strategy based on the game server and the central server is provided, a cache mechanism of the two layers of servers is provided, the game client side directly accesses the third-party platform to be optimized to access the third-party platform through the central server, all accesses to the third-party platform are initiated by the central server, the access frequency aiming at the third-party platform can be greatly reduced, and the pressure of the third-party platform server is reduced.
Drawings
FIG. 1 is a schematic diagram of access frequency limitations for a third party platform;
FIG. 2 is a flowchart illustrating steps of a third party platform access method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating steps of another third party platform access method according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating steps of a third party platform access method according to an embodiment of the present invention;
fig. 5 is a block diagram of a third-party platform access device according to an embodiment of the present invention;
fig. 6 is a block diagram of another third party platform access device according to an embodiment of the present invention;
fig. 7 is a block diagram of a third-party platform access device according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of them. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present invention.
The game development can be generally divided into a server and a client, and in the game development, the client often needs to access a third-party platform, for example, a third-party live platform or a third-party payment platform in the game, so as to embed an application of the third-party platform in the game. The existing access method is that a client directly calls a third-party platform interface to be in butt joint with a third-party platform server, and the method is suitable for most situations, but if the third-party platform has limitation on access frequency, and when more game players are used, the client used by each game player needs to call the third-party platform interface, so that the access frequency of the third-party platform can reach the upper limit, and the third-party service cannot be normally used.
Referring to fig. 1, a schematic diagram of access frequency limitation for a third party platform is shown. For the "token acquisition interface of item 3 in the figure is limited 500 times per day", that is, it means that the third party platform has an access frequency limit of 500 times per day, for example, in game development, when a certain game is accessed to the third party platform, an enterprise developer specific account needs to be applied to the third party platform for opening, all players of the game share the account to access the third party platform, and the access frequency of accessing the third party platform through the account is at most 500 times per day.
The third-party platform interface has an access frequency limit, and when a game developer develops, if logic for accessing a token (token, computer term) is implemented at a game client, when a large number of game players exist and the number of concurrent requests of the game player client is high, the access frequency limit of the third-party platform may be exceeded, which easily causes an exception or error returned by the third-party platform interface, and the third-party service is unavailable.
One of the core ideas of the embodiments of the present invention is that when a game client needs to access a third-party platform, first historical access token information for the third-party platform may be acquired from a game server in communication connection with the game client, or second historical access token information for the third-party platform may be acquired from a central server in communication connection with the game server, and when the first historical access token information and the second historical access token information do not meet a requirement, the central server may acquire latest access token information from the third-party platform. By adopting the method, a third-party platform access strategy based on the game server and the central server is provided, a cache mechanism of the two layers of servers is provided, the game client side directly accesses the third-party platform to be optimized to access the third-party platform through the central server, all accesses to the third-party platform are initiated by the central server, the access frequency aiming at the third-party platform can be greatly reduced, and the pressure of the third-party platform server is reduced.
A third party platform access method provided by the present application is described in detail below from the perspective of a game client.
Referring to fig. 2, a flowchart illustrating steps of a third party platform access method according to an embodiment of the present invention is shown, and is applied to a game client, where the game client is in communication connection with a game server, and the game server is in communication connection with a central server, where the method specifically includes the following steps:
step 201, responding to an access instruction for a target third-party platform, and generating a first access token application request for the target third-party platform.
The third-party platform access method can be applied to a scene that a game development game client accesses the third-party platform. The type of game may be a role playing game, an action game, an adventure game, a strategy game, and the like. The game client may be a client used by a game player. The game server may be a server programmed with the corresponding code and the creation of rules for playing the game. The game client may be communicatively coupled to the game server. Preferably, one game client is communicatively connected to only one game server, and one game server may be communicatively connected to a plurality of game clients.
In an embodiment of the present invention, a central server is further provided, the central server may be in communication with the game server, the central server is a globally unique server, and all accesses to the third party platform are initiated via the central server.
The third-party platform may include a third-party live broadcast platform, a third-party payment platform, a third-party video service platform, and the like, and accessing the game client to the third-party platform may enable the game client to call a third-party service provided by an API (Application Programming Interface) of the third-party platform. For example, for the third party payment platform, the interface document may be provided to the merchant needing cooperation, and then the merchant may interface the interface document into its own application, so as to implement functions of the merchant application invoking online payment of the third party payment platform, and the like.
In the method, when the game client needs to call a target third-party platform interface, a request is sent to a connected game server, namely a first access token application request for applying an access token for the target third-party platform can be generated and sent according to an access instruction of a user.
In an alternative embodiment of the present application, for step 201, the following sub-steps may be performed:
sub-step S11, in response to the access instruction for the target third party platform, determining an access type of the target third party platform.
And a substep S12, if the access type is a first access type, generating the first access token application request for the target third party platform.
Wherein the first access type is a type having an access frequency limit.
In specific implementation, after the access type of the target third-party platform is determined to be the type with the access frequency limitation, a corresponding first access token application request is generated. When the game is developed and accessed to the third-party platform, whether access frequency limitation exists or not is clearly stated in the technical document of the third-party platform. Thus, the type of access of the target third party platform may be determined by querying the technical documentation of the target third party platform.
In addition, if the access type of the target third-party platform is not the first access type and does not have access frequency limitation, the target third-party platform interface can be directly called to access the target third-party platform.
Step 202, sending the first access token application request to the game server.
In the embodiment of the present invention, after generating the first access token application request, the game client may send the first access token application request to the game server. Different from the prior art, the game client does not directly access the target third-party platform through the target third-party platform interface, but firstly sends the first access token application request to the game server to inquire whether the effective access token exists.
Step 203, receiving one of the first historical access token information, the second historical access token information and the latest access token information which are returned by the game server and aim at the target third-party platform.
Wherein the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
In the embodiment of the invention, the game client can receive the access token information returned by the game server, and the method specifically comprises three conditions, wherein one condition is the first historical access token information stored in the game server; one is second historical access token information stored in the central server; and the current central server applies for the latest acquired access token information from the target third-party platform.
It is understood that before the game client of the current user applies for the access token for the target third-party platform, the game clients of other users also apply for the access token for the target third-party platform, and cache the obtained access token information in the game server or the central server. Therefore, when the game client of the current user applies for the access token for the target third-party platform, whether the first historical access token information or the second historical access token information meets the requirement or not can be firstly inquired from the game server or the central server, and specifically, whether the inquiry is valid or not can be judged. And under the condition that the requirement is not met, obtaining the latest access token information from the target third-party platform through the central server.
In an alternative embodiment of the present application, for step 203, the following sub-steps may be performed:
and a substep S21, receiving the first historical access token information for the target third-party platform sent by the game server if the first historical access token information for the target third-party platform in the first local cache data of the game server is in the validity period.
The game server inquires the first local cache data, and the first historical access token information aiming at the target third-party platform is sent after the first historical access token information is valid.
And a substep S22, if it is found that the first historical access token information for the target third-party platform in the first local cache data of the game server is not in the validity period and it is found that the second historical access token information for the target third-party platform in the second local cache data of the central server is in the validity period, receiving the second historical access token information for the target third-party platform forwarded by the game server.
And querying the second historical access token information in the second local cache data by the central server, wherein the second historical access token information aiming at the target third-party platform is sent after the second historical access token information is valid.
And a substep S23, receiving the latest access token information for the target third party platform forwarded by the game server if the first historical access token information for the target third party platform in the first local cache data of the game server is not in the validity period and the second historical access token information for the target third party platform in the second local cache data of the central server is not in the validity period.
The latest access token information is provided by the target third-party platform according to the received second access token application request; and the central server inquires second local cache data, generates and sends second historical access token information aiming at the target third-party platform in the second local cache data after the second access token application request is not in the valid period.
In a specific embodiment, after receiving the first access token application request, the game server firstly queries whether the first historical access token information in the local cache is in the valid period, and if so, directly returns the first historical access token information to the game client. If the first historical access token information in the game server is not within the validity period, the game server sends the request to the central server. And after receiving the request sent by the game server, the central server inquires whether the second historical access token information in the local cache is in the valid period, and if so, directly returns the second historical access token information to the requested game server. And if the second historical access token information in the central server is not within the validity period, the central server requests the latest token data from the target third-party platform, updates the local cache after obtaining the latest access token information provided by the target third-party platform, and returns the latest access token information to the game server. And after receiving the latest access token information returned by the central server, the game server returns the latest access token information to the game client.
And 204, accessing the target third-party platform by using the first historical access token information or the second historical access token information or the latest access token information.
In the embodiment of the invention, the game client can adopt one of the valid first historical access token information or the second historical access token information or the latest access token information for access.
In summary, in the embodiment of the present invention, when a game client needs to access a third-party platform, first historical access token information for the third-party platform may be acquired from a game server in communication connection with the game client, or second historical access token information for the third-party platform may be acquired from a central server in communication connection with the game server, and when the first historical access token information and the second historical access token information do not meet a requirement, the central server may acquire the latest access token information from the third-party platform. By adopting the method, a third-party platform access strategy based on the game server and the central server is provided, a cache mechanism of two layers of servers is provided, the game client side directly accesses the third-party platform to be optimized to access the third-party platform through the central server, all accesses to the third-party platform are initiated by the central server, the access frequency to the third-party platform can be greatly reduced, and the pressure of the third-party platform server is reduced. The game client is not directly connected with a third-party platform, but accesses the platform interface through the middle layer of the server, and as the number of game servers of a game is possibly large, in order to prevent the game servers from exceeding the upper limit of the access frequency, a globally unique central server is added, and all accesses to the third-party platform are initiated by the central server.
The third party platform access method provided by the present application is described below from the perspective of a game server, and for avoiding repetition, only a brief description is provided here, and the specific implementation process of the method may refer to the process described from the perspective of a game client.
Referring to fig. 3, a flowchart illustrating steps of another third party platform access method provided in an embodiment of the present invention is applied to a game server, where the game server is in communication connection with a plurality of game clients, and the game server is in communication connection with a central server, and specifically includes the following steps:
step 301, receiving a first access token application request for a target third party platform sent by the game client.
Wherein the first access token application request is generated by the game client in response to an access instruction for the target third party platform.
Step 302, inquiring first historical access token information aiming at the target third-party platform in first local cache data of the game server according to the first access token application request, and judging whether the first historical access token information is in a validity period.
Step 303, returning one of first historical access token information, second historical access token information and latest access token information for the target third-party platform to the game client according to the first determination result, so that the game client accesses the target third-party platform by using the first historical access token information, the second historical access token information or the latest access token information.
Wherein the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
The first judgment result is a judgment result of whether the first historical access token information is in the validity period.
In an alternative embodiment of the present invention, for step 303, the following steps may be performed:
and if the first historical access token information is in the validity period, sending the first historical access token information aiming at the target third-party platform to the game client.
If the first historical access token information is not in the validity period, forwarding the first access token application request to the central server; receiving one of the second historical access token information and the latest access token information for the target third party platform returned by the central server; forwarding one of the second historical access token information and the most recent access token information for the target third party platform to the game client.
In an optional embodiment of the present invention, the receiving one of the second historical access token information and the latest access token information for the target third party platform returned by the central server includes:
if the second historical access token information aiming at the target third-party platform in the second local cache data of the central server is inquired to be in the valid period, the second historical access token information aiming at the target third-party platform sent by the central server is received.
And querying the second historical access token information in the second local cache data by the central server, wherein the second historical access token information aiming at the target third-party platform is sent after the second historical access token information is valid.
And if the second historical access token information aiming at the target third-party platform in the second local cache data of the central server is not in the validity period, receiving the latest access token information aiming at the target third-party platform forwarded by the central server.
The latest access token information is provided by the target third-party platform according to the received second access token application request; and the central server inquires second local cache data, generates and sends second historical access token information aiming at the target third-party platform in the second local cache data after the second access token application request is not in the valid period.
In an optional embodiment of the present invention, after receiving the latest access token information for the target third party platform forwarded by the central server, the method further includes:
updating the latest access token information into the first local cache data.
By caching the latest access token information, the number of communications between the game server and the central server can be reduced, and the game client can directly obtain the valid token from the connected game server without the need for the game server to obtain the token from the central server each time.
In summary, in the embodiment of the present invention, when a game client needs to access a third-party platform, first historical access token information for the third-party platform may be acquired from a game server in communication connection with the game client, or second historical access token information for the third-party platform may be acquired from a central server in communication connection with the game server, and when the first historical access token information and the second historical access token information do not meet a requirement, the central server may acquire the latest access token information from the third-party platform. By adopting the method, a third-party platform access strategy based on the game server and the central server is provided, a cache mechanism of the two layers of servers is provided, the game client side directly accesses the third-party platform to be optimized to access the third-party platform through the central server, all accesses to the third-party platform are initiated by the central server, the access frequency aiming at the third-party platform can be greatly reduced, and the pressure of the third-party platform server is reduced.
The third party platform access method provided by the present application is described below from the perspective of a central server, and for the sake of avoiding repetition, only a brief description is given here, and the specific implementation process of the method may refer to the process described from the perspective of a game client or a game server.
Referring to fig. 4, a flowchart illustrating steps of still another third party platform access method provided in an embodiment of the present invention is applied to a central server, where the central server is in communication connection with a game server, and the game server is in communication connection with a plurality of game clients, and specifically includes the following steps:
step 401, receiving a first access token application request for a target third-party platform forwarded by the game server.
The game server inquires that first historical access token information aiming at the target third-party platform in the first local cache data is not forwarded after the first historical access token information is valid.
Step 402, inquiring second historical access token information aiming at the target third-party platform in second local cache data of the central server according to the first access token application request, and judging whether the second historical access token information is in a validity period.
Step 403, returning one of second historical access token information and latest access token information for the target third-party platform to the game server according to a second judgment result, so that after the game server forwards the second historical access token information or the latest access token information to the game client, the game client accesses the target third-party platform by using the second historical access token information or the latest access token information.
Wherein the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
The second determination result is a determination result regarding whether the second history access token information is in the validity period.
In an alternative embodiment of the present invention, for step 403, the following steps may be performed:
and if the second historical access token information is in the validity period, sending the second historical access token information aiming at the target third-party platform to the game server.
If the second historical access token information is not in the validity period, generating and sending a second access token application request aiming at the target third-party platform to the target third-party platform; and receiving the latest access token information aiming at the second access token application request returned by the target third-party platform, and forwarding the latest access token information aiming at the target third-party platform to the game server.
In an optional embodiment of the present invention, after receiving the latest access token information returned by the target third party platform for the second access token application request, the method further includes:
and updating the latest access token information into the second local cache data, and recording the updating time.
In the embodiment of the present invention, the obtained latest access token information may be cached in the central server.
In summary, in the embodiment of the present invention, when a game client needs to access a third-party platform, first historical access token information for the third-party platform may be acquired from a game server in communication connection with the game client, or second historical access token information for the third-party platform may be acquired from a central server in communication connection with the game server, and when the first historical access token information and the second historical access token information do not meet a requirement, the central server may acquire the latest access token information from the third-party platform. By adopting the method, a third-party platform access strategy based on the game server and the central server is provided, a cache mechanism of the two layers of servers is provided, the game client side directly accesses the third-party platform to be optimized to access the third-party platform through the central server, all accesses to the third-party platform are initiated by the central server, the access frequency aiming at the third-party platform can be greatly reduced, and the pressure of the third-party platform server is reduced.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 5, a block diagram of a third party platform access device according to an embodiment of the present invention is shown, and is applied to a game client, where the game client is communicatively connected to a game server, and the game server is communicatively connected to a central server, where the third party platform access device specifically includes the following modules:
a generating module 501, configured to generate a first access token application request for a target third-party platform in response to an access instruction for the target third-party platform;
a sending module 502, configured to send the first access token application request to the game server;
a first receiving module 503, configured to receive one of first historical access token information, second historical access token information, and latest access token information, which is returned by the game server and is for the target third-party platform; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements;
an accessing module 504, configured to access the target third-party platform by using the first historical access token information or the second historical access token information or the latest access token information.
In an embodiment of the present invention, the first receiving module includes:
the first receiving submodule is used for receiving the first historical access token information which is sent by the game server and aims at the target third-party platform if the first historical access token information which aims at the target third-party platform in the first local cache data of the game server is inquired to be in the validity period; and the game server inquires that the first historical access token information aiming at the target third-party platform in the first local cache data is sent after the first historical access token information is valid.
In an embodiment of the present invention, the first receiving module includes:
a second receiving submodule, configured to receive second historical access token information, which is forwarded by the game server and is intended for the target third-party platform, if it is queried that the first historical access token information, which is intended for the target third-party platform, in the first local cache data of the game server is not in a validity period and it is queried that the second historical access token information, which is intended for the target third-party platform, in the second local cache data of the central server is in a validity period; and the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is sent after the second historical access token information is valid.
In an embodiment of the present invention, the first receiving module includes:
a third receiving submodule, configured to receive the latest access token information for the target third-party platform forwarded by the game server if it is found that the first historical access token information for the target third-party platform in the first local cache data of the game server is not in a validity period and it is found that the second historical access token information for the target third-party platform in the second local cache data of the central server is not in a validity period; the latest access token information is provided for the target third-party platform according to the received second access token application request; and the second access token application request is generated and sent after the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is not in the valid period.
In an embodiment of the present invention, the generating module includes:
a determining submodule, configured to determine, in response to the access instruction for the target third-party platform, an access type of the target third-party platform;
the generation submodule is used for generating the first access token application request aiming at the target third-party platform if the access type is a first access type; the first access type is a type having an access frequency limit.
In summary, in the embodiment of the present invention, when a game client needs to access a third-party platform, first historical access token information for the third-party platform may be acquired from a game server in communication connection with the game client, or second historical access token information for the third-party platform may be acquired from a central server in communication connection with the game server, and when the first historical access token information and the second historical access token information do not meet a requirement, the central server may acquire the latest access token information from the third-party platform. By adopting the method, a third-party platform access strategy based on the game server and the central server is provided, a cache mechanism of the two layers of servers is provided, the game client side directly accesses the third-party platform to be optimized to access the third-party platform through the central server, all accesses to the third-party platform are initiated by the central server, the access frequency aiming at the third-party platform can be greatly reduced, and the pressure of the third-party platform server is reduced.
Referring to fig. 6, a block diagram of another third party platform access device according to an embodiment of the present invention is shown, and is applied to a game server, where the game server is communicatively connected to a plurality of game clients, and the game server is communicatively connected to a central server, and specifically includes the following modules:
a second receiving module 601, configured to receive a first access token application request for a target third-party platform sent by the game client; the first access token application request is generated by the game client in response to an access instruction for the target third party platform;
a first query module 602, configured to query, according to the first access token application request, first historical access token information for the target third-party platform in first local cache data of the game server, and determine whether the first historical access token information is in a validity period;
a first returning module 603, configured to return one of first historical access token information, second historical access token information, and latest access token information for the target third-party platform to the game client according to a first determination result, so that the game client accesses the target third-party platform by using the first historical access token information, the second historical access token information, or the latest access token information; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is obtained from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
In an embodiment of the present invention, the first returning module includes:
and the first sending submodule is used for sending the first historical access token information aiming at the target third-party platform to the game client side if the first historical access token information is in the validity period.
In an embodiment of the present invention, the first returning module includes:
the second sending submodule is used for forwarding the first access token application request to the central server if the first historical access token information is not in the validity period;
a fourth receiving submodule, configured to receive one of the second historical access token information and the latest access token information, which is returned by the central server and is for the target third-party platform;
a third sending submodule, configured to forward one of the second historical access token information and the latest access token information for the target third-party platform to the game client.
In this embodiment of the present invention, the fourth receiving sub-module includes:
a first receiving unit, configured to receive second historical access token information, which is sent by the central server and is intended for the target third-party platform, if it is found that the second historical access token information, which is intended for the target third-party platform, in second local cache data of the central server is in a validity period; and the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is sent after the second historical access token information is valid.
In this embodiment of the present invention, the fourth receiving sub-module includes:
a second receiving unit, configured to receive the latest access token information for the target third-party platform forwarded by the central server if it is found that the second historical access token information for the target third-party platform in the second local cache data of the central server is not in the validity period; the latest access token information is provided for the target third-party platform according to the received second access token application request; and the second access token application request is generated and sent after the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is not in the valid period.
In an embodiment of the present invention, the apparatus further includes:
and the first updating module is used for updating the latest access token information into the first local cache data.
In summary, in the embodiment of the present invention, when a game client needs to access a third-party platform, first historical access token information for the third-party platform may be acquired from a game server in communication connection with the game client, or second historical access token information for the third-party platform may be acquired from a central server in communication connection with the game server, and when the first historical access token information and the second historical access token information do not meet a requirement, the central server may acquire the latest access token information from the third-party platform. By adopting the method, a third-party platform access strategy based on the game server and the central server is provided, a cache mechanism of the two layers of servers is provided, the game client side directly accesses the third-party platform to be optimized to access the third-party platform through the central server, all accesses to the third-party platform are initiated by the central server, the access frequency aiming at the third-party platform can be greatly reduced, and the pressure of the third-party platform server is reduced.
Referring to fig. 7, a block diagram of a third-party platform access device according to an embodiment of the present invention is shown, and is applied to a central server, where the central server is communicatively connected to a game server, and the game server is communicatively connected to a plurality of game clients, where the third-party platform access device specifically includes the following modules:
a third receiving module 701, configured to receive a first access token application request for a target third-party platform forwarded by the game server; the first access token application request is generated by the game client in response to an access instruction aiming at the target third-party platform, and is forwarded by the game server after inquiring that first historical access token information aiming at the target third-party platform in first local cache data is not in a valid period;
a second query module 702, configured to query, according to the first access token application request, second historical access token information for the target third-party platform in second local cache data of the central server, and determine whether the second historical access token information is in a validity period;
a second returning module 703, configured to return one of second historical access token information and latest access token information for the target third-party platform to the game server according to a second determination result, so that after the game server forwards the second historical access token information or the latest access token information to the game client, the game client accesses the target third-party platform by using the second historical access token information or the latest access token information; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is obtained from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
In an embodiment of the present invention, the second returning module includes:
and the fourth sending submodule is used for sending the second historical access token information aiming at the target third-party platform to the game server if the second historical access token information is in the validity period.
In an embodiment of the present invention, the second returning module includes:
a fifth sending submodule, configured to generate and send a second access token application request for the target third-party platform to the target third-party platform if the second historical access token information is not in the validity period;
and the fifth receiving submodule is used for receiving the latest access token information which is returned by the target third-party platform and aims at the second access token application request, and forwarding the latest access token information aiming at the target third-party platform to the game server.
In an embodiment of the present invention, the apparatus further includes:
and the second updating module is used for updating the latest access token information into the second local cache data and recording the updating time.
In summary, in the embodiment of the present invention, when a game client needs to access a third-party platform, first historical access token information for the third-party platform may be acquired from a game server in communication connection with the game client, or second historical access token information for the third-party platform may be acquired from a central server in communication connection with the game server, and when the first historical access token information and the second historical access token information do not meet a requirement, the central server may acquire the latest access token information from the third-party platform. By adopting the method, a third-party platform access strategy based on the game server and the central server is provided, a cache mechanism of the two layers of servers is provided, the game client side directly accesses the third-party platform to be optimized to access the third-party platform through the central server, all accesses to the third-party platform are initiated by the central server, the access frequency aiming at the third-party platform can be greatly reduced, and the pressure of the third-party platform server is reduced.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, including: the third-party platform access method comprises a processor, a memory and a computer program which is stored in the memory and can run on the processor, wherein when the computer program is executed by the processor, each process of the third-party platform access method embodiment is realized, the same technical effect can be achieved, and in order to avoid repetition, the details are not repeated.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements each process of the third-party platform access method embodiment, and can achieve the same technical effect, and is not described herein again to avoid repetition.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "include", "including" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or terminal device including a series of elements includes not only those elements but also other elements not explicitly listed or inherent to such process, method, article, or terminal device. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The third-party platform access method, the third-party platform access device, the electronic device and the computer-readable storage medium provided by the present invention are described in detail above, and specific examples are applied in this document to explain the principles and embodiments of the present invention, and the descriptions of the above embodiments are only used to help understand the method and the core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (20)

1. A third party platform access method for a game client, the game client communicatively coupled to a game server, the game server communicatively coupled to a central server, the method comprising:
responding to an access instruction aiming at a target third-party platform, and generating a first access token application request aiming at the target third-party platform;
sending the first access token application request to the game server;
receiving one of first historical access token information, second historical access token information and latest access token information which are returned by the game server and aim at the target third-party platform; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements;
and accessing the target third-party platform by adopting the first historical access token information or the second historical access token information or the latest access token information.
2. The method of claim 1, wherein the receiving one of first historical access token information, second historical access token information, and latest access token information returned by the game server for the target third party platform comprises:
if the first historical access token information aiming at the target third-party platform in the first local cache data of the game server is inquired to be in the validity period, receiving the first historical access token information aiming at the target third-party platform sent by the game server; and the game server inquires that the first historical access token information aiming at the target third-party platform in the first local cache data is sent after the first historical access token information is valid.
3. The method of claim 1, wherein the receiving one of first historical access token information, second historical access token information, and most recent access token information returned by the game server for the target third-party platform comprises:
if the first historical access token information aiming at the target third-party platform in the first local cache data of the game server is not in the validity period and the second historical access token information aiming at the target third-party platform in the second local cache data of the central server is in the validity period, receiving the second historical access token information aiming at the target third-party platform forwarded by the game server; and the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is sent after the second historical access token information is valid.
4. The method of claim 1, wherein the receiving one of first historical access token information, second historical access token information, and most recent access token information returned by the game server for the target third-party platform comprises:
if the first historical access token information aiming at the target third-party platform in the first local cache data of the game server is not in the validity period and the second historical access token information aiming at the target third-party platform in the second local cache data of the central server is not in the validity period, receiving the latest access token information aiming at the target third-party platform forwarded by the game server; the latest access token information is provided for the target third-party platform according to the received second access token application request; and the second access token application request is generated and sent after the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is not in the valid period.
5. The method of claim 1, wherein generating a first access token application request for a target third-party platform in response to an access instruction for the target third-party platform comprises:
determining, in response to the access instruction for the target third party platform, an access type of the target third party platform;
if the access type is a first access type, generating a first access token application request aiming at the target third-party platform; the first access type is a type having an access frequency limit.
6. A third party platform access method for use with a game server communicatively coupled to a plurality of game clients, the game server communicatively coupled to a central server, the method comprising:
receiving a first access token application request aiming at a target third-party platform, which is sent by the game client; the first access token application request is generated by the game client in response to an access instruction for the target third party platform;
inquiring first historical access token information aiming at the target third-party platform in first local cache data of the game server according to the first access token application request, and judging whether the first historical access token information is in the validity period;
returning one of first historical access token information, second historical access token information and latest access token information aiming at the target third-party platform to the game client according to the first judgment result so that the game client accesses the target third-party platform by adopting the first historical access token information or the second historical access token information or the latest access token information; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
7. The method of claim 6, wherein returning one of first historical access token information, second historical access token information, and latest access token information for the target third-party platform to the game client according to the first determination comprises:
and if the first historical access token information is in the validity period, sending the first historical access token information aiming at the target third-party platform to the game client.
8. The method of claim 6, wherein returning one of first historical access token information, second historical access token information, and latest access token information for the target third-party platform to the game client according to the first determination comprises:
if the first historical access token information is not in the validity period, forwarding the first access token application request to the central server;
receiving one of the second historical access token information and the latest access token information for the target third party platform returned by the central server;
forwarding one of the second historical access token information and the most recent access token information for the target third party platform to the game client.
9. The method of claim 8, wherein the receiving one of the second historical access token information and the most recent access token information returned by the central server for the target third party platform comprises:
if the second historical access token information aiming at the target third-party platform in the second local cache data of the central server is inquired to be in the validity period, receiving the second historical access token information aiming at the target third-party platform sent by the central server; and the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is sent after the second historical access token information is valid.
10. The method of claim 8, wherein the receiving one of the second historical access token information and the most recent access token information returned by the central server for the target third party platform comprises:
if the second historical access token information aiming at the target third-party platform in the second local cache data of the central server is not in the validity period, receiving the latest access token information aiming at the target third-party platform forwarded by the central server; the latest access token information is provided for the target third-party platform according to the received second access token application request; and the second access token application request is generated and sent after the central server inquires that the second historical access token information aiming at the target third-party platform in the second local cache data is not in the valid period.
11. The method of claim 10, wherein after receiving the latest access token information for the target third party platform forwarded by the central server, further comprising:
updating the latest access token information into the first local cache data.
12. A third party platform access method, applied to a central server, the central server being communicatively coupled to a game server, the game server being communicatively coupled to a plurality of game clients, the method comprising:
receiving a first access token application request aiming at a target third-party platform forwarded by the game server; the first access token application request is generated by the game client in response to an access instruction aiming at the target third-party platform, and is forwarded by the game server after inquiring that first historical access token information aiming at the target third-party platform in first local cache data is not in a valid period;
inquiring second historical access token information aiming at the target third-party platform in second local cache data of the central server according to the first access token application request, and judging whether the second historical access token information is in the validity period;
returning one of second historical access token information and latest access token information aiming at the target third-party platform to the game server according to a second judgment result, so that after the game server forwards the second historical access token information or the latest access token information to the game client, the game client accesses the target third-party platform by adopting the second historical access token information or the latest access token information; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
13. The method of claim 12, wherein returning one of second historical access token information and latest access token information for the target third-party platform to the game server according to a second determination result comprises:
and if the second historical access token information is in the validity period, sending the second historical access token information aiming at the target third-party platform to the game server.
14. The method of claim 12, wherein returning one of second historical access token information and latest access token information for the target third-party platform to the game server according to a second determination result comprises:
if the second historical access token information is not in the validity period, generating and sending a second access token application request aiming at the target third-party platform to the target third-party platform;
and receiving the latest access token information aiming at the second access token application request returned by the target third-party platform, and forwarding the latest access token information aiming at the target third-party platform to the game server.
15. The method of claim 14, wherein after receiving the latest access token information returned by the target third party platform for the second access token application request, further comprising:
and updating the latest access token information into the second local cache data, and recording the updating time.
16. A third party platform access device for use with a game client, the game client communicatively coupled to a game server, the game server communicatively coupled to a central server, the device comprising:
the generation module is used for responding to an access instruction aiming at a target third-party platform and generating a first access token application request aiming at the target third-party platform;
a sending module, configured to send the first access token application request to the game server;
the first receiving module is used for receiving one of first historical access token information, second historical access token information and latest access token information which are returned by the game server and aim at the target third-party platform; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements;
and the access module is used for accessing the target third-party platform by adopting the first historical access token information or the second historical access token information or the latest access token information.
17. A third party platform access device for use with a game server, the game server communicatively coupled to a plurality of game clients, the game server communicatively coupled to a central server, the device comprising:
the second receiving module is used for receiving a first access token application request aiming at a target third-party platform and sent by the game client; the first access token application request is generated by the game client in response to an access instruction for the target third party platform;
the first query module is used for querying first historical access token information aiming at the target third-party platform in first local cache data of the game server according to the first access token application request and judging whether the first historical access token information is in the validity period;
a first returning module, configured to return one of first historical access token information, second historical access token information, and latest access token information for the target third-party platform to the game client according to a first determination result, so that the game client accesses the target third-party platform by using the first historical access token information, the second historical access token information, or the latest access token information; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is obtained from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
18. A third party platform access device for use with a central server communicatively coupled to a game server communicatively coupled to a plurality of game clients, the device comprising:
the third receiving module is used for receiving a first access token application request which is forwarded by the game server and aims at a target third-party platform; the first access token application request is generated by the game client in response to an access instruction aiming at the target third-party platform, and is forwarded by the game server after inquiring that first historical access token information aiming at the target third-party platform in first local cache data is not in a valid period;
the second query module is used for querying second historical access token information aiming at the target third-party platform in second local cache data of the central server according to the first access token application request and judging whether the second historical access token information is in the validity period;
a second returning module, configured to return one of second historical access token information and latest access token information for the target third-party platform to the game server according to a second determination result, so that after the game server forwards the second historical access token information or the latest access token information to the game client, the game client accesses the target third-party platform by using the second historical access token information or the latest access token information; the first historical access token information is stored by the game server; the second historical access token information is stored by the central server; and the latest access token information is acquired from the target third-party platform through the central server under the condition that the first historical access token information and the second historical access token information do not meet the requirements.
19. An electronic device, comprising: a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program when executed by the processor implementing the steps of a third party platform access method according to any one of claims 1-5 or 6-11 or 12-15.
20. A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of a third party platform access method according to any one of claims 1 to 5 or 6 to 11 or 12 to 15.
CN202210139168.5A 2022-02-15 2022-02-15 Third party platform access method and device, electronic equipment and medium Active CN114553433B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210139168.5A CN114553433B (en) 2022-02-15 2022-02-15 Third party platform access method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210139168.5A CN114553433B (en) 2022-02-15 2022-02-15 Third party platform access method and device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN114553433A true CN114553433A (en) 2022-05-27
CN114553433B CN114553433B (en) 2023-09-08

Family

ID=81675233

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210139168.5A Active CN114553433B (en) 2022-02-15 2022-02-15 Third party platform access method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114553433B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116248762A (en) * 2022-12-02 2023-06-09 中山市可讯科技有限公司 Cache system and method based on unstable request

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130144755A1 (en) * 2011-12-01 2013-06-06 Microsoft Corporation Application licensing authentication
US8504824B1 (en) * 2012-05-30 2013-08-06 Bank Of America Corporation One-time rotating key for third-party authentication
CN106453414A (en) * 2016-11-29 2017-02-22 迈普通信技术股份有限公司 Third party login authentication method and system, proxy server and client
WO2017067227A1 (en) * 2015-10-22 2017-04-27 乐视控股(北京)有限公司 Third party account number authorisation method, device, server, and system
US20190132317A1 (en) * 2017-10-30 2019-05-02 International Business Machines Corporation Third-Party Authorization of Access Tokens
US20200104473A1 (en) * 2018-09-27 2020-04-02 International Business Machines Corporation Authorization of resource access
CN111182321A (en) * 2019-12-31 2020-05-19 广州博冠信息科技有限公司 Method, device and system for processing information
CN112491778A (en) * 2019-09-11 2021-03-12 北京京东尚科信息技术有限公司 Authentication method, device, system and medium
CN112738805A (en) * 2020-12-30 2021-04-30 青岛海尔科技有限公司 Device control method and apparatus, storage medium, and electronic device
CN113271289A (en) * 2020-12-15 2021-08-17 全芯智造技术有限公司 Method, system and computer storage medium for resource authorization and access
CN113312653A (en) * 2021-06-25 2021-08-27 中国农业银行股份有限公司 Open platform authentication and authorization method, device and storage medium
US20210392131A1 (en) * 2020-06-15 2021-12-16 Charter Communications Operating, Llc Management of access credentials
US20220029808A1 (en) * 2020-07-26 2022-01-27 Akeyless Secuirity LTD. System, Product and Method for Providing Secured Access to Data

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130144755A1 (en) * 2011-12-01 2013-06-06 Microsoft Corporation Application licensing authentication
US8504824B1 (en) * 2012-05-30 2013-08-06 Bank Of America Corporation One-time rotating key for third-party authentication
WO2017067227A1 (en) * 2015-10-22 2017-04-27 乐视控股(北京)有限公司 Third party account number authorisation method, device, server, and system
CN106453414A (en) * 2016-11-29 2017-02-22 迈普通信技术股份有限公司 Third party login authentication method and system, proxy server and client
US20190132317A1 (en) * 2017-10-30 2019-05-02 International Business Machines Corporation Third-Party Authorization of Access Tokens
US20200104473A1 (en) * 2018-09-27 2020-04-02 International Business Machines Corporation Authorization of resource access
CN112491778A (en) * 2019-09-11 2021-03-12 北京京东尚科信息技术有限公司 Authentication method, device, system and medium
CN111182321A (en) * 2019-12-31 2020-05-19 广州博冠信息科技有限公司 Method, device and system for processing information
US20210392131A1 (en) * 2020-06-15 2021-12-16 Charter Communications Operating, Llc Management of access credentials
US20220029808A1 (en) * 2020-07-26 2022-01-27 Akeyless Secuirity LTD. System, Product and Method for Providing Secured Access to Data
CN113271289A (en) * 2020-12-15 2021-08-17 全芯智造技术有限公司 Method, system and computer storage medium for resource authorization and access
CN112738805A (en) * 2020-12-30 2021-04-30 青岛海尔科技有限公司 Device control method and apparatus, storage medium, and electronic device
CN113312653A (en) * 2021-06-25 2021-08-27 中国农业银行股份有限公司 Open platform authentication and authorization method, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王小勇;郑世宝;袁江海;: "棋牌类网络游戏客户端架构设计", 信息技术, no. 04 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116248762A (en) * 2022-12-02 2023-06-09 中山市可讯科技有限公司 Cache system and method based on unstable request

Also Published As

Publication number Publication date
CN114553433B (en) 2023-09-08

Similar Documents

Publication Publication Date Title
US11245770B2 (en) Locality based content distribution
US20180167444A1 (en) Content delivery reconciliation
US9083675B2 (en) Translation of resource identifiers using popularity information upon client request
US9451046B2 (en) Managing CDN registration by a storage provider
US20130067530A1 (en) DNS-Based Content Routing
US20230388361A1 (en) Network address resolution
US11805093B2 (en) Systems and methods for processing requests for content of a content distribution network
CN110557284A (en) data aggregation method and device based on client gateway
CN114553433B (en) Third party platform access method and device, electronic equipment and medium
CN112044057A (en) Game state monitoring method and device
CN110807040B (en) Method, device, equipment and storage medium for managing data
CN111240727A (en) Information updating method and device
CN108197256A (en) Access the method and system of specified network service platform
CN105635747A (en) Video cache method and device

Legal Events

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