WO2020173126A1 - 基于区块链的会话数据处理方法、装置、设备及介质 - Google Patents

基于区块链的会话数据处理方法、装置、设备及介质 Download PDF

Info

Publication number
WO2020173126A1
WO2020173126A1 PCT/CN2019/116435 CN2019116435W WO2020173126A1 WO 2020173126 A1 WO2020173126 A1 WO 2020173126A1 CN 2019116435 W CN2019116435 W CN 2019116435W WO 2020173126 A1 WO2020173126 A1 WO 2020173126A1
Authority
WO
WIPO (PCT)
Prior art keywords
session
block
session data
characteristic value
generating
Prior art date
Application number
PCT/CN2019/116435
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 WO2020173126A1 publication Critical patent/WO2020173126A1/zh

Links

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/14Session management

Definitions

  • Block chain-based session data processing method device, equipment and medium
  • This application relates to the field of blockchain technology, and in particular to a method, device, device, and medium for processing session data based on the blockchain.
  • a session is called a "session" in a computer, especially in a network application.
  • Session is used to store the attributes and configuration information required by a specific user session.
  • the above attributes or configuration information are called session data.
  • session data In this way, when a user jumps between the web pages of the business server provided by the application server, the session data will It will not be lost, but will continue to exist in the entire user session.
  • a session resolution mechanism is proposed.
  • the session data generated by the session established by each application server is centrally stored on a session management server, namely It's not stored in this machine, but in another centralized storage place. In this way, no matter which application server it is, when the application server uses session data, it also stores the session data from this centralized
  • the data is read on the session management server.
  • the session management server has a failure such as downtime, it will cause the loss of session data of the application server and affect the use of session data in the application server cluster.
  • the embodiments of the present application provide a blockchain-based session data processing method, device, computer equipment, and storage medium.
  • each node server can share the above-mentioned session data and the non-modifiable data. , Reduce the impact of session data loss caused by node server downtime, and improve High session data validity to ensure the availability of session data.
  • a block chain-based session data processing method is applied to a node server of a session data processing system, the session data processing system includes an application server cluster, The node server is any one of the application server clusters, each node server of the application server cluster stores a blockchain, and the method includes:
  • the session request is the first session request, acquiring session data generated by the session corresponding to the session request;
  • a block chain-based session data processing device is applied to a node server of a session data processing system, the session data processing system includes an application server cluster, The node server is any one of the application server clusters, each node server of the application server cluster stores a blockchain, and the blockchain-based session data processing device includes:
  • the determining module is configured to determine whether the session request is the first session request when the session request sent by the user through the browser is received;
  • an obtaining module configured to obtain session data generated by the session corresponding to the session request if the determining module determines that the session request is the first session request;
  • the first generating module is configured to generate a first session identifier uniquely corresponding to the session
  • a second generating module configured to generate a block according to the session data obtained by the obtaining module and the first session identifier generated by the first generating module
  • the broadcast module is configured to broadcast the block generated by the second generation module to the blockchain.
  • a computer device including a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, and the processor implements the above-mentioned Block chain session data processing method.
  • One or more readable storage media storing computer readable instructions, wherein when the computer readable instructions are executed by one or more processors, the one or more processors execute Realize the above-mentioned block chain-based session data processing method.
  • FIG. 1 is a schematic diagram of a system architecture of the blockchain-based session data processing system in this application.
  • FIG. 2 is a schematic flowchart of an embodiment of a blockchain-based session data processing method in this application;
  • FIG. 3 is another embodiment of a blockchain-based session data processing method in this application Schematic diagram of the process;
  • FIG. 4 is a schematic flowchart of another embodiment of a block chain-based session data processing method in this application;
  • FIG. 5 is a block chain-based session data processing method in this application Schematic flowchart of another embodiment;
  • FIG. 6 is a schematic flowchart of another embodiment of a blockchain-based session data processing method in this application; [0033] FIG. 7 is another implementation of a blockchain-based session data processing method in this application Example flow diagram; [0034] FIG. 8 is a schematic structural diagram of an embodiment of a block chain-based session data processing device in this application; [0035] FIG. 9 is a schematic structural diagram of an embodiment of a computer device in this application.
  • the session data processing system is used for a system for sharing session data between a node server and a node server.
  • the data processing system includes multiple node servers, and the multiple node servers above refer to each application server in the application server cluster.
  • Each node server can work normally, and each node server can establish a session with the client, generate session data, and realize the sharing of the above-mentioned session data through the blockchain.
  • the above-mentioned application server specifically refers to a server that provides web services for users.
  • the block chain-based session data processing method provided by the embodiment of the present application can be applied to the node server in the system architecture shown in FIG. 1, where the client communicates with each node server through the network.
  • the foregoing client may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices that can establish sessions with various node servers.
  • Each of the above-mentioned node servers may be implemented by an independent server or a server cluster composed of multiple servers, which is not limited in the embodiment of the present application.
  • Each node server of the session data processing system based on the blockchain is provided with a corresponding node identifier.
  • each node server of the session data processing system stores the information of other node servers of the session data processing system. Node ID, so as to subsequently broadcast the generated block to other node servers of the session data processing system according to the node IDs of other node servers.
  • each node server can maintain a node identification list, and store the node identification and node name of each node server in the session data processing system in the node identification list.
  • the node identification list of each node server can be used.
  • the hardware address or network address or other identification information that can uniquely identify the node server is used as the node identification, which is not specifically limited in the embodiment of the present application.
  • each node server in the session data processing system stores the same block chain, where the block chain is composed of multiple blocks, and the founding block includes a block header and a block
  • the block header stores basic block information such as block header feature values and version numbers.
  • the block body stores session data.
  • the next block of the founding block uses the founding block as the parent block, and the next block Block header And the block body, and the block header of the next block stores the block header feature value of the current block, the block header feature value of the parent block, the version number and other basic block information, and so on, so that the block
  • the block data stored in each block in the chain is related to the block data stored in the parent block, ensuring that the session data in the block cannot be tampered with.
  • FIG. 2 is an implementation process of a blockchain-based session data processing method in this application.
  • the method is applied to a node server of a session data processing system based on a blockchain, the session data processing system includes an application server cluster, the node server is one of the application server clusters, and the application server cluster
  • the method includes the following steps:
  • S10 When a session request sent by the user through the browser is received, determine whether the session request is the first session request.
  • a session refers to a process in which a client communicates with an interactive system.
  • the above-mentioned interactive system refers to a system that provides business services for users.
  • it can be implemented by an application server as the above-mentioned interactive system and the client. End to interact.
  • the user entering the shopping system through the client's account password to exiting the shopping system can be considered as a session process.
  • a session is usually created through the three-way handshake of TCP, and the session is closed when TCP closes the connection.
  • the HTTP session mechanism is introduced in the web application, that is: Maintaining the association between the user and different requests issued by the same user between multiple HTTP connections is called maintaining a session, that is In other words, session is used to represent a session between the server and the browser.
  • This process is continuous or can be intermittent.
  • the node server when the JSP page does not explicitly prohibit the session, when the JSP is requested for the first time when the browser is opened on the client side, the node server will automatically create a session for it and give it a session identifier. Sent to the client's browser. Later, when the client requests other resources in this application, it will automatically add the above-mentioned session identifier to the request header. In this way, the month server will receive the session identifier when receiving the session request.
  • session data corresponding to the session request refers to the data generated during the session between the browser and the node server after the session request is received, and the session data is used to store attributes and configurations required by the user session information.
  • the above-mentioned session data is some data associated with the user in the session request.
  • the session data includes session data such as username and password, user information, etc., and specific examples are not given here.
  • S30 Generate a first session identifier uniquely corresponding to the session.
  • a unique session identifier corresponding to the session is generated.
  • the mechanism for generating the session identifier may be different. For example, it may be based on a random number + session request time + node server hardware information + generating the first session identifier.
  • other session identifiers that can generate a unique identifier for this session request may be used, which is not specifically limited in this embodiment of the application.
  • S40 Generate a block according to the session data and the first session identifier.
  • a block is generated according to the above-mentioned session data and the first session identifier.
  • step S40 that is, generating a block according to the session data and the first session identifier, specifically includes the following steps:
  • S41 Calculate the session data according to different preset feature value algorithms to obtain at least two feature values.
  • S42 Generate a target characteristic value according to the at least two characteristic values.
  • different preset feature value algorithms can be used to perform feature value calculation on the session data to obtain at least two session data feature values, and according to The aforementioned at least two session data feature values generate a target feature value, so that the target feature value is used as the feature value corresponding to the session data generation block. It can be understood that, based on the foregoing method, calculating the feature value of the session data through different preset feature value algorithms can effectively reduce the theft or modification of the session data in one step.
  • the aforementioned different preset feature value algorithms may refer to SHA2 56 algorithm, SHA512 algorithm, or other algorithms, such as ripemd256 algorithm, etc., which specific preset feature value algorithm is adopted, and the session data processing system is configured according to actual needs.
  • the specific embodiments of the present invention are not limited.
  • step S41 that is, the session data is calculated according to different preset feature value algorithms to obtain at least two feature values, specifically Include the following steps
  • S411 Calculate the session data according to the SHA256 algorithm to obtain the first characteristic value.
  • S412 Calculate the session data according to the SHA512 algorithm to obtain a second characteristic value.
  • step S42 that is, generating a target characteristic value according to the at least two characteristic values includes:
  • S42' Generate the target characteristic value according to the first characteristic value and the second characteristic value.
  • the first characteristic value may be generated based on the SHA256 algorithm and the session data
  • the second characteristic value may be generated based on the SHA512 and the session data
  • the target characteristic value may be generated based on the first and second characteristic values.
  • step S42 that is, generating the target characteristic value according to the first characteristic value and the second characteristic value specifically includes the following steps:
  • S42P Cross-sort the characters of the first characteristic value and the second characteristic value according to a preset sorting rule to obtain a sorting result.
  • the embodiment of the application can respectively determine the character positions of the first feature value and the second feature value in the cross sorting, and compare the first feature value and the second feature value according to the determined character position Each character is sorted to obtain the sorting result, and the sorting result is used as the target feature value.
  • the characters of the first characteristic value and the second characteristic value may be cross-sorted to obtain the above-mentioned target characteristic value. For example, assuming that the first feature value is abed... and the second feature value is ABCD..., then abed... and ABCD...
  • a threshold can be preset, and the preset threshold can be broadcast to each node server of the session data processing system. When the node detects that the size of the generated target feature value exceeds the preset threshold, it can compare the at least two feature values.
  • S43 Generate block header information according to the target feature value and block basic information, where the block basic information includes the target feature value of the parent block of the current block and the first session identifier.
  • S44 Generate the block according to the session data and the block header information, where the session data is used as the block body information of the block.
  • the block header information including the block basic information and the target feature value is generated according to the target feature value and the block basic information.
  • the block basic information further includes a timestamp, a block header feature value of the parent block of the current block (that is, a target feature value corresponding to the parent block), and the first session identifier.
  • the block body information of the block is session data
  • the block header information of the block includes the target feature value of the current block, the block header feature value of the parent block, and the first session identifier.
  • block header information of the above block also includes other block header information of the block, which is not listed here, such as the block version number.
  • the session data, the block header feature value of the parent block, and the target feature value of the current block are stored in the corresponding location to obtain a new block.
  • S50 Broadcast the block to the blockchain.
  • step S50 that is, broadcasting the block to the blockchain, specifically includes the following steps:
  • S51 Obtain the node identifier of each node server in the application server cluster.
  • each node server of the blockchain-based session data processing system has a corresponding node identifier.
  • each node server stores a blockchain-based The node identifiers of other node servers in the session data processing system, therefore, the node identifiers of each node server in the blockchain can be obtained.
  • the newly generated block is broadcast to other node servers in the blockchain-based session data processing system, so that other node servers Add the newly generated block to the stored blockchain to realize the sharing of blockchain data (that is, session data) in the basic session data processing system.
  • session data that is, session data
  • step S10 that is, determining whether the session request is the first session request, specifically includes the following steps:
  • S11 Determine whether the received session request carries a second session identifier
  • S12 If it is determined that the received session request carries the second session identifier, determine that the session request is a non-first session request, and if it is determined that the session request does not carry the second session identifier , It is determined that the session request is the first session request.
  • steps S11-S12 it can be understood that, as mentioned in the above description, when a user establishes a session with a node server for the first time through a client browser, the node server will generate a session identifier corresponding to the session and send it to the client The monogram identifier is fed back so that the client will carry the session identifier in the next request. Therefore, when the node server receives a session request sent by any client, the node server determines whether the received session request carries a second session identifier. Specifically, the node server parses the session request after receiving the session request.
  • Session request so as to determine whether the session request carries the second session identifier, if it is determined that the received session request carries the second session identifier, then the session request is determined to be a non-first session request, and if the session is determined If the request does not carry the second session identifier, it is determined that the session request is the first session request.
  • the embodiment of the present application provides a block chain-based session data processing method.
  • each node server can share the above-mentioned session data and the unmodifiable data, which reduces the risk of the node server
  • the impact of session data loss caused by downtime improves the validity of session data and protects Verify that session data is available.
  • a block chain-based session data processing device is provided, and the block chain-based session data processing device corresponds to the block chain-based session data processing method in the above-mentioned embodiment one-to-one.
  • the block chain-based session data processing device is applied to a node server of a session data processing system, the session data processing system includes an application server cluster, and the node server is in the application server cluster
  • Each node server of the application server cluster stores a block chain
  • the block chain-based session data processing device 10 includes: a determination module 101, an acquisition module 102, a first generation module 103, and a second The generating module 104 and the broadcasting module 105.
  • the determining module 101 is configured to determine whether the session request is the first session request when the session request sent by the user through the browser is received;
  • the obtaining module 102 is configured to, if the determining module determines that the session request is the first session request, obtain the session data generated by the session corresponding to the session request;
  • the first generating module 103 is configured to generate a first session identifier uniquely corresponding to the session
  • the second generating module 104 is configured to generate a block according to the session data obtained by the obtaining module and the first session identifier generated by the first generating module;
  • the broadcasting module 105 is configured to broadcast the block generated by the second generation module to the blockchain.
  • the second generating module 104 is specifically configured to:
  • block header information generating block header information according to the target feature value and block basic information, where the block basic information includes a timestamp, a block identifier, and the first session identifier;
  • the block is generated according to the session data and the block header information, wherein the session data is used as the block body information of the block.
  • the second generating module 104 is configured to calculate the session data according to different preset feature value algorithms to obtain at least two feature values, which specifically includes: [0095] The second generating module 104 is used to:
  • the second generating module 104 is configured to generate a target feature value according to the at least two feature values, and specifically includes: the second generating module 104 is configured to: according to the first feature value and the second feature value The target feature value is generated.
  • the second generating module 104 is configured to generate the target characteristic value according to the first characteristic value and the second characteristic value, which specifically includes:
  • the second generating module 104 is configured to: cross-sort the characters of the first characteristic value and the second characteristic value according to a preset sorting cross rule to obtain a cross sorting result; As the target characteristic value.
  • the determining module 101 is configured to determine whether the session request is the first session request, including:
  • the determining module 101 is specifically configured to: determine whether the received session request carries a second session identifier; if it is determined that the received session request carries the second session identifier, determine the session request It is a non-first session request, and if it is determined that the session request does not carry the second session identifier, then it is determined that the session request is the first session request.
  • the broadcasting module 105 for broadcasting the block to the blockchain includes:
  • the broadcast module 105 is configured to: obtain the node identifier of each node server in the application server cluster; and broadcast the block to the blockchain of the node server corresponding to the node identifier according to the node identifier.
  • the embodiment of the present application provides a block chain-based session data processing device.
  • each node server can share the above-mentioned session data and the unmodifiable data, thereby reducing the problem of the node server
  • the impact of session data loss caused by downtime improves the validity of session data and ensures the availability of session data.
  • Each module in the above-mentioned session data processing device may be implemented in whole or in part by software, hardware, or a combination thereof.
  • the above modules can be embedded in hardware form or independent of computer equipment
  • the processor in the device may also be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 9.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a readable storage medium and an internal memory.
  • the readable storage medium includes a nonvolatile readable storage medium and a volatile readable storage medium, and the readable storage medium stores an operating system, computer readable instructions, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer readable instructions in the readable storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer-readable instructions are executed by the processor to realize a blockchain-based session data processing method.
  • a computer device including a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, and the processor executes the following steps when the computer-readable instructions are executed :
  • the embodiment of the present application provides a computer device, which realizes that each node server can share the above-mentioned session data and the unmodifiable data by means of a blockchain, and reduces the session data caused by the downtime of the node server.
  • the impact of loss improves the validity of session data and ensures the availability of session data.
  • one or more readable storage media storing computer readable instructions are provided, and the readable storage media includes a non-volatile readable storage medium and a volatile readable storage medium,
  • the one or more processors execute the following steps: [0116] When receiving a session request sent by a user through a browser, determine whether the session request is the first session request;
  • the session request is the first session request, acquiring session data generated by the session corresponding to the session request;
  • the embodiment of the present application provides a computer-readable storage medium, which realizes that each node server can share the above-mentioned session data and the unmodifiable data by means of a blockchain, and reduces the downtime caused by the node server.
  • the impact of the loss of session data can improve the validity of the session data and ensure that the session data is available.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDR AM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

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

Abstract

本申请公开了一种基于区块链的会话数据处理方法、装置、计算机设备及存储介质,减少由于节点服务器宕机带来的会话数据丢失的影响,提高会话数据有效性,保证会话数据可用。方法部分包括:基于区块链的会话数据处理方法应用于会话数据处理系统的节点服务器中,节点服务器为应用服务器集群中的任意一个,应用服务器集群的每个节点服务器存储有区块链,方法包括:当接收到用户通过浏览器发送的会话请求时,确定会话请求是否为首次会话请求;若确定会话请求为首次会话请求,则获取会话请求对应的会话所生成的会话数据;生成与会话唯一对应的第一会话标识;根据会话数据以及第一会话标识生成区块;将区块广播至区块链。

Description

基于区块链的会话数据处理方法、 装置、 设备及 介质
[0001] 本申请以 2019年 2月 25日提交的申请号为 201910137178.3, 名称为“基于区块链 的会话数据处理方法、 装置、 设备及介质”的中国发明专利申请为基础, 并要求 其优先权。
技术领域
[0002] 本申请涉及区块链技术领域, 尤其涉及一种基于区块链的会话数据处理方法、 装置、 设备及介质。
[0003]
[0004] 背景技术
[0005] session, 在计算机中, 尤其是在网络应用中, 被称为“会话”。 session用于存储 特定用户会话所需的属性及配置信息, 上述属性或配置信息被称为 session数据, 这样, 当用户在应用服务器所提供的业务服务器的 web页之间跳转时, session 数据将不会丢失, 而使得整个用户会话中一直存在下去。 传统的方案中, 提出 了一种 session解决机制中, 在面对应用服务器集群时, 每一台应用服务器所建立 的会话所产生的 session数据, 都是集中保存在一台 session管理服务器上, 即不是 保存在本机了, 而是放在了另一个集中存储的地方。 这样, 不论是哪台应用服 务器, 应用服务器使用 session数据时, 也是从这个集中存储 session
数据的 session管理服务器上读取。 然而, 但该 session管理服务器产生宕机等故障 时, 会导致应用服务器的 session数据丢失, 影响应用服务器集群的对于 session数 据的使用。
[0006]
[0007] 发明内容
[0008] 本申请实施例提供一种基于区块链的会话数据处理方法、 装置、 计算机设备及 存储介质, 通过区块链的方式, 实现各个节点服务器均能共享上述会话数据以 及数据不可修改性, 减少由于节点服务器宕机带来的会话数据丢失的影响, 提 高会话数据有效性, 保证会话数据可用。
[0009] 一种基于区块链的会话数据处理方法, 所述基于区块链的会话数据处理方法应 用于会话数据处理系统的节点服务器中, 所述会话数据处理系统包括应用服务 器集群, 所述节点服务器为所述应用服务器集群中的任意一个, 所述应用服务 器集群的每个节点服务器存储有区块链, 所述方法包括:
[0010] 当接收到用户通过浏览器发送的会话请求时, 确定所述会话请求是否为首次会 话请求;
[0011] 若确定所述会话请求为首次会话请求, 则获取所述会话请求对应的会话所生成 的会话数据;
[0012] 生成与所述会话唯一对应的第一会话标识;
[0013] 根据所述会话数据以及第一会话标识生成区块;
[0014] 将所述区块广播至所述区块链。
[0015] 一种基于区块链的会话数据处理装置, 所述基于区块链的会话数据处理装置应 用于会话数据处理系统的节点服务器中, 所述会话数据处理系统包括应用服务 器集群, 所述节点服务器为所述应用服务器集群中的任意一个, 所述应用服务 器集群的每个节点服务器存储有区块链, 所述基于区块链的会话数据处理装置 包括:
[0016] 确定模块, 用于当接收到用户通过浏览器发送的会话请求时, 确定所述会话请 求是否为首次会话请求;
[0017] 获取模块, 用于若所述确定模块确定所述会话请求为首次会话请求, 则获取所 述会话请求对应的会话所生成的会话数据;
[0018] 第一生成模块, 用于生成与所述会话唯一对应的第一会话标识;
[0019] 第二生成模块, 用于根据所述获取模块获取的所述会话数据以及所述第一生成 模块生成的第一会话标识生成区块;
[0020] 广播模块, 用于将所述第二生成模块生成的所述区块广播至所述区块链。
[0021] 一种计算机设备, 包括存储器、 处理器以及存储在所述存储器中并可在所述处 理器上运行的计算机可读指令, 所述处理器执行所述计算机可读指令时实现上 述基于区块链的会话数据处理方法。 [0022] 一个或多个存储有计算机可读指令的可读存储介质, 其特征在于, 所述计算机 可读指令被一个或多个处理器执行时, 使得所述一个或多个处理器执行时实现 上述基于区块链的会话数据处理方法。
[0023] 本申请的一个或多个实施例的细节在下面的附图和描述中提出, 本申请的其他 特征和优点将从说明书、 附图以及权利要求变得明显。
[0024]
[0025] 附图说明
[0026] 为了更清楚地说明本申请实施例的技术方案, 下面将对本申请实施例的描述中 所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本申 请的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前 提下, 还可以根据这些附图获得其他的附图。
[0027] 图 1是本申请中基于区块链的会话数据处理系统的一系统架构示意图;
[0028] 图 2是本申请中一种基于区块链的会话数据处理方法一个实施例流程示意图; [0029] 图 3是本申请中一种基于区块链的会话数据处理方法另一实施例流程示意图; [0030] 图 4是本申请中一种基于区块链的会话数据处理方法另一实施例流程示意图; [0031] 图 5是本申请中一种基于区块链的会话数据处理方法另一实施例流程示意图;
[0032] 图 6是本申请中一种基于区块链的会话数据处理方法另一实施例流程示意图; [0033] 图 7是本申请中一种基于区块链的会话数据处理方法另一实施例流程示意图; [0034] 图 8是本申请中一种基于区块链的会话数据处理装置一实施例结构示意图; [0035] 图 9是本申请中计算机设备的一实施例结构示意图。
[0036]
[0037] 具体实施方式
[0038] 下面将结合本申请实施例中的附图, 对本申请实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本申请一部分实施例, 而不是全部的实 施例。 基于本申请中的实施例, 本领域普通技术人员在没有作出创造性劳动前 提下所获得的所有其他实施例, 都属于本申请保护的范围。
[0039] 在对本申请实施例进行描述之前, 先对本申请实施例涉及到的术语、 应用场景 进行简单的介绍: [0040] 请参阅图 1所示的基于区块链的会话数据处理系统的一系统架构示意图, 该会 话数据处理系统用于进行节点服务器与节点服务器之间的会话数据的共享的系 统, 该会话数据处理系统包括多个节点服务器, 上述多个节点服务器指的是应 用服务器集群中的各个应用服务器。 每个节点服务器均可以正常工作, 且每个 节点服务器都可以与客户端之间建立会话, 产生会话数据, 并通过区块链实现 上述会话数据之间的共享。 例如, 当会话数据处理系统的任意一个节点服务器 与客户端之间产生会话数据时, 会话数据处理系统的其他节点服务器将上述产 生的会话数据作为共享数据进行存储, 从而使得该会话数据处理系统的全部节 点存储的会话数据均一致。 另外需要说明的是, 上述应用服务器具体指的是为 用户提供 web服务的服务器。 本申请实施例提供的基于区块链的会话数据处理方 法中, 可应用在如图 1的所示的系统架构中的节点服务器中, 其中, 客户端通过 网络与各个节点服务器进行通信。 其中, 上述客户端可以但不限于各种个人计 算机、 笔记本电脑、 智能手机、 平板电脑和便携式可穿戴设备等可与各个节点 服务器建立会话的客户端, 另外需要说明的是, 在具体应用中, 上述各个节点 服务器, 可以用独立的服务器或者是多个服务器组成的服务器集群来实现, 本 申请实施例也不做限定。
[0041] 基于区块链的会话数据处理系统的每个节点服务器均设有对应的节点标识, 另 夕卜, 会话数据处理系统的每个节点服务器均存储有会话数据处理系统的其他节 点服务器的节点标识, 以便后续根据其他节点服务器的节点标识, 将生成的区 块广播至会话数据处理系统的其他节点服务器中。 示例性的, 每个节点服务器 可维护一张节点标识列表, 将会话数据处理系统中各个节点服务器的节点标识 和节点名称对应保存在该节点标识列表中, 示例性的, 可用每个节点服务器的 硬件地址或网络地址或其他可唯一标识节点服务器的标识信息作为上述节点标 识, 本申请实施例不做具体限定。
[0042] 需要说明的是, 该会话数据处理系统中的每个节点服务器均存储一条相同的区 块链, 其中, 区块链由多个区块组成, 创始区块中包括区块头和区块体, 区块 头中存储有区块头特征值、 版本号等区块基础信息, 区块主体中存储有会话数 据, 而创始区块的下一区块以创始区块作为父区块, 下一区块同样包括区块头 和区块主体, 而下一区块的区块头中存储有当前区块的区块头特征值、 父区块 的区块头特征值、 版本号等区块基础信息, 并以此类推, 使得区块链中的每个 区块中存储的区块数据均与父区块中存储的区块数据存在关联, 保证区块中会 话数据的不可篡改性。
[0043] 下面对本申请所提供的基于区块链的会话数据处理方法的各个实施例进行描述 , 请参阅图 2, 图 2为本申请中一种基于区块链的会话数据处理方法一个实施流 程示意图, 该方法应用在基于区块链的会话数据处理系统的节点服务器中, 所 述会话数据处理系统包括应用服务器集群, 所述节点服务器为所述应用服务器 集群中的一个, 所述应用服务器集群构成区块链, 包括如下步骤:
[0044] S10: 当接收到用户通过浏览器发送的会话请求时, 确定所述会话请求是否为 首次会话请求。
[0045] 会话是指一个客户端与交互系统进行通讯的过程, 上述交互系统是指为用户提 供业务服务的系统, 在具体实现中, 结合图 1, 可通过应用服务器实现作为上述 交互系统与客户端进行交互。 例如, 用户通过客户端从输入账户密码进入购物 系统到退出购物系统就可认为是一个会话过程。 在 web应用中, 通常通过 TCP的 三次握手就创建了一个会话, TCP关闭连接则关闭会话。 为了识别不同的会话请 求是否来自同一客户端, web应用中引入了 HTTP会话机制, 即: 多次 HTTP连接 间维护用户与同一用户发出的不同请求之间关联的情况称为维护一个会话, 也 就是说, 用 session代表服务器与浏览器的一次会话过程, 这个过程是连续的, 也 可以时断时续的。 例如, 在 servlet中, 当 jsp页面没有显式禁止 session的时候, 在 通过客户端打开浏览器第一次请求该 jsp的时候, 节点服务器会自动为其创建一 个会话, 并赋予其一个会话标识, 发送给客户端的浏览器。 以后客户端接着请 求本应用中其他资源的时候, 会自动在请求头上添加上述会话标识。 这样, 月艮 务器端在接到会话请求时候, 就会收到会话标识。
[0046] 在本申请实施例中, 当接收到用户通过浏览器发送的会话请求时, 会确定该会 话请求是否为首次会话请求。
[0047] S20: 若确定所述会话请求为首次会话请求, 则获取所述会话请求对应的会话 数据。 [0048] 可以理解, 当确定接收到的会话请求为首次会话请求时, 用户通过客户端的浏 览器与节点服务器建立会话, 并获取会话请求对应的会话数据 (也即 session数据 , 下文统一用会话数据进行描述) , 上述会话请求对应的会话数据指的是接收 到该会话请求后, 浏览器与节点服务器之间会话过程中所产生的数据, 该会话 数据用于存储用户会话所需的属性及配置信息。 换句话说, 上述会话数据是在 该次会话请求中与用户相关联的一些数据, 示例性的, 该会话数据包括用户名 密码和用户的资料等等会话数据, 具体这里不一一举例。
[0049] S30: 生成与所述会话唯一对应的第一会话标识。
[0050] 在获取到上述会话请求并确定该会话请求为首次会话请求之后, 由于为首次会 话请求, 为了区别出不同会话过程对应的会话数据, 会生成该会话唯一对应的 会话标识。 需要说明的是, 在本申请实施例中, 所采用的生成会话标识的机制 可以不同, 示例性的, 可基于随机数 +会话请求时间 +节点服务器硬件信息 +生成 上述第一会话标识, 具体不做限定, 在实际应用中, 可采用其他可生成此次会 话请求唯一标识的会话标识, 本申请实施例不做具体限定。
[0051] S40: 根据所述会话数据以及第一会话标识生成区块。
[0052] 在本申请实施例中, 在获取到上述会话数据, 以及生成上述会话唯一的会话标 识之后, 根据所述会话数据以及第一会话标识生成区块。
[0053] 具体地, 如图 3所示, 在一实施例中, 步骤 S40中, 也即所述根据所述会话数据 以及第一会话标识生成区块, 具体包括如下步骤:
[0054] S41: 根据不同的预设特征值算法对所述会话数据进行计算以获得至少两个特 征值。
[0055] S42: 根据所述至少两个特征值生成目标特征值。
[0056] 在本申请实施例中, 对于会话数据处理系统的每个节点服务器, 可通过不同的 预设特征值算法对会话数据进行特征值计算, 以得到至少两个会话数据特征值 , 并根据上述至少两个会话数据特征值生成目标特征值, 以将该目标特征值作 为该会话数据生成区块时所对应的特征值。 可以理解, 基于上述方式, 通过不 同的预设特征值算法计算会话数据的特征值, 可以有效地进行一步减少会话数 据受窃或修改。 另外需要说明的是, 上述不同的预设特征值算法可以是指 SHA2 56算法、 SHA512算法或其他算法, 例如 ripemd256算法等, 具体采取何种预设特 征值算法, 会话数据处理系统依据实际需求配置。 具体本发实施例不做限定。
[0057] 具体地, 在一实施例中, 如图 4所示, 步骤 S41中, 也即所述根据不同的预设特 征值算法对所述会话数据进行计算以获得至少两个特征值, 具体包括如下步骤
[0058] S411: 根据 SHA256算法对所述会话数据进行计算以获得第一特征值。
[0059] S412: 根据 SHA512算法对所述会话数据进行计算以获得第二特征值。
[0060] 步骤 S42中, 也即所述根据所述至少两个特征值生成目标特征值, 包括:
[0061] S42': 根据所述第一特征值以及第二特征值生成所述目标特征值。
[0062] 可以基于 SHA256算法以及会话数据生成第一特征值, 根据 SHA512和会话数据 生成第二特征值, 最后根据上述第一、 第二特征值生成上述目标特征值。 可见 , 在本申请实施例中, 提出了一种具体根据不同的预设特征值算法所计算出来 的第一特征值和第二特征值来计算出目标特征值的具体实现方式, 提高了方案 的可实施性。
[0063] 在一实施例中, 如图 5所示, 步骤 S42中, 也即所述根据所述第一特征值以及 第二特征值生成所述目标特征值, 具体包括如下步骤:
[0064] S42P: 依据预设排序规则, 将所述第一特征值与第二特征值的各个字符进行 交叉排序以获得排序结果。
[0065] S422\ 将所述排序结果作为所述目标特征值。
[0066] 对于步骤 S42P- S422\ 本申请实施例可以分别确定第一特征值以及第二特征 值在交叉排序时的字符位置, 并根据确定的字符位置对第一特征值以及第二特 征值的各个字符进行排序以获得排序结果, 并将排序结果作为目标特征值。 示 例性的, 可以将第一特征值和第二特征值的各个字符进行交叉排序, 从而得到 上述目标特征值。 例如, 假设第一特征值为 abed..., 第二特征值为 ABCD..., 则 可以对 abed...以及 ABCD...进行交叉排序, 例如以第一特征值的首个字符作为目 标特征值的首个字符, 则交叉排序结果为 aAbBcCdD..., 从而生成目标特征值。 需要说明的是, 上述例子在这里只是举例说明, 并不对本申请实施例构成限定 [0067] 需要说明的是, 考虑到区块的存储空间有限, 因此需要对区块中的目标特征值 的存储空间进行限定, 在一些实施例中, 针对基于区块链的会话数据处理系统 , 可预设阈值, 并将该预设阈值广播至会话数据处理系统的各个节点服务器中 , 当节点检测到生成的目标特征值的大小超过上述预设阈值时, 则可以对上述 至少两个特征值中包含的字符进行选取, 以保留适当的位数的字符, 将未选取 到的字符进行删除, 并对保留的字符进行排序以获得排序结果, 从而使得生成 的区块中存储的目标特征值的提及小于预设阈值, 减少区块的存储压力。
[0068] S43: 根据所述目标特征值以及区块基础信息生成区块头信息, 所述区块基础 信息包括当前区块的父区块的目标特征值以及所述第一会话标识。
[0069] S44: 根据所述会话数据以及所述区块头信息生成所述区块, 其中, 所述会话 数据作为所述区块的区块主体信息。
[0070] 对于步骤 S43-S45 可以理解, 在得到目标特征值之后, 根据目标特征值以及 区块基础信息生成包含有区块基础信息以及目标特征值的区块头信息。 其中, 区块基础信息还包含时间戳、 当前区块的父区块的区块头特征值 (也即父区块 对应的目标特征值) 以及所述第一会话标识。 也就是说, 区块的区块主体信息 为会话数据, 区块的区块头信息包含当前区块的目标特征值、 父区块的区块头 特征值以及第一会话标识。 需要说明的是, 上述区块的区块头信息中, 还包括 区块的其他区块头信息, 这里不一一列举, 例如区块版本号等。 对应于上一块 父区块的存储位置, 将会话数据、 父区块的区块头特征值以及当前区块的目标 特征值存储至相应的位置上, 从而得到一个新的区块。
[0071] S50: 将所述区块广播至所述区块链。
[0072] 在根据所述会话数据以及第一会话标识生成区块之后, 将所述区块广播至所述 区块链中。
[0073] 在一实施例中, 如图 6所示, 步骤 S50中, 也即所述将所述区块广播至所述区块 链, 具体包括如下步骤:
[0074] S51: 获取所述应用服务器集群中各个节点服务器的节点标识。
[0075] S52: 根据所述节点标识将所述区块广播至所述节点标识对应的节点服务器的 区块链中。 [0076] 对于步骤 S51-S52, 如前面所述, 对于基于区块链的会话数据处理系统的每个 节点服务器均有对应的节点标识, 另外, 每个节点服务器均存储有基于区块链 的会话数据处理系统的其他节点服务器的节点标识, 因此, 可以获取所述区块 链中的各个节点服务器的节点标识。 也就是说, 根据基于区块链的会话数据处 理系统中其他节点服务器的节点标识, 将新生成的区块广播至基于区块链的会 话数据处理系统的其他节点服务器中, 以使得其他节点服务器将该新生成的区 块加入存储的区块链中, 实现区块链数据 (也即会话数据) 在基会话数据处理 系统的共享。 由此可见, 当基于区块链的会话数据处理系统的任意一个节点服 务器出现宕机时, 该节点服务器与客户端所建立的会话数据并不会消失从而影 响到正常业务的进行, 有效地保证了各个节点服务器的会话数据的有效性。
[0077] 具体地, 在一实施例中, 如图 7所示, 步骤 S10中, 也即所述确定所述会话请求 是否为首次会话请求, 具体包括如下步骤:
[0078] S11: 判断接收到的所述会话请求是否携带第二会话标识;
[0079] S12: 若判断接收到的所述会话请求携带有所述第二会话标识, 则确定所述会 话请求为非首次会话请求, 若判断所述会话请求未携带有所述第二会话标识, 则确定所述会话请求为首次会话请求。
[0080] 对于步骤 S11-S12, 可以理解, 在上述描述已经提到, 在用户通过客户端浏览 器与节点服务器首次建立会话时, 节点服务器会生成该会话对应的会话标识, 并向该客户端反馈该会标标识, 以使得该客户端下一次请求来时携带上所会话 标识。 因此, 当节点服务器接收到任何一个客户端发送的会话请求时, 节点服 务器判断接收到的所述会话请求是否携带有第二会话标识, 具体地, 节点服务 器接收到所述会话请求后, 解析该会话请求, 从而确定会话请求是否携带有第 二会话标识, 若判断接收到的所述会话请求携带有所述第二会话标识, 则确定 所述会话请求为非首次会话请求, 若判断所述会话请求未携带有所述第二会话 标识, 则确定所述会话请求为首次会话请求。
[0081] 可见, 本申请实施例提供了一种基于区块链的会话数据处理方法, 通过区块链 的方式, 实现各个节点服务器均能共享上述会话数据以及数据不可修改性, 减 少由于节点服务器宕机带来的会话数据丢失的影响, 提高会话数据有效性, 保 证会话数据可用。
[0082] 应理解, 上述实施例中各步骤的序号的大小并不意味着执行顺序的先后, 各过 程的执行顺序应以其功能和内在逻辑确定, 而不应对本申请实施例的实施过程 构成任何限定。
[0083] 在一实施例中, 提供一种基于区块链的会话数据处理装置, 该基于区块链的会 话数据处理装置与上述实施例中基于区块链的会话数据处理方法一一对应。 如 图 8所示, 所述基于区块链的会话数据处理装置应用于会话数据处理系统的节点 服务器中, 所述会话数据处理系统包括应用服务器集群, 所述节点服务器为所 述应用服务器集群中的任意一个, 所述应用服务器集群的每个节点服务器存储 有区块链, 所述基于区块链的会话数据处理装置 10包括: 确定模块 101、 获取模 块 102、 第一生成模块 103、 第二生成模块 104以及广播模块 105。
[0084] 确定模块 101, 用于当接收到用户通过浏览器发送的会话请求时, 确定所述会 话请求是否为首次会话请求;
[0085] 获取模块 102, 用于若所述确定模块确定所述会话请求为首次会话请求, 则获 取所述会话请求对应的会话所生成的会话数据;
[0086] 第一生成模块 103 , 用于生成与所述会话唯一对应的第一会话标识;
[0087] 第二生成模块 104, 用于根据所述获取模块获取的所述会话数据以及所述第一 生成模块生成的第一会话标识生成区块;
[0088] 广播模块 105, 用于将所述第二生成模块生成的所述区块广播至所述区块链。
[0089] 在一实施例中, 所述第二生成模块 104具体用于:
[0090] 根据不同的预设特征值算法对所述会话数据进行计算以获得至少两个特征值;
[0091] 根据所述至少两个特征值生成目标特征值;
[0092] 根据所述目标特征值以及区块基础信息生成区块头信息, 所述区块基础信息包 括时间戳、 区块标识以及所述第一会话标识;
[0093] 根据所述会话数据以及所述区块头信息生成所述区块, 其中, 所述会话数据作 为所述区块的区块主体信息。
[0094] 在一实施例中, 所述第二生成模块 104用于所述根据不同的预设特征值算法对 所述会话数据进行计算以获得至少两个特征值, 具体包括: [0095] 所述第二生成模块 104用于:
[0096] 根据 SHA256算法对所述会话数据进行计算以获得第一特征值;
[0097] 根据 SHA512算法对所述会话数据进行计算以获得第二特征值;
[0098] 所述第二生成模块 104用于根据所述至少两个特征值生成目标特征值, 具体包 括: 所述第二生成模块 104用于: 根据所述第一特征值以及第二特征值生成所述 目标特征值。
[0099] 在一实施例中, 所述第二生成模块 104用于根据所述第一特征值以及第二特征 值生成所述目标特征值, 具体包括:
[0100] 所述第二生成模块 104用于: 依据预设排序交叉规则, 将所述第一特征值与第 二特征值的各个字符进行交叉排序以获得交叉排序结果; 将所述交叉排序结果 作为所述目标特征值。
[0101] 在一实施中, 确定模块 101用于所述确定所述会话请求是否为首次会话请求, 包括:
[0102] 确定模块 101具体用于: 判断接收到的所述会话请求是否携带有第二会话标识 ; 若判断接收到的所述会话请求携带有所述第二会话标识, 则确定所述会话请 求为非首次会话请求, 若判断所述会话请求未携带有所述第二会话标识, 则确 定所述会话请求为所述首次会话请求。
[0103] 在一实施例中, 广播模块 105用于将所述区块广播至所述区块链包括:
[0104] 广播模块 105用于: 获取所述应用服务器集群中各个节点服务器的节点标识; 根据所述节点标识将所述区块广播至所述节点标识对应的节点服务器的区块链 中。
[0105] 可见, 本申请实施例提供了一种基于区块链的会话数据处理装置, 通过区块链 的方式, 实现各个节点服务器均能共享上述会话数据以及数据不可修改性, 减 少由于节点服务器宕机带来的会话数据丢失的影响, 提高会话数据有效性, 保 证会话数据可用。
[0106] 关于会话数据处理装置的具体限定可以参见上文中对于会话数据处理方法的限 定, 在此不再赘述。 上述会话数据处理装置中的各个模块可全部或部分通过软 件、 硬件及其组合来实现。 上述各模块可以硬件形式内嵌于或独立于计算机设 备中的处理器中, 也可以以软件形式存储于计算机设备中的存储器中, 以便于 处理器调用执行以上各个模块对应的操作。
[0107] 在一个实施例中, 提供了一种计算机设备, 该计算机设备可以是服务器, 其内 部结构图可以如图 9所示。 该计算机设备包括通过系统总线连接的处理器、 存储 器、 网络接口和数据库。 其中, 该计算机设备的处理器用于提供计算和控制能 力。 该计算机设备的存储器包括可读存储介质、 内存储器。 该可读存储介质包 括非易失性可读存储介质和易失性可读存储介质, 该可读存储介质存储有操作 系统、 计算机可读指令和数据库。 该内存储器为可读存储介质中的操作系统和 计算机可读指令的运行提供环境。 该计算机设备的网络接口用于与外部的终端 通过网络连接通信。 该计算机可读指令被处理器执行时以实现一种基于区块链 的会话数据处理方法。
[0108] 在一个实施例中, 提供了一种计算机设备, 包括存储器、 处理器及存储在存储 器上并可在处理器上运行的计算机可读指令, 处理器执行计算机可读指令时实 现以下步骤:
[0109] 当接收到用户通过浏览器发送的会话请求时, 确定所述会话请求是否为首次会 话请求;
[0110] 若确定所述会话请求为首次会话请求, 则获取所述会话请求对应的会话所生成 的会话数据;
[0111] 生成与所述会话唯一对应的第一会话标识;
[0112] 根据所述会话数据以及第一会话标识生成区块;
[0113] 将所述区块广播至所述区块链。
[0114] 可见, 本申请实施例提供了一种计算机设备, 通过区块链的方式, 实现各个节 点服务器均能共享上述会话数据以及数据不可修改性, 减少由于节点服务器宕 机带来的会话数据丢失的影响, 提高会话数据有效性, 保证会话数据可用。
[0115] 在一个实施例中, 提供一个或多个存储有计算机可读指令的可读存储介质, 所 述可读存储介质包括非易失性可读存储介质和易失性可读存储介质, 所述计算 机可读指令被一个或多个处理器执行时, 使得所述一个或多个处理器执行如下 步骤: [0116] 当接收到用户通过浏览器发送的会话请求时, 确定所述会话请求是否为首次会 话请求;
[0117] 若确定所述会话请求为首次会话请求, 则获取所述会话请求对应的会话所生成 的会话数据;
[0118] 生成与所述会话唯一对应的第一会话标识;
[0119] 根据所述会话数据以及第一会话标识生成区块;
[0120] 将所述区块广播至所述区块链。
[0121] 可见, 本申请实施例提供了一种计算机可读存储介质, 通过区块链的方式, 实 现各个节点服务器均能共享上述会话数据以及数据不可修改性, 减少由于节点 服务器宕机带来的会话数据丢失的影响, 提高会话数据有效性, 保证会话数据 可用。
[0122] 本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程, 是可 以通过计算机可读指令来指令相关的硬件来完成, 所述的计算机可读指令可存 储于一非易失性计算机可读取存储介质中, 该计算机可读指令在执行时, 可包 括如上述各方法的实施例的流程。 其中, 本申请所提供的各实施例中所使用的 对存储器、 存储、 数据库或其它介质的任何引用, 均可包括非易失性和 /或易失 性存储器。 非易失性存储器可包括只读存储器 (ROM) 、 可编程 ROM (PROM ) 、 电可编程 ROM (EPROM) 、 电可擦除可编程 ROM (EEPROM) 或闪存。 易失性存储器可包括随机存取存储器 (RAM) 或者外部高速缓冲存储器。 作为 说明而非局限, RAM以多种形式可得, 诸如静态 RAM (SRAM) 、 动态 RAM ( DRAM) 、 同步 DRAM (SDRAM) 、 双数据率 SDRAM (DDRSDRAM) 、 增强 型 SDRAM (ESDRAM) 、 同步链路 (Synchlink) DRAM (SLDRAM) 、 存储 器总线 (Rambus) 直接 RAM (RDRAM) 、 直接存储器总线动态 RAM (DRDR AM) 、 以及存储器总线动态 RAM (RDRAM) 等。
[0123] 所属领域的技术人员可以清楚地了解到, 为了描述的方便和简洁, 仅以上述各 功能单元、 模块的划分进行举例说明, 实际应用中, 可以根据需要而将上述功 能分配由不同的功能单元、 模块完成, 即将所述装置的内部结构划分成不同的 功能单元或模块, 以完成以上描述的全部或者部分功能。 [0124] 以上所述实施例仅用以说明本申请的技术方案, 而非对其限制; 尽管参照前述 实施例对本申请进行了详细的说明, 本领域的普通技术人员应当理解: 其依然 可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分技术特征进 行等同替换; 而这些修改或者替换, 并不使相应技术方案的本质脱离本申请各 实施例技术方案的精神和范围, 均应包含在本申请的保护范围之内。

Claims

权利要求书
[权利要求 1] 一种基于区块链的会话数据处理方法, 其特征在于, 所述基于区块链 的会话数据处理方法应用于会话数据处理系统的节点服务器中, 所述 会话数据处理系统包括应用服务器集群, 所述节点服务器为所述应用 服务器集群中的任意一个, 所述应用服务器集群的每个节点服务器存 储有区块链, 所述方法包括:
当接收到用户通过浏览器发送的会话请求时, 确定所述会话请求是否 为首次会话请求;
若确定所述会话请求为首次会话请求, 则获取所述会话请求对应的会 话所生成的会话数据;
生成与所述会话唯一对应的第一会话标识;
根据所述会话数据以及第一会话标识生成区块; 将所述区块广播至所述区块链。
[权利要求 2] 如权利要求 1所述的基于区块链的会话数据处理方法, 其特征在于, 所述根据所述会话数据以及第一会话标识生成区块, 包括: 根据不同的预设特征值算法对所述会话数据进行计算以获得至少两个 特征值;
根据所述至少两个特征值生成目标特征值;
根据所述目标特征值以及区块基础信息生成区块头信息, 所述区块基 础信息包括时间戳、 区块标识以及所述第一会话标识;
根据所述会话数据以及所述区块头信息生成所述区块, 其中, 所述会 话数据作为所述区块的区块主体信息。
[权利要求 3] 如权利要求 2所述的基于区块链的会话数据处理方法, 其特征在于, 所述根据不同的预设特征值算法对所述会话数据进行计算以获得至少 两个特征值, 包括:
根据 SHA256算法对所述会话数据进行计算以获得第一特征值; 根据 SHA512算法对所述会话数据进行计算以获得第二特征值; 所述根据所述至少两个特征值生成目标特征值, 包括: 根据所述第一特征值以及第二特征值生成所述目标特征值。
[权利要求 4] 如权利要求 3所述的基于区块链的会话数据处理方法, 其特征在于, 所述根据所述第一特征值以及第二特征值生成所述目标特征值, 包括 依据预设排序交叉规则, 将所述第一特征值与第二特征值的各个字符 进行交叉排序以获得交叉排序结果;
将所述交叉排序结果作为所述目标特征值。
[权利要求 5] 如权利要求 1-4任一项所述的基于区块链的会话数据处理方法, 其特 征在于, 所述确定所述会话请求是否为首次会话请求, 包括: 判断接收到的所述会话请求是否携带有第二会话标识;
若判断接收到的所述会话请求携带有所述第二会话标识, 则确定所述 会话请求为非首次会话请求, 若判断所述会话请求未携带有所述第二 会话标识, 则确定所述会话请求为所述首次会话请求。
[权利要求 6] 如权利要求 5所述的基于区块链的会话数据处理方法, 其特征在于, 所述将所述区块广播至所述区块链包括:
获取所述应用服务器集群中各个节点服务器的节点标识;
根据所述节点标识将所述区块广播至所述节点标识对应的节点服务器 的区块链中。
[权利要求 7] 一种基于区块链的会话数据处理装置, 其特征在于, 所述基于区块链 的会话数据处理装置应用于会话数据处理系统的节点服务器中, 所述 会话数据处理系统包括应用服务器集群, 所述节点服务器为所述应用 服务器集群中的任意一个, 所述应用服务器集群的每个节点服务器存 储有区块链, 所述基于区块链的会话数据处理装置包括:
确定模块, 用于当接收到用户通过浏览器发送的会话请求时, 确定所 述会话请求是否为首次会话请求;
获取模块, 用于若所述确定模块确定所述会话请求为首次会话请求, 则获取所述会话请求对应的会话所生成的会话数据;
第一生成模块, 用于生成与所述会话唯一对应的第一会话标识; 第二生成模块, 用于根据所述获取模块获取的所述会话数据以及所述 第一生成模块生成的第一会话标识生成区块;
广播模块, 用于将所述第二生成模块生成的所述区块广播至所述区块 链。
[权利要求 8] 如权利要求 7所述的基于区块链的会话数据处理装置, 其特征在于, 所述第二生成模块具体用于:
根据不同的预设特征值算法对所述会话数据进行计算以获得至少两个 特征值;
根据所述至少两个特征值生成目标特征值;
根据所述目标特征值以及区块基础信息生成区块头信息, 所述区块基 础信息包括时间戳、 区块标识以及所述第一会话标识;
根据所述会话数据以及所述区块头信息生成所述区块, 其中, 所述会 话数据作为所述区块的区块主体信息。
[权利要求 9] 如权利要求 8所述的基于区块链的会话数据处理装置, 其特征在于, 所述第二生成模块 1用于所述根据不同的预设特征值算法对所述会话 数据进行计算以获得至少两个特征值, 具体包括: 所述第二生成模块用于:
根据 SHA256算法对所述会话数据进行计算以获得第一特征值; 根据 SHA512算法对所述会话数据进行计算以获得第二特征值; 所述第二生成模块用于根据所述至少两个特征值生成目标特征值, 具 体包括: 所述第二生成模块用于: 根据所述第一特征值以及第二特征 值生成所述目标特征值。
[权利要求 10] 如权利要求 9所述的基于区块链的会话数据处理装置, 其特征在于, 所述第二生成模块用于根据所述第一特征值以及第二特征值生成所述 目标特征值, 具体包括:
所述第二生成模块用于: 依据预设排序交叉规则, 将所述第一特征值 与第二特征值的各个字符进行交叉排序以获得交叉排序结果; 将所述交叉排序结果作为所述目标特征值。
[权利要求 11] 如权利要求 7- 10任一项所述的基于区块链的会话数据处理装置, 其特 征在于, 所述确定模块具体用于:
判断接收到的所述会话请求是否携带有第二会话标识;
若判断接收到的所述会话请求携带有所述第二会话标识, 则确定所述 会话请求为非首次会话请求, 若判断所述会话请求未携带有所述第二 会话标识, 则确定所述会话请求为所述首次会话请求。
[权利要求 12] 如权利要求 11所述的基于区块链的会话数据处理装置, 其特征在于, 所述广播模块具体用于:
获取所述应用服务器集群中各个节点服务器的节点标识;
根据所述节点标识将所述区块广播至所述节点标识对应的节点服务器 的区块链中。
[权利要求 13] 一种计算机设备, 包括存储器、 处理器以及存储在所述存储器中并可 在所述处理器上运行的计算机可读指令, 其特征在于, 所述计算机设 备应用于会话数据处理系统的节点服务器中, 所述会话数据处理系统 包括应用服务器集群, 所述节点服务器为所述应用服务器集群中的任 意一个, 所述应用服务器集群的每个节点服务器存储有区块链, 所述 处理器执行所述计算机可读指令时实现如下步骤: 当接收到用户通过浏览器发送的会话请求时, 确定所述会话请求是否 为首次会话请求;
若确定所述会话请求为首次会话请求, 则获取所述会话请求对应的会 话所生成的会话数据;
生成与所述会话唯一对应的第一会话标识;
根据所述会话数据以及第一会话标识生成区块; 将所述区块广播至所述区块链。
[权利要求 14] 如权利要求 13所述的计算机设备, 其特征在于, 所述根据所述会话数 据以及第一会话标识生成区块, 包括:
根据不同的预设特征值算法对所述会话数据进行计算以获得至少两个 特征值; 根据所述至少两个特征值生成目标特征值;
根据所述目标特征值以及区块基础信息生成区块头信息, 所述区块基 础信息包括时间戳、 区块标识以及所述第一会话标识;
根据所述会话数据以及所述区块头信息生成所述区块, 其中, 所述会 话数据作为所述区块的区块主体信息。
[权利要求 15] 如权利要求 14所述的计算机设备, 其特征在于, 所述根据不同的预设 特征值算法对所述会话数据进行计算以获得至少两个特征值, 包括: 根据 SHA256算法对所述会话数据进行计算以获得第一特征值; 根据 SHA512算法对所述会话数据进行计算以获得第二特征值; 所述根据所述至少两个特征值生成目标特征值, 包括:
根据所述第一特征值以及第二特征值生成所述目标特征值。
[权利要求 16] 如权利要求 15所述的计算机设备, 其特征在于, 所述根据所述第一特 征值以及第二特征值生成所述目标特征值, 包括: 依据预设排序交叉规则, 将所述第一特征值与第二特征值的各个字符 进行交叉排序以获得交叉排序结果;
将所述交叉排序结果作为所述目标特征值。
[权利要求 17] 一个或多个存储有计算机可读指令的可读存储介质, 其特征在于, 所 述可读存储介质应用于会话数据处理系统的节点服务器中, 所述会话 数据处理系统包括应用服务器集群, 所述节点服务器为所述应用服务 器集群中的任意一个, 所述应用服务器集群的每个节点服务器存储有 区块链, 所述处理器执行所述计算机可读指令时实现如下步骤: 当接收到用户通过浏览器发送的会话请求时, 确定所述会话请求是否 为首次会话请求;
若确定所述会话请求为首次会话请求, 则获取所述会话请求对应的会 话所生成的会话数据;
生成与所述会话唯一对应的第一会话标识;
根据所述会话数据以及第一会话标识生成区块; 将所述区块广播至所述区块链。
[权利要求 18] 如权利要求 17所述的计算机设备, 其特征在于, 所述根据所述会话数 据以及第一会话标识生成区块, 包括:
根据不同的预设特征值算法对所述会话数据进行计算以获得至少两个 特征值;
根据所述至少两个特征值生成目标特征值;
根据所述目标特征值以及区块基础信息生成区块头信息, 所述区块基 础信息包括时间戳、 区块标识以及所述第一会话标识;
根据所述会话数据以及所述区块头信息生成所述区块, 其中, 所述会 话数据作为所述区块的区块主体信息。
[权利要求 19] 如权利要求 18所述的计算机设备, 其特征在于, 所述根据不同的预设 特征值算法对所述会话数据进行计算以获得至少两个特征值, 包括: 根据 SHA256算法对所述会话数据进行计算以获得第一特征值; 根据 SHA512算法对所述会话数据进行计算以获得第二特征值; 所述根据所述至少两个特征值生成目标特征值, 包括:
根据所述第一特征值以及第二特征值生成所述目标特征值。
[权利要求 20] 如权利要求 19所述的计算机设备, 其特征在于, 所述根据所述第一特 征值以及第二特征值生成所述目标特征值, 包括: 依据预设排序交叉规则, 将所述第一特征值与第二特征值的各个字符 进行交叉排序以获得交叉排序结果;
将所述交叉排序结果作为所述目标特征值
PCT/CN2019/116435 2019-02-25 2019-11-08 基于区块链的会话数据处理方法、装置、设备及介质 WO2020173126A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910137178.3A CN109981739A (zh) 2019-02-25 2019-02-25 基于区块链的会话数据处理方法、装置、设备及介质
CN201910137178.3 2019-02-25

Publications (1)

Publication Number Publication Date
WO2020173126A1 true WO2020173126A1 (zh) 2020-09-03

Family

ID=67077361

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116435 WO2020173126A1 (zh) 2019-02-25 2019-11-08 基于区块链的会话数据处理方法、装置、设备及介质

Country Status (2)

Country Link
CN (1) CN109981739A (zh)
WO (1) WO2020173126A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109981739A (zh) * 2019-02-25 2019-07-05 平安科技(深圳)有限公司 基于区块链的会话数据处理方法、装置、设备及介质
CN111641559B (zh) * 2020-04-22 2022-02-15 金蝶软件(中国)有限公司 基于区块链的多人会话数据传输方法、系统和计算机设备
CN113852655A (zh) * 2020-06-28 2021-12-28 北京金山云网络技术有限公司 信息管理方法、装置及区块链服务系统
CN114155010A (zh) * 2021-12-06 2022-03-08 广州繁星互娱信息科技有限公司 一种产品标识码生成方法、装置、电子设备及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815728A (zh) * 2017-01-03 2017-06-09 北京供销科技有限公司 一种基于区块链技术的大数据确权方法及系统
CN108629038A (zh) * 2018-05-11 2018-10-09 北京奇虎科技有限公司 基于区块链的网页存证方法及系统
CN108958898A (zh) * 2018-07-11 2018-12-07 佛山伊苏巨森科技有限公司 一种用于向区块链发布匿名定向事务的方法
WO2018224941A1 (en) * 2017-06-07 2018-12-13 nChain Holdings Limited Methods and systems to establish trusted peer-to-peer communications between nodes in a blockchain network
CN109191149A (zh) * 2018-08-22 2019-01-11 合肥高科创新科技有限公司 一种基于区块链的商品数字身份生成方法
CN109327457A (zh) * 2018-11-09 2019-02-12 广州大学 一种基于区块链的物联网设备身份认证方法及系统
CN109981739A (zh) * 2019-02-25 2019-07-05 平安科技(深圳)有限公司 基于区块链的会话数据处理方法、装置、设备及介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6539494B1 (en) * 1999-06-17 2003-03-25 Art Technology Group, Inc. Internet server session backup apparatus
US9769205B2 (en) * 2013-04-06 2017-09-19 Citrix Systems, Inc. Systems and methods for SSL session management in a cluster system
CN104735098B (zh) * 2013-12-18 2018-05-08 青岛海尔空调器有限总公司 会话信息的控制方法和控制系统
CN104580226B (zh) * 2015-01-15 2017-07-11 上海瀚之友信息技术服务有限公司 一种共享会话数据的系统和方法
CN106357778A (zh) * 2016-09-27 2017-01-25 山东浪潮商用系统有限公司 一种会话信息的共享方法、装置及系统
CN106911465B (zh) * 2017-02-27 2018-09-04 腾讯科技(深圳)有限公司 区块生成方法及装置
CN107294709A (zh) * 2017-06-27 2017-10-24 阿里巴巴集团控股有限公司 一种区块链数据处理方法、装置及系统
CN108881231A (zh) * 2018-06-21 2018-11-23 郑州云海信息技术有限公司 一种集群系统中同步账户信息的方法、装置和存储介质
CN109088871B (zh) * 2018-08-14 2021-10-08 深圳市人民政府金融发展服务办公室 基于区块链技术的数据报送方法及系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815728A (zh) * 2017-01-03 2017-06-09 北京供销科技有限公司 一种基于区块链技术的大数据确权方法及系统
WO2018224941A1 (en) * 2017-06-07 2018-12-13 nChain Holdings Limited Methods and systems to establish trusted peer-to-peer communications between nodes in a blockchain network
CN108629038A (zh) * 2018-05-11 2018-10-09 北京奇虎科技有限公司 基于区块链的网页存证方法及系统
CN108958898A (zh) * 2018-07-11 2018-12-07 佛山伊苏巨森科技有限公司 一种用于向区块链发布匿名定向事务的方法
CN109191149A (zh) * 2018-08-22 2019-01-11 合肥高科创新科技有限公司 一种基于区块链的商品数字身份生成方法
CN109327457A (zh) * 2018-11-09 2019-02-12 广州大学 一种基于区块链的物联网设备身份认证方法及系统
CN109981739A (zh) * 2019-02-25 2019-07-05 平安科技(深圳)有限公司 基于区块链的会话数据处理方法、装置、设备及介质

Also Published As

Publication number Publication date
CN109981739A (zh) 2019-07-05

Similar Documents

Publication Publication Date Title
US11089023B2 (en) Computer readable storage media for tiered connection pooling and methods and systems for utilizing same
WO2020173126A1 (zh) 基于区块链的会话数据处理方法、装置、设备及介质
CN110086822B (zh) 面向微服务架构的统一身份认证策略的实现方法及系统
WO2021218018A1 (zh) 网页端实现跨域请求的数据处理方法、装置及相关设备
WO2018036314A1 (zh) 一种单点登录认证方法及装置、存储介质
WO2018006872A1 (zh) 一种混合云的接口调用方法及装置
US10262146B2 (en) Application-to-application messaging over an insecure application programming interface
US11632247B2 (en) User security token invalidation
CN111625301A (zh) 幂等处理方法、装置、设备及存储介质
US20200120039A1 (en) Systems and methods for controlling access to broker resources
CN111212075A (zh) 业务请求的处理方法、装置、电子设备及计算机存储介质
CN112527835B (zh) 基于缓存的认证请求处理方法、装置及相关设备
CN111614548A (zh) 消息推送方法、装置、计算机设备和存储介质
CN112187465B (zh) 无感登录方法、装置、计算机设备和存储介质
CN113271364B (zh) 服务编排数据的共享系统、方法、计算机设备及存储介质
CN111327680B (zh) 认证数据同步方法、装置、系统、计算机设备和存储介质
WO2023077748A1 (zh) 一种账户管理方法、装置、计算机设备和存储介质
CN113225348B (zh) 请求防重放校验方法和装置
CN114924783A (zh) 应用程序的接口调用方法、装置、设备及存储介质
CN111552551A (zh) 基于主从系统的用户管理方法、装置、计算机设备和介质
CN114679302B (zh) 对接单点登陆类系统的方法、装置、设备及存储介质
CN114363398B (zh) 会话安全处理方法、装置、计算机设备和存储介质
CN114285607B (zh) 云环境下的联网认证方法、系统、计算机设备及存储介质
CN110442447B (zh) 基于消息队列的负载均衡方法、装置和计算机设备
CN117081782A (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: 19917372

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: 19917372

Country of ref document: EP

Kind code of ref document: A1