CN113708938B - Token obtaining method, token obtaining device and terminal equipment - Google Patents
Token obtaining method, token obtaining device and terminal equipment Download PDFInfo
- Publication number
- CN113708938B CN113708938B CN202111261798.1A CN202111261798A CN113708938B CN 113708938 B CN113708938 B CN 113708938B CN 202111261798 A CN202111261798 A CN 202111261798A CN 113708938 B CN113708938 B CN 113708938B
- Authority
- CN
- China
- Prior art keywords
- token
- application program
- target
- server
- acquisition request
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000004590 computer program Methods 0.000 claims description 21
- 238000012545 processing Methods 0.000 claims description 5
- 230000005540 biological transmission Effects 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 10
- 238000004891 communication Methods 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 239000007858 starting material Substances 0.000 description 3
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic 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/321—Cryptographic 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/3213—Cryptographic 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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Stored Programmes (AREA)
Abstract
The application is applicable to the technical field of communication, and provides a token obtaining method, a token obtaining device and a terminal device, wherein the token obtaining method comprises the following steps: controlling the main application program to generate a token acquisition request and sending the token acquisition request to the server; the token acquisition request is used for requesting the server to issue a target token; the main application program receives the target token and sends first prompt information to at least one auxiliary application program; the first prompt message is used for describing the acquisition mode of the target token; the secondary application obtains a target token based on the first hint information. The token obtaining method provided by the application is simple to operate, and the target tokens of the main application program and each auxiliary application program are the same, so that the process that when a certain auxiliary application program obtains a new token, the new token obtained by the previous auxiliary application program is invalid and needs to be continuously obtained is avoided, and the pressure of a server is reduced.
Description
Technical Field
The present application belongs to the field of communications technologies, and in particular, to a token obtaining method, a token obtaining apparatus, a terminal device, and a computer-readable storage medium.
Background
The token (token) is a string of character strings generated by the server, and is a token for the terminal device to request data from the server, and the token has timeliness, so the terminal device needs to acquire a new token from the server at certain intervals.
In the existing method for acquiring the new token, the terminal device provides an interface for acquiring the token, and each application program on the terminal device can acquire the new token from the server through the interface. However, since the terminal device is installed with the plurality of applications, and the plurality of applications share the identity information, when the token of the terminal device fails, it indicates that the tokens of the plurality of applications all fail, at this time, each application acquires a new token from the server, which may cause the failure of the new token acquired by the previous application, and the new token needs to be continuously acquired, which is cumbersome to operate, and the server may frequently generate a new token according to the identity information, thereby increasing the pressure of the server.
Disclosure of Invention
The embodiment of the application provides a token obtaining method, a token obtaining device, a terminal device and a computer readable storage medium, and can solve the problems that in the prior art, each application program of the terminal device obtains a new token from a server, so that the new token obtained by a previous application program is invalid, the new token needs to be continuously obtained, the operation is complex, and the pressure of the server is increased.
In a first aspect, an embodiment of the present application provides a token obtaining method, including:
controlling the main application program to generate a token acquisition request and sending the token acquisition request to the server; the token acquisition request is used for requesting the server to issue a target token;
the main application program receives the target token and sends first prompt information to at least one auxiliary application program; the first prompt message is used for describing the acquisition mode of the target token;
the secondary application obtains a target token based on the first hint information.
Optionally, before the controlling the main application generates the token obtaining request and sends the token obtaining request to the server, the method further includes:
when detecting that the current token does not meet the preset requirement, the auxiliary application program sends second prompt information to the main application program; the second prompt message is used for describing that the current token is invalid;
correspondingly, the controlling the main application program to generate a token obtaining request and send the token obtaining request to the server includes:
and when receiving the second prompt message, the main application program generates a token acquisition request and sends the token acquisition request to the server.
Optionally, when detecting that the current token is invalid, the application program sends a second prompt message to the host application program, where the second prompt message includes:
and when the auxiliary application program detects that the current token is invalid through the token interceptor, determining that the current token does not meet the preset requirement, and sending second prompt information to the main application program.
Optionally, when the secondary application detects that the current token is invalid through the token interceptor, determining that the current token does not meet the preset requirement, and sending a second prompt message to the primary application, where the second prompt message includes:
and the auxiliary application program detects that the service time of the current token is not within a preset service life through the token interceptor, and determines that the current token is invalid.
Optionally, the receiving, by the primary application, the target token and sending the first prompt information to the at least one secondary application includes:
the host application receiving the target token;
the main application program stores the target token into a database and sends first prompt information to at least one auxiliary application program; the first prompt message is used for describing that a target token is stored in the database;
correspondingly, the auxiliary application program obtains the target token based on the first prompt message, and the method comprises the following steps:
and the auxiliary application program receives the first prompt message and acquires the target token from the database.
Optionally, the storing, by the primary application, the target token in the database, and sending the first prompt information to the at least one secondary application includes:
and updating the current token in the database according to the target token.
Optionally, the controlling the main application generates a token obtaining request, and sends the token obtaining request to the server, including:
a token acquisition request is sent to the server based on a transmission control protocol.
In a second aspect, an embodiment of the present application provides a token obtaining apparatus, including:
the system comprises a generating unit, a server and a processing unit, wherein the generating unit is used for controlling a main application program to generate a token acquisition request and sending the token acquisition request to the server; the token acquisition request is used for requesting the server to issue a target token;
the first sending unit is used for receiving the target token by the main application program and sending first prompt information to at least one auxiliary application program; the first prompt message is used for describing an acquisition mode of the target token;
and the first acquisition unit is used for acquiring the target token by the auxiliary application program based on the first prompt information.
In a third aspect, an embodiment of the present application provides a terminal device, including: memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the token acquisition method according to any of the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the token obtaining method according to any one of the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when run on a terminal device, enables the terminal device to execute the token obtaining method according to any one of the above first aspects.
Compared with the prior art, the embodiment of the application has the advantages that:
according to the token acquisition method provided by the embodiment of the application, a token acquisition request is generated by controlling a main application program, and the token acquisition request is sent to a server; the token acquisition request is used for requesting a server to issue a target token; therefore, each auxiliary application program is prevented from sending a token acquisition request to the server, and finally, the main application program can send first prompt information for describing the acquisition mode of the target token to at least one auxiliary application program after receiving the target token; therefore, after each auxiliary application program receives the first prompt information, it can be determined that the main application program obtains a new token, that is, a target token, at this time, each auxiliary application program can obtain the new token based on the first prompt information, the operation is simple, and the target tokens of the main application program and each auxiliary application program are the same, so that a process that when a certain auxiliary application program obtains the new token, the new token obtained by the previous auxiliary application program is invalid and needs to be continuously obtained is avoided, and the server only needs to generate the new token according to the token obtaining request of the main application program, so that the pressure of the server is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a token obtaining system according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating an implementation of a token obtaining method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of an implementation of a token obtaining method according to another embodiment of the present application;
FIG. 4 is a flowchart of an implementation of a token obtaining method according to yet another embodiment of the present application;
fig. 5 is a schematic structural diagram of a token obtaining apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a token obtaining system according to an embodiment of the present disclosure. As shown in fig. 1, a token obtaining system provided in an embodiment of the present application includes: a terminal device 10 and a server 20 communicatively connected to the terminal device. The communication connection may be a wired communication connection or a wireless communication connection.
The terminal device 10 may include, but is not limited to, a smart phone, a tablet computer, a desktop computer, or the like. The server 20 may be a tablet computer or desktop computer, etc.
In the embodiment of the present application, the terminal device 10 is installed with a plurality of applications, including a main application 11 and at least one auxiliary application 12. The main application 11 may be an application carried by the terminal device 10 when it leaves a factory, and the auxiliary application 12 may be an application downloaded by a user, such as an application for WeChat.
Taking the terminal device 10 as an android phone as an example, the main application 11 may be an android system desktop Launcher (Launcher).
It should be noted that, in the terminal device 10, the primary application 11 and the at least one secondary application 12 share one identity information, so that the primary application 11 and the at least one secondary application 12 can use the same token.
Based on this, the android mobile phone may control the android system desktop starter to generate a token acquisition request, and send the token acquisition request to the server 20, after receiving the token acquisition request, the server 20 may generate a target token according to the token acquisition request, and issue the target token to the android system desktop starter, and the android system desktop starter may receive the target token and send first prompt information to the at least one auxiliary application 12, where the first prompt information is used to describe an acquisition manner of the target token, and therefore the auxiliary application 12 may acquire the target token based on the first prompt information.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of a token obtaining method according to an embodiment of the present disclosure. In the embodiment of the application, the execution subject of the token obtaining method is the terminal device.
As shown in fig. 2, the token obtaining method provided in an embodiment of the present application may include steps S101 to S103, which are detailed as follows:
in S101, a control host application generates a token acquisition request, and sends the token acquisition request to a server; the token acquisition request is used for requesting the server to issue a target token.
In one embodiment of the application, since the token has timeliness, the terminal device may control the host application to generate a token obtaining request based on a preset time interval and send the token obtaining request to the server. The preset time interval may be set according to actual needs, and is not limited here, for example, the preset time interval may be set according to the valid use time of the token.
In another embodiment of the present application, the terminal device may specifically control the host application to generate the token obtaining request through steps S201 to S202 shown in fig. 3, which are detailed as follows:
in S201, when detecting that the current token does not meet the preset requirement, the secondary application sends a second prompt message to the primary application; the second prompt message is used for describing that the current token is invalid.
In S202, the host application is controlled to generate the token obtaining request and send the token obtaining request to the server when receiving the second prompt message.
In this embodiment, since the auxiliary application installed in the terminal device needs to use the valid token to request the server for the relevant data, when detecting that the current token does not meet the preset requirement, the auxiliary application may send the second prompt message to the main application. Wherein the current token refers to a token used by the secondary application before sending the second hints information to the primary application.
It should be noted that the preset requirement may be: the current token is a valid token. A valid token specifically refers to a token that can retrieve data from a server.
In an embodiment of the present application, each secondary application may be provided with a token interceptor (token interceptor), so that the secondary application may detect whether the current token is invalid through the token interceptor. The token interceptor is equivalent to a network interface and can detect the current token.
Therefore, each auxiliary application program can detect whether the current token is invalid or not through the respective token interceptors when requesting the relevant data from the server, and the detection efficiency of the token is improved.
When the secondary application detects that the current token is invalid through the token interceptor, the secondary application may determine that the current token is an invalid token, that is, the current token does not meet the preset requirement, and therefore, the secondary application may send the second prompt message to the primary application.
In another embodiment of the present application, the secondary application may determine that the current token is invalid when the usage time of the current token is detected by the token interceptor to be not within a preset usage period. The preset service life can be set according to the valid use time of the current token.
By the method, the terminal equipment controls the main application program to send the token obtaining request only when any auxiliary application program detects that the current token does not meet the preset requirement, so that the situation that the terminal equipment also controls the main application program to send the token obtaining request when the current token is valid is avoided, the pressure of a server is reduced, and the processing efficiency of the terminal equipment is improved.
After detecting that the main application program receives the second prompt message, the terminal device may control the main application program to generate a token acquisition request, and send the token acquisition request to the server.
In one embodiment of the present application, after controlling the host application to generate the token obtaining request, the terminal device may send the token obtaining request to the server based on the transmission control protocol.
Based on this, after receiving the token acquisition request sent by the host application, the server may generate a string of characters, determine the string of characters as a target token, and send the target token to the host application of the terminal device.
In S102, the primary application receives the target token and sends first prompt information to at least one secondary application; the first prompt message is used for describing the acquisition mode of the target token.
In S103, the secondary application acquires the target token based on the first prompt information.
In the embodiment of the application, the auxiliary application program obtains the target token according to the first prompt message sent by the main application program without interacting with the server, so that the situation that the server generates a token again according to the request of the auxiliary application program and the target token received by the main application program is invalid is avoided.
In an embodiment of the present application, since there is a case that the primary application fails to send the target token or the target token is lost in the sending process when the primary application directly sends the target token to the secondary application, step S102 may further include steps S301 to S302 shown in fig. 4, and correspondingly, step S103 specifically executes step S303 shown in fig. 4, which is described in detail as follows:
in S301, the host application receives the target token.
In S302, the primary application stores the target token in a database, and sends the first prompt message to the at least one secondary application; the first prompt message is used for describing that the target token is stored in the database.
In S303, the secondary application receives the first prompt message and obtains the target token from the database.
In this embodiment, after receiving the target token, the host application may store the target token in the database, and therefore the first prompt information may be specifically described as that the target token is stored in the database.
It should be noted that, since the tokens are all stored in the database, in order to ensure that the token acquired by the secondary application is the latest token, that is, a valid target token, the primary application may update the current token in the database according to the target token, that is, the target token covers the current token, that is, only the target token that is received by the primary application most recently is stored in the database.
Based on this, the secondary application may obtain the target token from the database after receiving the first prompt message.
By the method, the target token can be stored in the database persistently and is not easy to lose, the success rate of obtaining the target token is improved, the auxiliary application program can obtain the target token from the database when required by the auxiliary application program, interaction with the main application program is not needed, and the interaction times with the main application program are reduced.
In another embodiment of the present application, after receiving the target token, the primary application may directly send the target token to at least one secondary application in the terminal device, and therefore, the first hint information may be specifically used to describe the receiving of the target token sent by the primary application.
Based on this, the secondary application program can directly receive the target token sent by the main application program after receiving the first prompt message.
As can be seen from the above, in the token acquisition method provided in the embodiment of the present application, a token acquisition request is generated by controlling a host application, and the token acquisition request is sent to a server; the token acquisition request is used for requesting a server to issue a target token; therefore, each auxiliary application program is prevented from sending a token acquisition request to the server, and finally, the main application program can send first prompt information for describing the acquisition mode of the target token to at least one auxiliary application program after receiving the target token; therefore, after each auxiliary application program receives the first prompt information, it can be determined that the main application program obtains a new token, that is, a target token, at this time, each auxiliary application program can obtain the new token based on the first prompt information, the operation is simple, and the target tokens of the main application program and each auxiliary application program are the same, so that a process that when a certain auxiliary application program obtains the new token, the new token obtained by the previous auxiliary application program is invalid and needs to be continuously obtained is avoided, and the server only needs to generate the new token according to the token obtaining request of the main application program, so that the pressure of the server is reduced.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 5 shows a block diagram of a token obtaining apparatus provided in the embodiment of the present application, corresponding to a token obtaining method described in the foregoing embodiment, and only shows portions related to the embodiment of the present application for convenience of description. Referring to fig. 5, the token obtaining apparatus 500 includes: a generating unit 51, a first transmitting unit 52 and a first acquiring unit 53. Wherein:
the generating unit 51 is configured to control the host application to generate a token obtaining request and send the token obtaining request to the server; the token acquisition request is used for requesting the server to issue a target token.
The first sending unit 52 is configured to receive the target token by the primary application, and send first prompt information to at least one secondary application; the first prompt message is used for describing the acquisition mode of the target token.
The first obtaining unit 53 is configured to obtain the target token by the secondary application based on the first prompt information.
In one embodiment of the present application, the token obtaining apparatus 500 further includes: and a second transmitting unit.
The second sending unit is used for sending second prompt information to the main application program when the auxiliary application program detects that the current token does not meet the preset requirement; the second prompt message is used for describing that the current token is invalid.
Correspondingly, the generating unit 51 is specifically configured to: and when receiving the second prompt message, the main application program generates the token acquisition request and sends the token acquisition request to the server.
In an embodiment of the present application, the second sending unit specifically includes: a first determination unit.
And the first determining unit is used for determining that the current token does not meet the preset requirement when the auxiliary application program detects that the current token is invalid through the token interceptor, and sending the second prompt message to the main application program.
In an embodiment of the present application, the first determining unit specifically includes: a second determination unit.
The second determining unit is used for determining that the current token is invalid when the auxiliary application program detects that the service time of the current token is not within a preset service life through the token interceptor.
In an embodiment of the present application, the first sending unit 52 specifically includes: a receiving unit and a third transmitting unit. Wherein:
the receiving unit is used for the main application program to receive the target token.
The third sending unit is used for storing the target token into a database by the main application program and sending the first prompt message to the at least one auxiliary application program; the first prompt message is used for describing that the target token is stored in the database.
Correspondingly, the first obtaining unit 53 is specifically configured to: and the auxiliary application program receives the first prompt message and acquires the target token from the database.
In an embodiment of the present application, the third sending unit specifically includes: and an updating unit.
The updating unit is used for updating the current token in the database according to the target token.
In an embodiment of the present application, the generating unit 51 specifically includes: and a fourth transmitting unit.
The fourth sending unit is configured to send the token obtaining request to the server based on a transmission control protocol.
As can be seen from the above, in the token obtaining apparatus provided in the embodiment of the present application, a token obtaining request is generated by controlling a host application, and the token obtaining request is sent to a server; the token acquisition request is used for requesting a server to issue a target token; therefore, each auxiliary application program is prevented from sending a token acquisition request to the server, and finally, the main application program can send first prompt information for describing the acquisition mode of the target token to at least one auxiliary application program after receiving the target token; therefore, after each auxiliary application program receives the first prompt information, it can be determined that the main application program obtains a new token, that is, a target token, at this time, each auxiliary application program can obtain the new token based on the first prompt information, the operation is simple, and the target tokens of the main application program and each auxiliary application program are the same, so that a process that when a certain auxiliary application program obtains the new token, the new token obtained by the previous auxiliary application program is invalid and needs to be continuously obtained is avoided, and the server only needs to generate the new token according to the token obtaining request of the main application program, so that the pressure of the server is reduced.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 6, the terminal device 6 of this embodiment includes: at least one processor 60 (only one shown in fig. 6), a memory 61, and a computer program 62 stored in the memory 61 and executable on the at least one processor 60, the processor 60 implementing the steps in any of the various token acquisition method embodiments described above when executing the computer program 62.
The terminal device may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is only an example of the terminal device 6, and does not constitute a limitation to the terminal device 6, and may include more or less components than those shown, or combine some components, or different components, such as an input/output device, a network access device, and the like.
The Processor 60 may be a Central Processing Unit (CPU), and the Processor 60 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may in some embodiments be an internal storage unit of the terminal device 6, such as a memory of the terminal device 6. The memory 61 may also be an external storage device of the terminal device 6 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are equipped on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 61 may also be used to temporarily store data that has been output or is to be output.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a terminal device, enables the terminal device to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be implemented by a computer program, which can be stored in a computer readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or apparatus capable of carrying computer program code to a terminal device, recording medium, computer Memory, Read-Only Memory (ROM), Random-Access Memory (RAM), electrical carrier wave signals, telecommunications signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed token obtaining apparatus and token obtaining method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (9)
1. A token acquisition method, comprising:
controlling a main application program to generate a token acquisition request and sending the token acquisition request to a server; the token acquisition request is used for requesting the server to issue a target token;
the main application program receives the target token and sends first prompt information to at least one auxiliary application program; the first prompt message is used for describing an acquisition mode of the target token;
the auxiliary application program obtains the target token based on the first prompt message;
before controlling the host application to generate a token obtaining request and sending the token obtaining request to a server, the method further includes:
the auxiliary application program sends second prompt information to the main application program when detecting that the current token does not meet the preset requirement; the second prompt message is used for describing that the current token is invalid;
correspondingly, the controlling the main application program to generate a token obtaining request and send the token obtaining request to the server includes:
and controlling the main application program to generate the token acquisition request and send the token acquisition request to the server when receiving the second prompt message.
2. The token acquisition method of claim 1, wherein the secondary application, upon detecting a failure of the current token, sends a second hint to the primary application, comprising:
and when the auxiliary application program detects that the current token is invalid through a token interceptor, determining that the current token does not meet the preset requirement, and sending the second prompt message to the main application program.
3. The token obtaining method of claim 2, wherein when the secondary application detects that the current token is invalid through a token interceptor, determining that the current token does not meet preset requirements, and sending the second prompt message to the primary application comprises:
and the secondary application program detects that the service time of the current token is not within a preset service life through a token interceptor, and determines that the current token is invalid.
4. The token acquisition method of claim 1, wherein the primary application receives the target token and sends a first hint to at least one secondary application, comprising:
the host application receiving the target token;
the main application program stores the target token in a database and sends the first prompt message to the at least one auxiliary application program; the first prompt message is used for describing that the target token is stored in the database;
correspondingly, the obtaining, by the secondary application, the target token based on the first prompt information includes:
and the auxiliary application program receives the first prompt message and acquires the target token from the database.
5. The token acquisition method of claim 4, wherein the primary application stores the target token in a database and sends a first hint to the at least one secondary application, comprising:
and updating the current token in the database according to the target token.
6. The token acquisition method of any one of claims 1 to 5, wherein the controlling host application generates a token acquisition request and sends the token acquisition request to a server, comprising:
and sending the token acquisition request to the server based on a transmission control protocol.
7. A token acquisition apparatus, comprising:
the system comprises a generating unit, a server and a processing unit, wherein the generating unit is used for controlling a main application program to generate a token acquisition request and sending the token acquisition request to the server; the token acquisition request is used for requesting the server to issue a target token;
the first sending unit is used for receiving the target token by the main application program and sending first prompt information to at least one auxiliary application program; the first prompt message is used for describing an acquisition mode of the target token;
a first obtaining unit, configured to obtain, by the secondary application, the target token based on the first prompt information;
wherein the token obtaining apparatus further comprises:
the second sending unit is used for sending second prompt information to the main application program when the auxiliary application program detects that the current token does not meet the preset requirement; the second prompt message is used for describing that the current token is invalid;
correspondingly, the generating unit is specifically configured to: and controlling the main application program to generate the token acquisition request and send the token acquisition request to the server when receiving the second prompt message.
8. Terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor realizes the steps of the token acquisition method according to any of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the token acquisition method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111261798.1A CN113708938B (en) | 2021-10-28 | 2021-10-28 | Token obtaining method, token obtaining device and terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111261798.1A CN113708938B (en) | 2021-10-28 | 2021-10-28 | Token obtaining method, token obtaining device and terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113708938A CN113708938A (en) | 2021-11-26 |
CN113708938B true CN113708938B (en) | 2022-02-11 |
Family
ID=78647379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111261798.1A Active CN113708938B (en) | 2021-10-28 | 2021-10-28 | Token obtaining method, token obtaining device and terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113708938B (en) |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8856887B2 (en) * | 2012-07-09 | 2014-10-07 | Ping Identity Corporation | Methods and apparatus for delegated authentication token retrieval |
CN103634316A (en) * | 2013-11-26 | 2014-03-12 | 乐视网信息技术(北京)股份有限公司 | Account login method and electronic equipment |
US10754929B2 (en) * | 2016-02-19 | 2020-08-25 | Blackberry Limited | Sharing contents between applications |
US10365909B2 (en) * | 2016-04-21 | 2019-07-30 | Data Accelerator Ltd. | Method and system for deploying virtualized applications |
US20180032374A1 (en) * | 2016-08-01 | 2018-02-01 | Intel Corporation | Application launch booster |
CN106161003A (en) * | 2016-08-21 | 2016-11-23 | 乐视控股(北京)有限公司 | Application program login method and terminal, system |
US11240239B2 (en) * | 2018-08-07 | 2022-02-01 | Dell Products L.P. | Apparatus and method for shared credential authentication |
US20210218725A1 (en) * | 2018-09-03 | 2021-07-15 | Huawei Technologies Co., Ltd. | Login Method, Token Sending Method, and Device |
CN110417730B (en) * | 2019-06-17 | 2022-07-19 | 平安科技(深圳)有限公司 | Unified access method of multiple application programs and related equipment |
CN110933092A (en) * | 2019-12-03 | 2020-03-27 | 银清科技有限公司 | JWT (just-in-one wt) based single sign-on realization method and device |
CN111898110A (en) * | 2020-08-05 | 2020-11-06 | 苏州朗动网络科技有限公司 | Method, device, server and storage medium for acquiring user identity information |
-
2021
- 2021-10-28 CN CN202111261798.1A patent/CN113708938B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113708938A (en) | 2021-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101662533B (en) | Software updating system and method | |
CN105354488A (en) | Application installation method, related apparatus and application installation system | |
CN109375937A (en) | Method for upgrading system, device, terminal device and storage medium | |
CN102255887A (en) | Method and system for providing online services corresponding to multiple mobile devices | |
CN110825411B (en) | Upgrading method and device for TWS (two way satellite System) earphone system and computer-readable storage medium | |
CN104065695A (en) | Software update method, server, user end and system | |
CN114465998B (en) | Multi-device file transmission method and device, terminal device and readable storage medium | |
JP2021508880A (en) | Terminal application management method, application server and terminal | |
CN111338662A (en) | Firmware upgrading method and device for slave station and terminal | |
CN112202747A (en) | Target device binding method and device, storage medium and electronic device | |
CN111182527B (en) | OTA (over the air) firmware upgrading method and device, terminal equipment and storage medium thereof | |
CN109947449A (en) | Method for upgrading system, device, storage medium and electronic equipment | |
KR20190086325A (en) | Electronic device for managing embedded subscriber identity module and method for the same | |
CN105260655A (en) | Application program starting protection method, device and system | |
CN114035830A (en) | Software upgrading method and device and electronic equipment | |
CN109656592B (en) | Card management method, device, terminal and computer readable storage medium | |
CN111176685A (en) | Upgrading method and device | |
KR20180050001A (en) | Firmware upgrade system and method for IoT | |
CN113708938B (en) | Token obtaining method, token obtaining device and terminal equipment | |
US20040122877A1 (en) | Permission token managemnet system, permission token management method, program and recording medium | |
CN113010238A (en) | Permission determination method, device and system for micro application call interface | |
CN107920074B (en) | SDK automatic upgrading method, terminal equipment and master control server | |
CN104301343A (en) | Database updating method and relevant equipment and system | |
US11698994B2 (en) | Method for a first start-up operation of a secure element which is not fully customized | |
CN115080068A (en) | Resource file transmission method, device, equipment and storage medium |
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 | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: 410000 Yuelu District Yuelu street, Changsha, Hunan Province, 5 left 101 rooms of R & D headquarters of Central South University Science Park. Patentee after: New Cloud Technology Group Co.,Ltd. Country or region after: China Address before: 410000 Yuelu District Yuelu street, Changsha, Hunan Province, 5 left 101 rooms of R & D headquarters of Central South University Science Park. Patentee before: HUNAN NEW CLOUDNET TECHNOLOGY Co.,Ltd. Country or region before: China |