Data access method, device, equipment and medium for third-party applications
By receiving data access requests from third-party applications, generating authorization pages and generating authorization instructions in response to user authorization operations, the problems of redundancy of code, high development and maintenance costs, and high data access complexity in the prior art are solved, and efficient data access is achieved.
Patent Information
- Application Number
- CN202210124351.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-10
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-02-10
AI Technical Summary
The data access methods of existing third-party applications have problems such as code redundancy, high development and maintenance costs, and high data access complexity.
By receiving data access requests from third-party applications, determining the domain name of the third-party application that is not logged in to the user, generating an authorization page, and generating an authorization instruction in response to the user's authorization operation, so that the third-party application can access data based on the authorization instructions.
Reduces code redundancy, reduces development and maintenance costs, and reduces the complexity of data access, thereby improving the efficiency of data access.
Smart Images

Figure CN114444068B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technologies, and in particular, to a method, apparatus, device, and medium for data access of a third-party application program. Background Art
[0002] Currently, the data access method of a third-party application program is usually to pre-write program codes for accessing the data of each third-party application program, and then each third-party application program accesses data through the written program codes. In practical applications, usually the number of third-party application programs is large, and corresponding program codes need to be separately written for each third-party application program, which not only results in code redundancy but also increases the development cost and maintenance cost. In addition, when multiple third-party application programs access data, there are problems of increasing the complexity of data access and reducing the efficiency of data access. Summary of the Invention
[0003] To solve the above problems, embodiments of the present invention provide a method, apparatus, device, and medium for data access of a third-party application program, so as to not only reduce code redundancy, lower the development cost and maintenance cost, but also reduce the complexity of data access, thereby improving the efficiency of data access.
[0004] In a first aspect, embodiments of the present invention provide a method for data access of a third-party application program, the method including:
[0005] Receiving a data access request of a third-party application program, and if the user corresponding to the data access request is an unlogged-in user, determining the domain name of the third-party application program included in the data access request;
[0006] Determining target domain name configuration information corresponding to the domain name of the third-party application program, generating an authorization page corresponding to the third-party application program based on the target domain name configuration information, and displaying the authorization page;
[0007] Responding to an authorized operation input based on the authorization page, generating an authorization instruction corresponding to the authorized operation, so that the third-party application program accesses data corresponding to the data access request based on the authorization instruction.
[0008] In a second aspect, embodiments of the present invention further provide a data access device for a third-party application program, the device including:
[0009] A domain name determination module, configured to receive a data access request of a third-party application program, and if the user corresponding to the data access request is an unlogged-in user, determine the domain name of the third-party application program included in the data access request;
[0010] An authorization page display module, configured to determine target domain name configuration information corresponding to the third-party application domain name, generate an authorization page corresponding to the third-party application based on the target domain name configuration information, and display the authorization page;
[0011] A data access module, configured to generate an authorization instruction corresponding to the authorized operation in response to the authorized operation input based on the authorization page, so that the third-party application accesses the data corresponding to the data access request based on the authorization instruction.
[0012] Thirdly, an embodiment of the present invention further provides an electronic device, which includes:
[0013] One or more processors;
[0014] A storage device, configured to store one or more programs;
[0015] When the program is executed by the processor, the processor implements the data access method for the third-party application provided in any embodiment of the present invention.
[0016] Fourthly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the data access method for the third-party application provided in any embodiment of the present invention.
[0017] The technical solution of the embodiment of the present invention, by receiving a data access request of a third-party application, if the user corresponding to the data access request is an unlogged user, the third-party application domain name included in the data access request can be determined, which can improve the access efficiency of the third-party application. Furthermore, the target domain name configuration information corresponding to the third-party application domain name can be determined, which can reduce the amount of code and code redundancy. After determining the target domain name configuration information corresponding to the third-party application domain name, an authorization page corresponding to the third-party application can be generated based on the target domain name configuration information, and the authorization page can be displayed to visually display the authorization page. After displaying the authorization page, an authorization operation can be performed based on the authorization page, so as to implement interactive response processing. Then, in response to the authorized operation input based on the authorization page, an authorization instruction corresponding to the authorized operation can be generated, so that the third-party application accesses the data corresponding to the data access request based on the authorization instruction, solving the technical problems of code redundancy, high development cost and maintenance cost, and high complexity of data access in the existing data access of third-party applications, and realizing not only reducing code redundancy, reducing development cost and maintenance cost, but also reducing the complexity of data access, thereby improving the efficiency of data access. Description of the Drawings
[0018] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings introduced are only the drawings of a part of the embodiments to be described by the present invention, rather than all the drawings. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0019] Figure 1 It is a schematic flowchart of a data access method for a third-party application provided in Embodiment 1 of the present invention;
[0020] Figure 2 It is a schematic flowchart of a data access method for a third-party application provided in Embodiment 2 of the present invention;
[0021] Figure 3 It is a schematic flowchart of a data access method for a third-party application provided in Embodiment 3 of the present invention;
[0022] Figure 4 It is a schematic flowchart of an alternative data access method for a third-party application provided in Embodiment 4 of the present invention;
[0023] Figure 5 It is a schematic structural diagram of a data access device for a third-party application provided in Embodiment 5 of the present invention;
[0024] Figure 6 It is a schematic structural diagram of an electronic device provided in Embodiment 6 of the present invention. Detailed Embodiments
[0025] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that for the convenience of description, only the parts related to the present invention rather than all the structures are shown in the accompanying drawings.
[0026] Embodiment 1
[0027] Figure 1 It is a schematic flowchart of a data access method for a third-party application provided in Embodiment 1 of the present invention. This embodiment is applicable to data access by a third-party application, especially applicable to the situation where an unlogged user accesses data through a third-party application. This method can be executed by a data access device of the third-party application, and the data access device of the third-party application can be implemented in software and / or hardware and can be integrated into an electronic device such as a computer or a server.
[0028] As Figure 1 shown, the method of this embodiment includes:
[0029] S110. Receive a data access request from a third-party application. If the user corresponding to the data access request is an unlogged user, determine the domain name of the third-party application included in the data access request.
[0030] Among them, the third-party application can be understood as developed by a third-party application developer. Exemplarily, the third-party application can be WeChat, Taobao, Douyin, etc. The data access request can be an HTTP request or an HTTPS request. Among them, the data access request can include, but is not limited to, the domain name of the third-party application. The data access request can be used for the third-party application to access data. The domain name of the third-party application can be understood as the domain name address of the third-party application. The domain name of the third-party application can be a name composed of a string of names separated by dots.
[0031] Specifically, receive a data access request from a third-party application. After receiving the data access request, it can be determined whether the user corresponding to the data access request is an unlogged user. If the user corresponding to the data access request is an unlogged user, the data access request can be parsed, and then the domain name of the third-party application included in the data access request can be determined, that is, the domain name of the third-party application included in the data access request can be determined. It can be understood that if the user corresponding to the data access request is a logged user, the third-party application can access the data corresponding to the data access request.
[0032] It should be noted that in the embodiments of the invention, there are various types of third-party applications, and the specific types are not limited herein. For example, third-party applications of the connection type, third-party applications of the business type, third-party applications of the lifestyle type, and third-party applications of the entertainment application type.
[0033] It should also be noted that the HTTP request can be a request transmitted based on the Hyper Text Transfer Protocol (HTTP). The HTTPS request can be a request transmitted based on the Hyper Text Transfer Protocol over Secure Socket Layer (HTTPS).
[0034] S120. Determine the target domain name configuration information corresponding to the domain name of the third-party application, generate an authorization page corresponding to the third-party application based on the target domain name configuration information, and display the authorization page.
[0035] Among them, the target domain name configuration information can be understood as the domain name configuration information corresponding to the current third-party application domain name. The target domain name configuration information can be pre-configured domain name information. The target domain name configuration information can be configured with user login methods and authorization methods. Among them, the user login method can be an open authorization method. Exemplarily, the open authorization method can be the OAuth2.0 method. The authorization method can be the authorization method in the authorization code mode or the authorization method in the token mode. The target domain name configuration information can be stored in the form of Key-Value (key-value pair).
[0036] Among them, the authorization page can be a page generated based on the target domain name configuration information corresponding to the third-party application domain name. The authorization page can be used to prompt the user to authorize to receive the user's authorization operation. Among them, the authorization operation can be a user click operation or a swipe operation.
[0037] Specifically, after determining the third-party application domain name included in the data access request, the domain name configuration information corresponding to the third-party application domain name can be determined, and then the domain name configuration information corresponding to the third-party application can be used as the target domain name configuration information. After determining the target domain name configuration information, the authorization page corresponding to the third-party application can be generated based on the target domain name configuration information. After the authorization page is generated, the authorization page can be rendered. Furthermore, the authorization page can be displayed.
[0038] It should be noted that the correspondence between the third-party application domain name and the number of target domain name configuration information can be one-to-one or one-to-many. In actual applications, the number of target domain name configuration information corresponding to different third-party application domain names can be the same or different.
[0039] S130. In response to the authorized operation input based on the authorization page, generate an authorization instruction corresponding to the authorized operation, so that the third-party application accesses the data corresponding to the data access request based on the authorization instruction.
[0040] Among them, the authorized operation can be the operation of the user, which can indicate that the user has authorized. The authorization instruction can be an instruction generated after the authorization page receives the authorized operation. The authorization instruction can be used to indicate that the user has authorized the third-party application to access the data corresponding to the data access request.
[0041] Specifically, after receiving the authorization operation input by the user based on the authorization page, when the authorization operation input by the user based on the authorization page is an authorized operation, in response to the authorized operation input based on the authorization page, an authorization instruction corresponding to the authorized operation can be generated. After receiving the authorization instruction, the data corresponding to the data access request can be determined, so that the third-party application accesses the data corresponding to the data access request based on the authorization instruction.
[0042] In the technical solution of the embodiment of the present invention, by receiving a data access request from a third-party application, if the user corresponding to the data access request is an unlogged user, the domain name of the third-party application included in the data access request can be determined, which can improve the access efficiency of the third-party application. Furthermore, the target domain name configuration information corresponding to the domain name of the third-party application can be determined, which can reduce the amount of code and code redundancy. After determining the target domain name configuration information corresponding to the domain name of the third-party application, an authorization page corresponding to the third-party application can be generated based on the target domain name configuration information, and the authorization page can be displayed to visually display the authorization page. After displaying the authorization page, an authorization operation can be performed based on the authorization page, so as to implement interactive response processing. Then, in response to the authorized operation input based on the authorization page, an authorization instruction corresponding to the authorized operation can be generated, so that the third-party application can access the data corresponding to the data access request based on the authorization instruction, solving the technical problems of code redundancy, high development cost and maintenance cost, and high complexity of data access in the existing data access of third-party applications, and realizing not only reducing code redundancy, reducing development cost and maintenance cost, but also reducing the complexity of data access, thereby improving the efficiency of data access.
[0043] Embodiment 2
[0044] Figure 2 FIG. is a schematic flowchart of a data access method for a third-party application provided in Embodiment 2 of the present invention. On the basis of the foregoing embodiment, optionally, determining the target domain name configuration information corresponding to the domain name of the third-party application and generating the authorization page corresponding to the third-party application based on the target domain name configuration information includes: determining the target domain name configuration information corresponding to the domain name of the third-party application based on the preset domain name configuration information, where the target domain name configuration information includes the authorization page address of the third-party application and the authorization page parameters corresponding to the authorization page address; generating the authorization page corresponding to the third-party application based on the authorization page address and the authorization page parameters. Among them, the same or corresponding technical terms as those in the above embodiment will not be described in detail here.
[0045] As Figure 2 shown, the method of this embodiment may specifically include:
[0046] S210. Receive a data access request from a third-party application. If the user corresponding to the data access request is an unlogged user, determine the domain name of the third-party application included in the data access request.
[0047] S220. Determine the target domain name configuration information corresponding to the domain name of the third-party application based on the preset domain name configuration information, where the target domain name configuration information includes the authorization page address of the third-party application and the authorization page parameters corresponding to the authorization page address.
[0048] Among them, the authorization page address of the third-party application can be the https web page address of the third-party application. The authorization page parameters can be the parameters of the authorization page address of the third-party application. Exemplarily, the authorization page URLs can be URL1, URL2, and URL3. Among them, the authorization page parameters corresponding to URL1 can be the open authorization method and the authorization code mode, the authorization page parameters corresponding to URL2 can be the non-open authorization method, and the authorization page parameters corresponding to URL3 can be the open authorization method and the token mode.
[0049] Specifically, after determining the domain name of the third-party application included in the data access request, the domain name configuration information corresponding to the domain name of the third-party application can be determined based on the pre-configured domain name configuration information, that is, the target domain name configuration information can be determined. Furthermore, the authorization page address of the third-party application corresponding to the domain name of the third-party application and the authorization page parameters corresponding to the authorization page address can be determined. Among them, the domain name configuration information is configured based on the authorization page URLs of multiple third-party applications and the authorization page parameters corresponding to the authorization page URLs. Optionally, the pre-configured domain name configuration information can be stored in the format of JavaScript Object Notation (JSON).
[0050] S230. Generate the authorization page corresponding to the third-party application based on the authorization page address and the authorization page parameters, and display the authorization page.
[0051] Specifically, after determining the authorization page address of the third-party application and the authorization page parameters corresponding to the authorization page address, the authorization page address and the authorization page parameters of the third-party application can be concatenated. Furthermore, the concatenated URL can be obtained. After obtaining the concatenated URL, the authorization page corresponding to the third-party application can be generated based on the concatenated URL. Furthermore, the authorization page corresponding to the third-party application can be displayed.
[0052] Optionally, the parameters in the authorization parameters can include, but are not limited to, the authorization mode, where the authorization mode can be the authorization code mode or the token mode. Embodiments of the present invention introduce how to generate authorization instructions in the authorization code mode and the token mode respectively:
[0053] When the authorization page parameter includes the authorization code mode, it can be understood that when the authorization mode is the authorization code mode, then, based on the authorization page address and the authorization page parameter, the authorization page corresponding to the third-party application can be generated, that is, based on the authorization page address and the authorization code mode, the authorization page corresponding to the third-party application is generated. Correspondingly, the authorization instruction corresponding to the authorized operation is generated in the following manner in response to the authorized operation input based on the authorization page:
[0054] In response to the authorized operation based on the authorization page, an authorization code corresponding to the authorized operation in the authorization code mode is generated, so that the third-party application can obtain an authorization token based on the authorization code, and the authorization token is used as the authorization instruction.
[0055] Among them, the authorization code can be an authorization code generated in response to the authorized operation on the authorization page in the authorization code mode, and can be used to obtain an authorization token. The authorization token can be understood as an identifier or token for data access.
[0056] Specifically, in response to the authorized operation based on the authorization page, the authorization mode corresponding to the authorized operation can be determined. If the authorization mode is the authorization code mode, then an authorization code corresponding to the authorized operation in the authorization code mode can be generated. After generating the authorization code, the authorization code can be sent to the third-party application, which can enable the third-party application to obtain an authorization token based on the authorization code. Furthermore, the authorization token obtained by the third-party application can be used as the authorization instruction.
[0057] When the authorization page parameter includes the token mode, then, based on the authorization page address and the authorization page parameter, the authorization page corresponding to the third-party application can be generated, that is, based on the authorization page address and the token mode, the authorization page corresponding to the third-party application is generated. Correspondingly, the authorization instruction corresponding to the authorized operation is generated in the following manner in response to the authorized operation input based on the authorization page:
[0058] In response to the authorized operation input based on the authorization page, an authorization token corresponding to the authorized operation in the token mode is generated, and the authorization token is used as the authorization instruction.
[0059] Specifically, in response to the authorized operation input based on the authorization page, the authorization mode corresponding to the authorized operation can be determined. If the authorization mode is the token mode, then an authorization token corresponding to the authorized operation in the token mode can be generated. Furthermore, the authorization token can be used as the authorization instruction.
[0060] S240. In response to the authorized operation input based on the authorization page, an authorization instruction corresponding to the authorized operation is generated, so that the third-party application can access the data corresponding to the data access request based on the authorization instruction.
[0061] In the technical solution of the embodiment of the present invention, after determining the domain name of the third-party application included in the data access request, the target domain name configuration information corresponding to the domain name of the third-party application can be determined based on the preset domain name configuration information, where the target domain name configuration information includes the authorization page address of the third-party application and the authorization page parameters corresponding to the authorization page address; based on the authorization page address and the authorization page parameters, an authorization page corresponding to the third-party application is generated, achieving the technical effect of generating the authorization page corresponding to the third-party application more flexibly and effectively.
[0062] Embodiment III
[0063] Figure 3 It is a schematic flowchart of a method for accessing data of a third-party application provided in Embodiment III of the present invention. On the basis of the foregoing embodiments, optionally, the step of enabling the third-party application to access the data corresponding to the data access request based on the authorization instruction includes: sending the authorization instruction to the interface corresponding to the third-party application, so that the third-party application accesses the data corresponding to the data access request by calling the interface. Among them, the same or corresponding technical terms as those in the above embodiments will not be elaborated here.
[0064] As Figure 3 shown, the method of this embodiment may specifically include:
[0065] S310. Receive a data access request from a third-party application. If the user corresponding to the data access request is an unlogged user, determine the domain name of the third-party application included in the data access request.
[0066] S320. Determine the target domain name configuration information corresponding to the domain name of the third-party application, generate an authorization page corresponding to the third-party application based on the target domain name configuration information, and display the authorization page.
[0067] S330. In response to the authorized operation input based on the authorization page, generate an authorization instruction corresponding to the authorized operation, and send the authorization instruction to the interface corresponding to the third-party application, so that the third-party application accesses the data corresponding to the data access request by calling the interface.
[0068] Among them, the interface corresponding to the third-party application can be understood as an interface for transmitting instructions to the third-party application.
[0069] Specifically, in response to the authorized operation input based on the authorization page, an authorization instruction corresponding to the authorized operation can be generated. After the authorization instruction is generated, the authorization instruction can be sent to the interface of the third-party application. So that the third-party application accesses the data corresponding to the data access request by calling the interface of the third-party application.
[0070] Optionally, before sending the authorization instruction to the interface of the third-party application, a communication connection with the third-party application can be established. After the communication connection is successfully established, the interface of the third-party application can be determined, and then the operation of sending the authorization instruction to the interface of the third-party application can be executed.
[0071] It can be understood that if the communication with the third-party application fails to be established, a prompt message for prompting the failure to establish a communication connection with the third-party application can be generated, so as to facilitate re-establishing a communication connection with the third-party application.
[0072] Optionally, the authorization instruction is sent to the interface corresponding to the third-party application through the following steps, so that the third-party application can access the data corresponding to the data access request by calling the interface:
[0073] Step 1: Send the authorization instruction to the real interface of the third-party application.
[0074] Among them, the real interface can be understood as the actual interface of the third-party application. It should be noted that one third-party application corresponds to one real interface.
[0075] Specifically, after generating the authorization instruction corresponding to the authorized operation, the real interface of the third-party application can be determined. After determining the real interface of the third-party application, the authorization instruction can be sent to the real interface of the third-party application.
[0076] Step 2: Determine the proxy interface corresponding to the real interface of the third-party application, so that the third-party application can access the data corresponding to the data access request by calling the proxy interface.
[0077] Among them, the proxy interface can be understood as a proxy interface that proxies the real interface of the third-party application. The corresponding relationship between the real interface and the proxy interface can be one-to-one. It should be noted that the real interfaces of different third-party applications can be different, so the input parameters and output parameters of the proxy interfaces corresponding to the real interfaces of different third-party applications can be the same. Such a setting can reduce code redundancy and reduce code development costs and maintenance costs.
[0078] Specifically, after sending the authorization instruction to the real interface of the third-party application, based on the pre-configured corresponding relationship between the real interface and the proxy interface, the proxy interface corresponding to the real interface of the third-party application can be determined. After determining the proxy interface corresponding to the real interface of the third-party application, the third-party application can be enabled to access the data corresponding to the data access request by calling the proxy interface.
[0079] It should be noted that in the embodiments of the present invention, the third-party application can obtain the data corresponding to the data access request through the parameter mapping between the real interface and the proxy interface. Among them, the request parameters and request addresses of the real interface are assembled and sent according to the call mode (POST, GET) and request type (JSON, FORM) of the real interface.
[0080] In the technical solution of the embodiments of the present invention, after generating the authorization instruction corresponding to the authorized operation, the authorization instruction is sent to the interface corresponding to the third-party application, so that the third-party application can access the data corresponding to the data access request by calling the interface, so that the third-party application can access the data corresponding to the data access request based on the authorization instruction, achieving the technical effect of not only reducing code redundancy, development cost and maintenance cost, but also reducing the complexity of data access, thereby improving the efficiency of data access.
[0081] Embodiment 4
[0082] An optional embodiment of a data access method for a third-party application is provided in Embodiment 4 of the present invention, and its specific implementation manner can be referred to in the following embodiments. Among them, the same or corresponding technical terms as those in the above embodiments will not be described in detail here.
[0083] See Figure 4 , the method of this embodiment specifically includes the following steps:
[0084] S410. Receive the user information access request of the third-party application. If the user corresponding to the user information access request is an unlogged user, determine the domain name of the third-party application in the user information access request.
[0085] Among them, the user information access request can be a data access request.
[0086] S420. Determine the target domain name configuration information corresponding to the domain name of the third-party application based on the preset domain name configuration information. Among them, the target domain name configuration information generates the authorization page address and authorization page parameters corresponding to the third-party application.
[0087] It should be noted that the preset domain name configuration information can flexibly configure the authorization page address and authorization page parameters corresponding to each third-party application according to actual needs.
[0088] S430. Concatenate the authorization page address and authorization page parameters, generate the authorization page corresponding to the third-party application based on the concatenated address, and display the authorization page.
[0089] S440. In response to the authorized operation input based on the authorization page, determine the authorization mode corresponding to the authorized operation. Generate an authorization instruction corresponding to the authorized operation based on the authorization mode.
[0090] Specifically, in response to an authorized operation input based on an authorization page, determine the authorization mode corresponding to the authorized operation. If the authorization mode is the authorization code mode, generate an authorization code corresponding to the authorized operation in the authorization code mode, so that the third-party application can obtain an authorization token based on the authorization code, and use the authorization token as an authorization instruction. If the authorization mode is the token mode, generate an authorization token corresponding to the authorized operation in the token mode, and use the authorization token as an authorization instruction.
[0091] S450. Send the authorization instruction to the real interface of the third-party application.
[0092] S460. Based on the pre-configured correspondence between the real interface and the proxy interface, determine the proxy interface corresponding to the real interface of the third-party application, so that the third-party application can access the user information corresponding to the user information access request by calling the proxy interface.
[0093] Exemplarily, the third-party application can be the third application App1 and the third application App2. Among them, the real interface of the third application App1 is the real interface C1, and the real interface of the third application App2 is the real interface C2. The pre-configured correspondence between the real interface and the proxy interface can be that the proxy interface corresponding to the real interface C1 is the proxy interface Agent1, and the proxy interface corresponding to the real interface C2 is the proxy interface Agent2. If the current third-party application is App1, the real interface of the third application App1 is the real interface C1, and the proxy interface corresponding to the real interface C1 of the third application App1 is the proxy interface Agent2, then the third application App1 can obtain the user information corresponding to the user information access request by calling the proxy interface Agent2, and map the data obtained by the proxy interface to the real interface C1, so as to obtain the user information corresponding to the user information access request.
[0094] In the embodiment of the present invention, the third-party application can implement joint login by calling the proxy interface to access the user information corresponding to the user information access request.
[0095] The technical solution of the embodiment of the present invention solves the technical problems of code redundancy, high development cost and maintenance cost, and high complexity of data access in the data access of existing third-party applications, and realizes not only reducing code redundancy, lowering development cost and maintenance cost, but also reducing the complexity of data access, thereby improving the efficiency of data access.
[0096] Embodiment Five
[0097] Figure 5It is a schematic structural diagram of a data access device for a third-party application provided in the fifth embodiment of the present invention. The present invention provides a data access device for a third-party application, and the device includes: a domain name determination module 510, an authorization page display module 520, and a data access module 530.
[0098] Among them, the domain name determination module 510 is configured to receive a data access request of a third-party application. If the user corresponding to the data access request is an unlogged-in user, the third-party application domain name included in the data access request is determined. The authorization page display module 520 is configured to determine the target domain name configuration information corresponding to the third-party application domain name, generate an authorization page corresponding to the third-party application based on the target domain name configuration information, and display the authorization page. The data access module 530 is configured to generate an authorization instruction corresponding to the authorized operation in response to the authorized operation input based on the authorization page, so that the third-party application accesses the data corresponding to the data access request based on the authorization instruction.
[0099] The technical solution of the embodiment of the present invention, through the domain name determination module, receives the data access request of the third-party application. If the user corresponding to the data access request is an unlogged-in user, the third-party application domain name included in the data access request can be determined, which can improve the access efficiency of the third-party application. Furthermore, through the authorization page display module, the target domain name configuration information corresponding to the third-party application domain name can be determined, which can reduce the amount of code and code redundancy. After determining the target domain name configuration information corresponding to the third-party application domain name, an authorization page corresponding to the third-party application can be generated based on the target domain name configuration information, and the authorization page can be displayed to display the authorization page in a visual form. After the authorization page is displayed, an authorization operation can be performed based on the authorization page, so as to implement interactive response processing. Then, through the data access module, in response to the authorized operation input based on the authorization page, an authorization instruction corresponding to the authorized operation can be generated, so that the third-party application accesses the data corresponding to the data access request based on the authorization instruction, solving the technical problems of code redundancy, high development cost and maintenance cost, and high complexity of data access in the existing data access of third-party applications, and realizing not only reducing code redundancy, reducing development cost and maintenance cost, but also reducing the complexity of data access, thereby improving the efficiency of data access.
[0100] Optionally, the authorization page display module 520 is configured to determine target domain name configuration information corresponding to the third-party application domain name based on preset domain name configuration information, where the target domain name configuration information includes the authorization page address of the third-party application and authorization page parameters corresponding to the authorization page address; and generate an authorization page corresponding to the third-party application based on the authorization page address and the authorization page parameters.
[0101] Optionally, the authorization page parameters include an authorization code mode. The authorization page display module 520 is configured to generate an authorization page corresponding to the third-party application based on the authorization page address and the authorization code mode; and the data access module 530 is configured to generate an authorization code corresponding to the authorized operation in the authorization code mode in response to an authorized operation based on the authorization page, so that the third-party application obtains an authorization token based on the authorization code and uses the authorization token as an authorization instruction.
[0102] Optionally, the authorization page parameters include a token mode. The authorization page display module 520 is configured to generate an authorization page corresponding to the third-party application based on the authorization page address and the token mode; and the data access module 530 is configured to generate an authorization token corresponding to the authorized operation in the token mode in response to an authorized operation input based on the authorization page and use the authorization token as an authorization instruction.
[0103] Optionally, the data access module 530 is configured to send the authorization instruction to an interface corresponding to the third-party application, so that the third-party application accesses data corresponding to the data access request by calling the interface.
[0104] Optionally, the data access module 530 is specifically configured to send the authorization instruction to the real interface of the third-party application; determine a proxy interface corresponding to the real interface of the third-party application, so that the third-party application accesses data corresponding to the data access request by calling the proxy interface.
[0105] Optionally, the data access module 530 is configured to determine a proxy interface corresponding to the real interface of the third-party application based on a pre-configured correspondence between the real interface and the proxy interface.
[0106] The above device can execute the data access method for a third-party application provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to executing the data access method for a third-party application.
[0107] It should be noted that the various units and modules included in the above-mentioned data access device of the third-party application are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the embodiments of the present invention.
[0108] Embodiment Six
[0109] Figure 6 It is a schematic structural diagram of an electronic device provided by Embodiment Six of the present invention. Figure 6 It shows a block diagram of an exemplary electronic device 12 suitable for implementing any embodiment of the present invention. Figure 6 The shown electronic device 12 is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present invention. The device 12 is typically an electronic device that undertakes the processing of configuration information.
[0110] As Figure 6 shown, the electronic device 12 is presented in the form of a general-purpose computing device. The components of the electronic device 12 may include but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 connecting different components (including the memory 28 and the processing unit 16).
[0111] The bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure in a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0112] The electronic device 12 typically includes a variety of computer-readable media. These media can be any available media accessible by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0113] The memory 28 may include a computer device-readable medium in the form of volatile memory, such as a random access memory (RAM) 30 and / or a cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer storage media. By way of example only, the storage system 34 may be used for reading and writing on a non-removable, non-volatile magnetic medium (not shown in the figure, commonly referred to as a "hard disk drive"). Although not shown in the figure, a disk drive for reading and writing on a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing on a removable non-volatile optical disk (such as a compact disc-read only memory (CD-ROM), a digital video disc-read only memory (DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 through one or more data media interfaces. The memory 28 may include at least one program product 40 having a set of program modules 42 configured to perform the functions of the embodiments of the present invention. The program product 40, which may be stored, for example, in the memory 28, such program modules 42 include, but are not limited to, one or more application programs, other program modules, and program data, and the implementation of a network environment may be included in each or some combination of these examples. The program modules 42 generally perform the functions and / or methods in the embodiments described in the present invention.
[0114] The electronic device 12 may also communicate with one or more external devices 14 (such as a keyboard, a mouse, a camera, etc. and a display), and may also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication may be carried out through an input / output (I / O) interface 22. Moreover, the electronic device 12 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN)) and / or a public network, such as the Internet, through a network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the electronic device 12 through the bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in combination with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, redundant arrays of independent disks (RAID) devices, magnetic tape drives, and data backup storage devices, etc.
[0115] The processing unit 16 executes various functional applications and data processing by running the programs stored in the memory 28, for example, implementing the data access method for the third-party application program provided in the foregoing embodiments of the present invention. The method includes:
[0116] Receiving a data access request from a third-party application program. If the user corresponding to the data access request is an unlogged-in user, determining the domain name of the third-party application program included in the data access request; determining the target domain name configuration information corresponding to the domain name of the third-party application program, generating an authorization page corresponding to the third-party application program based on the target domain name configuration information, and displaying the authorization page; in response to an authorized operation input based on the authorization page, generating an authorization instruction corresponding to the authorized operation, so that the third-party application program accesses the data corresponding to the data access request based on the authorization instruction.
[0117] Certainly, those skilled in the art can understand that the processor can also implement the technical solutions of the data access method for the third-party application program provided in any embodiment of the present invention.
[0118] Embodiment Six
[0119] Embodiment Six of the present invention further provides a computer-readable storage medium, on which a computer program is stored. The feature is that when the program is executed by a processor, for example, the data access method for the third-party application program provided in the foregoing embodiments of the present invention. The method includes:
[0120] Receiving a data access request from a third-party application program. If the user corresponding to the data access request is an unlogged-in user, determining the domain name of the third-party application program included in the data access request; determining the target domain name configuration information corresponding to the domain name of the third-party application program, generating an authorization page corresponding to the third-party application program based on the target domain name configuration information, and displaying the authorization page; in response to an authorized operation input based on the authorization page, generating an authorization instruction corresponding to the authorized operation, so that the third-party application program accesses the data corresponding to the data access request based on the authorization instruction.
[0121] The computer storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable media. The computer-readable media may be computer-readable signal media or computer-readable storage media. The computer-readable storage media may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage media may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0122] The computer-readable signal media may include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal media may also be any computer-readable media other than the computer-readable storage media, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0123] The program code contained on the computer-readable media may be transmitted by any appropriate medium, including but not limited to wireless, wire, optical fiber cable, RF, etc., or any suitable combination of the above.
[0124] The computer program code for performing the operations of the embodiments of the present invention may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0125] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A data access method for a third-party application, characterized in that Including: Receiving a data access request from a third - party application. If the user corresponding to the data access request is an unlogged - in user, determining the domain name of the third - party application included in the data access request; Determining target domain - name configuration information corresponding to the domain name of the third - party application based on preset domain - name configuration information. Wherein, the target domain - name configuration information includes the authorization page address of the third - party application and the authorization page parameters corresponding to the authorization page address; Concatenating the authorization page address and the authorization page parameters, generating an authorization page corresponding to the third - party application based on the concatenated address, and displaying the authorization page; In response to an authorized operation input based on the authorization page, determining the authorization mode corresponding to the authorized operation, and generating an authorization instruction corresponding to the authorized operation based on the authorization mode, so that the third - party application accesses the data corresponding to the data access request based on the authorization instruction.
2. The method according to claim 1, characterized in that, The authorization mode includes the authorization - code mode. The step of, in response to an authorized operation input based on the authorization page, determining the authorization mode corresponding to the authorized operation, and generating an authorization instruction corresponding to the authorized operation based on the authorization mode includes: In response to an authorized operation based on the authorization page, generating an authorization code corresponding to the authorized operation in the authorization - code mode, so that the third - party application obtains an authorization token based on the authorization code, and using the authorization token as the authorization instruction.
3. The method according to claim 1, characterized in that The authorization mode includes the token mode; The step of, in response to an authorized operation input based on the authorization page, determining the authorization mode corresponding to the authorized operation, and generating an authorization instruction corresponding to the authorized operation based on the authorization mode includes: In response to an authorized operation based on the authorization page, generating an authorization token corresponding to the authorized operation in the token mode, and using the authorization token as the authorization instruction.
4. The method according to claim 1, wherein The step of so that the third - party application accesses the data corresponding to the data access request based on the authorization instruction includes: Sending the authorization instruction to an interface corresponding to the third - party application, so that the third - party application accesses the data corresponding to the data access request by calling the interface.
5. The method according to claim 4, characterized in that, The step of sending the authorization instruction to an interface corresponding to the third - party application, so that the third - party application accesses the data corresponding to the data access request by calling the interface includes: Sending the authorization instruction to the real interface of the third - party application; Determining a proxy interface corresponding to the real interface of the third - party application, so that the third - party application accesses the data corresponding to the data access request by calling the proxy interface.
6. The method according to claim 5, wherein The step of determining a proxy interface corresponding to the real interface of the third - party application includes: Determining a proxy interface corresponding to the real interface of the third - party application based on the pre - configured correspondence between the real interface and the proxy interface.
7. A data access device for a third-party application, characterized in that, Including: A domain - name determination module, configured to receive a data access request from a third - party application. If the user corresponding to the data access request is an unlogged - in user, determining the domain name of the third - party application included in the data access request; An authorization page display module, configured to determine target domain name configuration information corresponding to the third-party application domain name based on preset domain name configuration information, where the target domain name configuration information includes the authorization page address of the third-party application and authorization page parameters corresponding to the authorization page address; splice the authorization page address and the authorization page parameters, generate an authorization page corresponding to the third-party application based on the spliced address, and display the authorization page; A data access module, configured to, in response to an authorized operation input based on the authorization page, determine an authorization mode corresponding to the authorized operation, and generate an authorization instruction corresponding to the authorized operation based on the authorization mode, so that the third-party application accesses data corresponding to the data access request based on the authorization instruction.
8. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs; When the program is executed by the processor, the processor implements the data access method of the third-party application as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the data access method of the third-party application as described in any one of claims 1-6.
Citation Information
Patent Citations
Network access control method, device, and apparatus and medium
CN110730174A