WO2016107458A1 - 恢复会话的方法和服务器、生成会话凭证的方法和装置 - Google Patents

恢复会话的方法和服务器、生成会话凭证的方法和装置 Download PDF

Info

Publication number
WO2016107458A1
WO2016107458A1 PCT/CN2015/098250 CN2015098250W WO2016107458A1 WO 2016107458 A1 WO2016107458 A1 WO 2016107458A1 CN 2015098250 W CN2015098250 W CN 2015098250W WO 2016107458 A1 WO2016107458 A1 WO 2016107458A1
Authority
WO
WIPO (PCT)
Prior art keywords
session
information
unit
credential
server
Prior art date
Application number
PCT/CN2015/098250
Other languages
English (en)
French (fr)
Inventor
张振宇
俞小浩
Original Assignee
阿里巴巴集团控股有限公司
张振宇
俞小浩
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 阿里巴巴集团控股有限公司, 张振宇, 俞小浩 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2016107458A1 publication Critical patent/WO2016107458A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials

Definitions

  • the embodiment of the present application provides a method and a server for restoring a session, and a method and apparatus for generating a session credential are implemented as follows:
  • the verification information generating unit is configured to generate, by using the first generation rule, first verification information corresponding to the session information in the session information generating unit;
  • the first hash value of the first character string may be a security hash algorithm (SHA-1) or a message digest algorithm (MD5), which is not limited in this application. .
  • SHA-1 security hash algorithm
  • MD5 message digest algorithm
  • the server may send the first session credential to the client.
  • the first session credential may be the unique identifier of the current session in the first communication connection.
  • the client When the client disconnects from the network, the first communication connection between the client and the server is disconnected; when the client re-accesses the network, the client establishes a second communication connection with the server.
  • the method may include: performing a first inverse confusion algorithm on the second session credential, where the first inverse confusion algorithm may be an inverse operation of the first obfuscation algorithm, and the obtained result may include second session information and Second verification information.
  • the second inverse confusion algorithm may correspond to the second confusion algorithm, and the second inverse confusion algorithm It can be the inverse of the second obfuscation algorithm.
  • the method of determining the encryption key may be the same as the method of determining the encryption key in the step of obtaining the first encryption result.
  • S107 The server generates third verification information corresponding to the second session information by using the first generation rule.
  • the second verification information may be the same as the third verification information. If the second verification information is the same as the third verification information, the second session information included in the second session connection may be Valid information. The session between the client and the server can be recovered using the second session information.
  • the method may further include: verifying a timestamp length of the second session credential between S105 and S106, if the timestamp length of the second session credential is less than a preset time length, the second session The credentials are valid and proceed to the next step for resolution.
  • the timestamp length of the second session credential may be equal to the time difference between the time when the second session credential is generated and the time when the server receives the second session credential.
  • the method for restoring a session may include:
  • S201 The server receives the session credentials sent by the client.
  • the server may parse the session credential according to a predetermined parsing rule.
  • the predetermined resolution rule may correspond to a generation rule that generates a session credential.
  • the generating the session credential generation rule may include: performing the reversible first obfuscation algorithm processing on the session information and the first check information, and obtaining the first obfuscated algorithm result as the session credential.
  • the parsing rule for parsing the session credential may include: performing a first inverse obfuscation algorithm on the session credential, where the first inverse scrambling algorithm may be an inverse operation of the first obfuscating algorithm, The result obtained may include session information and first verification information.
  • the generating rule for generating the session credential may further include: symmetrically encrypting the result of the first obfuscating algorithm processing, and encrypting the first encrypted result, the first string, and the first The timestamp corresponding to a string is calculated by a reversible second obfuscation algorithm, and the obtained second obfuscated algorithm result is used as a session credential.
  • the first word The string can be calculated based on the session information.
  • S203 The server adopts a predetermined verification algorithm on the session information, and generates second verification information corresponding to the session information.
  • the second string corresponding to the session information may be randomly generated.
  • the verification algorithm for calculating the second verification information may include: a parity check algorithm or a Cyclic Redundancy Check (CRC) algorithm.
  • the verification algorithm for calculating the first verification information may also adopt other verification algorithms known to those skilled in the art, which is not limited in this application.
  • the server may verify whether the second check information is the same as the first check information. If the second check information is the same as the first check information, it may indicate that the session information included in the session credential is valid.
  • the session information can be utilized to recover a session between the client and the server.
  • the method for generating a session credential may include:
  • S301 Receive information of a client login server, and generate session information.
  • the session information may be used to identify a session between the client and the server in the first communication connection.
  • S302 Generate first verification information corresponding to the session information by using a first generation rule.
  • the server may generate first verification information based on the session information.
  • the first verification information may have a one-to-one correspondence with the session information.
  • the first verification information may also be used to identify a session between the client and the server in the first communication connection.
  • the generating, by using the first generation rule, the first verification information corresponding to the session information may include: the server generating a character string corresponding to the session information; and the server calculating a digest value of the session information And obtaining, according to the digest value and the character string, the first verification information by using a verification algorithm. among them,
  • the character string corresponding to the session information may be randomly generated.
  • the check algorithm for calculating the first check information may include a parity check algorithm or a Cyclic Redundancy Check (CRC algorithm).
  • the verification algorithm for calculating the first verification information may also adopt other verification algorithms known to those skilled in the art, which is not limited in this application.
  • S303 Generate a session credential by using the second generation rule based on the session information and the first verification information.
  • the server may generate the session credential by using the second generation rule based on the session information and the first verification information.
  • the session information and the first check information may be processed by a reversible first confusion algorithm, and the obtained first confusion algorithm result is used as a session certificate.
  • the confusing algorithm may adopt any one of the confusing algorithms in the field of data processing, which is not limited in this application.
  • the second generation rule may further include: encrypting the result of the first obfuscating algorithm processing, and encrypting the encrypted first encryption result, the character string, and a timestamp corresponding to the character string
  • the calculation is performed by the reversible second obfuscation algorithm, and the obtained processing result of the second obfuscation algorithm is used as the session credential.
  • the second obfuscation algorithm may be the same as the first obfuscation algorithm, or may be different from the first obfuscation algorithm.
  • the first verification information corresponding to the session information is generated in the first communication connection, and the session credential is generated by using the session information and the first verification information.
  • the verification information in the session credential can be used to identify the session in the first communication connection.
  • the client may send the session credential received in the first communication connection to the server, and the server uses the same session information in the received session credential.
  • the method of generating the second verification information by comparing the first verification information with the second verification information, determining whether the session information sent by the client in the second communication connection is the same as the session information in the first communication connection, if In the same way, the call can be resumed for the client.
  • the method for restoring a session only needs to calculate and compare the check code to verify whether the session information is valid, and can quickly restore the session for the user.
  • the method for restoring a session disclosed in the embodiment of the present application does not need to configure a storage space to store user information, and the storage resource of the server can be saved. Further, determining the length of the time stamp of the session credential can further ensure the reliability of the session credential. Further, the reliability of the session credential can also be ensured by using an encryption method in the process of generating the session credential.
  • the server may include: a first session information unit 410, a first check information unit 420, a first session credential unit 430, a credential sending unit 440, a credential receiving unit 450, a credential parsing unit 460, and a The second check information unit 470 and the verification recovery unit 480. among them,
  • the first session information unit 410 may be configured to receive information of a client login server in the first communication connection, and generate first session information.
  • the first verification information unit 420 may be configured to generate first verification information corresponding to the first session information in the first session information unit 410 by using the first generation rule.
  • the first session credential unit 430 may be configured to utilize the second generation rule based on the first session information in the first session information unit 410 and the first verification information in the first verification information unit 420. Generate the first session credentials.
  • the credential sending unit 440 may be configured to send the first session credential generated by the first session credential unit 430 to the client in the first communication connection.
  • the credential receiving unit 450 may be configured to receive the second session credential sent by the client in the second communication connection.
  • the credential parsing unit 460 may be configured to parse the session credential according to a second parsing rule corresponding to the second generating rule in the first session credential unit 430, to obtain second check information and second session information. .
  • the second verification information unit 470 may be configured to generate third verification information corresponding to the second session information by using the first generation rule in the first verification information unit 420.
  • the verification and recovery unit 480 may be configured to verify whether the third verification information obtained by the second verification information unit 470 is the same as the second verification information obtained by the credential analysis unit 460, and if the same, the second session The information is valid, and the second session information is used to resume the session.
  • the server may further comprise: a time verification unit.
  • the time verification unit may be configured to verify whether the timestamp length of the second session credential received by the credential receiving unit is less than a preset time length, and if the timestamp length is less than a preset time length, the second session credential is valid.
  • the second session credential is parsed by the credential parsing unit.
  • the server may include: a receiving unit 510, a parsing unit 520, a check information unit 530, and a check information verifying unit 540. among them,
  • the receiving unit 510 can be configured to receive a session credential sent by the client.
  • the parsing unit 520 may be configured to parse the session credential received by the receiving unit 510 according to a predetermined parsing rule to obtain first verification information and session information.
  • the verification information unit 530 can be configured to generate second verification information corresponding to the session information in the parsing unit 520 by using a predetermined verification algorithm.
  • the verification information verification unit 540 may be configured to verify whether the second verification information is the same as the first verification information. If the same, the session information is valid, and the session information is used to restore the session.
  • the server may further include: a time unit.
  • the time unit may be configured to verify whether the timestamp length of the session credential received by the receiving unit is less than a preset time length, and if the timestamp length is less than a preset time length, the session credential is valid, and the parsing is utilized. The unit parses the session credentials.
  • the apparatus may include a session information generating unit 610, a check information generating unit 620, and a session credential generating unit 630. among them,
  • the session information generating unit 610 can be configured to receive information of the client login server and generate session information.
  • the verification information generating unit 620 may be configured to generate first verification information corresponding to the session information in the session information generating unit 610 by using the first generation rule.
  • the session credential generating unit 630 can be configured to generate a session credential by using the second generation rule based on the session information in the session information generating unit 610 and the first check information in the check information generating unit 620.
  • the server for restoring the session and the device for generating the session voucher disclosed in the foregoing embodiments, corresponding to the method embodiment of the present application, can achieve the technical effects of the method embodiment of the present application.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller can be implemented in any suitable manner, for example, the controller can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor.
  • computer readable program code eg, software or firmware
  • examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, The Microchip PIC18F26K20 and the Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller can be logically programmed by means of logic gates, switches, ASICs, programmable logic controllers, and embedding.
  • Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component.
  • a device for implementing various functions can be considered as a software module that can be both a method of implementation and a structure within a hardware component.
  • the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
  • the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, portions of the technical solution of the present application that contribute substantially or to the prior art may be embodied in the form of a software product.
  • the computing device includes one or more processors (CPU ), input / output interface, network interface and memory.
  • the computer software product can include instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments.
  • the computer software product can be stored in a memory, which may include non-persistent memory, random access memory (RAM), and/or nonvolatile memory in a computer readable medium, such as read only memory (ROM) or Flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read only memory
  • EEPROM electrically erasable programmable read only memory
  • flash memory or other memory technology
  • compact disk read only memory CD-ROM
  • DVD digital versatile disk
  • Magnetic tape cartridges magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include transitory computer readable media, such as modulated data signals and carrier waves.
  • This application can be used in a variety of general purpose or special purpose computer system environments or configurations.
  • the application can be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the present application can also be practiced in a distributed computing environment where A remote processing device that is connected to the communication network to perform tasks.
  • program modules can be located in both local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请实施例公开了一种恢复会话的方法和服务器、生成会话凭证的方法和装置,所述恢复会话的方法包括:服务器接收客户端发来的会话凭证;所述服务器根据预定的解析规则对所述会话凭证进行解析,得到第一校验信息与会话信息;所述服务器对所述会话信息采用预定的校验算法,生成与所述会话信息对应的第二校验信息;所述服务器验证第二校验信息与第一校验信息是否相同,若相同,所述会话信息有效,利用所述会话信息恢复会话。本申请实施例提供的一种恢复会话的方法和服务器、生成会话凭证的方法和装置,可以提高恢复用户会话的速度。

Description

恢复会话的方法和服务器、生成会话凭证的方法和装置 技术领域
本申请涉及网络通信技术领域,特别涉及一种恢复会话的方法和服务器、生成会话凭证的方法和装置。
背景技术
随着移动设备的普及,移动应用的用户群体在不断扩大。移动设备可以在不同的网络环境中频繁的切换。移动设备在切换网络的过程中,移动设备与提供所述移动应用服务的服务器之间的会话会发生中断。恢复会话信息的技术可以使得用户的移动设备在重新接入网络时,自动恢复所述移动设备与服务器之间的会话,不需要用户重新登录进行身份验证。
现有的恢复会话的方法可以包括:用户登录所述应用的服务器时,所述应用的服务器生成会话信息并将所述会话信息发送至客户端;所述应用的服务器可以采用服务集群的方式,所述服务集群中可以设置有用于存储所述用户会话信息的存储服务器;当用户网络中断以后再次接入网络时,所述客户端可以发送所述会话信息至所述应用对应的服务器;所述服务集群查找所述存储服务器中的会话信息,将查找到的会话信息与用户发来的会话信息进行比对,比对的结果为相同,表示用户发来的会话信息有效,可以根据用户发来的会话信息恢复中断前的用户会话。
在实现本申请过程中,发明人发现现有技术中至少存在如下问题:现有的恢复会话的方法需要配置存储服务器用于存储用户的会话信息,中断后,用户设备再次接入网络时,需要在存储服务器中查找用户的会话信息,再与用户发来的会话信息进行比较,服务器之间的信息调用和会话信息的查找会花费一定的时间,可能会导致用户的会话恢复过程速度较慢,影响用户体验。
发明内容
本申请实施例的目的是提供一种恢复会话的方法和服务器、生成会话凭证的方法和装置,以提高恢复用户会话的速度。
为解决上述技术问题,本申请实施例提供一种恢复会话的方法和服务器、生成会话凭证的方法和装置是这样实现的:
一种恢复会话的方法,包括:
在第一通信连接中,服务器接收客户端登录服务器的信息,生成第一会话信息;
所述服务器利用第一生成规则生成与第一会话信息对应的第一校验信息;
所述服务器基于第一会话信息与第一校验信息,利用第二生成规则生成第一会话凭证;
所述服务器在第一通信连接中发送第一会话凭证至客户端;
所述服务器在第二通信连接中接收所述客户端发来的第二会话凭证;
所述服务器根据与第二生成规则对应的第二解析规则对所述会话凭证进行解析,得到第二校验信息与第二会话信息;
所述服务器利用第一生成规则生成与第二会话信息对应的第三校验信息;
验证第二校验信息与第三校验信息是否相同,若相同,第二会话信息有效,利用第二会话信息恢复会话。
优选方案中,所述方法在接收客户端发来的第二会话凭证的步骤后还包括:验证第二会话凭证的时间戳长度,若所述时间戳长度小于预设时间长度,第二会话凭证有效,进入下一步骤进行解析。
一种恢复会话的方法,包括:
服务器接收客户端发来的会话凭证;
所述服务器根据预定的解析规则对所述会话凭证进行解析,得到第一校验信息与会话信息;
所述服务器对所述会话信息采用预定的校验算法,生成与所述会话信息对应的第二校验信息;
所述服务器验证第二校验信息与第一校验信息是否相同,若相同,所述会话信息有效,利用所述会话信息恢复会话。
一种会话凭证的生成方法,包括:
接收客户端登录服务器的信息,生成会话信息;
利用第一生成规则生成与所述会话信息对应的第一校验信息;
基于所述会话信息与第一校验信息,利用第二生成规则生成会话凭证。
一种恢复会话的服务器,包括:第一会话信息单元、第一校验信息单元、第一会话凭证单元、凭证发送单元、凭证接收单元、凭证解析单元、第二校验信息单元和验证恢复单元;其中,
所述第一会话信息单元,用于在第一通信连接中,接收客户端登录服务器的信息,生成第一会话信息;
所述第一校验信息单元,用于利用第一生成规则生成与所述第一会话信息单元中的第一 会话信息对应的第一校验信息;
所述第一会话凭证单元,用于基于所述第一会话信息单元中的第一会话信息与所述第一校验信息单元中的第一校验信息,利用第二生成规则生成第一会话凭证;
所述凭证发送单元,用于在第一通信连接中发送所述第一会话凭证单元生成的第一会话凭证至客户端;
所述凭证接收单元,用于第二通信连接中接收所述客户端发来的第二会话凭证;
所述凭证解析单元,用于根据与所述第一会话凭证单元中第二生成规则对应的第二解析规则对所述会话凭证进行解析,得到第二校验信息与第二会话信息;
所述第二校验信息单元,用于利用所述第一校验信息单元中的第一生成规则生成与第二会话信息对应的第三校验信息;
所述验证恢复单元,用于验证所述第二校验信息单元得到的第三校验信息与所述凭证解析单元得到的第二校验信息是否相同,若相同,第二会话信息有效,利用第二会话信息恢复会话。
优选方案中,所述服务器还包括:时间验证单元;所述时间验证单元,用于验证所述凭证接收单元接收到的第二会话凭证的时间戳长度,若所述时间戳长度小于预设时间长度,第二会话凭证有效,利用所述凭证解析单元对第二会话凭证进行解析。
一种恢复会话的服务器,包括:接收单元、解析单元、校验信息单元和校验信息验证单元;其中,
所述接收单元,用于接收客户端发来的会话凭证;
所述解析单元,用于根据预定的解析规则对所述接收单元接收的会话凭证进行解析,得到第一校验信息与会话信息;
所述校验信息单元,用于采用预定的校验算法生成与所述解析单元中的会话信息对应的第二校验信息;
所述校验信息验证单元,用于验证第二校验信息与第一校验信息是否相同,若相同,所述会话信息有效,利用所述会话信息恢复会话。
一种生成会话凭证的装置,包括:会话信息生成单元、校验信息生成单元和会话凭证生成单元;其中,
所述会话信息生成单元,用于接收客户端登录服务器的信息,生成会话信息;
所述校验信息生成单元,用于利用第一生成规则生成与所述会话信息生成单元中的会话信息对应的第一校验信息;
所述会话凭证生成单元,用于基于所述会话信息生成单元中的会话信息与所述校验信息 生成单元中的第一校验信息,利用第二生成规则生成会话凭证。
由以上本申请实施例提供的技术方案可见,本申请实施例提供的恢复会话的方法和服务器、生成会话凭证的方法和装置,在第一通信连接中生成了与会话信息对应的第一校验信息,通过所述会话信息与第一校验信息生成会话凭证并发送给客户端,所述会话凭证中的第一校验信息可以用于标识第一通信连接中的会话。当第一通信连接断开,建立第二通信连接后,所述客户端可以将第一通信连接中接收到的会话凭证发送给服务器,所述服务器将接收到的会话凭证中的会话信息采用相同的方法生成第二校验信息,通过比较第一校验信息与第二校验信息,可以确定第二通信连接中客户端发来的会话信息是否与第一通信连接中的会话信息相同,若相同,可以为所述客户端恢复通话。所述的恢复会话的方法只需要通过计算并比对校验码的方式即可验证会话信息是否有效,可以快速为用户恢复会话。同时本申请实施例公开的恢复会话的方法不需要配置存储空间来存储用户信息,可以节省服务器的存储资源。进一步地,对所述会话凭证的时间戳长度进行判定,可以进一步保证会话凭证的可靠性。进一步地,在生成会话凭证的过程中采用加密的方法也可以保证所述会话凭证的可靠性。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请恢复会话的方法一个实施例的流程图;
图2是本申请第二通信连接中恢复会话的方法一个实施例的流程图;
图3是本申请第一通信连接中生成会话凭证的方法一个实施例的流程图;
图4是本申请恢复会话的服务器的一个实施例的模块图;
图5是本申请第二通信连接中恢复会话的服务器的一个实施例的模块图;
图6是本申请第一通信连接中生成会话凭证的装置的一个实施例的模块图。
具体实施方式
本申请实施例提供一种恢复会话的方法和服务器、生成会话凭证的方法和装置。
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人 员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
图1是本申请恢复会话的方法一个实施例的流程图。如图1所示,所述恢复会话的方法可以包括:
S101:在第一通信连接中,服务器接收客户端登录服务器的信息,生成第一会话信息。
在第一通信连接中,服务器可以接收客户端登陆服务器的信息,生成第一会话信息。
所述第一会话信息可以包括:客户端的设备号、客户端登陆地点和客户端版本信息等。
所述第一会话信息可以用于标识第一通信连接中所述客户端与所述服务器之间的会话。
S102:所述服务器利用第一生成规则生成与第一会话信息对应的第一校验信息。
所述服务器基于第一会话信息,可以生成第一校验信息。所述第一校验信息可以与所述第一会话信息具有一一对应的关系。所述第一校验信息也可以用于标识第一通信连接中所述客户端与所述服务器之间的会话。
所述第一校验信息可以利用第一生成规则生成,所述第一生成规则可以是预设的第一生成规则。
所述利用第一生成规则生成与第一会话信息对应的第一校验信息,具体可以包括:所述服务器生成与所述第一会话信息对应的第一字符串;所述服务器计算第一会话信息的摘要值;根据所述摘要值和第一字符串,利用校验算法得到第一校验信息。所述与第一会话信息对应的第一字符串可以是随机生成的。
所述计算第一校验信息的校验算法可以包括:奇偶校验算法或循环冗余校验算法(Cyclic Redundancy Check,简称CRC算法)。所述计算第一校验信息的校验算法还可以采用本领域人员所了解的其他校验算法,本申请对此并不作出限定。
S103:所述服务器基于第一会话信息与第一校验信息,利用第二生成规则生成第一会话凭证。
所述服务器基于第一会话信息与第一校验信息,可以利用第二生成规则生成第一会话凭证。
具体地,可以将第一会话信息与第一校验信息进行可逆的第一混淆算法处理,得到的第一混淆算法结果作为第一会话凭证。
所述混淆算法可以采用数据处理领域中的任意一种混淆算法,本申请对此并不作出限定。
在另一个实施例中,利用第二生成规则生成第一会话凭证还可以包括:对所述第一混淆算法处理的结果进行加密得到第一加密结果,将第一加密结果、第一字符串和所述第一字符串的时间戳利用可逆的第二混淆算法进行计算,得到的第二混淆算法的处理结果作为第一会 话凭证。所述第二混淆算法可以与第一混淆算法相同,也可以与第一混淆算法不相同。
所述对第一混淆算法处理的结果进行的加密可以是对称加密过程,具体地,可以包括:计算第一字符串的第一散列值;根据第一散列值和所述第一字符串的时间戳确定加密密钥,利用所述加密密钥对所述第一混淆算法处理的结果进行对称加密。
所述根据第一散列值和所述第一字符串的时间戳确定加密密钥,可以包括:根据第一散列值和所述第一字符串的时间戳计算加密密钥;或者根据第一散列值、第一字符串的时间戳与加密密钥之间预设的对应关系确定加密密钥。
所述计算第一字符串的第一散列值可以采用安全哈希算法(SHA-1)或消息摘要算法第五版(Message Digest Algorithm,简称为MD5)等,本申请对此并不作出限定。
S104:所述服务器在第一通信连接中发送第一会话凭证至客户端。
在第一通信连接中,所述服务器可以发送所述第一会话凭证至客户端。所述第一会话凭证可以作为第一通信连接中当前会话的唯一标识。
S105:所述服务器在第二通信连接中接收所述客户端发来的第二会话凭证。
所述客户端断开网络时,所述客户端与所述服务器的第一通信连接断开;所述客户端重新接入网络时,所述客户端与所述服务器建立第二通信连接。
在第二通信连接中,所述服务器可以接收所述客户端发来的第二会话凭证。所述第二会话凭证可以是客户端中第一通信连接中接收到的服务器发来的第一会话凭证。
S106:所述服务器根据与第二生成规则对应的第二解析规则对第二会话凭证进行解析,得到第二校验信息与第二会话信息。
所述服务器可以利用第二解析规则对所述客户端第二会话凭证进行解析。所述第二解析规则可以与第二生成规则相对应。所述第二解析规则可以是第二生成规则的逆运算。
具体地,可以包括:对所述第二会话凭证进行第一逆混淆算法处理,所述第一逆混淆算法可以是所述第一混淆算法的逆运算,得到的结果可以包括第二会话信息和第二校验信息。
在另一个实施例中,若对所述第一混淆算法处理的结果进行对称加密,将加密后的第一加密结果、第一字符串和所述第一字符串的时间戳通过可逆的第二混淆算法进行计算,得到的第二混淆算法结果作为第一会话凭证。相应地,所述对第二会话凭证进行解析还包括:在对第二会话凭证进行第一逆混淆算法处理之前,还可以对第二会话凭证进行第二逆混淆算法处理,得到第二加密结果、第二字符串和第二字符串对应的时间戳;计算第二字符串的第二散列值;根据第二散列值和第二字符串对应的时间戳确定加密密钥;利用所述加密密钥对所述第二加密结果进行解密,再对解密后的结果采用第一逆混淆算法进行处理得到第二校验信息和第二会话信息。所述第二逆混淆算法可以与所述第二混淆算法相对应,第二逆混淆算法 可以是第二混淆算法的逆运算。所述确定加密密钥的方法与得到第一加密结果步骤中确定加密密钥的方法可以相同。
S107:所述服务器利用第一生成规则生成与第二会话信息对应的第三校验信息。
所述服务器基于第二会话信息,利用第一生成规则生成与第二会话信息对应的第三校验信息。具体可以包括:所述服务器计算第二会话信息的摘要值;根据第二会话信息的摘要值和第二字符串,利用所述校验算法得到第三校验信息。
S108:验证第二校验信息与第三校验信息是否相同,若相同,第二会话信息有效,利用第二会话信息恢复会话。
可以验证第二校验信息与第三校验信息是否相同,若第二校验信息与第三校验信息相同,可以表示第二通信连接中的第二会话凭证所包含的第二会话信息为有效信息。可以利用第二会话信息恢复所述客户端与所述服务器之间的会话。
在另一个实施例中,所述方法在S105与S106之间还可以包括:验证第二会话凭证的时间戳长度,若所述第二会话凭证的时间戳长度小于预设时间长度,第二会话凭证有效,进入下一步骤进行解析。所述第二会话凭证的时间戳长度可以等于生成第二会话凭证的时间与服务器接收第二会话凭证的时间之间的时间差。
图2是本申请第二通信连接中恢复会话的方法一个实施例的流程图。如图2所示,所述恢复会话的方法可以包括:
S201:服务器接收客户端发来的会话凭证。
服务器可以接收客户端发来的会话凭证。所述会话凭证可以是第一通信连接中由所述服务器发送给所述客户端的。
S202:所述服务器根据预定的解析规则对所述会话凭证进行解析,得到第一校验信息与会话信息。
所述服务器可以根据预定的解析规则对所述会话凭证进行解析。所述预定的解析规则可以与生成会话凭证的生成规则相对应。例如,所述生成会话凭证的生成规则可以包括:将会话信息与第一校验信息进行可逆的第一混淆算法处理,得到的第一混淆算法结果作为会话凭证。相应地,用于对所述会话凭证进行解析的解析规则可以包括:对所述会话凭证进行第一逆混淆算法处理,所述第一逆混淆算法可以是所述第一混淆算法的逆运算,得到的结果可以包括会话信息和第一校验信息。
在另一实施例中,所述用于生成会话凭证的生成规则还可以包括:对所述第一混淆算法处理的结果进行对称加密,将加密后的第一加密结果、第一字符串和第一字符串对应的时间戳通过可逆的第二混淆算法进行计算,得到的第二混淆算法结果作为会话凭证。所述第一字 符串可以根据会话信息计算得到。相应地,所述用于对会话凭证进行解析的解析规则还包括:在对所述会话凭证进行第一逆混淆算法处理之前,还可以对所述会话凭证进行第二逆混淆算法处理,得到第二加密结果、第一字符串和第一字符串对应的时间戳;计算第一字符串的第一散列值;根据第一散列值和第一字符串对应的时间戳确定加密密钥;利用所述加密密钥对所述第二加密结果进行解密,再对解密后的结果采用第一逆混淆算法进行处理得到第一校验信息和会话信息。所述第二逆混淆算法可以与所述第二混淆算法相对应,第二逆混淆算法可以是第二混淆算法的逆运算。
S203:所述服务器对所述会话信息采用预定的校验算法,生成与所述会话信息对应的第二校验信息。
所述服务器对所述会话信息采用预定的校验算法,生成与所述会话信息对应的第二校验信息。所述预定的校验算法可以采用生成第一校验信息的第一生成规则。所述预定的校验算法可以包括:所述服务器生成与所述会话信息对应的第二字符串;所述服务器计算所述会话信息的摘要值;根据所述摘要值和第二字符串,利用校验算法得到第二校验信息。其中,
所述与会话信息对应的第二字符串可以是随机生成的。
所述计算第二校验信息的校验算法可以包括:奇偶校验算法或循环冗余校验算法(Cyclic Redundancy Check,简称CRC算法)。所述计算第一校验信息的校验算法还可以采用本领域人员所了解的其他校验算法,本申请对此并不作出限定。
S204:所述服务器验证第二校验信息与第一校验信息是否相同,若相同,所述会话信息有效,利用所述会话信息恢复会话。
所述服务器可以验证第二校验信息与第一校验信息是否相同,若第二校验信息与第一校验信息相同,可以表示所述会话凭证所包含的会话信息有效。可以利用所述会话信息恢复所述客户端与所述服务器之间的会话。
在另一个实施例中,所述方法在S201与S202之间还可以包括:验证所述会话凭证的时间戳长度,若所述会话凭证的时间戳长度小于预设时间长度,所述会话凭证有效,进入下一步骤进行解析。所述会话凭证的时间戳长度可以等于所述会话凭证的生成时间与所述服务器接收所述会话凭证的时间之间的时间差。
图3是本申请第一通信连接中生成会话凭证的方法一个实施例的流程图。如图3所示,所述生成会话凭证的方法可以包括:
S301:接收客户端登录服务器的信息,生成会话信息。
在第一通信连接中,服务器可以接收客户端登陆服务器的信息,生成会话信息。
所述会话信息可以包括:客户端的设备号、客户端登陆地点、客户端版本信息等。
所述会话信息可以用于标识第一通信连接中所述客户端与所述服务器之间的会话。
S302:利用第一生成规则生成与所述会话信息对应的第一校验信息。
所述服务器基于所述会话信息,可以生成第一校验信息。所述第一校验信息可以与所述会话信息具有一一对应的关系。所述第一校验信息也可以用于标识第一通信连接中所述客户端与所述服务器之间的会话。
所述第一校验信息可以利用第一生成规则生成,所述第一生成规则可以是预设的第一生成规则。
所述利用第一生成规则生成与所述会话信息对应的第一校验信息,具体可以包括:所述服务器生成与所述会话信息对应的字符串;所述服务器计算所述会话信息的摘要值;根据所述摘要值和所述字符串,利用校验算法得到第一校验信息。其中,
所述与会话信息对应的字符串可以是随机生成的。
所述计算第一校验信息的校验算法可以包括:奇偶校验算法或循环冗余校验算法(Cyclic Redundancy Check,简称CRC算法)。所述计算第一校验信息的校验算法还可以采用本领域人员所了解的其他校验算法,本申请对此并不作出限定。
S303:基于所述会话信息与第一校验信息,利用第二生成规则生成会话凭证。
所述服务器基于会话信息与第一校验信息,可以利用第二生成规则生成会话凭证。
具体地,可以将所述会话信息与第一校验信息进行可逆的第一混淆算法处理,得到的第一混淆算法结果作为会话凭证。所述混淆算法可以采用数据处理领域中的任意一种混淆算法,本申请对此并不作出限定。
在另一个实施例中,第二生成规则还可以包括:对所述第一混淆算法处理的结果进行加密,将加密后的第一加密结果、所述字符串和所述字符串对应的时间戳利用可逆的第二混淆算法进行计算,得到的第二混淆算法的处理结果作为会话凭证。所述第二混淆算法可以与第一混淆算法相同,也可以与第一混淆算法不相同。
对所述第一混淆算法处理的结果进行加密可以采用对称加密的方法。所述对第一混淆算法处理的结果进行对称加密可以包括:计算所述字符串的散列值;根据所述散列值和所述生成时间确定加密密钥,利用所述加密密钥对所述第一混淆算法处理的结果进行对称加密。
所述根据散列值和所述生成时间确定加密密钥,可以包括:根据所述散列值和所述字符串对应的时间戳计算加密密钥;或者根据所述散列值、字符串对应的时间戳与加密密钥之间预设的对应关系确定加密密钥。所述计算字符串的散列值可以采用安全哈希算法(SHA-1)或消息摘要算法第五版(Message Digest Algorithm,简称为MD5)等,本申请对此并不作出限定。
上述实施例公开的恢复会话的方法、生成会话凭证的方法,在第一通信连接中生成了与会话信息对应的第一校验信息,通过所述会话信息与第一校验信息生成会话凭证并发送给客户端,所述会话凭证中的校验信息可以用于标识第一通信连接中的会话。当第一通信连接断开,建立第二通信连接后,所述客户端可以将第一通信连接中接收到的会话凭证发送给服务器,所述服务器将接收到的会话凭证中的会话信息采用相同的方法生成第二校验信息,通过比较第一校验信息与第二校验信息,可以确定第二通信连接中客户端发来的会话信息是否与第一通信连接中的会话信息相同,若相同,可以为所述客户端恢复通话。所述的恢复会话的方法只需要通过计算并比对校验码的方式即可验证会话信息是否有效,可以快速为用户恢复会话。同时本申请实施例公开的恢复会话的方法不需要配置存储空间来存储用户信息,可以节省服务器的存储资源。进一步地,对所述会话凭证的时间戳长度进行判定,可以进一步保证会话凭证的可靠性。进一步地,在生成会话凭证的过程中采用加密的方法也可以保证所述会话凭证的可靠性。
下面介绍本申请恢复会话的服务器的实施例。
图4是本申请恢复会话的服务器的一个实施例的模块图。如图4所示,所述服务器可以包括:第一会话信息单元410、第一校验信息单元420、第一会话凭证单元430、凭证发送单元440、凭证接收单元450、凭证解析单元460、第二校验信息单元470和验证恢复单元480。其中,
所述第一会话信息单元410,可以用于在第一通信连接中,接收客户端登录服务器的信息,生成第一会话信息。
所述第一校验信息单元420,可以用于利用第一生成规则生成与所述第一会话信息单元410中的第一会话信息对应的第一校验信息。
所述第一会话凭证单元430,可以用于基于所述第一会话信息单元410中的第一会话信息与所述第一校验信息单元420中的第一校验信息,利用第二生成规则生成第一会话凭证。
所述凭证发送单元440,可以用于在第一通信连接中发送所述第一会话凭证单元430生成的第一会话凭证至客户端。
所述凭证接收单元450,可以用于第二通信连接中接收所述客户端发来的第二会话凭证。
所述凭证解析单元460,可以用于根据与所述第一会话凭证单元430中第二生成规则对应的第二解析规则对所述会话凭证进行解析,得到第二校验信息与第二会话信息。
所述第二校验信息单元470,可以用于利用所述第一校验信息单元420中的第一生成规则生成与第二会话信息对应的第三校验信息。
所述验证恢复单元480,可以用于验证所述第二校验信息单元470得到的第三校验信息与所述凭证解析单元460得到的第二校验信息是否相同,若相同,第二会话信息有效,利用第二会话信息恢复会话。
在另一个实施例中所述服务器还可以包括:时间验证单元。所述时间验证单元可以用于验证所述凭证接收单元接收到的第二会话凭证的时间戳长度是否小于预设时间长度,若所述时间戳长度小于预设时间长度,第二会话凭证有效,利用所述凭证解析单元对第二会话凭证进行解析。
图5是本申请第二通信连接中恢复会话的服务器的一个实施例的模块图。如图5所示,所述服务器可以包括:接收单元510、解析单元520、校验信息单元530和校验信息验证单元540。其中,
所述接收单元510,可以用于接收客户端发来的会话凭证。
所述解析单元520,可以用于根据预定的解析规则对所述接收单元510接收的会话凭证进行解析,得到第一校验信息与会话信息。
所述校验信息单元530,可以用于采用预定的校验算法生成与所述解析单元520中的会话信息对应的第二校验信息。
所述校验信息验证单元540,可以用于验证第二校验信息与第一校验信息是否相同,若相同,所述会话信息有效,利用所述会话信息恢复会话。
在另一个实施例中,所述服务器还可以包括:时间单元。所述时间单元可以用于验证所述接收单元接收到的会话凭证的时间戳长度是否小于预设时间长度,若所述时间戳长度小于预设时间长度,所述会话凭证有效,利用所述解析单元对所述会话凭证进行解析。
图6是本申请第一通信连接中生成会话凭证的装置的一个实施例的模块图。如图6所示,所述装置可以包括:会话信息生成单元610、校验信息生成单元620和会话凭证生成单元630。其中,
所述会话信息生成单元610,可以用于接收客户端登录服务器的信息,生成会话信息。
所述校验信息生成单元620,可以用于利用第一生成规则生成与所述会话信息生成单元610中的会话信息对应的第一校验信息。
所述会话凭证生成单元630,可以用于基于所述会话信息生成单元610中的会话信息与所述校验信息生成单元620中的第一校验信息,利用第二生成规则生成会话凭证。
上述实施例公开的恢复会话的服务器以及生成会话凭证的装置,与本申请的方法实施例相对应,可以实现本申请方法实施例的技术效果。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字***“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片2。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog2。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的***、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。该计算机软件产品可以包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。该计算机软件产品可以存储在内存中,内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括短暂电脑可读媒体(transitory media),如调制的数据信号和载波。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于***实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本申请可用于众多通用或专用的计算机***环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器***、基于微处理器的***、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何***或设备的分布式计算环境等等。
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过 通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
虽然通过实施例描绘了本申请,本领域普通技术人员知道,本申请有许多变形和变化而不脱离本申请的精神,希望所附的权利要求包括这些变形和变化而不脱离本申请的精神。

Claims (20)

  1. 一种恢复会话的方法,其特征在于,包括:
    在第一通信连接中,服务器接收客户端登录服务器的信息,生成第一会话信息;
    所述服务器利用第一生成规则生成与第一会话信息对应的第一校验信息;
    所述服务器基于第一会话信息与第一校验信息,利用第二生成规则生成第一会话凭证;
    所述服务器在第一通信连接中发送第一会话凭证至客户端;
    所述服务器在第二通信连接中接收所述客户端发来的第二会话凭证;
    所述服务器根据与第二生成规则对应的第二解析规则对所述会话凭证进行解析,得到第二校验信息与第二会话信息;
    所述服务器利用第一生成规则生成与第二会话信息对应的第三校验信息;
    验证第二校验信息与第三校验信息是否相同,若相同,第二会话信息有效,利用第二会话信息恢复会话。
  2. 如权利要求1所述的一种恢复会话的方法,其特征在于,所述方法在接收客户端发来的第二会话凭证的步骤后还包括:验证第二会话凭证的时间戳长度是否小于预设时间长度,若所述时间戳长度小于预设时间长度,第二会话凭证有效,进入下一步骤进行解析。
  3. 一种恢复会话的方法,其特征在于,包括:
    服务器接收客户端发来的会话凭证;
    所述服务器根据预定的解析规则对所述会话凭证进行解析,得到第一校验信息与会话信息;
    所述服务器对所述会话信息采用预定的校验算法,生成与所述会话信息对应的第二校验信息;
    所述服务器验证第二校验信息与第一校验信息是否相同,若相同,所述会话信息有效,利用所述会话信息恢复会话。
  4. 如权利要求3所述的一种恢复会话的方法,其特征在于,所述预定的解析规则与生成所述会话凭证的生成规则相对应。
  5. 如权利要求4所述的一种恢复会话的方法,其特征在于,所述解析规则包括:对所述会话凭证进行第一逆混淆算法处理,得到会话信息和第一校验信息;所述第一逆混淆算法 是第一混淆算法的逆运算;所述第一混淆算法用于生成会话凭证。
  6. 如权利要求4所述的一种恢复会话的方法,其特征在于,所述解析规则包括:
    对所述会话凭证进行第二逆混淆算法处理,得到第二加密结果、第一字符串和第一字符串对应的时间戳;
    计算第一字符串的第一散列值;根据第一散列值和第一字符串对应的时间戳确定加密密钥;
    利用所述加密密钥对所述第二加密结果进行解密,对解密后的结果采用第一逆混淆算法进行处理得到第一校验信息和会话信息;
    所述第二逆混淆算法是第二混淆算法的逆运算;所述第一逆混淆算法是第一混淆算法的逆运算;所述第一混淆算法和第二混淆算法用于生成会话凭证。
  7. 如权利要求3所述的一种恢复会话的方法,其特征在于,所述生成第二校验信息包括:
    所述服务器生成与所述会话信息对应的第二字符串;
    所述服务器计算所述会话信息的摘要值;
    根据所述摘要值和第一字符串,利用校验算法得到第二校验信息。
  8. 如权利要求3所述的一种恢复会话的方法,其特征在于,所述方法在接收客户端发来的会话凭证的步骤后还包括:验证所述会话凭证的时间戳长度是否小于预设时间长度,若所述时间戳长度小于预设时间长度,所述会话凭证有效,进入下一步骤进行解析。
  9. 如权利要求8所述的一种恢复会话的方法,其特征在于,所述会话凭证的时间戳长度等于接收所述会话凭证的时间与生成所述会话凭证的时间之间的时间差。
  10. 如权利要求3-9中任意一项所述的一种恢复会话的方法,其特征在于,所述会话信息包括:客户端的设备号、客户端登陆地点和客户端版本信息。
  11. 一种会话凭证的生成方法,其特征在于,包括:
    接收客户端登录服务器的信息,生成会话信息;
    利用第一生成规则生成与所述会话信息对应的第一校验信息;
    基于所述会话信息与第一校验信息,利用第二生成规则生成会话凭证。
  12. 如权利要求11所述的一种会话凭证的生成方法,其特征在于,所述利用第一生成规则生成与所述会话信息对应的第一校验信息,包括:
    述服务器生成与所述第一会话信息对应的第一字符串;
    所述服务器计算第一会话信息的摘要值;
    根据所述摘要值和第一字符串,利用校验算法得到第一校验信息。
  13. 如权利要求12所述的一种会话凭证的生成方法,其特征在于,所述生成会话凭证包括:将所述会话信息与第一校验信息进行可逆的第一混淆算法处理,得到的第一混淆算法结果作为会话凭证。
  14. 如权利要求12所述的一种会话凭证的生成方法,其特征在于,所述生成会话凭证包括:
    将所述会话信息与第一校验信息进行可逆的第一混淆算法处理;
    对所述第一混淆算法处理的结果进行对称加密;
    将加密后的第一加密结果、第一字符串和第一字符串对应的时间戳利用可逆的第二混淆算法进行计算,得到的第二混淆算法的处理结果作为会话凭证。
  15. 如权利要求14所述的一种会话凭证的生成方法,其特征在于,所述第二混淆算法与第一混淆算法相同或者不相同。
  16. 一种恢复会话的服务器,其特征在于,包括:第一会话信息单元、第一校验信息单元、第一会话凭证单元、凭证发送单元、凭证接收单元、凭证解析单元、第二校验信息单元和验证恢复单元;其中,
    所述第一会话信息单元,用于在第一通信连接中,接收客户端登录服务器的信息,生成第一会话信息;
    所述第一校验信息单元,用于利用第一生成规则生成与所述第一会话信息单元中的第一会话信息对应的第一校验信息;
    所述第一会话凭证单元,用于基于所述第一会话信息单元中的第一会话信息与所述第一校验信息单元中的第一校验信息,利用第二生成规则生成第一会话凭证;
    所述凭证发送单元,用于在第一通信连接中发送所述第一会话凭证单元生成的第一会话凭证至客户端;
    所述凭证接收单元,用于第二通信连接中接收所述客户端发来的第二会话凭证;
    所述凭证解析单元,用于根据与所述第一会话凭证单元中第二生成规则对应的第二解析规则对所述会话凭证进行解析,得到第二校验信息与第二会话信息;
    所述第二校验信息单元,用于利用所述第一校验信息单元中的第一生成规则生成与第二会话信息对应的第三校验信息;
    所述验证恢复单元,用于验证所述第二校验信息单元得到的第三校验信息与所述凭证解析单元得到的第二校验信息是否相同,若相同,第二会话信息有效,利用第二会话信息恢复会话。
  17. 如权利要求16所述的一种恢复会话的服务器,其特征在于,所述服务器还包括:时间验证单元;所述时间验证单元,用于验证所述凭证接收单元接收到的第二会话凭证的时间戳长度,若所述时间戳长度小于预设时间长度,第二会话凭证有效,利用所述凭证解析单元对第二会话凭证进行解析。
  18. 一种恢复会话的服务器,其特征在于,包括:接收单元、解析单元、校验信息单元和校验信息验证单元;其中,
    所述接收单元,用于接收客户端发来的会话凭证;
    所述解析单元,用于根据预定的解析规则对所述接收单元接收的会话凭证进行解析,得到第一校验信息与会话信息;
    所述校验信息单元,用于采用预定的校验算法生成与所述解析单元中的会话信息对应的第二校验信息;
    所述校验信息验证单元,用于验证第二校验信息与第一校验信息是否相同,若相同,所述会话信息有效,利用所述会话信息恢复会话。
  19. 如权利要求18所述的一种恢复会话的服务器,其特征在于,还包括:时间单元;所述时间单元,用于验证所述接收单元接收到的会话凭证的时间戳长度是否小于预设时间长度,若所述时间戳长度小于预设时间长度,所述会话凭证有效,利用所述解析单元对所述会话凭证进行解析。
  20. 一种生成会话凭证的装置,其特征在于,包括:会话信息生成单元、校验信息生成单元和会话凭证生成单元;其中,
    所述会话信息生成单元,用于接收客户端登录服务器的信息,生成会话信息;
    所述校验信息生成单元,用于利用第一生成规则生成与所述会话信息生成单元中的会话信息对应的第一校验信息;
    所述会话凭证生成单元,用于基于所述会话信息生成单元中的会话信息与所述校验信息生成单元中的第一校验信息,利用第二生成规则生成会话凭证。
PCT/CN2015/098250 2014-12-29 2015-12-22 恢复会话的方法和服务器、生成会话凭证的方法和装置 WO2016107458A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410835823.6 2014-12-29
CN201410835823.6A CN105812313B (zh) 2014-12-29 2014-12-29 恢复会话的方法和服务器、生成会话凭证的方法和装置

Publications (1)

Publication Number Publication Date
WO2016107458A1 true WO2016107458A1 (zh) 2016-07-07

Family

ID=56284236

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/098250 WO2016107458A1 (zh) 2014-12-29 2015-12-22 恢复会话的方法和服务器、生成会话凭证的方法和装置

Country Status (2)

Country Link
CN (1) CN105812313B (zh)
WO (1) WO2016107458A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110188333A (zh) * 2019-04-26 2019-08-30 阿里巴巴集团控股有限公司 一种配置电子凭证模板、验证凭证的方法、***及设备
CN111092942A (zh) * 2019-12-13 2020-05-01 中移(杭州)信息技术有限公司 报文处理方法、装置、电子设备及存储介质
CN115484301A (zh) * 2022-08-04 2022-12-16 支付宝(杭州)信息技术有限公司 一种数据传输方法、装置、存储介质及电子设备

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109391656B (zh) * 2017-08-09 2021-10-08 中兴通讯股份有限公司 一种设备管理会话的恢复方法、装置、客户端及服务器
CN108809991A (zh) * 2018-06-15 2018-11-13 北京云枢网络科技有限公司 一种基于sdk动态水印的客户端合法性校验的方法
CN113259429B (zh) * 2021-05-11 2023-12-05 鸬鹚科技(深圳)有限公司 会话保持管控方法、装置、计算机设备及介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7206826B1 (en) * 2001-10-25 2007-04-17 Sprint Communications Company L.P. Configuration recovery after gateway failure
CN102811211A (zh) * 2011-05-30 2012-12-05 索尼公司 支持登录验证的设备和进行登录验证的方法
CN102833253A (zh) * 2012-08-29 2012-12-19 五八同城信息技术有限公司 建立客户端与服务器安全连接的方法及服务器

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030154398A1 (en) * 2002-02-08 2003-08-14 Eaton Eric Thomas System for providing continuity between session clients and method therefor
CN100527682C (zh) * 2003-11-12 2009-08-12 株式会社日立制作所 会话QoS控制装置
JP2008152471A (ja) * 2006-12-15 2008-07-03 Fujitsu Ltd サーバ、情報処理方法、サーバ用プログラム、およびサーバシステム
CN201682522U (zh) * 2010-02-08 2010-12-22 阿里巴巴集团控股有限公司 会话信息存储***及应用服务器

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7206826B1 (en) * 2001-10-25 2007-04-17 Sprint Communications Company L.P. Configuration recovery after gateway failure
CN102811211A (zh) * 2011-05-30 2012-12-05 索尼公司 支持登录验证的设备和进行登录验证的方法
CN102833253A (zh) * 2012-08-29 2012-12-19 五八同城信息技术有限公司 建立客户端与服务器安全连接的方法及服务器

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110188333A (zh) * 2019-04-26 2019-08-30 阿里巴巴集团控股有限公司 一种配置电子凭证模板、验证凭证的方法、***及设备
CN111092942A (zh) * 2019-12-13 2020-05-01 中移(杭州)信息技术有限公司 报文处理方法、装置、电子设备及存储介质
CN111092942B (zh) * 2019-12-13 2023-04-07 中移(杭州)信息技术有限公司 报文处理方法、装置、电子设备及存储介质
CN115484301A (zh) * 2022-08-04 2022-12-16 支付宝(杭州)信息技术有限公司 一种数据传输方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
CN105812313B (zh) 2019-12-27
CN105812313A (zh) 2016-07-27

Similar Documents

Publication Publication Date Title
KR102272117B1 (ko) 블록체인 기반 데이터 프로세싱 방법 및 디바이스
WO2016107458A1 (zh) 恢复会话的方法和服务器、生成会话凭证的方法和装置
EP3552132B1 (en) Login information processing method and device
US10419409B2 (en) Method and apparatus for secure network communications
CN110378139B (zh) 一种数据密钥保护方法、***及电子设备和存储介质
US9171145B2 (en) Protecting cryptographic secrets using file system attributes
US8997230B1 (en) Hierarchical data security measures for a mobile device
US10931651B2 (en) Key management
CN107689869B (zh) 用户口令管理的方法和服务器
TWI740399B (zh) 資料處理方法、裝置和電子設備
WO2016058487A1 (zh) 一种信息处理方法及装置
US9722795B2 (en) Digitally signing JSON messages
US10198600B2 (en) Transparent execution of secret content
JP2017534971A (ja) データ同期の方法及び装置
EP3206329A1 (en) Security check method, device, terminal and server
US20220006632A1 (en) Information verification method, apparatus, and device
CN113630412B (zh) 资源下载方法、资源下载装置、电子设备以及存储介质
WO2024027598A1 (zh) 一种数据传输方法、装置、存储介质及电子设备
WO2019184741A1 (zh) 应用程序信息的存储、处理方法及装置
US9245097B2 (en) Systems and methods for locking an application to device without storing device information on server
US20230409718A1 (en) Data processing methods, apparatuses, and devices
CN112953893B (zh) 基于隐私保护的身份验证方法、装置、设备及***

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15875136

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15875136

Country of ref document: EP

Kind code of ref document: A1