[go: up one dir, main page]

CN109302493B - A user information sharing method, device, electronic device and storage medium - Google Patents

A user information sharing method, device, electronic device and storage medium Download PDF

Info

Publication number
CN109302493B
CN109302493B CN201811358406.1A CN201811358406A CN109302493B CN 109302493 B CN109302493 B CN 109302493B CN 201811358406 A CN201811358406 A CN 201811358406A CN 109302493 B CN109302493 B CN 109302493B
Authority
CN
China
Prior art keywords
page
request
user information
proxy
local storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811358406.1A
Other languages
Chinese (zh)
Other versions
CN109302493A (en
Inventor
钟望
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201811358406.1A priority Critical patent/CN109302493B/en
Publication of CN109302493A publication Critical patent/CN109302493A/en
Application granted granted Critical
Publication of CN109302493B publication Critical patent/CN109302493B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a user information sharing method and device, electronic equipment and a storage medium, and relates to the technical field of Internet. The user information sharing method comprises the following steps: the first page sends a first request to the server; the first page sends a second request to the proxy page embedded in the first inner face after receiving the user information fed back by the server; the second request includes user information; the proxy page stores the user information into a local storage; the second page sends a third request to a proxy page embedded in the second page in the loading process; the proxy page acquires user information from the local storage and sends the user information to the second page; the second page receives and displays user information. According to the invention, the first page and the second page can share the user information by embedding the proxy page in the first page and the second page, so that the flow and the bandwidth are saved, and the page loading speed is accelerated.

Description

User information sharing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method and an apparatus for sharing user information, an electronic device, and a storage medium.
Background
In the prior art, if a plurality of pages all require the same user information, each page needs to acquire the user information from a server when being loaded. For example: the client application program comprises a login page, a main page, a personal information page and a commodity detail page, wherein the login page, the main page and the personal information page all need to acquire user information from the server. When a login page receives account information (including an account name and an account password) and a login instruction of a user, sending a login request to a server; if the server passes the verification of the login request, the main page and the user information (the user information can be user gender, user profile, head portrait, mailbox, telephone and the like) are fed back to the login page, and the client application program displays the user information in the main page after receiving the main page and the user information. When the personal information page is loaded, the personal information page acquires the user information from the server again. Therefore, in the prior art, the client needs to access the server for downloading the user information for multiple times, which wastes flow and bandwidth and affects the recording speed of the client page.
Disclosure of Invention
Embodiments of the present invention provide a user information sharing method, an apparatus, an electronic device, and a storage medium, which can implement sharing user information between pages by embedding a proxy page in a page where user information needs to be shared, save traffic and bandwidth, and accelerate page loading speed. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention discloses a method for sharing user information, where the method includes:
the first page sends a first request to the server; an agent page is embedded in the first page;
after receiving the user information fed back by the server according to the first request, the first page sends a second request to the proxy page; wherein the second request includes the user information;
the proxy page saves the user information to a local storage based on the second request;
the second page sends a third request to the proxy page in the loading process; the proxy page is embedded in the second page;
the proxy page acquires the user information from the local storage based on the third request and sends the acquired user information to the second page;
and the second page receives and displays the user information.
Optionally, before the first page sends the first request to the server, the method further includes: embedding proxy pages in the first page and the second page by the following method;
creating an IFrame in the first page and the second page; and the src attribute of the IFrame in the first page and the src attribute of the IFrame in the second page both point to the pre-stored proxy page.
Optionally, the first page generates a second request by calling a postMessage method of a hypertext markup language, and sends the second request to the proxy page.
Optionally, the saving, by the proxy page, the user information to a local storage based on the second request includes: judging whether the second request is an information storage request, if so, intercepting user information from the second request, and storing the user information to a local storage;
and the proxy page acquires the user information from the local storage based on the third request, wherein the user information is acquired from the local storage by judging whether the third request is an information acquisition request or not, and if so, the user information is acquired from the local storage.
Optionally, during the loading process of the second page, the third request is sent to the proxy page by calling a postMessage method of a hypertext markup language.
Optionally, the first page, the proxy page and the second page all belong to a first home domain; the saving the user information to a local storage comprises: and saving the user information into a storage area corresponding to the first main domain.
In a second aspect, an embodiment of the present invention discloses a user information sharing apparatus, where the apparatus includes:
the first request sending module is used for sending a first request to the server by the first page; an agent page is embedded in the first page;
the second request sending module is used for sending a second request to the proxy page after the first page receives the user information fed back by the server according to the first request; wherein the second request includes the user information;
the user information storage module is used for storing the user information into a local storage by the proxy page based on the second request;
a third request sending module, configured to send a third request to the proxy page during loading of the second page; the proxy page is embedded in the second page;
a user information obtaining module, configured to obtain, by the proxy page, the user information from the local storage based on the third request, and send the obtained user information to the second page;
and the user information display module is used for receiving and displaying the user information on the second page.
Optionally, the apparatus further comprises:
the IFrame establishing module is used for establishing IFrame in the first page and the second page; and the src attribute of the IFrame in the first page and the src attribute of the IFrame in the second page both point to the pre-stored proxy page.
Optionally, the second request sending module is specifically configured to generate a second request by calling a postMessage method of a hypertext markup language, and send the second request to the proxy page.
Optionally, the user information saving module is specifically configured to determine whether the second request is an information storage request, and if so, intercept the user information from the second request and save the user information to a local storage;
the user information obtaining module is specifically configured to determine whether the third request is an information obtaining request, and if so, obtain the user information from the local storage.
Optionally, the third request sending module is specifically configured to send the third request to the proxy page by invoking a postMessage method of a hypertext markup language in the loading process of the second page.
In a third aspect, an embodiment of the present invention discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement any one of the method steps of the user information sharing method when executing the program stored in the memory.
In yet another aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements any one of the above-mentioned user information sharing methods.
In the user information sharing method, device, electronic device, and storage medium provided in the embodiments of the present invention, an agent page is embedded in a page that needs to share user information in advance (for example, if a first page and a second page need to share information, the agent page is embedded in the first page and the second page). When the first page acquires the user information from the server, the user information is stored in the local storage through the proxy page, and the second page can directly acquire the user information from the local storage through the proxy page during loading without acquiring the user information from the server again.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a user information sharing method according to an embodiment of the present invention;
fig. 2 is a flowchart of a user information sharing method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a user information sharing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a user information sharing method according to an embodiment of the present invention.
As shown in fig. 1, in this embodiment, the user information sharing method includes the following steps:
s101, a first page sends a first request to a server; an agent page is embedded in the first page.
In this step, when the user enters the current home domain, the user may first enter the first page of the home domain. The first page may be a login page of a login domain of the home domain. For example, the main domain is a.com, and the first page is a landing page corresponding to a.a.com.
Before S101, the method further includes: the first page gets a first request.
Specifically, the first page is a login page a.A.com; the first request is a login request sent by the client to login the first page. After the client enters the login page, account information and a verification code input by the user can be acquired in the login page, wherein the account information can comprise an account name and an account password. And generating a login request based on the click event, and further sending the login request to the server. The login page is embedded with an agent page, the login page and the agent page are in a parent-child relationship, namely the login page can access the agent page, the user information of the login page is stored through the agent page, and the stored user information is obtained through the agent page.
Optionally, before the first page sends the first request to the server, the S101 further includes: embedding proxy pages in a first page and a second page by the following method;
creating an IFrame in the first page and the second page; and the src attributes of the iframes in the first page and the second page both point to pre-stored proxy pages.
In the embodiment of the invention, the empty page for simulating the client to access the server is pre-established, namely the proxy page. And storing the proxy page in a local proxy server, simulating the process of accessing the server by the client through the proxy page, and downloading and storing the user information from the server in the local storage of the client.
In this step, for each page that needs user information, an Iframe is created in the page, and the src attribute of the Iframe of the page is set to point to a pre-stored proxy page. In the process of loading the page, the page can directly send a request to the embedded proxy page, access the proxy page and directly store or acquire user information in the local storage through the proxy page.
IFrame is an HTML (HyperText Markup Language) tag that functions as a document within a document, or floating frame (IFrame). The IFrame element will create an inline frame (i.e., inline frame) that contains another document.
For example, the address of the proxy page established in this step is: http:// proxy. Creating an Iframe in the first page in advance, wherein the src attribute in the Iframe tag is set as the address of the proxy page (http:// proxy. myweb. com/proxy. html); an Iframe is created in the second page in advance with the src attribute in the Iframe tag set to the address of the proxy page (http:// proxy.
S102, after receiving user information fed back by a server according to a first request, a first page sends a second request to a proxy page; wherein the second request includes user information.
After receiving the first request, the server verifies the login information of the first request. And after the verification is passed, obtaining the user information corresponding to the user from the user information pre-stored in the database, and returning to the first page.
For example, the first page is a login page and the first request is a login request. After receiving the login request, the server verifies login information of the login request, wherein the login information can comprise a user account, a user password and a verification code. And after the verification is passed, acquiring user information corresponding to the account information from the database, and feeding back the user information to a login page of the client.
The user information is information of the user corresponding to the first request when registering and characteristic information about the user. Such as user account, user avatar, mailbox, fan count, historical browsing records, historical viewing records, and the like. The first page may contain one or more types of user information, for example, the first page is a login page, and the login page may contain a user account, a mailbox, a user avatar, and the like in the user information.
Optionally, in S101, the first page generates a second request by calling a postMessage method of the hypertext markup language, and sends the second request to the proxy page.
The postMessage is a commonly used function in Windows API (Application Programming Interface) for placing a message in a message queue. The messages in the message queue are obtained by calling GetMessage and PeekMessage.
For example, the first page is a login page and the second request is a user information storage request. After the login page of the client receives the user information, the user information is put into the message queue in a postMessage mode, and a user information storage request is generated. And then according to the src attribute of the Iframe of the login page, sending the user information storage request to a URL (Uniform Resource Locator) of a proxy page corresponding to the src attribute.
S103, the proxy page stores the user information to a local storage based on the second request.
S104, the second page sends a third request to the proxy page in the loading process; and the second page is embedded with a proxy page.
In the loading process of the second page, a third request can be sent to the proxy page, and the user information corresponding to the second page in the cached user information is obtained through the proxy page.
Optionally, in the process of loading, the second page in S104 sends a third request to the proxy page by calling a postMessage method of the hypertext markup language.
For example, the second page is a goods page b.a.com, and the third request is a user information acquisition request. And the commodity page of the client puts the user information to be acquired into a message queue in a postMessage mode to generate a user information acquisition request. And then according to the src attribute of the Iframe of the commodity page, sending a user information acquisition request to a URL (Uniform Resource Locator) of the proxy page corresponding to the src attribute.
S105, the proxy page acquires user information from the local storage based on the third request and sends the acquired user information to the second page;
in this step, after the proxy page receives the third request, the user information corresponding to the second page is acquired from the user information stored in the local storage. And sending the acquired user information to the second page.
For example, the second page is a commodity page, and the user information of the commodity page is a user account, a mailbox, a user avatar, a user historically browsed commodities, a user historically purchased commodities, and the like in the stored user information. And after receiving the third request, the proxy page acquires a user account, a mailbox, a user head portrait, a user history browsed commodity, a user history purchased commodity and the like from the user information stored in the local storage, and sends the acquired user information to the commodity page.
Optionally, the saving, by the proxy page in S103, the user information to the local storage based on the second request includes: judging whether the second request is an information storage request, if so, intercepting the user information from the second request, and storing the user information to a local storage;
the proxy page of the embodiment of the invention has the following functions: the method comprises the steps of acquiring a request sent by a client browser by monitoring a message event of html5 of the client browser, and judging the type of the request: if the request type is set, storing the received user information in a local storage localStorage of the client; and if the request type is get, reading user information from a local storage localStorage of the client.
Specifically, the proxy page in S103 receives the second request, determines the second request, and caches the user information in the local storage if the type of the second request is set.
For example, after receiving a user information storage request of a login page, the proxy page determines that the type of the user information storage request is set, intercepts user information contained in a character string of the user information storage request, and stores the user information into a local storage localStorage.
In the above S105, the proxy page acquires the user information from the local storage based on the third request, including determining whether the third request is an information acquisition request, and if so, acquiring the user information from the local storage.
Specifically, if the proxy page in S105 determines that the type of the third request is get, the user information of the second page is obtained from the user information stored in the local storage.
For example, after receiving a user information acquisition request of a commodity page, the proxy page determines that the type of the user information acquisition request is get, and then acquires user information of the commodity page from user information stored in a local storage localStorage.
And S106, receiving and displaying the user information by the second page.
In the user information sharing method provided by the embodiment of the invention, the first page is used for sending the first request to the server to acquire the user information, then the acquired user information is cached to the local storage through the proxy page, and when other pages need the user information, the user information in the local storage is directly accessed through the proxy page, so that the user information is prevented from being sent to the server to acquire the request, the flow of the user corresponding to the client side is further saved, and the sharing of the user information is facilitated.
Optionally, the first page, the proxy page, and the second page all belong to a first home domain; saving the user information to a local store includes: the user information is saved to a storage area corresponding to the first home domain.
For example, the first home domain is an online shopping platform a.com; the first page is a sub-domain a.A.com where a login page of the online shopping platform is located; the second page is a sub-domain b.A.com where the commodity page of the shopping website is located; the proxy page creates a sub-domain c.a.com for the client to store user information specifically for that online shopping platform a.com.
Therefore, the user information sharing method can realize different sub-domains needing user information in the same main domain, directly obtains the needed user information in the local cache through the access proxy page, facilitates the obtaining of the user information, and reduces the flow required by the client to access the server to obtain the user information.
In addition, the first page, the proxy page and the second page may belong to different home domains; saving the user information to a local store includes: and saving the user information into the local shared storage area.
For example, the first page is a sub-domain a.a.com where a login page of the online shopping platform a.com is located; the second page is a sub-domain b.B.com where the login page of the online shopping platform B.com is located; com, the domain where the shared page of the local proxy server is located.
In the embodiment of the invention, the IFrame can be created in the first page, and the src attribute of the IFrame in the first page points to the proxy page c.com. An IFrame may be created in the second page, the src attribute of the IFrame in the second page pointing to proxy page c.com. And then, the first page stores the user information acquired for the first time in the local shared server through the proxy page, the second page can directly access the proxy page after passing the verification of the server, and the user information corresponding to the second page is acquired in the local shared server through the proxy page.
Therefore, the user information sharing method can realize the subdomain needing the user information without a main domain, directly obtain the needed user information in the local cache by accessing the proxy page, facilitate the obtaining of the user information and reduce the flow required by the client accessing the server to obtain the user information.
The embodiment of the invention discloses a user information sharing method, as shown in fig. 2, fig. 2 is a flow chart of the user information sharing method of the embodiment of the invention, and the method comprises the following steps:
s201, receiving a first request sent by a client.
S202, user information corresponding to the first request is obtained.
After receiving a first request sent by a client, a server can verify user information of a user sending the first request, and after the verification is passed, the server acquires and sends user information corresponding to the first request.
Optionally, before the obtaining of the user information corresponding to the first request in S202, the method further includes:
and verifying whether the user sending the first request is a legal user existing in the information table or not according to the information table of each user which is stored in advance.
The server side can establish an information table of the user in advance, and the information table is used for storing the registration information of the user and the user characteristic information of the corresponding user. For example, the information table includes a user name, a password, a mailbox, and a head portrait when the user registers, and records a history browsing record, a history viewing record, the number of fans of the user, information of interest, and information of collection of the user.
In this step, according to the information table, it is verified whether the user sending the first request at the client, the input user account and the password are the same password corresponding to the same user account stored in the information table, and if the user account and the password are both the same user and correctly correspond to each other, it is determined that the user is a legal user.
S203, sending the user information to the client.
In the user information sharing method, the first request sent by the client is received, the user information of the user corresponding to the first request is verified, after the verification is passed, the user information corresponding to the first request is obtained, and the obtained user information is returned to the client, so that the user information is obtained at one time and returned to the client, the phenomenon that the client accesses the server for multiple times to obtain the user information of the same user is reduced, and the flow of the client is further saved.
In a second aspect, an embodiment of the present invention discloses a user information sharing device, as shown in fig. 3, fig. 3 is a schematic structural diagram of a user information sharing device according to an embodiment of the present invention, where the device includes:
a first request sending module 301, configured to send a first request to a server by a first page; an agent page is embedded in the first page;
a second request sending module 302, configured to send, by the first page, a second request to the proxy page after receiving the user information fed back by the server according to the first request; wherein the second request includes user information;
the user information saving module 303 is configured to save, by the proxy page, the user information to the local storage based on the second request;
a third request sending module 304, configured to send a third request to the proxy page during the loading process of the second page; wherein, the second page is embedded with a proxy page;
a user information obtaining module 305, configured to obtain, by the proxy page, user information from the local storage based on the third request, and send the obtained user information to the second page;
and a user information display module 306, configured to receive and display the user information on the second page.
In the user information sharing apparatus provided in the embodiment of the present invention, an agent page is embedded in a page that needs to share user information in advance (for example, if a first page and a second page need to share information, the agent page is embedded in the first page and the second page). When the first page acquires the user information from the server, the user information is stored in the local storage through the proxy page, and the second page can directly acquire the user information from the local storage through the proxy page during loading without acquiring the user information from the server again.
Optionally, in an embodiment of the user information sharing apparatus of the present invention, the apparatus further includes:
the IFrame establishing module is used for establishing IFrame in the first page and the second page; and the src attributes of the iframes in the first page and the second page both point to pre-stored proxy pages.
Optionally, in an embodiment of the user information sharing apparatus of the present invention, the second request sending module 302 is specifically configured to generate, by the first page, a second request by calling a postMessage method of a hypertext markup language, and send the second request to the proxy page.
Optionally, in an embodiment of the user information sharing apparatus of the present invention, the user information saving module 303 is specifically configured to determine whether the second request is an information storage request, and if so, intercept the user information from the second request and save the user information to a local storage;
the user information obtaining module 305 is specifically configured to determine whether the third request is an information obtaining request, and if so, obtain the user information from the local storage.
Optionally, in an embodiment of the user information sharing apparatus of the present invention, the third request sending module 304 is specifically configured to send the third request to the proxy page by invoking a postMessage method of the hypertext markup language during the loading of the second page.
In a third aspect, an embodiment of the invention discloses an electronic device, as shown in fig. 4. Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, which includes a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete communication with each other through the communication bus 404;
a memory 403 for storing a computer program;
the processor 401, when executing the program stored in the memory 403, is configured to implement the following method steps:
the first page sends a first request to the server; an agent page is embedded in the first page;
after receiving user information fed back by the server according to the first request, the first page sends a second request to the proxy page; wherein the second request includes user information;
the proxy page saves the user information to a local storage based on the second request;
the second page sends a third request to the proxy page in the loading process; wherein, the second page is embedded with a proxy page;
the proxy page acquires user information from the local storage based on the third request and sends the acquired user information to the second page;
the second page receives and displays user information.
The communication bus 404 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 404 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 402 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory 403 may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory 403 may also be at least one storage device located remotely from the processor 401.
The Processor 401 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In an electronic device provided in an embodiment of the present invention, a proxy page is embedded in a page that needs to share user information in advance (for example, if a first page and a second page need to share information, the proxy page is embedded in the first page and the second page). When the first page acquires the user information from the server, the user information is stored in the local storage through the proxy page, and the second page can directly acquire the user information from the local storage through the proxy page during loading without acquiring the user information from the server again.
In another aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements any one of the above-mentioned user information sharing methods applied to the client.
In a computer-readable storage medium provided in an embodiment of the present invention, a proxy page is embedded in a page that needs to share user information in advance (for example, if a first page and a second page need to share information, the proxy page is embedded in the first page and the second page). When the first page acquires the user information from the server, the user information is stored in the local storage through the proxy page, and the second page can directly acquire the user information from the local storage through the proxy page during loading without acquiring the user information from the server again.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the device, the electronic apparatus and the storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and the relevant points can be referred to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (13)

1.一种用户信息共享方法,其特征在于,包括:1. a user information sharing method, is characterized in that, comprises: 第一页面向服务器发送第一请求;所述第一页面内嵌设有代理页面;The first page sends a first request to the server; the first page is embedded with a proxy page; 第一页面在接收到所述服务器根据所述第一请求反馈的用户信息后,向所述代理页面发送第二请求;其中,所述第二请求包括所述用户信息;After receiving the user information fed back by the server according to the first request, the first page sends a second request to the proxy page; wherein the second request includes the user information; 所述代理页面基于所述第二请求将所述用户信息保存到本地存储;The proxy page saves the user information to local storage based on the second request; 第二页面在加载的过程中,向所述代理页面发送第三请求;其中,所述第二页面内嵌设有所述代理页面;During the loading process of the second page, a third request is sent to the proxy page; wherein, the proxy page is embedded in the second page; 所述代理页面基于所述第三请求从所述本地存储获取所述用户信息,并将获取的用户信息发送至所述第二页面,所述第一页面、所述代理页面和所述第二页面均属于第一主域;The proxy page acquires the user information from the local storage based on the third request, and sends the acquired user information to the second page, the first page, the proxy page and the second page All pages belong to the first main domain; 所述第二页面接收并显示所述用户信息。The second page receives and displays the user information. 2.根据权利要求1所述的方法,其特征在于,在所述第一页面向服务器发送第一请求之前,还包括:通过以下方法在所述第一页面和所述第二页面内嵌代理页面;2 . The method according to claim 1 , wherein before the first page sends the first request to the server, the method further comprises: embedding a proxy in the first page and the second page by the following method. 3 . page; 在所述第一页面和所述第二页面中创建IFrame;其中,所述第一页面和所述第二页面中的IFrame的src属性均指向预存的所述代理页面。Create an IFrame in the first page and the second page; wherein, the src attributes of the IFrame in the first page and the second page both point to the pre-stored proxy page. 3.根据权利要求1所述的方法,其特征在于,所述第一页面通过调用超文本标记语言的postMessage方法生成第二请求,并将所述第二请求发送至所述代理页面。3 . The method according to claim 1 , wherein the first page generates a second request by invoking a postMessage method of Hypertext Markup Language, and sends the second request to the proxy page. 4 . 4.根据权利要求1所述的方法,其特征在于,所述代理页面基于所述第二请求将所述用户信息保存到本地存储,包括:判断所述第二请求是否为信息存储请求,若是,则将从所述第二请求中截取用户信息,并将所述用户信息保存到本地存储;4. The method according to claim 1, wherein the proxy page saves the user information to local storage based on the second request, comprising: judging whether the second request is an information storage request, and if so , the user information will be intercepted from the second request, and the user information will be saved to local storage; 所述代理页面基于所述第三请求从所述本地存储获取所述用户信息,包括判断所述第三请求是否为信息获取请求,若是,则从所述本地存储获取所述用户信息。The proxy page acquiring the user information from the local storage based on the third request includes determining whether the third request is an information acquisition request, and if so, acquiring the user information from the local storage. 5.根据权利要求1所述的方法,其特征在于,所述第二页面在加载的过程中,通过调用超文本标记语言的postMessage方法向所述代理页面发送所述第三请求。5 . The method according to claim 1 , wherein during the loading process of the second page, the third request is sent to the proxy page by invoking a postMessage method of hypertext markup language. 6 . 6.根据权利要求1-5任一项所述的方法,其特征在于,所述将所述用户信息保存到本地存储包括:将所述用户信息保存到与所述第一主域对应的存储区域内。6. The method according to any one of claims 1-5, wherein the saving the user information to a local storage comprises: saving the user information to a storage corresponding to the first primary domain within the area. 7.一种用户信息共享装置,其特征在于,包括:7. A device for sharing user information, comprising: 第一请求发送模块,用于第一页面向服务器发送第一请求;所述第一页面内嵌设有代理页面;The first request sending module is used for the first page to send the first request to the server; the first page is embedded with a proxy page; 第二请求发送模块,用于第一页面在接收到所述服务器根据所述第一请求反馈的用户信息后,向所述代理页面发送第二请求;其中,所述第二请求包括所述用户信息;The second request sending module is used for the first page to send a second request to the proxy page after receiving the user information fed back by the server according to the first request; wherein the second request includes the user information; 用户信息保存模块,用于所述代理页面基于所述第二请求将所述用户信息保存到本地存储;a user information saving module, used for the proxy page to save the user information to local storage based on the second request; 第三请求发送模块,用于第二页面在加载的过程中,向所述代理页面发送第三请求;其中,所述第二页面内嵌设有所述代理页面;A third request sending module, configured to send a third request to the proxy page during the loading process of the second page; wherein the proxy page is embedded in the second page; 用户信息获取模块,用于所述代理页面基于所述第三请求从所述本地存储获取所述用户信息,并将获取的用户信息发送至所述第二页面,所述第一页面、所述代理页面和所述第二页面均属于第一主域;a user information acquisition module, used for the proxy page to acquire the user information from the local storage based on the third request, and send the acquired user information to the second page, the first page, the Both the proxy page and the second page belong to the first main domain; 用户信息显示模块,用于所述第二页面接收并显示所述用户信息。The user information display module is used for the second page to receive and display the user information. 8.根据权利要求7所述的装置,其特征在于,所述装置还包括:8. The apparatus according to claim 7, wherein the apparatus further comprises: IFrame建立模块,用于在所述第一页面和所述第二页面中创建IFrame;其中,所述第一页面和所述第二页面中的IFrame的src属性均指向预存的所述代理页面。The IFrame creation module is configured to create an IFrame in the first page and the second page; wherein, the src attribute of the IFrame in the first page and the second page both point to the pre-stored proxy page. 9.根据权利要求7所述的装置,其特征在于,第二请求发送模块,具体用于所述第一页面通过调用超文本标记语言的postMessage方法生成第二请求,并将所述第二请求发送至所述代理页面。9 . The apparatus according to claim 7 , wherein the second request sending module is specifically used for the first page to generate a second request by invoking a postMessage method of hypertext markup language, and sends the second request to the second request. 10 . sent to the proxy page. 10.根据权利要求7所述的装置,其特征在于,所述用户信息保存模块,具体用于判断所述第二请求是否为信息存储请求,若是,则将从所述第二请求中截取用户信息,并将所述用户信息保存到本地存储;10 . The device according to claim 7 , wherein the user information storage module is specifically configured to determine whether the second request is an information storage request, and if so, intercept the user from the second request. 11 . information, and save the user information to local storage; 所述用户信息获取模块,具体用于判断所述第三请求是否为信息获取请求,若是,则从所述本地存储获取所述用户信息。The user information acquisition module is specifically configured to determine whether the third request is an information acquisition request, and if so, acquire the user information from the local storage. 11.根据权利要求7所述的装置,其特征在于,第三请求发送模块,具体用于所述第二页面在加载的过程中,通过调用超文本标记语言的postMessage方法向所述代理页面发送所述第三请求。11. The device according to claim 7, wherein the third request sending module is specifically used for sending the second page to the proxy page by invoking the postMessage method of the hypertext markup language during the loading process of the second page the third request. 12.一种电子设备,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,所述处理器、所述通信接口、所述存储器通过所述通信总线完成相互间的通信;12. An electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; 所述存储器,用于存放计算机程序;the memory for storing computer programs; 所述处理器,用于执行所述存储器上所存放的程序时,实现权利要求1-6任一所述的方法步骤。The processor is configured to implement the method steps of any one of claims 1-6 when executing the program stored in the memory. 13.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-6任一所述的方法步骤。13. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps of any one of claims 1-6 are implemented.
CN201811358406.1A 2018-11-15 2018-11-15 A user information sharing method, device, electronic device and storage medium Active CN109302493B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811358406.1A CN109302493B (en) 2018-11-15 2018-11-15 A user information sharing method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811358406.1A CN109302493B (en) 2018-11-15 2018-11-15 A user information sharing method, device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN109302493A CN109302493A (en) 2019-02-01
CN109302493B true CN109302493B (en) 2021-06-22

Family

ID=65144197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811358406.1A Active CN109302493B (en) 2018-11-15 2018-11-15 A user information sharing method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN109302493B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113542336A (en) * 2020-04-30 2021-10-22 北京字节跳动网络技术有限公司 Information switching sharing method and device, electronic equipment and storage medium
CN111767500A (en) * 2020-06-23 2020-10-13 平安普惠企业管理有限公司 Data storage sharing method and device, computer equipment and storage medium
CN112380027B (en) * 2020-10-20 2023-06-20 福建天泉教育科技有限公司 Method and terminal for realizing communication among different webpages in mobile terminal environment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1682212A (en) * 2002-07-22 2005-10-12 梅迪亚奥内网络公司 Auxiliary content delivery system
CN101281522A (en) * 2007-04-06 2008-10-08 阿里巴巴集团控股有限公司 Method and system for processing related key words
CN103023790A (en) * 2012-12-31 2013-04-03 北京京东世纪贸易有限公司 Method and system used for realizing cross-domain interactive access
CN103207863A (en) * 2012-01-13 2013-07-17 腾讯科技(深圳)有限公司 Page cross-domain interacting method and terminal
CN103309877A (en) * 2012-03-12 2013-09-18 腾讯科技(深圳)有限公司 Method and device for cross-domain communication and full-duplex communication
CN106874323A (en) * 2016-06-28 2017-06-20 阿里巴巴集团控股有限公司 A kind of date storage method and device
CN106933722A (en) * 2017-03-06 2017-07-07 腾云天宇科技(北京)有限公司 A kind of web application monitoring method, server and system

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3437933B2 (en) * 1999-01-21 2003-08-18 インターナショナル・ビジネス・マシーンズ・コーポレーション Browser sharing method and system
CN101075240A (en) * 2006-08-25 2007-11-21 腾讯科技(深圳)有限公司 Method and system for spanned acquiring data
CN1976300A (en) * 2006-11-20 2007-06-06 华为技术有限公司 Management maintanance method for switch-on equipment
US8522200B2 (en) * 2008-08-28 2013-08-27 Microsoft Corporation Detouring in scripting systems
US8452837B2 (en) * 2010-11-03 2013-05-28 Google Inc. Data delivery
US10095789B2 (en) * 2012-08-26 2018-10-09 Derek A. Devries Method and system of searching composite web page elements and annotations presented by an annotating proxy server
CN103019734B (en) * 2012-12-25 2016-08-03 北京奇虎科技有限公司 A kind of activity object implementation, system and browser
WO2015176321A1 (en) * 2014-05-23 2015-11-26 华为技术有限公司 Information sharing method and device
CN105183851A (en) * 2015-09-08 2015-12-23 上海上讯信息技术股份有限公司 Interaction method and device overcoming browser same-origin policy limit
CN107193834A (en) * 2016-03-15 2017-09-22 广州市动景计算机科技有限公司 Computing device, device and method for browsing pages
CN106446049B (en) * 2016-08-31 2018-07-13 腾讯科技(深圳)有限公司 A kind of page data interactive device and method
CN106777346B (en) * 2017-01-17 2018-07-06 杨飞 Nginx web Back end datas processing methods and system based on C language

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1682212A (en) * 2002-07-22 2005-10-12 梅迪亚奥内网络公司 Auxiliary content delivery system
CN101281522A (en) * 2007-04-06 2008-10-08 阿里巴巴集团控股有限公司 Method and system for processing related key words
CN103207863A (en) * 2012-01-13 2013-07-17 腾讯科技(深圳)有限公司 Page cross-domain interacting method and terminal
CN103309877A (en) * 2012-03-12 2013-09-18 腾讯科技(深圳)有限公司 Method and device for cross-domain communication and full-duplex communication
CN103023790A (en) * 2012-12-31 2013-04-03 北京京东世纪贸易有限公司 Method and system used for realizing cross-domain interactive access
CN106874323A (en) * 2016-06-28 2017-06-20 阿里巴巴集团控股有限公司 A kind of date storage method and device
CN106933722A (en) * 2017-03-06 2017-07-07 腾云天宇科技(北京)有限公司 A kind of web application monitoring method, server and system

Also Published As

Publication number Publication date
CN109302493A (en) 2019-02-01

Similar Documents

Publication Publication Date Title
US9929895B2 (en) Unique identifiers for browsers
EP2433258B1 (en) Protected serving of electronic content
CN106462590B (en) System for managing modifications to web pages by extensions
US9443257B2 (en) Securing expandable display advertisements in a display advertising environment
US9667687B2 (en) Generating processed web address information
CN107979632B (en) Processing method, device and system for push information
US11676155B1 (en) Methods and apparatus for mobile device messaging-based communications using custom-generated deeplinks and based on the hyper text transfer protocol (HTTP)
WO2019037417A1 (en) Webpage data crawling method and apparatus, webpage data crawling platform, and storage medium
US20110161440A1 (en) System and method for enhancing digital content
CN109302493B (en) A user information sharing method, device, electronic device and storage medium
US9881318B1 (en) Attributing web-based user actions to multivariate test parameters associated with publisher content
CA2767033A1 (en) System and method for enhancing digital content
US11062019B2 (en) System and method for webpages scripts validation
JP5388248B1 (en) Information processing system and information processing method
US20210192563A1 (en) Webpage advertisement anti-blocking method, content delivery network, and client terminal
US9082146B1 (en) System, method, and medium for generating cached product information pages
CN112685211A (en) Error information display method and device, electronic equipment and medium
CN113781137B (en) Channel information display method, display device, computer system and storage medium
JP2018503923A (en) General-purpose business procurement
CN115665115A (en) A web application access method, device, electronic equipment and storage medium
CN110874433B (en) Information processing method and system thereof, computer system and computer readable medium
JP7232576B2 (en) NOTIFICATION DEVICE, NOTIFICATION METHOD AND NOTIFICATION PROGRAM
US11444967B2 (en) Method and system for identifying malicious activity of pre-determined type
WO2014192067A1 (en) Information processing system and information processing method
CN104063246B (en) A kind of method and device of loading tool bar

Legal Events

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