CN107203576B - Information synchronization method and device - Google Patents

Information synchronization method and device Download PDF

Info

Publication number
CN107203576B
CN107203576B CN201610159149.3A CN201610159149A CN107203576B CN 107203576 B CN107203576 B CN 107203576B CN 201610159149 A CN201610159149 A CN 201610159149A CN 107203576 B CN107203576 B CN 107203576B
Authority
CN
China
Prior art keywords
identification code
component
server
user
unit
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
CN201610159149.3A
Other languages
Chinese (zh)
Other versions
CN107203576A (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 Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201610159149.3A priority Critical patent/CN107203576B/en
Publication of CN107203576A publication Critical patent/CN107203576A/en
Application granted granted Critical
Publication of CN107203576B publication Critical patent/CN107203576B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Abstract

The application discloses an information synchronization method and device. One embodiment of the method comprises: acquiring an identification code for the component stored in the component in the process of loading the webpage through the embedded component for loading the webpage; comparing the stored user identification code with the identification code for the component, and judging whether the user identification code is the same as the identification code for the component; if the user identification code is the same as the component identification code, writing a code for calling a data synchronization interface into a script of the webpage; and after the component runs the script and calls the data synchronization interface, performing information synchronization with the webpage through the data synchronization interface. The embodiment realizes quick and efficient information synchronization.

Description

Information synchronization method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of internet technologies, and in particular, to an information synchronization method and apparatus.
Background
With the popularization of mobile terminals, more and more applications suitable for mobile terminals appear. Since the mobile terminal involves various operating systems (e.g., IOS system, Android system, Windows Phone system, etc.), it is difficult to develop a variety of applications suitable for various mobile terminals. Under the background, Hybrid App (Hybrid mode mobile application) comes from the beginning, which is an App between Web App (Web-based application) and Native App (localized application), and has the advantages of both good user interaction experience and cross-platform development of the Web App.
However, the Hybrid App encounters interaction between a native page and an embedded web page (e.g., html5 page), and information of a user needs to be synchronized in the interaction process, and particularly, how to quickly and efficiently implement information synchronization is an urgent problem to be solved under the condition that the providers of the native page and the embedded web page content of the Hybrid App are the same in the same mobile terminal.
Disclosure of Invention
It is an object of the present application to provide an improved information synchronization method and apparatus to solve the technical problems mentioned in the background section above.
In a first aspect, the present application provides an information synchronization method, including: acquiring an identification code for the component stored in the component in the process of loading the webpage through an embedded component for loading the webpage, wherein the identification code for the component is an identification code which is acquired from a server in advance and is used for verifying the identity of a user; comparing the stored user identification code with the identification code for the component, and judging whether the user identification code is the same as the identification code for the component, wherein the user identification code is an identification code which is acquired from the server in advance and is used for verifying the identity of the user; if the user identification code is the same as the component identification code, writing a code for calling a data synchronization interface into a script of the webpage; and after the component runs the script and calls the data synchronization interface, performing information synchronization with the webpage through the data synchronization interface.
In some embodiments, before the obtaining the identification code for the component stored in the component, the method further comprises: receiving login information input by a user through a primary page, sending the login information to a server, and verifying the login information by the server; receiving an identification code for verification sent by the server, and storing the identification code for verification as a user identification code, wherein the identification code for verification is generated by the server according to the login information after the login information is verified successfully; receiving, by the component, the identification code for authentication from the server and storing as an identification code for the component.
In some embodiments, the method further comprises: sending a first data access request to the server through the webpage, wherein the first data access request comprises the identification code for the component; and receiving first data returned by the server for the first data access request, wherein the first data is returned after the server determines that the component identification code is identical to a pre-generated and stored identification code for verification.
In some embodiments, the method further comprises: sending a second data access request to the server through a native page, wherein the second data access request comprises a user identification code; and receiving second data returned by the server for the second data access request, wherein the second data is returned after the server determines that the user identification code is the same as the pre-generated and stored identification code for verification.
In some embodiments, the component-specific identifier code and/or the user identifier code has an expiration date; and the method further comprises: judging whether the operation information of the user is received within the valid period of the component identification code and/or the user identification code; if so, extending the validity period of the component identification code and/or the user identification code; if not, determining that the component-use identification code and/or the user identification code is expired.
In some embodiments, the method further comprises: acquiring a request which is sent by the webpage to the server and is used for requesting redirection access, wherein the request comprises the identification code for the component; receiving a redirected webpage address returned by the server aiming at the request, and loading a redirected page corresponding to the webpage address through the component, wherein the webpage address is sent after the server determines that the identification code for the component is the same as a pre-generated and stored identification code for verification; comparing the identification code for the component with the user identification code, and judging whether the identification code for the component is the same as the user identification code; and if the two pieces of information are the same, acquiring the interaction information between the redirection page and the server.
In a second aspect, the present application provides an information synchronization apparatus, the apparatus comprising: the device comprises an acquisition unit, a verification unit and a verification unit, wherein the acquisition unit is used for acquiring an identification code for the component stored in an embedded component for loading the webpage page in the process of loading the webpage page by the component for loading the webpage page, and the identification code for the component is acquired from a server in advance and is used for verifying the identity of a user; the comparison unit is used for comparing the stored user identification code with the component identification code and judging whether the user identification code is the same as the component identification code or not, wherein the user identification code is an identification code which is acquired from the server in advance and is used for verifying the identity of a user; the writing unit is used for writing a code for calling a data synchronization interface into a script of the webpage page if the user identification code is the same as the component identification code; and the synchronization unit is used for carrying out information synchronization with the webpage through the data synchronization interface after the assembly runs the script and calls the data synchronization interface.
In some embodiments, the apparatus further comprises: the receiving and sending unit is used for receiving login information input by a user through a native page, sending the login information to a server and verifying the login information by the server; the first receiving and storing unit is used for receiving an identification code for verification sent by the server and storing the identification code for verification as a user identification code, wherein the identification code for verification is generated by the server according to the login information after the login information is verified successfully; a second receiving and storing unit for receiving the identification code for authentication from the server through the component and storing as an identification code for component.
In some embodiments, the apparatus further comprises: a first sending unit, configured to send a first data access request to the server through the web page, where the first data access request includes the identification code for the component; a first receiving unit, configured to receive first data returned by the server for the first data access request, where the first data is returned after the server determines that the component identification code is identical to a pre-generated and stored identification code for authentication.
In some embodiments, the apparatus further comprises: a second sending unit, configured to send a second data access request to the server through a native page, where the second data access request includes a user identification code; and a second receiving unit, configured to receive second data returned by the server for the second data access request, where the second data is returned after the server determines that the user identification code is the same as a pre-generated and stored identification code for authentication.
In some embodiments, the component-specific identifier code and/or the user identifier code has an expiration date; and the apparatus further comprises: a judging unit configured to judge whether operation information of a user is received within a term of validity of the component identification code and/or the user identification code; a term extension unit for extending the term of validity of the component-use identification code and/or the user identification code if received; and the confirmation expiration unit is used for determining that the component identification code and/or the user identification code is expired if the component identification code and/or the user identification code are not received.
In some embodiments, the apparatus further comprises: a request acquiring unit, configured to acquire a request for requesting redirection of access, sent by the web page to the server, where the request includes the identifier for the component; a reloading unit, configured to receive a redirected web page address returned by the server for the request, and load a redirected page corresponding to the web page address through the component, where the web page address is sent after the server determines that the component identification code is the same as a pre-generated and stored identification code for verification; a comparison and judgment unit for comparing the component identification code with the user identification code and judging whether the component identification code is the same as the user identification code; and the information acquisition unit is used for acquiring the interaction information between the redirection page and the server if the redirection page is the same as the server.
According to the information synchronization method and device, the pre-stored identification code for the component is obtained in the process that the embedded component for loading the webpage loads the webpage, the identification code for the component is compared with the pre-stored user identification code, if the identification code for the component is the same as the pre-stored user identification code, the code for calling the data synchronization interface is written into the script of the webpage, and after the script is operated by the component and the data synchronization interface is called, information synchronization can be carried out on the webpage through the data synchronization interface, so that information synchronization is achieved quickly and efficiently.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of an information synchronization method according to the present application;
FIG. 3 is a flow diagram of yet another embodiment of an information synchronization method according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of an information synchronization apparatus according to the present application;
fig. 5 is a schematic structural diagram of a computer system suitable for implementing the terminal device or the server according to the embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the information synchronization method or information synchronization apparatus of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon client applications developed using various development modes, such as Native App, Web App, Hybrid App, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, and the like.
The server 105 may be a server that provides various services, and for example, may verify login information transmitted by the terminal apparatuses 101, 102, and 103, generate an authentication code from the login information after the verification is successful, and feed back the authentication code to the terminal apparatus.
It should be noted that the information synchronization method provided in the embodiment of the present application is generally executed by the terminal devices 101, 102, and 103, and accordingly, the information synchronization apparatus is generally disposed in the terminal devices 101, 102, and 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of an information synchronization method according to the present application is shown. The information synchronization method comprises the following steps:
step 201, in the process of loading the webpage page through the embedded component for loading the webpage page, acquiring the component identification code stored in the component.
In this embodiment, the electronic device (for example, the terminal devices 101, 102, and 103 shown in fig. 1) on which the information synchronization method operates is installed with a client application, which may be an application developed using a Hybrid mode, that is, a Hybrid App. The client application may be embedded with a component for loading a Web page, where the component may be a component capable of implementing a Web browser function, such as a WebView component, and the WebView component may be a system component used by the client application for loading a Web page. The client application can acquire the component identification code prestored in the component in the process of loading the webpage page through the component, wherein the component identification code can be the identification code acquired from the server in advance and used for verifying the identity of the user. For example, the identification code for the component may be an identification code written in an Http Cookie in the component after being generated by the server, the identification code in the Http Cookie may be a text fragment carried by the component by default when sending the Http request, and the identification code may be used to verify the identity of the user. The Web page may be a Web page embedded in the client application, and may include a Web page in html format, xhtml format, asp format, php format, jsp format, shtml format, nsp format, xml format, or other format developed in the future. For example, the web page may be an html5 page.
Step 202, comparing the stored user identification code with the component identification code, and judging whether the user identification code is the same as the component identification code.
In this embodiment, based on the component identifier obtained in step 201, the client application may compare a locally pre-stored user identifier with the component identifier, and determine whether the user identifier and the component identifier are the same, where the user identifier may be an identifier obtained from a server in advance and used for verifying the identity of a user.
And step 203, if the user identification code is the same as the component identification code, writing a code for calling the data synchronization interface into a script of the webpage.
In this embodiment, based on the determination result in step 202, if the user identifier is the same as the component identifier, it may be determined that the user identifier and the component identifier point to the same user, and at this time, the client application may write a code for invoking a data synchronization interface into a script of the web page being loaded by the component. In this embodiment, the Script may be a Script written by various scripting languages, such as JavaScript scripting language, VBScript scripting language, ActionScript scripting language, MAX Script scripting language, ASP scripting language, JSP scripting language, PHP scripting language, SQL scripting language, Perl scripting language, Shell scripting language, python scripting language, Ruby scripting language, and JavaFX scripting language.
And step 204, after the component runs the script and calls the data synchronization interface, performing information synchronization with the webpage through the data synchronization interface.
In this embodiment, after the component runs the script and calls the data synchronization interface, the client application may perform information synchronization with the web page through the data synchronization interface, for example, the client application may send information to the web page through the data synchronization interface, or receive information sent by the web page through the data synchronization interface. Here, the information to be synchronized may be various information related to the user, such as user login information, user personal information, user operation information, and the like.
In some optional implementations of this embodiment, the component-use identification code and/or the user identification code may further have a validity period beyond which the component-use identification code and/or the user identification code expires, for example, the expired identification code may be deleted. The client application may determine whether operation information of the user is received within a valid period of the component identification code and/or the user identification code, where the operation information may be input by the user through a native page or through an embedded Web page; if the operation information is received, the valid period of the component identification code and/or the user identification code is prolonged; if the operation information is not received, it is determined that the component identification code and/or the user identification code is expired. The expiration date may be manually set according to actual needs. For example, the valid period of the component identification code and/or the user identification code may be set to 24 hours, and then the valid period may be extended if the operation information of the user is received within 24 hours of the valid period; and determining to expire and delete if the operation information of the user is not received within 24 hours of the valid period.
In some optional implementation manners of this embodiment, the client application may further first obtain a request, sent by the web page to the server, for requesting redirection of access, where the request includes the component identification code. Here, the request for redirecting access may be a request for redirecting access, which is generated according to request information input by a user on the web page and is sent to a server. For example, in a certain shopping application, a user inputs request information for adding a commodity into a shopping cart through an html5 page embedded in the application, and at this time, if it is detected that the user is not currently logged in, a request for redirection access is sent to a server, where the request may include an identification code for a component and keyword information of a page for redirection access, where the keyword information of the page for redirection access may be logged in by the user, and the server may return website information corresponding to the page for redirection access requested by the user according to the request; secondly, the client application may further receive a redirected web page address returned by the server in response to the request, and load a redirected page corresponding to the web page address through the component, where the web page address is sent after the server determines that the component identification code is identical to a pre-generated and stored verification identification code; then, the client application may compare the identifier code for the component with the user identifier code, and determine whether the identifier code for the component is the same as the user identifier code, where the script of the redirection page may not include the data synchronization interface; finally, if the component identifier is the same as the user identifier, the client application may obtain the interaction information between the redirection page and the server, for example, the client application may obtain a request sent by the user to the server through the redirection page, and obtain information sent by the server to the redirection page for the request.
According to the method provided by the embodiment of the application, the code for calling the data synchronization interface is written in the script of the embedded webpage of the client application, and information synchronization is performed after the data synchronization interface is called, so that quick and efficient information synchronization with the embedded webpage is realized.
With further reference to fig. 3, a flow 300 of yet another embodiment of an information synchronization method is shown. The process 300 of the information synchronization method includes the following steps:
step 301, receiving login information input by a user through a native page, sending the login information to a server, and verifying the login information by the server.
In this embodiment, the electronic device (for example, the terminal devices 101, 102, 103 shown in fig. 1) on which the information synchronization method operates is installed with a client application, and the client application can receive login information input by a user through a native page, send the login information to a server, and verify the login information by the server. The Native page may be a page developed based on Native language of the operating system of the electronic device described above. The login information may include information such as an account number and a password. The server may verify the login information, for example, the server may verify that the account entered by the user is present and that the password is correct.
And step 302, receiving the identification code for verification sent by the server, and storing the identification code for verification as the user identification code.
In this embodiment, the client application may receive the identification code for authentication sent by the server, and store the identification code for authentication as the user identification code. The authentication identification code may be generated by the server based on the login information after the login information is successfully verified, and the server may store the generated authentication identification code. The above-mentioned identification code for authentication may have a validity period, which may be calculated from the generation time. For example, after the login information is successfully verified, the server may perform a Hash operation on the login information input by the user to generate a Hash mark, and the Hash mark may be used as the identification code for authentication. The server may further include a time parameter for identifying the current time when performing the Hash operation on the login information, so that a unique Hash mark related to the time may be generated as the identification code for authentication.
In step 303, the identification code for authentication is received from the server by the component and stored as the identification code for the component.
In this embodiment, the client application may receive the identification code for verification generated by the server from the server through an embedded component for loading a web page, and store the identification code for verification as the identification code for component, for example, the component may store the identification code for verification in the Http Cookie.
Step 304, in the process of loading the webpage page through the embedded component for loading the webpage page, acquiring the component identification code stored in the component.
In this embodiment, step 304 may refer to step 201 of the corresponding embodiment in fig. 2, which is not described herein again.
Step 305, comparing the stored user identification code with the component identification code, and judging whether the user identification code is the same as the component identification code.
In this embodiment, step 305 may refer to step 202 of the corresponding embodiment in fig. 2, which is not described herein again.
And step 306, if the user identification code is the same as the component identification code, writing a code for calling the data synchronization interface into the script of the webpage.
In this embodiment, step 306 may refer to step 203 of the corresponding embodiment in fig. 2, which is not described herein again.
Step 307, after the component runs the script and calls the data synchronization interface, performing information synchronization with the webpage through the data synchronization interface.
In this embodiment, step 307 may refer to step 204 of the corresponding embodiment in fig. 2, which is not described herein again.
In some optional implementation manners of this embodiment, the client application may further send a first data access request to a server through the web page, where the first data access request includes the identifier code for the component; the client application may further receive first data returned by the server in response to the first data access request, where the first data is returned after the server determines that the component identification code is identical to a pre-generated and stored authentication identification code.
In some optional implementations of this embodiment, the client application may further send a second data access request to the server through the native page, where the second data access request includes the user identifier; and then, the client can also receive second data returned by the server for a second data access request, wherein the second data is returned after the server determines that the user identification code is the same as the pre-generated and stored identification code for verification.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the information synchronization method 300 in this embodiment highlights the generation steps of the identification code for authentication, the identification code for assembly, and the user identification code, which ensure that the identification code for authentication, the identification code for assembly, and the user identification code corresponding to the same user are the same, and during the information synchronization and the data return process of the server, the identification code for authentication, the identification code for assembly, and the user identification code may be used for user authentication, and only after the authentication passes (i.e., after the comparison is the same), the information interaction may be performed, so that the information interaction is performed quickly and efficiently, and at the same time, the safety and reliability of the information interaction are ensured.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an information synchronization apparatus, which corresponds to the method embodiment shown in fig. 2, and which can be applied to various electronic devices.
As shown in fig. 4, the information synchronization apparatus 400 according to the present embodiment includes: an acquisition unit 401, a comparison unit 402, a writing unit 403, and a synchronization unit 404. The acquiring unit 401 is configured to acquire an identifier code for a component stored in an embedded component for loading a web page during a process of loading the web page by the component, where the identifier code for the component is an identifier code acquired from a server in advance and used for verifying an identity of a user; the comparing unit 402 is configured to compare a stored user identifier with the component identifier, and determine whether the user identifier is the same as the component identifier, where the user identifier is an identifier that is obtained from the server in advance and is used to verify a user identity; the writing unit 403 is configured to write a code for calling a data synchronization interface into a script of the web page if the user identifier is the same as the component identifier; the synchronization unit 404 is configured to perform information synchronization with the web page through the data synchronization interface after the component runs the script and calls the data synchronization interface.
In this embodiment, the specific processing of the obtaining unit 401, the comparing unit 402, the writing unit 403, and the synchronizing unit 404 may refer to the detailed description of step 201, step 202, step 203, and step 204 in the embodiment of fig. 2, and is not described herein again.
In some optional implementations of this embodiment, the apparatus further includes: a receiving and transmitting unit (not shown) for receiving login information input by a user through a native page, and transmitting the login information to a server to be verified by the server; a first receiving and storing unit (not shown) for receiving an identification code for authentication transmitted from the server, the identification code being generated by the server based on the login information after the login information is successfully verified, and storing the identification code for authentication as a user identification code; a second receiving and storing unit (not shown) for receiving the identification code for authentication from the server through the component and storing it as an identification code for the component. The implementation manner may refer to detailed descriptions of step 301, step 302, and step 303 in the embodiment corresponding to fig. 3, and is not described herein again.
In some optional implementations of this embodiment, the apparatus further includes: a first transmitting unit (not shown) configured to transmit a first data access request to the server through the web page, wherein the first data access request includes the component identification code; a first receiving unit (not shown) configured to receive first data returned by the server in response to the first data access request, where the first data is returned after the server determines that the component identification code is identical to a previously generated and stored authentication identification code. For the implementation, reference may be made to the detailed description of the corresponding implementation in the embodiment corresponding to fig. 3, which is not described herein again.
In some optional implementations of the embodiment, a second sending unit (not shown) is configured to send a second data access request to the server through a native page, where the second data access request includes a user identification code; a second receiving unit (not shown) configured to receive second data returned by the server in response to the second data access request, where the second data is returned after the server determines that the user identification code is identical to a pre-generated and stored identification code for authentication. For the implementation, reference may be made to the detailed description of the corresponding implementation in the embodiment corresponding to fig. 3, which is not described herein again.
In some optional implementations of this embodiment, the component identification code and/or the user identification code have an expiration date; and the above apparatus further comprises: a judging unit (not shown) for judging whether or not the operation information of the user is received within the valid period of the component identification code and/or the user identification code; a term extension unit (not shown) for extending the term of validity of the component identification code and/or the user identification code if received; and a confirmation expiration unit (not shown) for determining that the component identification code and/or the user identification code is expired if not received. For the implementation, reference may be made to the detailed description of the corresponding implementation in the embodiment corresponding to fig. 2, which is not described herein again.
In some optional implementations of this embodiment, the apparatus further includes: a request acquiring unit (not shown) configured to acquire a request, sent by the web page to the server, for requesting a redirected access, where the request includes the component identification code; a reloading unit (not shown) configured to receive a redirected web page address returned by the server for the request, and load a redirected page corresponding to the web page address through the component, where the web page address is sent after the server determines that the component identification code is identical to a pre-generated and stored identification code for authentication; a comparing and judging unit (not shown) for comparing the component identification code with the user identification code and judging whether the component identification code is identical with the user identification code; and an information obtaining unit (not shown) configured to obtain interaction information between the redirection page and the server if the redirection page is the same as the server. For the implementation, reference may be made to the detailed description of the corresponding implementation in the embodiment corresponding to fig. 2, which is not described herein again.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use in implementing a terminal device or server of an embodiment of the present application is shown.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 501.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a comparison unit, a writing unit, and a synchronization unit. The names of these units do not constitute a limitation to the unit itself in some cases, and for example, the acquiring unit may also be described as "a unit that acquires an identification code for a component stored in a component for loading a web page during loading of the web page by an embedded component".
As another aspect, the present application also provides a non-volatile computer storage medium, which may be the non-volatile computer storage medium included in the apparatus in the above-described embodiments; or it may be a non-volatile computer storage medium that exists separately and is not incorporated into the terminal. The non-transitory computer storage medium stores one or more programs that, when executed by a device, cause the device to: acquiring an identification code for the component stored in the component in the process of loading the webpage through an embedded component for loading the webpage, wherein the identification code for the component is an identification code which is acquired from a server in advance and is used for verifying the identity of a user; comparing the stored user identification code with the identification code for the component, and judging whether the user identification code is the same as the identification code for the component, wherein the user identification code is an identification code which is acquired from the server in advance and is used for verifying the identity of the user; if the user identification code is the same as the component identification code, writing a code for calling a data synchronization interface into a script of the webpage; and after the component runs the script and calls the data synchronization interface, performing information synchronization with the webpage through the data synchronization interface.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention as referred to in the present application is not limited to the embodiments with a specific combination of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (14)

1. A method for synchronizing information, the method comprising:
acquiring an identification code for the component stored in the component in the process of loading the webpage through an embedded component for loading the webpage, wherein the identification code for the component is an identification code which is acquired from a server in advance and is used for verifying the identity of a user;
comparing the stored user identification code with the identification code for the component, and judging whether the user identification code is the same as the identification code for the component, wherein the user identification code is an identification code which is acquired from the server in advance and is used for verifying the identity of the user;
if the user identification code is the same as the component identification code, writing a code for calling a data synchronization interface into a script of the webpage;
and after the component runs the script and calls the data synchronization interface, performing information synchronization with the webpage through the data synchronization interface.
2. The method of claim 1, wherein prior to said obtaining an identification code for a component stored in said component, said method further comprises:
receiving login information input by a user through a primary page, sending the login information to a server, and verifying the login information by the server;
receiving an identification code for verification sent by the server, and storing the identification code for verification as a user identification code, wherein the identification code for verification is generated by the server according to the login information after the login information is verified successfully;
receiving, by the component, the identification code for authentication from the server and storing as an identification code for the component.
3. The method of claim 2, further comprising:
sending a first data access request to the server through the webpage, wherein the first data access request comprises the identification code for the component;
and receiving first data returned by the server for the first data access request, wherein the first data is returned after the server determines that the component identification code is identical to a pre-generated and stored identification code for verification.
4. The method of claim 2, further comprising:
sending a second data access request to the server through a native page, wherein the second data access request comprises a user identification code;
and receiving second data returned by the server for the second data access request, wherein the second data is returned after the server determines that the user identification code is the same as the pre-generated and stored identification code for verification.
5. The method according to claim 1, characterized in that the component identification code and/or the user identification code has an expiration date; and
the method further comprises the following steps:
judging whether the operation information of the user is received within the valid period of the component identification code and/or the user identification code;
if so, extending the validity period of the component identification code and/or the user identification code;
if not, determining that the component-use identification code and/or the user identification code is expired.
6. The method of claim 1, further comprising:
acquiring a request which is sent by the webpage to the server and is used for requesting redirection access, wherein the request comprises the identification code for the component;
receiving a redirected webpage address returned by the server aiming at the request, and loading a redirected page corresponding to the webpage address through the component, wherein the webpage address is sent after the server determines that the identification code for the component is the same as a pre-generated and stored identification code for verification;
comparing the identification code for the component with the user identification code, and judging whether the identification code for the component is the same as the user identification code;
and if the two pieces of information are the same, acquiring the interaction information between the redirection page and the server.
7. An information synchronization apparatus, characterized in that the apparatus comprises:
the device comprises an acquisition unit, a verification unit and a verification unit, wherein the acquisition unit is used for acquiring an identification code for the component stored in an embedded component for loading the webpage page in the process of loading the webpage page by the component for loading the webpage page, and the identification code for the component is acquired from a server in advance and is used for verifying the identity of a user;
the comparison unit is used for comparing the stored user identification code with the component identification code and judging whether the user identification code is the same as the component identification code or not, wherein the user identification code is an identification code which is acquired from the server in advance and is used for verifying the identity of a user;
the writing unit is used for writing a code for calling a data synchronization interface into a script of the webpage page if the user identification code is the same as the component identification code;
and the synchronization unit is used for carrying out information synchronization with the webpage through the data synchronization interface after the assembly runs the script and calls the data synchronization interface.
8. The apparatus of claim 7, further comprising:
the receiving and sending unit is used for receiving login information input by a user through a native page, sending the login information to a server and verifying the login information by the server;
the first receiving and storing unit is used for receiving an identification code for verification sent by the server and storing the identification code for verification as a user identification code, wherein the identification code for verification is generated by the server according to the login information after the login information is verified successfully;
a second receiving and storing unit for receiving the identification code for authentication from the server through the component and storing as an identification code for component.
9. The apparatus of claim 8, further comprising:
a first sending unit, configured to send a first data access request to the server through the web page, where the first data access request includes the identification code for the component;
a first receiving unit, configured to receive first data returned by the server for the first data access request, where the first data is returned after the server determines that the component identification code is identical to a pre-generated and stored identification code for authentication.
10. The apparatus of claim 8, further comprising:
a second sending unit, configured to send a second data access request to the server through a native page, where the second data access request includes a user identification code;
and a second receiving unit, configured to receive second data returned by the server for the second data access request, where the second data is returned after the server determines that the user identification code is the same as a pre-generated and stored identification code for authentication.
11. The apparatus of claim 7, wherein the component identification code and/or the user identification code has an expiration date; and
the device further comprises:
a judging unit configured to judge whether operation information of a user is received within a term of validity of the component identification code and/or the user identification code;
a term extension unit for extending the term of validity of the component-use identification code and/or the user identification code if received;
and the confirmation expiration unit is used for determining that the component identification code and/or the user identification code is expired if the component identification code and/or the user identification code are not received.
12. The apparatus of claim 7, further comprising:
a request acquiring unit, configured to acquire a request for requesting redirection of access, sent by the web page to the server, where the request includes the identifier for the component;
a reloading unit, configured to receive a redirected web page address returned by the server for the request, and load a redirected page corresponding to the web page address through the component, where the web page address is sent after the server determines that the component identification code is the same as a pre-generated and stored identification code for verification;
a comparison and judgment unit for comparing the component identification code with the user identification code and judging whether the component identification code is the same as the user identification code;
and the information acquisition unit is used for acquiring the interaction information between the redirection page and the server if the redirection page is the same as the server.
13. An apparatus for performing an information synchronization method, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
14. A computer-readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-6.
CN201610159149.3A 2016-03-18 2016-03-18 Information synchronization method and device Active CN107203576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610159149.3A CN107203576B (en) 2016-03-18 2016-03-18 Information synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610159149.3A CN107203576B (en) 2016-03-18 2016-03-18 Information synchronization method and device

Publications (2)

Publication Number Publication Date
CN107203576A CN107203576A (en) 2017-09-26
CN107203576B true CN107203576B (en) 2020-06-05

Family

ID=59904266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610159149.3A Active CN107203576B (en) 2016-03-18 2016-03-18 Information synchronization method and device

Country Status (1)

Country Link
CN (1) CN107203576B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595656B (en) * 2018-04-28 2022-02-18 宁波银行股份有限公司 Data processing method and system
CN108829528B (en) * 2018-06-11 2021-06-25 腾讯科技(深圳)有限公司 Content sharing method and device, and message processing method and device
CN109101228B (en) * 2018-08-10 2022-01-28 百度在线网络技术(北京)有限公司 Application program execution method and device
CN109885360B (en) * 2019-02-28 2022-06-03 北京小米移动软件有限公司 Data processing method, device and storage medium
CN110633432A (en) * 2019-08-19 2019-12-31 深圳汇商通盈科技有限公司 Method, device, terminal equipment and medium for acquiring data
CN115729592A (en) * 2022-11-21 2023-03-03 上海秉匠信息科技有限公司 Page updating method and device, electronic equipment and medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102137118A (en) * 2011-04-26 2011-07-27 苏州阔地网络科技有限公司 Method and system for web security synchronous browse based on webpage
CN102137119A (en) * 2011-04-26 2011-07-27 苏州阔地网络科技有限公司 Method and system for synchronously browsing webpage based on webpage
CN102750283A (en) * 2011-04-20 2012-10-24 阿里巴巴集团控股有限公司 Massive data synchronization system and method
CN103200146A (en) * 2012-01-04 2013-07-10 中国移动通信集团安徽有限公司 Method and device for data synchronism of terminal and server
CN103617485A (en) * 2013-11-15 2014-03-05 中国航空无线电电子研究所 Uniform authority management and deployment system
CN104866316A (en) * 2015-06-02 2015-08-26 雷虹 Data center middleware system
CN105095360A (en) * 2015-06-25 2015-11-25 小米科技有限责任公司 Method and device for processing user requests for browser
CN105208032A (en) * 2015-09-30 2015-12-30 北京奇虎科技有限公司 Asynchronous login method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7149946B2 (en) * 2003-06-13 2006-12-12 Microsoft Corporation Systems and methods for enhanced stored data verification utilizing pageable pool memory
CA2674659C (en) * 2008-08-05 2016-10-18 Accenture Global Services Gmbh Synchronous to asynchronous web page conversion

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750283A (en) * 2011-04-20 2012-10-24 阿里巴巴集团控股有限公司 Massive data synchronization system and method
CN102137118A (en) * 2011-04-26 2011-07-27 苏州阔地网络科技有限公司 Method and system for web security synchronous browse based on webpage
CN102137119A (en) * 2011-04-26 2011-07-27 苏州阔地网络科技有限公司 Method and system for synchronously browsing webpage based on webpage
CN103200146A (en) * 2012-01-04 2013-07-10 中国移动通信集团安徽有限公司 Method and device for data synchronism of terminal and server
CN103617485A (en) * 2013-11-15 2014-03-05 中国航空无线电电子研究所 Uniform authority management and deployment system
CN104866316A (en) * 2015-06-02 2015-08-26 雷虹 Data center middleware system
CN105095360A (en) * 2015-06-25 2015-11-25 小米科技有限责任公司 Method and device for processing user requests for browser
CN105208032A (en) * 2015-09-30 2015-12-30 北京奇虎科技有限公司 Asynchronous login method and device

Also Published As

Publication number Publication date
CN107203576A (en) 2017-09-26

Similar Documents

Publication Publication Date Title
CN107203576B (en) Information synchronization method and device
US10635735B2 (en) Method and apparatus for displaying information
US11340961B2 (en) Dynamically integrating a client application with third-party services
CN111160845B (en) Service processing method and device
CN106716960B (en) User authentication method and system
CN107623690B (en) Login method, device and storage medium
CN107015870B (en) Method and device for realizing communication between web page and local application and electronic equipment
CN109257321B (en) Secure login method and device
CN106716918B (en) User authentication method and system
CN108810896B (en) Connection authentication method and device of wireless access point
CN110708346A (en) Information processing system and method
CN105447204A (en) Website recognition method and apparatus
CN105025041A (en) File upload method, file upload apparatus and system
CN104753892B (en) Network resource transmission method, device and system
CN104967586A (en) User identity authentication method, user identity authentication apparatus and user identity authentication system
CN106682491B (en) Application downloading method and device
CN104767614A (en) Information authentication method and device
CN105791249A (en) Third-party application processing method, device and system
CN108449186B (en) Security verification method and device
CN105701198A (en) Page validation method and device
RU2753450C1 (en) Method and device for fast order processing
CN110855655B (en) Information verification method, device, equipment and storage medium
CN111241518B (en) User authentication method, device, equipment and medium
US9537807B2 (en) Automatically transitioning a user from a call to action to an enrollment interface
CN110650014B (en) Signature authentication method, system, equipment and storage medium based on hessian protocol

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