[go: up one dir, main page]

CN109302446B - Cross-platform access method, apparatus, electronic device and storage medium - Google Patents

Cross-platform access method, apparatus, electronic device and storage medium Download PDF

Info

Publication number
CN109302446B
CN109302446B CN201810929073.7A CN201810929073A CN109302446B CN 109302446 B CN109302446 B CN 109302446B CN 201810929073 A CN201810929073 A CN 201810929073A CN 109302446 B CN109302446 B CN 109302446B
Authority
CN
China
Prior art keywords
server
sub
main server
login information
cookie file
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
CN201810929073.7A
Other languages
Chinese (zh)
Other versions
CN109302446A (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.)
Guangdong Baolun Electronics Co ltd
Original Assignee
Guangzhou Baolun Electronics 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 Guangzhou Baolun Electronics Co Ltd filed Critical Guangzhou Baolun Electronics Co Ltd
Priority to CN201810929073.7A priority Critical patent/CN109302446B/en
Publication of CN109302446A publication Critical patent/CN109302446A/en
Application granted granted Critical
Publication of CN109302446B publication Critical patent/CN109302446B/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/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a cross-platform access method, which comprises the following steps: sending a login command to a main server through a target server, and carrying out identity authentication on login information by the main server; after the identity authentication is passed, the main server encrypts the login information to generate a cookie file and sends the cookie file to the target server; the target server sends the cookie file to a sub-server; the sub-server sends the cookie file to a main server for consistency verification; and sending the verification result to a sub-server, and allowing the target server to log in by the sub-server. The invention also discloses a cross-platform access device, electronic equipment and a computer readable storage medium. According to the invention, cross-platform access is realized through interaction between the main server and the sub-servers, login information does not need to be input when each sub-server is accessed, only the sub-server needs to perform consistency verification with the main server at the background, and the user experience is improved.

Description

跨平台访问方法、装置、电子设备及存储介质Cross-platform access method, apparatus, electronic device and storage medium

技术领域technical field

本发明涉及信息访问技术领域,尤其涉及一种跨平台访问方法、装置、电子设备及存储介质。The present invention relates to the technical field of information access, and in particular, to a cross-platform access method, device, electronic device and storage medium.

背景技术Background technique

随着移动终端技术的快速发展,其提供的功能也越来越多,用户可以自由地安装各种用web技术编写的应用,由于平台间的不兼容,因此在移动终端中安装几十个应用已是非常普遍的现象。现有技术中通过Java Applet插件,可以实现多个浏览器上的运行,并能够获得一致的体验,但是,这种方式存在以下缺陷:Java Applet插件体积过大,运行速度慢,并且移动操作系统对Java语言的支持不够,因此,只能运行在个人电脑上,无法在移动终端上运行,而且,对所有的平台进行访问时,均需要注册并输入登录账户、密码等,降低了用户体验。With the rapid development of mobile terminal technology, it provides more and more functions. Users can freely install various applications written in web technology. Due to the incompatibility between platforms, dozens of applications are installed in mobile terminals. has become a very common phenomenon. In the prior art, the Java Applet plug-in can be used to run on multiple browsers, and a consistent experience can be obtained. However, this method has the following defects: the Java Applet plug-in is too large, the running speed is slow, and the mobile operating system The support for the Java language is not enough. Therefore, it can only be run on a personal computer and cannot be run on a mobile terminal. Moreover, when accessing all platforms, it is necessary to register and enter a login account, password, etc., which reduces the user experience.

发明内容SUMMARY OF THE INVENTION

为了克服现有技术的不足,本发明的目的之一在于提供一种跨平台访问方法,其通过主服务器和子服务器间的交互,实现跨平台访问,访问各子服务器无需输入登录信息,只需要子服务器在后台与主服务器进行一致性验证即可,提高用户体验。In order to overcome the deficiencies of the prior art, one of the purposes of the present invention is to provide a cross-platform access method, which realizes cross-platform access through the interaction between the main server and the sub-servers. Access to each sub-server does not require input of login information, and only requires sub-servers. The server can perform consistency verification with the main server in the background to improve user experience.

本发明的目的之二在于提供一种跨平台访问装置,其通过主服务器和子服务器间的交互,实现跨平台访问,访问各子服务器无需输入登录信息,只需要子服务器在后台与主服务器进行一致性验证即可,提高用户体验。The second purpose of the present invention is to provide a cross-platform access device, which realizes cross-platform access through the interaction between the main server and the sub-servers. Access to each sub-server does not require input of login information, and only requires the sub-server to be consistent with the main server in the background. Sexual verification is enough to improve user experience.

本发明的目的之三在于提供一种实现上述跨平台访问方法的电子设备。The third object of the present invention is to provide an electronic device that implements the above-mentioned cross-platform access method.

本发明的目的之四在于提供一种存储上述跨平台访问方法的计算机可读存储介质。The fourth object of the present invention is to provide a computer-readable storage medium storing the above-mentioned cross-platform access method.

本发明的目的之一采用如下技术方案实现:One of the objects of the present invention adopts the following technical scheme to realize:

一种跨平台访问方法,用于通过目标服务器访问主服务器和子服务器,所述子服务器为多个,所述子服务器与主服务器通讯,包括以下步骤:A cross-platform access method for accessing a main server and a sub-server through a target server, wherein the sub-servers are multiple, and the sub-servers communicate with the main server, comprising the following steps:

通过目标服务器向主服务器发送登录命令,主服务器获取目标服务器发送的登录信息并对所述登录信息进行身份验证;Send a login command to the main server through the target server, and the main server obtains the login information sent by the target server and authenticates the login information;

身份验证通过后,主服务器对所述登录信息进行加密,生成一个cookie文件发送至目标服务器,所述cookie文件并保存于主服务器中,目标服务器在本地浏览器中保存所述cookie文件;After the identity verification is passed, the main server encrypts the login information, generates a cookie file and sends it to the target server, the cookie file is stored in the main server, and the target server saves the cookie file in the local browser;

目标服务器访问子服务器时,将所述cookie文件发送至子服务器;When the target server accesses the sub-server, it sends the cookie file to the sub-server;

所述子服务器接收所述cookie文件并将所述cookie文件发送至主服务器,与所述主服务器内存储的cookie文件进行一致性验证;The sub-server receives the cookie file and sends the cookie file to the main server, and performs consistency verification with the cookie file stored in the main server;

一致性验证成功后,将验证结果发送至子服务器,子服务器允许所述目标服务器登录。After the consistency verification is successful, the verification result is sent to the sub-server, and the sub-server allows the target server to log in.

进一步地,在通过目标服务器向主服务器发送登录命令之前,还包括:Further, before sending the login command to the master server through the target server, the method further includes:

通过所述目标服务器设置登录信息,所述登录信息至少包括账户和密码;Setting login information by the target server, the login information at least includes an account and a password;

目标服务器通过websocket技术,以命令形式将所述登录信息发送到主服务器,主服务器将接收到的所述登录信息保存于主服务器数据库中;The target server sends the login information to the main server in the form of commands through the websocket technology, and the main server saves the received login information in the main server database;

主服务器通过websocket技术将所述登录信息群发至所有子服务器中。The main server sends the login information to all sub-servers in a group through the websocket technology.

进一步地,通过目标服务器对所述登录信息进行修改,形成修改后的登录信息;Further, the login information is modified by the target server to form the modified login information;

目标服务器通过websocket技术,以命令形式将所述修改后的登录信息发送到主服务器,主服务器将接收到的所述修改后的登录信息更新到主服务器数据库中;The target server sends the modified login information to the main server in the form of a command through the websocket technology, and the main server updates the received modified login information to the main server database;

主服务器通过websocket技术将所述修改后的登录信息群发至所有子服务器中进行数据同步。The main server sends the modified login information to all the sub-servers in a mass manner through the websocket technology for data synchronization.

进一步地,通过目标服务器向主服务器发送登录命令,包括:Further, send a login command to the master server through the target server, including:

用户在其终端设备的本地浏览器输入登录信息登录目标服务器;The user logs in to the target server by entering the login information in the local browser of the terminal device;

在用户发出跨平台登录请求时,目标服务器向主服务器发送登录命令,并将所述登录信息发送至主服务器。When a user sends a cross-platform login request, the target server sends a login command to the main server, and sends the login information to the main server.

进一步地,目标服务器在本地浏览器中保存所述cookie文件,包括:Further, the target server saves the cookie file in the local browser, including:

目标服务器将所述cookie文件发送至用户的终端设备使用的本地浏览器中上保存,保存方式为自动或手动。The target server sends the cookie file to the local browser used by the user's terminal device for saving, and the saving method is automatic or manual.

进一步地,目标服务器访问子服务器时,将所述cookie文件发送至子服务器,包括:Further, when the target server accesses the sub-server, it sends the cookie file to the sub-server, including:

用户通过其终端设备的本地浏览器查找到待访问的子服务器;The user finds the sub-server to be accessed through the local browser of his terminal device;

查找后,目标服务器将所述cookie文件发送至待访问的子服务器。After searching, the target server sends the cookie file to the sub-server to be accessed.

本发明的目的之二采用如下技术方案实现:The second purpose of the present invention adopts the following technical scheme to realize:

一种跨平台访问装置,用于通过目标服务器访问主服务器和子服务器,所述子服务器为多个,所述子服务器与主服务器通讯,包括:A cross-platform access device for accessing a main server and sub-servers through a target server, the sub-servers are multiple, and the sub-servers communicate with the main server, including:

身份验证模块,用于通过目标服务器向主服务器发送登录命令,主服务器获取目标服务器发送的登录信息并对所述登录信息进行身份验证;an identity verification module, configured to send a login command to the main server through the target server, and the main server obtains the login information sent by the target server and authenticates the login information;

生成模块,用于身份验证通过后,主服务器对所述登录信息进行加密,生成一个cookie文件发送至目标服务器,所述cookie文件并保存于主服务器中,目标服务器在本地浏览器中保存所述cookie文件;The generating module is used to encrypt the login information by the main server after the authentication is passed, generate a cookie file and send it to the target server, the cookie file is stored in the main server, and the target server saves the described cookie file in the local browser. cookie files;

访问模块,用于目标服务器访问子服务器时,将所述cookie文件发送至子服务器;The access module is used to send the cookie file to the sub-server when the target server accesses the sub-server;

一致性验证模块,用于所述子服务器接收所述cookie文件并将所述cookie文件发送至主服务器,与所述主服务器内存储的cookie文件进行一致性验证;a consistency verification module, used for the sub-server to receive the cookie file and send the cookie file to the main server, and perform consistency verification with the cookie file stored in the main server;

登录模块,用于一致性验证成功后,将验证结果发送至子服务器,子服务器允许所述目标服务器登录。The login module is used to send the verification result to the sub-server after the consistency verification is successful, and the sub-server allows the target server to log in.

本发明的目的之三采用如下技术方案实现:The third purpose of the present invention adopts the following technical scheme to realize:

一种电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本发明目的之一的跨平台访问方法。An electronic device, comprising: one or more processors; storage means for storing one or more programs, when the one or more programs are executed by the one or more processors, so that the one or more programs A plurality of processors realize the cross-platform access method which is one of the objects of the present invention.

本发明的目的之四采用如下技术方案实现:The fourth purpose of the present invention adopts the following technical scheme to realize:

一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现本发明目的之一的跨平台访问方法。A computer-readable storage medium on which a computer program is stored, when the program is executed by a processor, realizes the cross-platform access method, one of the objectives of the present invention.

相比现有技术,本发明的有益效果在于:Compared with the prior art, the beneficial effects of the present invention are:

本发明通过目标服务器、主服务器和子服务器间的交互,实现跨平台访问,避免各平台间的不兼容造成不一致的体验产生,而且,访问各子服务器无需输入登录信息,只需要子服务器在后台与主服务器进行一致性验证即可,提高用户体验。The present invention realizes cross-platform access through the interaction among the target server, the main server and the sub-servers, and avoids the generation of inconsistent experiences caused by the incompatibility of each platform. Moreover, accessing each sub-server does not require inputting login information, and only requires the sub-server to communicate with each other in the background. The main server can perform consistency verification to improve user experience.

附图说明Description of drawings

图1为本发明实施例一的跨平台访问方法的流程图;1 is a flowchart of a cross-platform access method according to Embodiment 1 of the present invention;

图2为本发明实施例二的跨平台访问装置的结构示意图;2 is a schematic structural diagram of a cross-platform access device according to Embodiment 2 of the present invention;

图3为本发明实施例三的电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device according to Embodiment 3 of the present invention.

具体实施方式Detailed ways

下面,结合附图以及具体实施方式,对本发明做进一步描述,需要说明的是,在不相冲突的前提下,以下描述的各实施例之间或各技术特征之间可以任意组合形成新的实施例。The present invention will be further described below with reference to the accompanying drawings and specific embodiments. It should be noted that, on the premise of no conflict, the embodiments or technical features described below can be combined arbitrarily to form new embodiments. .

实施例一Example 1

本发明实施例一公开了一种跨平台访问方法,用于通过目标服务器访问主服务器和子服务器,所述子服务器为多个,所述子服务器与主服务器通讯。主服务器和子服务器的地位可以随时切换,即任意子服务器都可以成为主服务器,主服务器和子服务器可以采用不同的操作系统和硬件架构构建,从而实现目标服务器的跨平台访问。Embodiment 1 of the present invention discloses a cross-platform access method, which is used for accessing a main server and sub-servers through a target server, wherein there are multiple sub-servers, and the sub-servers communicate with the main server. The status of the main server and sub-server can be switched at any time, that is, any sub-server can become the main server, and the main server and sub-server can be constructed with different operating systems and hardware architectures, so as to achieve cross-platform access to the target server.

该方法可以由硬件或/和软件来执行,请参照图1所示,其包括以下步骤:The method can be executed by hardware or/and software, please refer to FIG. 1, which includes the following steps:

110、通过目标服务器向主服务器发送登录命令,主服务器获取目标服务器发送的登录信息并对所述登录信息进行身份验证。110. Send a login command to the main server through the target server, and the main server obtains the login information sent by the target server and performs authentication on the login information.

在通过目标服务器向主服务器发送登录命令之前任意时间,还需要注册登录信息,其具体包括:通过所述目标服务器设置登录信息,所述登录信息至少包括账户和密码;目标服务器通过websocket技术,以命令形式将所述登录信息发送到主服务器,主服务器将接收到的所述登录信息保存于主服务器数据库中;主服务器通过websocket技术将所述登录信息群发至所有子服务器中。At any time before sending a login command to the main server through the target server, it is also necessary to register login information, which specifically includes: setting login information through the target server, and the login information at least includes an account and a password; The login information is sent to the main server in the form of a command, and the main server saves the received login information in the main server database; the main server sends the login information to all sub-servers in a group through websocket technology.

如果需要对登录信息进行修改,其则需要先通过目标服务器对所述登录信息进行修改,形成修改后的登录信息;然后目标服务器通过websocket技术,以命令形式将所述修改后的登录信息发送到主服务器,主服务器将接收到的所述修改后的登录信息更新到主服务器数据库中;最后主服务器通过websocket技术将所述修改后的登录信息群发至所有子服务器中进行数据同步。If the login information needs to be modified, it needs to modify the login information through the target server first to form the modified login information; then the target server sends the modified login information in the form of commands to the websocket technology. The main server, the main server updates the received modified login information to the main server database; finally, the main server sends the modified login information to all sub-servers for data synchronization through websocket technology.

身份验证通过后,则执行步骤120的操作,否则,反馈到目标服务器。目标服务器为用户登录的服务器,其也可以作为主服务器或子服务器使用。用户通过终端设备以应用形式登录目标服务器,再由目标服务器向主服务器发送命令,终端设备可以是台式机、笔记本、手机、平板电脑等,应用可以是浏览器或者app客户端等。这里仅以浏览器为例,对本发明登录以及访问等进行解释和说明。通过目标服务器向主服务器发送登录命令,包括:用户在其终端设备的本地浏览器输入登录信息登录目标服务器;在用户发出跨平台登录请求时,目标服务器向主服务器发送登录命令,并将所述登录信息发送至主服务器。After the authentication is passed, the operation of step 120 is performed; otherwise, the feedback is sent to the target server. The target server is the server logged in by the user, which can also be used as a master server or a sub server. The user logs in to the target server in the form of an application through a terminal device, and then the target server sends a command to the main server. The terminal device can be a desktop computer, a notebook, a mobile phone, a tablet computer, etc., and the application can be a browser or an app client. Here, only a browser is taken as an example to explain and describe the login and access of the present invention. Sending a login command to the main server through the target server includes: the user enters login information in the local browser of his terminal device to log in to the target server; when the user sends a cross-platform login request, the target server sends a login command to the main server, and sends the login information to the main server. The login information is sent to the main server.

120、身份验证通过后,主服务器对所述登录信息进行加密,生成一个cookie文件发送至目标服务器,所述cookie文件并保存于主服务器中,目标服务器在本地浏览器中保存所述cookie文件。120. After the authentication is passed, the main server encrypts the login information, generates a cookie file and sends it to the target server, the cookie file is stored in the main server, and the target server saves the cookie file in the local browser.

加密方式可以是对称加密,也可以是非对称加密。目标服务器接收到主服务器发送的所述cookie文件后,再发送至用户的终端设备使用的本地浏览器中进行保存,保存方式为自动或手动。The encryption method can be symmetric encryption or asymmetric encryption. After receiving the cookie file sent by the main server, the target server sends it to the local browser used by the user's terminal device for saving, and the saving method is automatic or manual.

130、当目标服务器访问任意的子服务器时,都会从本地浏览器中读取该所述cookie文件并发送至子服务器。130. When the target server accesses any sub-server, it will read the cookie file from the local browser and send it to the sub-server.

用户通过其终端设备的本地浏览器登录目标服务器,通过目标服务器查找并选中待访问的子服务器;选中后,目标服务器自动将所述cookie文件发送至待访问的子服务器。The user logs in to the target server through the local browser of his terminal device, searches and selects the sub-server to be accessed through the target server; after selection, the target server automatically sends the cookie file to the sub-server to be accessed.

140、所述子服务器接收所述cookie文件并将所述cookie文件发送至主服务器,与所述主服务器内存储的cookie文件进行一致性验证。140. The sub-server receives the cookie file and sends the cookie file to the main server, and performs consistency verification with the cookie file stored in the main server.

如果两个cookie文件内容一致,则说明一致性验证成功,执行150步骤的操作,反之,一致性验证不通过,不允许登录该子服务器,如果仍要登录该子服务器,则可以输入登录信息的形式进行,或者删除本地浏览器中的cookie文件,重新生成,再次登录该子服务器。If the contents of the two cookie files are the same, it means that the consistency verification is successful, and the operation of step 150 is performed. Otherwise, if the consistency verification fails, the sub-server is not allowed to log in. If you still want to log in to the sub-server, you can enter the login information. form, or delete the cookie file in the local browser, regenerate it, and log in to the sub-server again.

150、一致性验证成功后,将验证结果发送至子服务器,子服务器允许所述目标服务器登录,即用户通过目标服务器可以访问子服务器,达到跨平台访问的目的,期间,无需输入登录信息,提高用户体验。150. After the consistency verification is successful, the verification result is sent to the sub-server, and the sub-server allows the target server to log in, that is, the user can access the sub-server through the target server, so as to achieve the purpose of cross-platform access. user experience.

实施例二Embodiment 2

实施例二公开了一种对应上述实施例的跨平台访问装置,用于通过目标服务器访问主服务器和子服务器,所述子服务器为多个,所述子服务器与主服务器通讯,请参照图2所示,其包括:The second embodiment discloses a cross-platform access device corresponding to the above-mentioned embodiment, which is used to access a main server and a sub-server through a target server. There are multiple sub-servers, and the sub-servers communicate with the main server. shown, which includes:

身份验证模块210,用于通过目标服务器向主服务器发送登录命令,主服务器获取目标服务器发送的登录信息并对所述登录信息进行身份验证;The identity verification module 210 is used for sending a login command to the main server through the target server, and the main server obtains the login information sent by the target server and authenticates the login information;

生成模块220,用于身份验证通过后,主服务器对所述登录信息进行加密,生成一个cookie文件发送至目标服务器,所述cookie文件并保存于主服务器中,目标服务器在本地浏览器中保存所述cookie文件;The generating module 220 is used to encrypt the login information by the main server after the authentication is passed, generate a cookie file and send it to the target server, the cookie file is stored in the main server, and the target server saves all the information in the local browser the cookie file described above;

访问模块230,用于目标服务器访问子服务器时,将所述cookie文件发送至子服务器;The access module 230 is used for sending the cookie file to the sub-server when the target server accesses the sub-server;

一致性验证模块240,用于所述子服务器接收所述cookie文件并将所述cookie文件发送至主服务器,与所述主服务器内存储的cookie文件进行一致性验证;Consistency verification module 240, used for the sub-server to receive the cookie file and send the cookie file to the main server, and perform consistency verification with the cookie file stored in the main server;

登录模块250,用于一致性验证成功后,将验证结果发送至子服务器,子服务器允许所述目标服务器登录。The login module 250 is configured to send the verification result to the sub-server after the consistency verification is successful, and the sub-server allows the target server to log in.

实施例三Embodiment 3

图3为本发明实施例三提供的一种电子设备的结构示意图,如图3所示,该电子设备包括处理器310、存储器320、输入装置330和输出装置340;计算机设备中处理器310的数量可以是一个或多个,图3中以一个处理器310为例;电子设备中的处理器310、存储器320、输入装置330和输出装置340可以通过总线或其他方式连接,图3中以通过总线连接为例。FIG. 3 is a schematic structural diagram of an electronic device according to Embodiment 3 of the present invention. As shown in FIG. 3 , the electronic device includes a processor 310, a memory 320, an input device 330, and an output device 340; The number can be one or more. In FIG. 3, one processor 310 is used as an example; the processor 310, the memory 320, the input device 330 and the output device 340 in the electronic device can be connected by a bus or in other ways. Take bus connection as an example.

存储器320作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本发明实施例中的跨平台访问方法对应的程序指令/模块(例如,跨平台访问装置中的身份验证模块210、生成模块220、访问模块230、一致性验证模块240和登录模块250)。处理器310通过运行存储在存储器320中的软件程序、指令以及模块,从而执行电子设备的各种功能应用以及数据处理,即实现上述的跨平台访问方法。As a computer-readable storage medium, the memory 320 can be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the cross-platform access method in the embodiment of the present invention (for example, the Authentication module 210, generation module 220, access module 230, consistency verification module 240 and login module 250). The processor 310 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 320, that is, to implement the above-mentioned cross-platform access method.

存储器320可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端的使用所创建的数据等。此外,存储器320可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器320可进一步包括相对于处理器310远程设置的存储器,这些远程存储器可以通过网络连接至电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 320 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Additionally, memory 320 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, memory 320 may further include memory located remotely from processor 310, which may be connected to the electronic device through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

输入装置330可用于接收输入的用户身份信息。输出装置340可包括显示屏等显示设备。Input device 330 may be used to receive input user identity information. The output device 340 may include a display device such as a display screen.

实施例四Embodiment 4

本发明实施例四还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种跨平台访问方法,该方法包括:Embodiment 4 of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are used to execute a cross-platform access method when executed by a computer processor, and the method includes:

通过目标服务器向主服务器发送登录命令,主服务器获取目标服务器发送的登录信息并对所述登录信息进行身份验证;Send a login command to the main server through the target server, and the main server obtains the login information sent by the target server and authenticates the login information;

身份验证通过后,主服务器对所述登录信息进行加密,生成一个cookie文件发送至目标服务器,所述cookie文件并保存于主服务器中,目标服务器在本地浏览器中保存所述cookie文件;After the identity verification is passed, the main server encrypts the login information, generates a cookie file and sends it to the target server, the cookie file is stored in the main server, and the target server saves the cookie file in the local browser;

目标服务器访问子服务器时,将所述cookie文件发送至子服务器;When the target server accesses the sub-server, it sends the cookie file to the sub-server;

所述子服务器接收所述cookie文件并将所述cookie文件发送至主服务器,与所述主服务器内存储的cookie文件进行一致性验证;The sub-server receives the cookie file and sends the cookie file to the main server, and performs consistency verification with the cookie file stored in the main server;

一致性验证成功后,将验证结果发送至子服务器,子服务器允许所述目标服务器登录。After the consistency verification is successful, the verification result is sent to the sub-server, and the sub-server allows the target server to log in.

当然,本发明实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的方法操作,还可以执行本发明任意实施例所提供的跨平台访问方法中的相关操作。Of course, a storage medium containing computer-executable instructions provided by an embodiment of the present invention is not limited to the above-mentioned method operations, and can also execute any of the cross-platform access methods provided by any embodiment of the present invention. related operations.

通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本发明可借助软件及必需的通用硬件来实现,当然也可以通过硬件实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(RandomAccess Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括若干指令用以使得一台电子设备(可以是手机,个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。From the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be realized by software and necessary general-purpose hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment . Based on such understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in a computer-readable storage medium, such as a floppy disk of a computer , read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disk, etc., including several instructions to make an electronic device (can be a mobile phone, personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

值得注意的是,上述跨平台访问装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。It is worth noting that, in the above embodiments of the cross-platform access device, the included units and modules are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, The specific names of the functional units are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present invention.

上述实施方式仅为本发明的优选实施方式,不能以此来限定本发明保护的范围,本领域的技术人员在本发明的基础上所做的任何非实质性的变化及替换均属于本发明所要求保护的范围。The above-mentioned embodiments are only preferred embodiments of the present invention, and cannot be used to limit the scope of protection of the present invention. Any insubstantial changes and substitutions made by those skilled in the art on the basis of the present invention belong to the scope of the present invention. Scope of protection claimed.

Claims (9)

1.一种跨平台访问方法,用于通过目标服务器访问主服务器和子服务器,所述子服务器为多个,所述子服务器与主服务器通讯,其特征在于,主服务器和子服务器之间的地位可切换设置,包括以下步骤:1. a cross-platform access method is used to access a main server and a sub-server through a target server, the sub-servers are multiple, and the sub-servers communicate with the main server, and it is characterized in that the position between the main server and the sub-server can be adjusted. Toggle settings, including the following steps: 通过目标服务器向主服务器发送登录命令,主服务器获取目标服务器发送的登录信息并对所述登录信息进行身份验证;Send a login command to the main server through the target server, and the main server obtains the login information sent by the target server and authenticates the login information; 身份验证通过后,主服务器对所述登录信息进行加密,生成一个cookie文件发送至目标服务器,所述cookie文件并保存于主服务器中,目标服务器在本地浏览器中保存所述cookie文件;After the identity verification is passed, the main server encrypts the login information, generates a cookie file and sends it to the target server, the cookie file is stored in the main server, and the target server saves the cookie file in the local browser; 目标服务器访问子服务器时,将所述cookie文件发送至子服务器;When the target server accesses the sub-server, it sends the cookie file to the sub-server; 所述子服务器接收所述cookie文件并将所述cookie文件发送至主服务器,与所述主服务器内存储的cookie文件进行一致性验证;The sub-server receives the cookie file and sends the cookie file to the main server, and performs consistency verification with the cookie file stored in the main server; 一致性验证成功后,将验证结果发送至子服务器,子服务器允许所述目标服务器登录。After the consistency verification is successful, the verification result is sent to the sub-server, and the sub-server allows the target server to log in. 2.如权利要求1所述的跨平台访问方法,其特征在于,在通过目标服务器向主服务器发送登录命令之前,还包括:2. The cross-platform access method according to claim 1, wherein before sending the login command to the main server through the target server, further comprising: 通过所述目标服务器设置登录信息,所述登录信息至少包括账户和密码;Setting login information by the target server, the login information at least includes an account and a password; 目标服务器通过websocket技术,以命令形式将所述登录信息发送到主服务器,主服务器将接收到的所述登录信息保存于主服务器数据库中;The target server sends the login information to the main server in the form of a command through the websocket technology, and the main server saves the received login information in the main server database; 主服务器通过websocket技术将所述登录信息群发至所有子服务器中。The main server sends the login information to all sub-servers in a group through the websocket technology. 3.如权利要求2所述的跨平台访问方法,其特征在于,通过目标服务器对所述登录信息进行修改,形成修改后的登录信息;3. The cross-platform access method according to claim 2, wherein the login information is modified by the target server to form the modified login information; 目标服务器通过websocket技术,以命令形式将所述修改后的登录信息发送到主服务器,主服务器将接收到的所述修改后的登录信息更新到主服务器数据库中;The target server sends the modified login information to the main server in the form of a command through the websocket technology, and the main server updates the received modified login information to the main server database; 主服务器通过websocket技术将所述修改后的登录信息群发至所有子服务器中进行数据同步。The main server sends the modified login information to all the sub-servers in a mass manner through the websocket technology for data synchronization. 4.如权利要求1所述的跨平台访问方法,其特征在于,通过目标服务器向主服务器发送登录命令,包括:4. The cross-platform access method according to claim 1, wherein sending a login command to the main server through the target server, comprising: 用户在其终端设备的本地浏览器输入登录信息登录目标服务器;The user logs in to the target server by entering the login information in the local browser of the terminal device; 在用户发出跨平台登录请求时,目标服务器向主服务器发送登录命令,并将所述登录信息发送至主服务器。When a user sends a cross-platform login request, the target server sends a login command to the main server, and sends the login information to the main server. 5.如权利要求4所述的跨平台访问方法,其特征在于,目标服务器在本地浏览器中保存所述cookie文件,包括:5. The cross-platform access method according to claim 4, wherein the target server saves the cookie file in the local browser, comprising: 目标服务器将所述cookie文件发送至用户的终端设备使用的本地浏览器中上保存,保存方式为自动或手动。The target server sends the cookie file to the local browser used by the user's terminal device for saving, and the saving method is automatic or manual. 6.如权利要求1所述的跨平台访问方法,其特征在于,目标服务器访问子服务器时,将所述cookie文件发送至子服务器,包括:6. The cross-platform access method according to claim 1, wherein when the target server accesses the sub-server, sending the cookie file to the sub-server, comprising: 用户通过其终端设备的本地浏览器查找到待访问的子服务器;The user finds the sub-server to be accessed through the local browser of his terminal device; 查找后,目标服务器将所述cookie文件发送至待访问的子服务器。After searching, the target server sends the cookie file to the sub-server to be accessed. 7.一种跨平台访问装置,用于通过目标服务器访问主服务器和子服务器,所述子服务器为多个,所述子服务器与主服务器通讯,其特征在于,主服务器和子服务器之间的地位可切换设置,包括:7. A cross-platform access device for accessing a main server and a sub-server through a target server, wherein the sub-servers are multiple, and the sub-servers communicate with the main server, and it is characterized in that the status between the main server and the sub-servers can be adjusted. Toggle settings, including: 身份验证模块,用于通过目标服务器向主服务器发送登录命令,主服务器获取目标服务器发送的登录信息并对所述登录信息进行身份验证;an identity verification module, configured to send a login command to the main server through the target server, and the main server obtains the login information sent by the target server and authenticates the login information; 生成模块,用于身份验证通过后,主服务器对所述登录信息进行加密,生成一个cookie文件发送至目标服务器,所述cookie文件并保存于主服务器中,目标服务器在本地浏览器中保存所述cookie文件;The generation module is used for the main server to encrypt the login information after the authentication is passed, to generate a cookie file and send it to the target server, the cookie file is stored in the main server, and the target server saves the described cookie file in the local browser. cookie files; 访问模块,用于目标服务器访问子服务器时,将所述cookie文件发送至子服务器;The access module is used to send the cookie file to the sub-server when the target server accesses the sub-server; 一致性验证模块,用于所述子服务器接收所述cookie文件并将所述cookie文件发送至主服务器,与所述主服务器内存储的cookie文件进行一致性验证;a consistency verification module, used for the sub-server to receive the cookie file and send the cookie file to the main server, and perform consistency verification with the cookie file stored in the main server; 登录模块,用于一致性验证成功后,将验证结果发送至子服务器,子服务器允许所述目标服务器登录。The login module is used to send the verification result to the sub-server after the consistency verification is successful, and the sub-server allows the target server to log in. 8.一种电子设备,其特征在于,包括:8. An electronic device, characterized in that, comprising: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,storage means for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-6中任一所述的跨平台访问方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the cross-platform access method according to any one of claims 1-6. 9.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-6中任一所述的跨平台访问方法。9. A computer-readable storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the cross-platform access method according to any one of claims 1-6 is implemented.
CN201810929073.7A 2018-08-15 2018-08-15 Cross-platform access method, apparatus, electronic device and storage medium Active CN109302446B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810929073.7A CN109302446B (en) 2018-08-15 2018-08-15 Cross-platform access method, apparatus, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810929073.7A CN109302446B (en) 2018-08-15 2018-08-15 Cross-platform access method, apparatus, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN109302446A CN109302446A (en) 2019-02-01
CN109302446B true CN109302446B (en) 2022-10-25

Family

ID=65165068

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810929073.7A Active CN109302446B (en) 2018-08-15 2018-08-15 Cross-platform access method, apparatus, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN109302446B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114285650A (en) * 2021-12-27 2022-04-05 中国电信股份有限公司 Communication system, method and device based on cookie authentication

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7194621B1 (en) * 2002-02-28 2007-03-20 Cisco Technology, Inc. Method and apparatus for encrypting data communicated between a client and a server that use an unencrypted data transfer protocol
CN101594360A (en) * 2009-07-07 2009-12-02 清华大学 Local area network system and method for maintaining information security of local area network
CN101981868A (en) * 2008-04-02 2011-02-23 阿尔卡特朗讯公司 IPTV network with D server controller implementing diagnostic tool, VoD server controller and policy server
CN102281291A (en) * 2011-07-18 2011-12-14 李建成 Log-in method and system
CN102378171A (en) * 2010-08-16 2012-03-14 中国移动通信集团公司 Automatic authentication method and system thereof, Portal server, and RADIUS server
CN105812350A (en) * 2016-02-03 2016-07-27 北京中搜云商网络技术有限公司 Cross-platform single-point registration system

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
PL1997270T3 (en) * 2006-03-09 2015-05-29 Vasco Data Security Int Gmbh Method and system for authenticating a user
CN1835438B (en) * 2006-03-22 2011-07-27 阿里巴巴集团控股有限公司 Method of realizing single time accession between websites and website thereof
CN102065141B (en) * 2010-12-27 2014-05-07 广州欢网科技有限责任公司 Method and system for realizing single sign-on of cross-application and browser
CN102682009B (en) * 2011-03-11 2017-02-15 腾讯科技(北京)有限公司 Method and system for logging in webpage
US9342288B2 (en) * 2013-05-31 2016-05-17 Itron, Inc. Surfacing cross platform applications
CN105007280B (en) * 2015-08-05 2018-06-05 郑州悉知信息科技股份有限公司 A kind of application login method and device
CN105577835B (en) * 2016-02-03 2020-08-14 北京中搜云商网络技术有限公司 Cross-platform single sign-on system based on cloud computing
US20180191856A1 (en) * 2016-12-29 2018-07-05 Synology Inc. Cross-domain communication methods and proxy servers using the same
CN106612290B (en) * 2017-01-19 2020-04-03 河海大学 A cross-domain single sign-on method for system integration

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7194621B1 (en) * 2002-02-28 2007-03-20 Cisco Technology, Inc. Method and apparatus for encrypting data communicated between a client and a server that use an unencrypted data transfer protocol
CN101981868A (en) * 2008-04-02 2011-02-23 阿尔卡特朗讯公司 IPTV network with D server controller implementing diagnostic tool, VoD server controller and policy server
CN101594360A (en) * 2009-07-07 2009-12-02 清华大学 Local area network system and method for maintaining information security of local area network
CN102378171A (en) * 2010-08-16 2012-03-14 中国移动通信集团公司 Automatic authentication method and system thereof, Portal server, and RADIUS server
CN102281291A (en) * 2011-07-18 2011-12-14 李建成 Log-in method and system
CN105812350A (en) * 2016-02-03 2016-07-27 北京中搜云商网络技术有限公司 Cross-platform single-point registration system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Cookie实现同域,跨域单点登录;零度anngle;《CSDN https://blog.csdn.net/zmx729618/article/details/51361848》;20160510;全文 *
基于XMPP协议的Android手机即时通信应用研究与实现;高明鹏;《中国优秀硕士学位论文全文数据库 (信息科技辑) 》;20130115;全文 *
基于跨平台移动开发框架AppCan的新闻线索征集系统的设计与实现;孙雪松;《中国优秀硕士学位论文全文数据库 (信息科技辑) 》;20141015;全文 *

Also Published As

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

Similar Documents

Publication Publication Date Title
US11792199B2 (en) Application-assisted login for a web browser
CN108683679B (en) Multi-account login method, device, equipment and storage medium of Web APP
TWI687113B (en) Method and server for determining whether the terminal logging in to the website is a mobile terminal
WO2018036314A1 (en) Single-sign-on authentication method and apparatus, and storage medium
EP3491808B1 (en) Interchangeable retrieval of content
JP2017538231A (en) Remote access control for stored data
US10574703B1 (en) Content delivery employing multiple security levels
WO2016101635A1 (en) Method, apparatus and device for synchronizing login status, and computer storage medium
US10069814B2 (en) Single sign on across multiple devices using a unique machine identification
CN108287894B (en) Data processing method, device, computing equipment and storage medium
CN111865911A (en) Method, communication apparatus, and storage medium for accessing cloud-based service
CN109274777B (en) A method, device, equipment and readable storage medium for exporting configuration files
US20170155712A1 (en) Method and device for updating cache data
CN102082800A (en) User request processing method and server
WO2016070718A1 (en) Method, device, and browser for file downloading
CN104836777B (en) Identity verification method and system
CN106161356B (en) Method and system for rapidly logging in website through client
CN105141632A (en) Method and device used for checking pages
CN107566329A (en) A kind of access control method and device
CN104932910A (en) Method and system for application program interface extension
TW201335777A (en) Distributed data storing and accessing system and method
CN109302446B (en) Cross-platform access method, apparatus, electronic device and storage medium
CN111193776B (en) Method, device, equipment and medium for automatically logging in client under cloud desktop environment
WO2016155266A1 (en) Data sharing method and device for virtual desktop
CN103957252A (en) Method and system for obtaining log of cloud storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: No. 56 Nanli East Road, Shiqi Town, Panyu District, Guangzhou City, Guangdong Province, 510000

Patentee after: Guangdong Baolun Electronics Co.,Ltd.

Address before: 511400 Building 1, industrial zone B, Zhongcun street, Zhongcun street, Panyu District, Guangzhou City, Guangdong Province

Patentee before: GUANGZHOU ITC ELECTRONIC TECHNOLOGY Co.,Ltd.