Method and device for transmitting user session data shared between multiple servers

By encrypting and signing user session data, distributed session data management between multiple servers is realized, solving the problem of third-party cache synchronization lock competition under high concurrency, simplifying cross-server data transmission, and ensuring data security. security and integrity.

CN114389817BActive Publication Date: 2024-10-18CHINA TELECOM CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111593015.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2024-10-18
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

In a multi-server environment, existing technology is difficult to effectively manage and synchronize session data. Especially in high concurrency situations, the data synchronization lock competition problem of third-party caches is more complex, affecting the storage and management of session data.

Method used

By encrypting and signing user session data, encapsulated session data is generated and transmitted between multiple servers. The receiving end decrypts and verifies the data through shared encryption keys to achieve distributed session data storage and management, avoiding Dependence on server-side caching.

Benefits of technology

It implements distributed session data management without server-side caching, simplifies cross-server session data transmission, avoids lock competition issues with third-party caches under high concurrency, and ensures data security and integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114389817B_ABST
    Figure CN114389817B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for transmitting user session data shared between multiple servers, which is used to realize the storage and management of distributed session data that does not rely on server-side cache. The present application provides a method for transmitting user session data shared between multiple servers, which includes: obtaining the original data of the user session shared between multiple servers; encapsulating the original data, generating and sending encapsulated session data, and the encapsulated session data includes the following contents: encrypted original data, signature data used for the receiving end to verify the original data, and encrypted data used to generate the signature data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method and device for transmitting user session data shared among multiple servers. Background Art

[0002] The following description of background technology may include insights, discoveries, understandings or disclosures or associations to at least some examples of embodiments of the present application, as well as disclosures that are not known to the relevant prior art but are provided by the present application. Some such contributions of the present application may be specifically pointed out below, while other such contributions of the present application will be apparent from the relevant context.

[0003] A stateless service is a service without a special state. All requests are processed uniformly by the server. The request itself carries all the parameters required by the server. The server itself does not store any data related to the request, including database storage information.

[0004] The processing of a single request by a stateless service does not depend on other requests. That is to say, all the information required to process a request is either included in the request or can be obtained from the outside (such as a database). The server itself does not store any information.

[0005] Redis (Remote Dictionary Server), also known as remote dictionary service, is an open source log-type, Key-Value database written in ANSI C language, supporting the network, memory-based or persistent, and providing APIs in multiple languages.

[0006] In WEB development, it is necessary to record the status information of user access, that is, user session data, so it is necessary to implement session data on the server side to store the status information of the current accessing user. At present, the usual way is to store the user's status information in the memory on the server side. When the user accesses, the server obtains the user's status information from the memory and performs management and access control operations.

[0007] The existing session data implementation solution works well in the case of a single service. However, for multiple services or scenarios that require load balancing, it is necessary to implement session data migration on the server side or store and manage session data through third-party caches such as Redis. This type of implementation solution has the problem of complex management of session data synchronization migration and competition for data synchronization locks accessed by centralized third-party caches in high concurrency situations. Summary of the invention

[0008] The embodiments of the present application provide a method and device for transmitting user session data shared among multiple servers, so as to realize storage and management of distributed session data that is independent of server-side cache.

[0009] At the data sending end, an embodiment of the present application provides a method for transmitting user session data shared between multiple servers, including:

[0010] Get raw data of user sessions shared across multiple servers;

[0011] The original data is encapsulated to generate and send encapsulated session data, wherein the encapsulated session data includes the following contents: the encrypted original data, signature data used for the receiving end to verify the original data, and encrypted data used to generate the signature data.

[0012] Through this method, the original data of the user session shared among multiple servers is encapsulated and processed, and the generated and sent encapsulated session data includes the following contents: the encrypted original data, the signature data used for the receiving end to verify the original data, and the encrypted data used to generate the signature data. Thus, the storage and management of distributed session data that does not rely on the server-side cache is realized, so that a server can store session data on the client (i.e., the browser side), and when another server accesses it, the session data can be handed over to the other server through the client for decryption, verification, modification, etc.

[0013] Optionally, the signature data is data obtained by calculating the encrypted data and the original data using a preset signature algorithm.

[0014] Optionally, the encapsulated session data also includes a data header.

[0015] Optionally, the encrypted data used to generate the signature data is randomly generated data.

[0016] Optionally, the encrypted original data is data obtained by first compressing the original data and then encrypting it, wherein the encryption key used is an encryption key shared among the multiple servers.

[0017] At the data receiving end, an embodiment of the present application provides a method for transmitting user session data shared between multiple servers, including:

[0018] Receiving encapsulated session data, wherein the encapsulated session data is data obtained by encapsulating original data of a user session shared among multiple servers; the encapsulated session data includes the following contents: encrypted original data, signature data used by a receiving end to verify the original data, and encrypted data used to generate the signature data;

[0019] The encapsulated session data is decapsulated.

[0020] Optionally, decapsulating the encapsulated session data specifically includes:

[0021] Decrypting the encrypted original data using the encryption key shared among the multiple servers to obtain the original data;

[0022] The encrypted data used to generate the signature data and the original data obtained by decryption are used to generate signature data, and the generated signature data is compared with the signature data in the encapsulated session data to see whether they are consistent.

[0023] An embodiment of the present application provides a transmission device for user session data shared between multiple servers, including:

[0024] An acquisition unit, used for acquiring original data of a user session shared among multiple servers;

[0025] The encapsulation unit is used to encapsulate the original data, generate and send encapsulated session data, and the encapsulated session data includes the following contents: the encrypted original data, the signature data used for the receiving end to verify the original data, and the encrypted data used to generate the signature data.

[0026] An embodiment of the present application provides a transmission device for user session data shared between multiple servers, including:

[0027] A receiving unit, configured to receive encapsulated session data, wherein the encapsulated session data is data obtained by encapsulating original data of a user session shared among multiple servers; the encapsulated session data includes the following contents: encrypted original data, signature data used by a receiving end to verify the original data, and encrypted data used to generate the signature data;

[0028] The decapsulation unit is used to decapsulate the encapsulated session data.

[0029] Optionally, it also includes:

[0030] An acquisition unit, used for acquiring original data of a user session shared among multiple servers;

[0031] The encapsulation unit is used to encapsulate the original data obtained by the acquisition unit, generate and send encapsulated session data, and the encapsulated session data includes the following contents: the encrypted original data, the signature data used for the receiving end to verify the original data, and the encrypted data used to generate the signature data.

[0032] Another embodiment of the present application provides a computing device, which includes a memory and a processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions stored in the memory, and execute any of the above methods according to the obtained program.

[0033] Furthermore, according to an embodiment, for example, a computer program product for a computer is provided, which includes software code portions, and when the product is run on the computer, these software code portions are used to perform the steps of the method defined above. The computer program product may include a computer-readable medium having the software code portions stored thereon. Furthermore, the computer program product may be directly loaded into the internal memory of the computer and / or sent via a network through at least one of an upload process, a download process, and a push process.

[0034] Another embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute any of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 A schematic diagram of a flow chart of a method for transmitting user session data shared between multiple servers at a sending end provided in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of the session data format provided in the embodiment of the present application;

[0038] Figure 3 A schematic diagram of a flow chart of a method for transmitting user session data shared between multiple servers at a receiving end provided in an embodiment of the present application;

[0039] Figure 4 A schematic diagram of the structure of a transmission device for user session data shared between multiple servers at a sending end provided in an embodiment of the present application;

[0040] Figure 5 A schematic diagram of the structure of a device for transmitting user session data shared between multiple servers at a receiving end provided in an embodiment of the present application;

[0041] Figure 6 A schematic diagram of the structure of a transmission device for user session data shared between multiple servers provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0043] The embodiments of the present application provide a method and device for transmitting user session data shared among multiple servers, so as to realize storage and management of distributed session data that is independent of server-side cache.

[0044] Among them, the method and the device are based on the same application concept. Since the method and the device solve the problem in a similar principle, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.

[0045] The terms "first", "second", etc. (if any) in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than the content illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0046] The following examples and embodiments are to be understood as illustrative examples only. Although this specification may refer to "one", "an" or "some" examples or embodiments in several places, this does not mean that each such reference relates to the same example or embodiment, nor does it mean that the feature applies only to a single example or embodiment. Individual features of different embodiments may also be combined to provide other embodiments. In addition, terms such as "including" and "comprising" should be understood as not limiting the described embodiments to only those features that have been mentioned; such examples and embodiments may also include features, structures, units, modules, etc. that are not specifically mentioned.

[0047] The following is a detailed description of each embodiment of the present application in conjunction with the accompanying drawings. It should be noted that the display order of the embodiments of the present application only represents the order of the embodiments, and does not represent the advantages and disadvantages of the technical solutions provided by the embodiments.

[0048] See also Figure 1 , a method for transmitting user session data shared between multiple servers provided in an embodiment of the present application includes:

[0049] S101, obtaining original data of a user session shared among multiple servers;

[0050] S102, encapsulate the original data to generate and send encapsulated session data, where the encapsulated session data includes the following contents: encrypted original data, signature data used by a receiving end to verify the original data, and encrypted data used to generate the signature data.

[0051] Optionally, the encapsulated session data also includes a data header.

[0052] For example, see Figure 2 , the embodiment of the present application defines the storage format of session data. The original data includes two groups of data, magic and session, where magic is randomly generated variable-length data used for data obfuscation or later expansion. Session is the actual user session data, and the application developer decides how to organize the data, such as the data content after serializing a Java object using Java serialization operations. The embodiment of the present application does not limit the content of the session data.

[0053] That is to say, the encapsulated session data described in the embodiment of the present application, for example, includes the following four sections:

[0054] The first data segment: fixed English letters enclosed in quotation marks, such as "telecomsession=", which means the data content is telecomsession=" without quotation marks.

[0055] “telecomsession=” is fixed data content, which is set to be compatible with Set-Cookies and is used to identify subsequent data content.

[0056] The second data:

[0057] m represents the data obtained by Base64 encoding the magic data, which is used to verify the actual session data later.

[0058] Among them, the role of magic in the entire format is to ensure that the same plaintext session content can obtain different ciphertext content, enhance the security of session data, and prevent third parties from guessing the content.

[0059] The third data:

[0060] Sign represents the data obtained by performing SM3 signature operation on the concatenated content of magic and session data. Since the signed data is binary data, the binary data is then Base64 encoded for easy data transmission.

[0061] sign is the signature of the data, which ensures that the session data is not tampered with or damaged by a third party during transmission, thereby ensuring the reliability and security of the session content.

[0062] The fourth paragraph of data:

[0063] frame represents the data content after the compressed session data is encrypted by SM4 and then encoded by Base64. The key used for SM4 encryption is an SM4 key shared by each server.

[0064] The purpose of SM4 encryption of the session is to ensure that the actual session content is not known to a third party during the transmission process, so as to ensure that the session content is invisible to the client.

[0065] According to the implementation of different servers, the content of the session can be implemented by each platform. For the serialized data of the session, it is assumed here that the serialized data is the session. Since the content of the session needs to be kept confidential to the client and has the characteristic of being tamper-proof, it is assumed that the servers sharing the session data all share a public secret key.

[0066] The final packaging data consists of the above four segments, according to Figure 2 The data is spliced ​​in the order shown, except for the first two data segments, each data segment is as follows Figure 2 As shown, the English character "." is used for segmentation to distinguish data of different segments, so that the receiving end can decapsulate and obtain the data of the corresponding segment.

[0067] In summary, as attached Figure 2 As shown, the session data starts with a fixed string "telecomsession=", followed by the base64-encoded magic data m and a fixed character ".", followed by the data signed by the magic data and session data using the national encryption SM3 algorithm, and then the fixed string ".", and then the session data content SD compressed by gzip and encrypted using the national encryption SM4.

[0068] The sending server can return the encapsulated session data content directly to the browser through the HTTP header Set-Cookies. The browser will automatically process the session data and carry the session data to the other server each time it requests a service. The server only needs to decrypt and verify the data according to cryptographic rules to implement the session function originally implemented on the server.

[0069] Therefore, correspondingly, at the receiving end, see Figure 3 , a method for transmitting user session data shared between multiple servers provided in an embodiment of the present application includes:

[0070] S201, receiving encapsulated session data, wherein the encapsulated session data is data obtained by encapsulating original data of a user session shared among multiple servers; the encapsulated session data includes the following contents: encrypted original data, signature data used by a receiving end to verify the original data, and encrypted data used to generate the signature data;

[0071] S202: Decapsulate the encapsulated session data.

[0072] For example, according to Figure 2 The format shown reads the data content of each segment in sequence from back to front and performs integrity verification.

[0073] Optionally, decapsulating the encapsulated session data specifically includes:

[0074] Decrypting the encrypted original data using the encryption key shared among the multiple servers to obtain the original data;

[0075] The encrypted data used to generate the signature data and the original data obtained by decryption are used to generate the signature data, and the generated signature data is compared with the signature data in the encapsulated session data to see if they are consistent. For example, if they are consistent, it means that the data is complete and has not been tampered with; if they are inconsistent, the packet can be discarded or fed back to the sender to make the sender resend.

[0076] It can be seen that the embodiments of the present application have the following advantages:

[0077] By utilizing the existing HTTP protocol implementation standards, a cache management mechanism that does not rely on complex and redundant server-side data can be implemented to achieve session data transmission and processing across servers.

[0078] Compared with the traditional single-server session implementation, even if the user request is migrated to another server, the content of the session data can still be read by the new server.

[0079] Compared with the method of synchronizing sessions based on third-party cache, it avoids the trouble of managing and setting up third-party cache, and in high concurrency situations, there is no need to wait for the lock wait and request IO pressure related to the competition of the third-party cache.

[0080] At the same time, based on cryptographic protection, through the above-mentioned magic encryption processing and corresponding verification, it can ensure that the content of the session is invisible and cannot be tampered with, and can be seamlessly integrated with the existing http protocol without the need for additional browser-side modification or implementation.

[0081] The following is an introduction to the equipment or device provided in the embodiments of the present application, in which the explanations or examples of technical features that are the same or corresponding to those described in the above method will not be repeated later.

[0082] See also Figure 4 , an embodiment of the present application provides a transmission device for user session data shared between multiple servers, comprising:

[0083] An acquisition unit 11 is used to acquire original data of a user session shared among multiple servers;

[0084] The encapsulation unit 12 is used to encapsulate the original data, generate and send encapsulated session data, and the encapsulated session data includes the following contents: the encrypted original data, the signature data used for the receiving end to verify the original data, and the encrypted data used to generate the signature data.

[0085] Optionally, the signature data is data obtained by calculating the encrypted data and the original data using a preset signature algorithm.

[0086] Optionally, the encapsulated session data also includes a data header.

[0087] Optionally, the encrypted data used to generate the signature data is randomly generated data.

[0088] Optionally, the encrypted original data is data obtained by first compressing the original data and then encrypting it, wherein the encryption key used is an encryption key shared among the multiple servers.

[0089] See also Figure 5 , an embodiment of the present application provides a transmission device for user session data shared between multiple servers, comprising:

[0090] The receiving unit 21 is used to receive encapsulated session data, wherein the encapsulated session data is data obtained by encapsulating original data of a user session shared among multiple servers; the encapsulated session data includes the following contents: encrypted original data, signature data used by the receiving end to verify the original data, and encrypted data used to generate the signature data;

[0091] The decapsulation unit 22 is used to decapsulate the encapsulated session data.

[0092] Optionally, decapsulating the encapsulated session data specifically includes:

[0093] Decrypting the encrypted original data using the encryption key shared among the multiple servers to obtain the original data;

[0094] The encrypted data used to generate the signature data and the original data obtained by decryption are used to generate signature data, and the generated signature data is compared with the signature data in the encapsulated session data to see whether they are consistent.

[0095] Optionally, the transmission device further includes Figure 4 The units shown are:

[0096] An acquisition unit, used for acquiring original data of a user session shared among multiple servers;

[0097] The encapsulation unit is used to encapsulate the original data obtained by the acquisition unit, generate and send encapsulated session data, and the encapsulated session data includes the following contents: the encrypted original data, the signature data used for the receiving end to verify the original data, and the encrypted data used to generate the signature data.

[0098] That is to say, the transmission device can be a transmitting device or a receiving device. The transmission device can be, for example, a server on the network side.

[0099] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0100] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[0101] See also Figure 6 Another device for transmitting user session data shared between multiple servers provided in an embodiment of the present application includes:

[0102] Memory 520, used to store program instructions;

[0103] The processor 500 is configured to call the program instructions stored in the memory and execute according to the obtained program:

[0104] Get raw data of user sessions shared across multiple servers;

[0105] The original data is encapsulated to generate and send encapsulated session data, wherein the encapsulated session data includes the following contents: the encrypted original data, signature data used for the receiving end to verify the original data, and encrypted data used to generate the signature data.

[0106] Optionally, the signature data is data obtained by calculating the encrypted data and the original data using a preset signature algorithm.

[0107] Optionally, the encapsulated session data also includes a data header.

[0108] Optionally, the encrypted data used to generate the signature data is randomly generated data.

[0109] Optionally, the encrypted original data is data obtained by first compressing the original data and then encrypting it, wherein the encryption key used is an encryption key shared among the multiple servers.

[0110] When the transmission device acts as a receiving end, the processor 500 is further configured to call the program instructions stored in the memory and execute according to the obtained program:

[0111] Receiving encapsulated session data, wherein the encapsulated session data is data obtained by encapsulating original data of a user session shared among multiple servers; the encapsulated session data includes the following contents: encrypted original data, signature data used by a receiving end to verify the original data, and encrypted data used to generate the signature data;

[0112] The encapsulated session data is decapsulated.

[0113] Optionally, decapsulating the encapsulated session data specifically includes:

[0114] Decrypting the encrypted original data using the encryption key shared among the multiple servers to obtain the original data;

[0115] The encrypted data used to generate the signature data and the original data obtained by decryption are used to generate signature data, and the generated signature data is compared with the signature data in the encapsulated session data to see whether they are consistent.

[0116] The transceiver 510 is configured to receive and send data under the control of the processor 500 .

[0117] Among them, Figure 6 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 500 and memory represented by memory 520. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 510 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 500 is responsible for managing the bus architecture and general processing, and the memory 520 may store data used by the processor 500 when performing operations.

[0118] The processor 500 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a complex programmable logic device (CPLD).

[0119] The embodiment of the present application provides a computing device, which may be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. The computing device may include a central processing unit (CPU), a memory, an input / output device, etc. The input device may include a keyboard, a mouse, a touch screen, etc. The output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.

[0120] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In an embodiment of the present application, the memory may be used to store the program of any of the methods provided in the embodiments of the present application.

[0121] The processor calls the program instructions stored in the memory, and the processor is used to execute any of the methods provided in the embodiments of the present application according to the obtained program instructions.

[0122] The present application embodiment also provides a computer program product or computer program, which includes a computer instruction, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction so that the computer device executes any of the methods described in the above embodiments. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0123] The embodiment of the present application provides a computer-readable storage medium for storing computer program instructions used by the apparatus provided in the embodiment of the present application, which includes a program for executing any of the methods provided in the embodiment of the present application. The computer-readable storage medium may be a non-transitory computer-readable medium.

[0124] The computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.

[0125] It should be understood that:

[0126] The access technology through which entities in the communication network transmit traffic can be any suitable current or future technology, such as WLAN (Wireless Local Access Network), WiMAX (Worldwide Interoperability for Microwave Access), LTE, LTE-A, 5G, Bluetooth, infrared, etc.; in addition, the embodiments can also apply wired technology, for example, IP-based access technology, such as a wired network or a fixed line.

[0127] Embodiments suitable for being implemented as software code or a portion thereof and running using a processor or processing functionality are independent of the software code and may be specified using any known or future developed programming language, such as a high-level programming language such as objective-C, C, C++, C#, Java, Python, Javascript, other scripting languages, etc., or a low-level programming language such as machine language or assembler.

[0128] The implementation of the embodiments is hardware independent and may be implemented using any known or future developed hardware technology or any mixture thereof, such as a microprocessor or CPU (central processing unit), MOS (metal oxide semiconductor), CMOS (complementary MOS), BiMOS (bipolar MOS), BiCMOS (bipolar CMOS), ECL (emitter coupled logic) and / or TTL (transistor-transistor logic).

[0129] Embodiments may be implemented as separate devices, apparatuses, units, components, or functions, or in a distributed manner, for example, one or more processors or processing functions may be used or shared in a process, or one or more processing segments or processing portions may be used and shared in a process, wherein one physical processor or more than one physical processor may be used to implement one or more processing portions dedicated to a specific process as described.

[0130] The device may be implemented by a semiconductor chip, a chipset, or a (hardware) module including such a chip or chipset.

[0131] The embodiments may also be implemented as any combination of hardware and software, such as ASIC (Application Specific IC (Integrated Circuit)) components, FPGA (Field Programmable Gate Array) or CPLD (Complex Programmable Logic Device) components or DSP (Digital Signal Processor) components.

[0132] The embodiments may also be implemented as a computer program product including a computer usable medium having computer readable program code embodied therein, the computer readable program code being adapted to perform the processes as described in the embodiments, wherein the computer usable medium may be a non-transitory medium.

[0133] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0134] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0135] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0137] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for transmitting user session data shared between multiple servers, characterized in that: Applied to a sending server, the method comprises: Get the raw data of user sessions that need to be shared among multiple servers; The original data is encapsulated to generate and send encapsulated session data to the client, wherein the encapsulated session data includes the following contents: The first segment of data: used to represent the preset data content of the subsequent data content; Second segment of data: data obtained by encoding the magic data; wherein the magic data is randomly generated data; The third segment of data: data obtained by calculating the concatenation of the magic data and the original data of the user session using a preset signature algorithm; The fourth segment of data: data obtained by compressing the original data of the user session and then encrypting it.

2. The method according to claim 1, characterized in that The third segment of data and the fourth segment of data are Base64-encoded data.

3. The method according to claim 1, characterized in that The signature algorithm used by the third segment of data is the SM3 algorithm.

4. The method according to claim 1, characterized in that The encryption algorithm used for the fourth segment of data is the SM4 algorithm.

5. The method according to claim 1, characterized in that The encryption key used by the fourth segment of data is an encryption key shared among the multiple servers.

6. A method for transmitting user session data shared between multiple servers, characterized in that: Applied to a receiving end server, the method comprises: Receiving encapsulated session data sent by the client, wherein the encapsulated session data is data obtained by encapsulating original data of a user session that needs to be shared among multiple servers by a sending server; Decapsulating the encapsulated session data; The encapsulated session data includes the following: The first segment of data: used to represent the preset data content of the subsequent data content; Second segment of data: data obtained by encoding the magic data; wherein the magic data is randomly generated data; The third segment of data: data obtained by calculating the concatenation of the magic data and the original data of the user session using a preset signature algorithm; The fourth segment of data: data obtained by compressing the original data of the user session and then encrypting it.

7. The method according to claim 6, characterized in that The encapsulated session data is decapsulated, specifically including: Decrypting the fourth segment of data using the encryption key shared among the multiple servers to obtain original data of the user session; The second segment of data and the original data of the user session obtained by decryption are used to generate signature data, and the generated signature data is compared with the third segment of data to see whether they are consistent.

8. A transmission device for user session data shared between multiple servers, characterized in that: Applied to a sending end server, the device comprises: An acquisition unit, used for acquiring original data of user sessions that need to be shared among multiple servers; The encapsulation unit is used to encapsulate the original data, generate and send encapsulated session data to the client, and the encapsulated session data includes the following content: The first segment of data: used to represent the preset data content of the subsequent data content; Second segment of data: data obtained by encoding the magic data; wherein the magic data is randomly generated data; The third segment of data: data obtained by calculating the concatenation of the magic data and the original data of the user session using a preset signature algorithm; The fourth segment of data: data obtained by compressing the original data of the user session and then encrypting it.

9. A transmission device for user session data shared between multiple servers, characterized in that: When the device is applied to a receiving end server, the device includes: A receiving unit, configured to receive encapsulated session data sent by a client, wherein the encapsulated session data is data obtained by encapsulating original data of a user session that needs to be shared among multiple servers by a sending server; A decapsulation unit, used for decapsulating the encapsulated session data; The encapsulated session data includes the following: The first segment of data: used to represent the preset data content of the subsequent data content; Second segment of data: data obtained by encoding the magic data; wherein the magic data is randomly generated data; The third segment of data: data obtained by calculating the concatenation of the magic data and the original data of the user session using a preset signature algorithm; The fourth segment of data: data obtained by compressing the original data of the user session and then encrypting it.

10. The device according to claim 9, characterized in that When the device is applied to a sending end server, the device further includes: An acquisition unit, used for acquiring original data of user sessions that need to be shared among multiple servers; The encapsulation unit is used to encapsulate the original data obtained by the acquisition unit, generate and send encapsulated session data to the client, and the encapsulated session data includes the following contents: the encrypted original data, the signature data used by the receiving end to verify the original data, and the encrypted data used to generate the signature data.

11. A computing device, characterized in that: include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 7 according to the obtained program.

12. A computer program product for a computer, characterized in that The invention comprises software code parts for executing the steps according to any one of claims 1 to 7 when the product is run on the computer.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system achieving distributed conversation under cloud computing environment

    CN103200212A

  • Cross-website login method, terminal and website server

    CN105897746A

  • Security authentication method and system for SDN controller

    CN107342856A