CN106529325A - Data sharing method and apparatus - Google Patents
Data sharing method and apparatus Download PDFInfo
- Publication number
- CN106529325A CN106529325A CN201610866197.6A CN201610866197A CN106529325A CN 106529325 A CN106529325 A CN 106529325A CN 201610866197 A CN201610866197 A CN 201610866197A CN 106529325 A CN106529325 A CN 106529325A
- Authority
- CN
- China
- Prior art keywords
- authorization
- identifier
- mapping
- storage location
- mapping table
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2141—Access rights, e.g. capability lists, access control lists, access tables, access matrices
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明实施例提供一种数据共享方法及装置,涉及互联网技术领域,主要目的是用以解决现有技术中用户在数据共享过程中操作繁琐的问题。本发明实施例所采用的技术方案是:接收授权请求响应,所述授权请求响应中携带有授权标识;根据指示信息从预置存储位置中获取与所述授权标识对应的映射授权标识,所述预置存储位置中保存有不同授权标识对应的映射授权标识;根据所述映射授权标识获取共享数据。本发明主要用于数据的共享。
Embodiments of the present invention provide a data sharing method and device, which relate to the technical field of the Internet, and are mainly used to solve the problem of cumbersome operations for users in the data sharing process in the prior art. The technical solution adopted in the embodiment of the present invention is: receiving the authorization request response, the authorization request response carrying the authorization identifier; obtaining the mapped authorization identifier corresponding to the authorization identifier from the preset storage location according to the instruction information, and the Mapping authorization identifiers corresponding to different authorization identifiers are stored in the preset storage location; shared data is obtained according to the mapping authorization identifiers. The present invention is mainly used for data sharing.
Description
技术领域technical field
本发明实施例涉及互联网技术领域,尤其涉及一种数据共享方法及装置。The embodiments of the present invention relate to the technical field of the Internet, and in particular, to a data sharing method and device.
背景技术Background technique
随着智能终端的快速发展,用户可以通过应用商城下载所需的应用程序,从而使得很多简单的操作和娱乐活动能够直接在终端上完成。由于每个应用程序都有用户身份证明(User Identification,UID),只有携带有应用程序的UID才能读取该应用程序覆盖的有关资料。With the rapid development of smart terminals, users can download required applications through the application store, so that many simple operations and entertainment activities can be directly completed on the terminal. Since each application program has a user identification (User Identification, UID), only the UID carrying the application program can read the relevant data covered by the application program.
当需要应用程序之间进行数据共享时,由于用户采用同一账号请求授权服务器登陆A应用程序中返回的UID和请求授权服务器登陆B应用程序返回的UID是不相同的,使得A应用程序与B应用程序无法进行数据共享,现有技术通常分别将用户会将请求授权服务器登陆应用程序返回的UID保存至本地,然后通过集成两个应用程序返回的UID来实现数据共享,然而,发明人在实现发明的过程中发现,上述数据共享的方式需要用户在客户端进行两次登录操作,使得用户操作繁琐,进而导致用户在客户端的操作体验较差。When it is necessary to share data between applications, since the UID returned by the user to request the authorization server to log in to the A application using the same account is different from the UID returned by requesting the authorization server to log in to the B application, the A application and the B application The program cannot share data. In the existing technology, the UID returned by the user to request the authorization server to log in to the application is usually saved locally, and then data sharing is realized by integrating the UIDs returned by the two applications. However, the inventor realizes the invention During the process, it was found that the above data sharing method requires the user to perform two login operations on the client terminal, which makes the user operation cumbersome and leads to poor user experience on the client terminal.
发明内容Contents of the invention
本发明实施例提供一种数据共享方法及装置,用以解决现有技术中用户在数据共享过程中操作繁琐的问题。Embodiments of the present invention provide a data sharing method and device to solve the problem of cumbersome operations for users in the data sharing process in the prior art.
一方面,本发明实施例提供了一种数据共享方法,包括:On the one hand, an embodiment of the present invention provides a data sharing method, including:
接收授权请求响应,所述授权请求响应中携带有授权标识;receiving an authorization request response, the authorization request response carrying an authorization identifier;
根据指示信息从预置存储位置中获取与所述授权标识对应的映射标识,所述预置存储位置中保存有不同授权标识对应的映射授权标识;Acquiring a mapping identifier corresponding to the authorization identifier from a preset storage location according to the indication information, where mapping authorization identifiers corresponding to different authorization identifiers are stored in the preset storage location;
根据所述映射授权标识获取共享数据。Obtain the shared data according to the mapping authorization identifier.
另一方面,本发明实施例提供了一种数据共享装置,包括:On the other hand, an embodiment of the present invention provides a data sharing device, including:
接收单元,用于接收授权请求响应,所述授权请求响应中携带有授权标识;a receiving unit, configured to receive an authorization request response, the authorization request response carrying an authorization identifier;
获取单元,用于根据指示信息从预置存储位置中获取与所述授权标识对应的映射标识,所述预置存储位置中保存有不同授权标识对应的映射授权标识;An acquisition unit, configured to acquire a mapping identifier corresponding to the authorization identifier from a preset storage location according to the indication information, where mapped authorization identifiers corresponding to different authorization identifiers are stored in the preset storage location;
共享单元,用于根据所述映射授权标识获取共享数据。A sharing unit, configured to acquire shared data according to the mapping authorization identifier.
本发明实施例提供的一种数据共享方法及装置,首先接收授权请求响应,该授权请求响应中携带有授权标识,然后根据指示信息从预置存储位置中获取与授权标识对应的映射授权标识,这里的预置存储位置中保存有不同授权标识对应的映射授权标识,以便于获取到与授权标识对应的映射授权标识,进而得到与映射授权标识对应的共享数据。与现有技术的数据共享方法相比,本发明实施例通过根据指示信息从预置存储位置中获取与授权标识对应的映射授权标识,使得用户无需在客户端进行两次登录,更加方便用户操作,进一步地,通过登录映射授权标识信获取与映射授权标识信息对应的共享数据,实现应用程序之间的数据共享,从而增强了应用程序之间的互动性。A data sharing method and device provided by an embodiment of the present invention firstly receives an authorization request response carrying an authorization identifier, and then obtains a mapped authorization identifier corresponding to the authorization identifier from a preset storage location according to the instruction information, The mapped authorization identifiers corresponding to different authorization identifiers are stored in the preset storage location here, so as to obtain the mapped authorization identifiers corresponding to the authorized identifiers, and then obtain the shared data corresponding to the mapped authorization identifiers. Compared with the data sharing method in the prior art, the embodiment of the present invention obtains the mapping authorization identification corresponding to the authorization identification from the preset storage location according to the instruction information, so that the user does not need to log in twice at the client, which is more convenient for the user to operate Further, the shared data corresponding to the mapping authorization identification information is obtained by logging in the mapping authorization identification information, so as to realize data sharing between application programs, thereby enhancing the interactivity between application programs.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作以简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明实施例提供的一种数据共享方法流程图;FIG. 1 is a flowchart of a data sharing method provided by an embodiment of the present invention;
图2为本发明实施例提供的另一种数据共享方法流程图;FIG. 2 is a flow chart of another data sharing method provided by an embodiment of the present invention;
图3为本发明实施例提供的一种数据共享装置结构示意图;FIG. 3 is a schematic structural diagram of a data sharing device provided by an embodiment of the present invention;
图4为本发明实施例提供的另一种数据共享装置结构示意图;FIG. 4 is a schematic structural diagram of another data sharing device provided by an embodiment of the present invention;
图5为本发明实施例提供的一种服务器的装置结构示意图。FIG. 5 is a schematic structural diagram of a server device provided by an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
本发明实施例提供了一种数据共享方法,如图1所示,该方法包括:The embodiment of the present invention provides a data sharing method, as shown in Figure 1, the method includes:
101、接收授权请求响应。101. Receive an authorization request response.
其中,授权请求响应中携带有授权标识,如UID、openid等能够标识用户身份的标识信息,本发明实施例对此不做限定,这里的授权标识相当于请求第三方应用程序授权登录当前应用程序返回的身份验证信息,以便于根据该授权标识中携带的第三方应用程序携带的信息完成登录。Wherein, the authorization request response carries an authorization identifier, such as UID, openid and other identification information that can identify the identity of the user, which is not limited in the embodiment of the present invention. The authorization identifier here is equivalent to requesting a third-party application program to authorize the login of the current application program The returned identity verification information, so as to complete the login according to the information carried by the third-party application carried in the authorization ID.
举例来说,如果用户在使用应用程序中需要登录时,会提示出注册登录或者第三方授权登录的方式,相应的页面上会显示出微信、腾讯qq或者新浪微博等第三方应用授权登录的图标,以便用户进行选择,当用户选择使用微信第三方授权登录的方式后,会通过接收到的微信返回的授权标识来获取用户的基本信息,从而实现成登录。For example, if the user needs to log in when using an application, the user will be prompted to register and log in or a third-party authorized login method, and the corresponding page will display the third-party application authorized login method such as WeChat, Tencent QQ or Sina Weibo. icon, so that the user can choose. When the user chooses to use the WeChat third-party authorized login method, the basic information of the user will be obtained through the received authorization ID returned by WeChat, so as to realize the login.
102、根据指示信息从预置存储位置中获取与授权标识对应的映射授权标识。102. Obtain a mapped authorization identifier corresponding to the authorization identifier from a preset storage location according to the indication information.
其中,预置存储位置中保存有不同授权标识对应的映射授权标识,这里的映射授权标识为共享应用程序通过授权登录得到的授权标识,对于本发明实施例,通过从预置存储位置中查找到共享应用程序对应的映射授权标识,从而实现与共享应用程序之间的数据共享。Wherein, the mapped authorization IDs corresponding to different authorization IDs are stored in the preset storage location, where the mapped authorization ID is the authorization ID obtained by the shared application through authorized login. For the embodiment of the present invention, by searching the preset storage location The mapping authorization ID corresponding to the sharing application, so as to realize data sharing with the sharing application.
这里的共享应用程序为根据用户指示信息选定的应用程序,需要说明的是,一个应用程序可以要求与多台应用程序进行数据共享,本发明实施例对共享应用程序的数量不做限定,由此可知一个授权标识可以对应有多个映射授权标识。The shared application program here is an application program selected according to user instruction information. It should be noted that one application program may require data sharing with multiple application programs. The embodiment of the present invention does not limit the number of shared application programs. It can be seen that one authorization ID can correspond to multiple mapping authorization IDs.
需要说明的是,预置存储位置可以包括存储服务器、数据库、缓存服务器等,本发明实施例对预置存储位置不做限定。It should be noted that the preset storage location may include a storage server, a database, a cache server, etc., and the embodiment of the present invention does not limit the preset storage location.
103、根据映射授权标识获取共享数据。103. Acquire the shared data according to the mapping authorization identifier.
当获取到映射授权标识后,用户以后便可以直接使用映射授权标识登录,实现查看共享应用程序中的用户操作信息,使得用户无需每次操作应用程序都进行两次登录,直接打开应用程序便自动实现数据共享,方便用户使用,另外,根据用户需求也可选择不同的共享应用程序,实现应用程序之间的灵活互通。After obtaining the mapping authorization ID, the user can log in directly with the mapping authorization ID in the future to view user operation information in the shared application, so that the user does not need to log in twice every time the application is operated, and the application will be automatically opened directly Realize data sharing, which is convenient for users to use. In addition, different shared applications can also be selected according to user needs to achieve flexible interoperability between applications.
本发明实施例提供的一种数据共享方法,首先接收授权请求响应,该授权请求响应中携带有授权标识,然后根据指示信息从预置存储位置中获取与授权标识对应的映射授权标识,这里的预置存储位置中保存有不同授权标识对应的映射授权标识,以便于获取到与授权标识对应的映射授权标识,进而得到与映射授权标识对应的共享数据。与现有技术的数据共享方法相比,本发明实施例通过根据指示信息从预置存储位置中获取与授权标识对应的映射授权标识,使得用户无需在客户端进行两次登录,更加方便用户操作,进一步地,通过登录映射授权标识信获取与映射授权标识信息对应的共享数据,实现应用程序之间的数据共享,从而增强了应用程序之间的互动性。A data sharing method provided by an embodiment of the present invention firstly receives an authorization request response carrying an authorization identifier, and then obtains a mapped authorization identifier corresponding to the authorization identifier from a preset storage location according to the instruction information, where The mapped authorization identifiers corresponding to different authorization identifiers are stored in the preset storage location, so as to obtain the mapped authorization identifiers corresponding to the authorized identifiers, and then obtain the shared data corresponding to the mapped authorization identifiers. Compared with the data sharing method in the prior art, the embodiment of the present invention obtains the mapping authorization identification corresponding to the authorization identification from the preset storage location according to the instruction information, so that the user does not need to log in twice at the client, which is more convenient for the user to operate Further, the shared data corresponding to the mapping authorization identification information is obtained by logging in the mapping authorization identification information, so as to realize data sharing between application programs, thereby enhancing the interactivity between application programs.
本发明实施例提供了另一种数据共享方法,如图2所示,该方法包括:The embodiment of the present invention provides another data sharing method, as shown in Figure 2, the method includes:
201、接收授权请求响应。201. Receive an authorization request response.
当用户在首次登陆应用程序时,需要选择登陆方式,现有的登陆方式主要有第三方授权登录和注册登录两种方式,对于本发明实施例,当用户选择第三方授权登录后,会向授权服务器发送授权请求,然后接收授权服务器返回授权标识并保存至本地,以便根据授权标识获取用户的操作数据,这里的授权标识可以包括但不限制于UID、appid等能够表明身份信息的标识,对于多个应用程序上述步骤同样适用。When the user logs in to the application program for the first time, he needs to choose a login method. The existing login methods mainly include third-party authorization login and registration login. The server sends an authorization request, and then receives the authorization server to return the authorization ID and save it locally, so as to obtain the user's operation data according to the authorization ID. The authorization ID here can include but is not limited to UID, appid, etc., which can indicate identity information. For multiple The same steps above apply for each application.
202、通过预设接口接收授权标识映射表。202. Receive an authorization identifier mapping table through a preset interface.
其中,授权映射表中记录有不同授权标识对应的映射授权标识,预设接口为自定义的应用程序接口,即api(Application Programming Interface)接口,可以进行预先定义一些函数,具体的函数定义方法本发明实施例不做具体限定。Among them, the authorization mapping table records the mapping authorization identifications corresponding to different authorization identifications. The default interface is a custom application program interface, that is, the api (Application Programming Interface) interface, which can pre-define some functions. The specific function definition method The embodiments of the invention are not specifically limited.
需要说明的是,api接口与预置存储位置相连接,在接口接收到授权映射表之后,直接将授权映射表存储至预置存储位置中。而在存储之前,需要客户端与预置服务器进行请求开放api接口的交互,客户端接收到请求开放api接口响应后,才可以进行数据的传输。通过预设接口接收授权按映射表,实现映射授权标识能够存储在固定存储位置中,以便于客户端的查找与进行实时处理。It should be noted that the api interface is connected to the preset storage location, and after the interface receives the authorization mapping table, the authorization mapping table is directly stored in the preset storage location. Before storing, the client needs to interact with the preset server to request the open API interface, and the client can only transmit data after receiving the response to the request open API interface. Receive the authorization according to the mapping table through the preset interface, and realize that the mapping authorization identifier can be stored in a fixed storage location, so as to facilitate the client's search and real-time processing.
上述的授权映射表的生成方式可以包括但不限制于下述步骤,预置服务器通过上报接口接收多个应用程序从第三方授权登录后返回的授权标识,并将不同授权标识之间进行一一映射,以得到授权映射表。The above method of generating the authorization mapping table may include but not limited to the following steps. The pre-configured server receives the authorization IDs returned by multiple applications from the third-party authorized login through the reporting interface, and performs one-by-one comparison between different authorization IDs. Mapping to get the authorization mapping table.
进一步可以将授权映射表保存至预置服务器的缓存或者数据库中,当预置服务器接收到客户端发送的获取请求后,将授权映射表发送至客户端,以便客户端根据授权映射表查找与共享应用程序对应的映射授权标识。Furthermore, the authorization mapping table can be saved in the cache or database of the pre-configuration server. When the pre-configuration server receives the acquisition request sent by the client, it will send the authorization mapping table to the client, so that the client can search and share according to the authorization mapping table. The mapping authorization ID corresponding to the application.
203、将所述授权映射表存储至预置存储位置中。203. Store the authorization mapping table in a preset storage location.
其中,预置存储位置中保存的授权映射表中具体可以包括不同应用程序授权登录的UID和共享应用程序的映射UID,其中,两个UID的值不同,需要说明的是,这里的授权映射表中的映射关系是一一映射的,若存在与多个应用程序共享数据的情况,需要建立与每个共享应用程序的映射关系,以便于客户端进行查找。Wherein, the authorization mapping table saved in the preset storage location may specifically include the UIDs authorized to log in by different applications and the mapped UIDs of shared applications, wherein the values of the two UIDs are different. It should be noted that the authorization mapping table here The mapping relationship in is a one-to-one mapping. If there is a situation of sharing data with multiple applications, it is necessary to establish a mapping relationship with each shared application to facilitate the client to search.
本发明实施例通过授权映射表将原始的授权标识替换为映射授权标识,最终实现授权标识的更新,使得同一用户的两个应用程序在选择相同第三方授权登录时,能够实现数据共享,进一步避免服务器中存在过多的资源占用,提高了数据资源的利用率。In the embodiment of the present invention, the original authorization ID is replaced by the mapping authorization ID through the authorization mapping table, and finally the authorization ID is updated, so that when two applications of the same user select the same third-party authorization to log in, data sharing can be realized, further avoiding Excessive resource occupation exists in the server, which improves the utilization rate of data resources.
204、按照预置时间间隔更新授权标识映射表。204. Update the authorization identifier mapping table according to a preset time interval.
对于本发明实施例,由于授权映射表中的共享应用程序会随着用户下载数量逐渐增多,因此有必要对授权映射表进行实时更新,本发明实施例对预置时间间隔不做限定,可以为1天、一周或者一个月。For the embodiment of the present invention, since the number of shared applications in the authorization mapping table will gradually increase with the number of users downloading, it is necessary to update the authorization mapping table in real time. The embodiment of the present invention does not limit the preset time interval, which can be 1 day, a week or a month.
具体地,预置服务器通过后台单独启动一个线程,每天定时从数据库或者缓存中保存的授权标识以及客户端实时反馈的授权标识进行汇总,然后建立授权标识与映射授权标识之间的映射关系,并将更新的映射关系保存至授权映射表中,完成更新操作。Specifically, the pre-set server independently starts a thread through the background, collects the authorization ID stored in the database or cache and the authorization ID fed back by the client in real time at regular intervals every day, and then establishes the mapping relationship between the authorization ID and the mapped authorization ID, and Save the updated mapping relationship to the authorization mapping table to complete the update operation.
205、根据指示信息从授权标识映射表中获取与授权标识对应的映射授权标识。205. Obtain the mapped authorization ID corresponding to the authorization ID from the authorization ID mapping table according to the indication information.
由于授权标识映射表中存储有不同授权标识与共享应用程序之间的映射关系,根据客户端已经保存在本地的授权标识从授权标识映射表中查找与共享应用程序对应的映射授权标识,并将映射授权标识替代之前的授权标识保存在本地,以便用户以后可以直接根据映射授权标识请求第三方授权登陆,进而获取与读取应用程序相关的数据,从而实现数据共享。Since the mapping relationship between different authorization IDs and shared applications is stored in the authorization ID mapping table, the mapping authorization ID corresponding to the shared application program is searched from the authorization ID mapping table according to the authorization ID stored locally by the client, and the The mapped authorization ID replaces the previous authorization ID and is stored locally, so that the user can directly request a third-party authorization login based on the mapped authorization ID in the future, and then obtain data related to reading the application, thereby realizing data sharing.
需要说明的是,这里的指示信息为根据用户实际需求设置需要共享数据的应用程序,进而获取需要共享数据的应用程序对应的映射授权标识,进一步能够读取共享应用程序的数据,如能读取到共享应用程序中的点赞行为和评论行为。It should be noted that the instruction information here is to set the application program that needs to share data according to the actual needs of the user, and then obtain the mapping authorization ID corresponding to the application program that needs to share data, and further be able to read the data of the shared application program. If you can read Like behavior and comment behavior in sharing application.
206、根据映射标识获取共享数据。206. Acquire the shared data according to the mapping identifier.
具体地,根据映射标识获取共享数据可以包括但不限制于如下步骤:通过预设接口接收与映射标识关联的应用操作数据,这里的应用操作数据为用户在共享应用程序中各种操作行为产生的操作数据,如用户的点赞行为数据或者用户的浏览行为数据,进一步对应用操作数据进行数据进行处理,得到共享数据。Specifically, obtaining shared data according to the mapping identifier may include but not limited to the following steps: receiving application operation data associated with the mapping identifier through a preset interface, where the application operation data is generated by various operation behaviors of the user in the shared application program The operation data, such as the user's like behavior data or the user's browsing behavior data, is further processed by the application operation data to obtain the shared data.
对于本发明实施例,具体的应用场景可以如下所示,但不限于此,包括:当用户在通过第三方应用程序微信授权登陆A应用程序时,客户端能够接收到授权服务器返回的uid并保存至本地,此时若用户想读取B应用程序中的用户操作数据,完成与B应用程序的互通,实现数据共享,首先通过上报接口api请求开放接口与应用服务端进行交互,该应用服务端中保存有授权映射表,并且在授权映射表中保存有不同应程序的uid与共享应用程序的uid的映射关系,这里包含有A应用程序与B应用程序的uid映射关系,进而客户端通过与应用服务器进行交互从应用服务器端获取授权映射表,并将授权映射表保存至A应用程序的本地中,或者也可以直接从应用程序中获取与B应用程序的uid,以便将B应用程序的uid替换保存至A应用程序的本地中,当A应用程序登录的时候,可以直接使用替换后的uid登陆,进而根据替换的uid从应用服务端中读取B应用程序的行为操作数据,进而实现数据共享。For the embodiment of the present invention, the specific application scenarios can be as follows, but not limited thereto, including: when the user authorizes to log in to the A application through the third-party application WeChat, the client can receive and save the uid returned by the authorization server To the local, if the user wants to read the user operation data in the B application program at this time, complete the intercommunication with the B application program, and realize data sharing, first request the open interface to interact with the application server through the reporting interface api, the application server The authorization mapping table is saved in the authorization mapping table, and the mapping relationship between the uid of different application programs and the uid of the shared application program is stored in the authorization mapping table, which includes the uid mapping relationship between the A application program and the B application program, and then the client passes through the The application server interacts to obtain the authorization mapping table from the application server, and save the authorization mapping table locally in the A application, or directly obtain the uid of the B application from the application, so that the B application's uid The replacement is saved to the local of the A application. When the A application logs in, it can directly use the replaced uid to log in, and then read the behavior operation data of the B application from the application server according to the replaced uid, and then realize the data. shared.
本发明实施例提供的另一种数据共享方法,通过预设接口与预置服务器进行交互,使得整个应用程序的共享过程中,网络请求代价低、服务器成本低,通过对授权映射表的定时更新,使得对于已经不再使用应用程序的用户可以不进行数据共享,从而节省了服务器资源,另外,对于同一用户可以选择与通过相同第三方授权登陆的应用程序进行数据共享,也可选择与通过不同第三方授权登陆的应用程序进行数据共享,增加了方案的灵活度。Another data sharing method provided by the embodiment of the present invention interacts with a preset server through a preset interface, so that in the sharing process of the entire application program, the network request cost is low and the server cost is low. , so that data sharing is not required for users who no longer use the application program, thereby saving server resources. In addition, the same user can choose to share data with the application program logged in through the same third-party authorization, or choose to share data with the same third-party authorized application. Third-party authorized login applications share data, increasing the flexibility of the solution.
进一步地,作为图1所述方法的具体实现,本发明实施例提供一种数据共享装置,如图3所示,该装置包括:接收单元31、获取单元32、共享单元33。Further, as a specific implementation of the method shown in FIG. 1 , an embodiment of the present invention provides a data sharing device. As shown in FIG. 3 , the device includes: a receiving unit 31 , an acquiring unit 32 , and a sharing unit 33 .
接收单元31,用于接收授权请求响应,其中,授权请求响应中携带有授权标识,相当于请求第三方应用程序授权登录当前应用程序返回的身份验证信息,以便于根据该授权标识中携带的第三方应用程序携带的信息完成登录;The receiving unit 31 is configured to receive an authorization request response, wherein the authorization request response carries an authorization identifier, which is equivalent to requesting a third-party application program to authorize the login of the identity verification information returned by the current application program, so as to facilitate the authorization according to the first authorization information carried in the authorization identifier. The information carried by the third-party application completes the login;
获取单元32,用于根据指示信息从预置存储位置中获取与授权标识对应的映射授权标识;An acquisition unit 32, configured to acquire a mapped authorization identifier corresponding to the authorization identifier from a preset storage location according to the indication information;
其中,预置存储位置中保存有不同授权标识对应的映射授权标识,对于本发明实施例,通过从预置存储位置中查找到共享应用程序对应的映射授权标识,从而实现与共享应用程序之间的数据共享;Wherein, the mapped authorization identifiers corresponding to different authorization identifiers are stored in the preset storage location. For the embodiment of the present invention, by finding the mapped authorization identifier corresponding to the shared application program from the preset storage location, the communication between the shared application program and the shared application program is realized. data sharing;
共享单元33,用于根据映射授权标识获取共享数据。A sharing unit 33, configured to acquire shared data according to the mapping authorization identifier.
需要说明的是,本发明实施例提供的一种数据共享装置所涉及各功能单元的其他相应描述,可以参考图1中的对应描述,在此不再赘述。It should be noted that, for other corresponding descriptions of the functional units involved in a data sharing device provided by the embodiment of the present invention, reference may be made to the corresponding descriptions in FIG. 1 , which will not be repeated here.
本发明实施例提供的一种数据共享装置,首先接收授权请求响应,该授权请求响应中携带有授权标识,然后根据指示信息从预置存储位置中获取与授权标识对应的映射授权标识,这里的预置存储位置中保存有不同授权标识对应的映射授权标识,以便于获取到与授权标识对应的映射授权标识,进而得到与映射授权标识对应的共享数据。与现有技术的数据共享方法相比,本发明实施例通过根据指示信息从预置存储位置中获取与授权标识对应的映射授权标识,使得用户无需在客户端进行两次登录,更加方便用户操作,进一步地,通过登录映射授权标识信获取与映射授权标识信息对应的共享数据,实现应用程序之间的数据共享,从而增强了应用程序之间的互动性。A data sharing device provided by an embodiment of the present invention first receives an authorization request response carrying an authorization identifier, and then obtains a mapped authorization identifier corresponding to the authorization identifier from a preset storage location according to the instruction information, where The mapped authorization identifiers corresponding to different authorization identifiers are stored in the preset storage location, so as to obtain the mapped authorization identifiers corresponding to the authorized identifiers, and then obtain the shared data corresponding to the mapped authorization identifiers. Compared with the data sharing method in the prior art, the embodiment of the present invention obtains the mapping authorization identification corresponding to the authorization identification from the preset storage location according to the instruction information, so that the user does not need to log in twice at the client, which is more convenient for the user to operate Further, the shared data corresponding to the mapping authorization identification information is obtained by logging in the mapping authorization identification information, so as to realize data sharing between application programs, thereby enhancing the interactivity between application programs.
进一步地,作为图2所述方法的具体实现,本发明实施例提供了另一种数据共享装置,如图4所示,进一步地,该装置包括:接收单元41、存储单元42、更新单元43、获取单元44、共享单元45;Further, as a specific implementation of the method described in FIG. 2 , the embodiment of the present invention provides another data sharing device, as shown in FIG. 4 , further, the device includes: a receiving unit 41, a storage unit 42, and an updating unit 43 , acquisition unit 44, sharing unit 45;
接收单元41,用于接收授权请求响应,该授权请求响应中携带有授权标识;The receiving unit 41 is configured to receive an authorization request response, the authorization request response carrying an authorization identifier;
存储单元42,用于将授权映射表存储至预置存储位置中,其中,授权映射表中记录有不同授权标识对应的映射授权标识,预设接口为自定义的应用程序接口;The storage unit 42 is configured to store the authorization mapping table in a preset storage location, wherein the authorization mapping table records mapping authorization identifications corresponding to different authorization identifications, and the preset interface is a self-defined application program interface;
更新单元43,用于按照预置时间间隔更新授权标识映射表,对于本发明实施例,由于授权映射表中的共享应用程序会随着用户下载数量逐渐增多,因此有必要对授权映射表进行实时更新;The update unit 43 is used to update the authorization identification mapping table according to the preset time interval. For the embodiment of the present invention, since the shared application programs in the authorization mapping table will gradually increase with the number of downloads by users, it is necessary to update the authorization mapping table in real time. renew;
获取单元44,用于根据指示信息从预置存储位置中获取与授权标识对应的映射授权标识,该预置存储位置中保存授权标识映射表,这里的指示信息为根据用户实际需求设置需要共享数据的应用程序,进而获取需要共享数据的应用程序对应的映射授权标识;The obtaining unit 44 is used to obtain the mapping authorization identification corresponding to the authorization identification from the preset storage location according to the instruction information, the authorization identification mapping table is stored in the preset storage location, and the instruction information here is to set the shared data according to the actual needs of the user. application, and then obtain the mapping authorization ID corresponding to the application that needs to share data;
共享单元45,用于根据所述映射授权标识获取共享数据。A sharing unit 45, configured to acquire shared data according to the mapping authorization identifier.
进一步地,接收单元41,还用于通过预设接口接收授权标识映射表,该授权映射表中记录有不同授权标识对应的映射授权标识;Further, the receiving unit 41 is also configured to receive an authorization identification mapping table through a preset interface, and the authorization mapping table records mapping authorization identifications corresponding to different authorization identifications;
进一步地,获取单元44,还用于根据指示信息从授权标识映射表中获取与授权标识对应的映射授权标识。Further, the acquiring unit 44 is further configured to acquire the mapped authorization identifier corresponding to the authorization identifier from the authorization identifier mapping table according to the indication information.
进一步地,共享单元45包括:Further, the sharing unit 45 includes:
接收模块451,用于通过预设接口接收与映射授权标识关联的应用操作数据,这里的应用操作数据为根据授权映射标识读取的共享应用程序对应的应用操作数据;The receiving module 451 is configured to receive application operation data associated with the mapping authorization identifier through a preset interface, where the application operation data is the application operation data corresponding to the shared application read according to the authorization mapping identifier;
处理模块452,用于对应用操作数据进行处理,得到共享数据。The processing module 452 is configured to process the application operation data to obtain shared data.
需要说明的是,本发明实施例提供的另一种数据共享装置所涉及各功能单元的其他相应描述,可以参考图2所示方法的对应描述,在此不再赘述。It should be noted that, for other corresponding descriptions of the functional units involved in another data sharing device provided by the embodiment of the present invention, reference may be made to the corresponding description of the method shown in FIG. 2 , which will not be repeated here.
本发明实施例提供的另一种数据共享装置,通过预设接口与预置服务器进行交互,使得整个应用程序的共享过程中,网络请求代价低、服务器成本低,通过对授权映射表的定时更新,使得对于已经不再使用应用程序的用户可以不进行数据共享,从而节省了服务器资源,另外,对于同一用户可以选择与通过相同第三方授权登陆的应用程序进行数据共享,也可选择与通过不同第三方授权登陆的应用程序进行数据共享,增加了方案的灵活度。Another data sharing device provided by the embodiment of the present invention interacts with a preset server through a preset interface, so that in the sharing process of the entire application program, the network request cost is low and the server cost is low. , so that data sharing is not required for users who no longer use the application program, thereby saving server resources. In addition, the same user can choose to share data with the application program logged in through the same third-party authorization, or choose to share data with the same third-party authorized application. Third-party authorized login applications share data, increasing the flexibility of the solution.
需要说明的是,针对上述服务端,凡是本发明实施例中使用到的各个单元模块的功能都可以通过硬件处理器(hardware processor)来实现。It should be noted that, for the above server, the functions of each unit module used in the embodiment of the present invention can be realized by a hardware processor (hardware processor).
示例性的,如图5所示,图5示出了本发明实施例提供的一种服务器的装置结构示意图,该服务端可以包括:处理器(processor)51、通信接口(Communications Interface)52、存储器(memory)53和总线54,其中,处理器51、通信接口52、存储器53通过总线54完成相互间的通信。通信接口52可以用于服务器与客户端之间的信息传输。处理器51可以调用存储器53中的逻辑指令,以执行如下方法:接收授权请求响应,所述授权请求响应中携带有授权标识;根据指示信息从预置存储位置中获取与所述授权标识对应的映射授权标识,所述预置存储位置中保存有不同授权标识对应的映射授权标识;根据所述映射授权标识获取共享数据。Exemplarily, as shown in FIG. 5, FIG. 5 shows a schematic structural diagram of a server device provided by an embodiment of the present invention. The server may include: a processor (processor) 51, a communication interface (Communications Interface) 52, A memory (memory) 53 and a bus 54 , wherein the processor 51 , the communication interface 52 , and the memory 53 communicate with each other through the bus 54 . The communication interface 52 can be used for information transmission between the server and the client. The processor 51 may call the logic instructions in the memory 53 to execute the following method: receiving an authorization request response, the authorization request response carrying an authorization identifier; obtaining the authorization identifier corresponding to the authorization identifier from a preset storage location according to the instruction information; Mapping authorization identifiers, where mapping authorization identifiers corresponding to different authorization identifiers are stored in the preset storage location; shared data is obtained according to the mapping authorization identifiers.
此外,上述的存储器53中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the memory 53 may be implemented in the form of software function units and may be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes. .
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative efforts.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610866197.6A CN106529325A (en) | 2016-09-29 | 2016-09-29 | Data sharing method and apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610866197.6A CN106529325A (en) | 2016-09-29 | 2016-09-29 | Data sharing method and apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN106529325A true CN106529325A (en) | 2017-03-22 |
Family
ID=58344679
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610866197.6A Pending CN106529325A (en) | 2016-09-29 | 2016-09-29 | Data sharing method and apparatus |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106529325A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112069471A (en) * | 2020-09-21 | 2020-12-11 | 浪潮云信息技术股份公司 | Application system authorization method, device and medium based on domestic CPU |
| CN114138513A (en) * | 2021-11-29 | 2022-03-04 | 中国平安财产保险股份有限公司 | Data sharing method, device, equipment and storage medium based on association system |
| CN109992614B (en) * | 2018-11-14 | 2023-05-30 | 创新先进技术有限公司 | Data acquisition method, device and server |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101771532A (en) * | 2008-12-31 | 2010-07-07 | 华为技术有限公司 | Method, device and system for realizing resource sharing |
| CN103905201A (en) * | 2014-03-28 | 2014-07-02 | 北界创想(北京)软件有限公司 | Interaction method and device for master application and multiple slave applications |
-
2016
- 2016-09-29 CN CN201610866197.6A patent/CN106529325A/en active Pending
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101771532A (en) * | 2008-12-31 | 2010-07-07 | 华为技术有限公司 | Method, device and system for realizing resource sharing |
| CN103905201A (en) * | 2014-03-28 | 2014-07-02 | 北界创想(北京)软件有限公司 | Interaction method and device for master application and multiple slave applications |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109992614B (en) * | 2018-11-14 | 2023-05-30 | 创新先进技术有限公司 | Data acquisition method, device and server |
| CN112069471A (en) * | 2020-09-21 | 2020-12-11 | 浪潮云信息技术股份公司 | Application system authorization method, device and medium based on domestic CPU |
| CN114138513A (en) * | 2021-11-29 | 2022-03-04 | 中国平安财产保险股份有限公司 | Data sharing method, device, equipment and storage medium based on association system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6463463B2 (en) | Service processing method, apparatus, and server | |
| US9667661B2 (en) | Privileged account manager, dynamic policy engine | |
| US9760723B2 (en) | Techniques for in-app user data authorization | |
| US11477187B2 (en) | API key access authorization | |
| US11093482B2 (en) | Managing access by third parties to data in a network | |
| CN109462601B (en) | Multi-platform access method and device based on eSIM | |
| CN106850794A (en) | Method and apparatus, server and terminal for operating group | |
| CN104917794A (en) | A data sharing method, device and system | |
| CN108205623B (en) | Method and apparatus for sharing a directory | |
| CN106713004B (en) | Router adaptation method and system | |
| CN110557284A (en) | data aggregation method and device based on client gateway | |
| CN106776917A (en) | A kind of method and apparatus for obtaining resource file | |
| CN107168765A (en) | A kind of method and system of remote compilation software | |
| CN109274705A (en) | Service providing method, apparatus and system based on user identity | |
| CN107172223A (en) | A kind of sharing method and shared system based on communication terminal and remote server | |
| CN106529325A (en) | Data sharing method and apparatus | |
| JP6163170B2 (en) | Service cooperation system, service cooperation apparatus, terminal device, service cooperation method, and service cooperation program | |
| AU2014349181A1 (en) | Techniques to rate-adjust data usage with a virtual private network | |
| KR102058407B1 (en) | Cloud-based virtual smartphone system | |
| CN103067260B (en) | Realize method and the device of instant messaging | |
| CN109391658B (en) | Account data synchronization method and equipment, storage medium and terminal thereof | |
| US10482397B2 (en) | Managing identifiers | |
| CN113852919B (en) | Method and device for generating early warning message, storage medium and electronic device | |
| US11757976B2 (en) | Unified application management for heterogeneous application delivery | |
| WO2018121164A1 (en) | Method, device, and system for creating service numbers |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| WD01 | Invention patent application deemed withdrawn after publication | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20170322 |