Session management method and device, equipment, medium and product
By determining the first object identifier in the session query request when receiving the session query request, and obtaining the session data to be used based on the preset query conditions, the problem of the inability to meet the management session data in the prior art is solved, and efficient and flexible session management is achieved.
Patent Information
- Application Number
- CN202411990530.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, only the session's own data is supported for session management, resulting in the inability to meet the needs of different users to manage session data, and the problem of poor session management results.
When receiving the session query request, the first object identifier in the session query request is determined; when the first object identifier meets the preset query conditions, the first node obtains the session data to be used based on the satisfied preset query conditions and the session query request; sends the session data to be used to the client of the object to which the first object identifier is; when the satisfied preset query conditions are management object query conditions, and the session termination instruction sent by the client is received, the second node releases the target session in the session termination instruction based on the session termination instruction.
It realizes the matching session data for different session query objects. While meeting session management needs, it ensures the security of session data, improves query efficiency, and supports specific objects to manage target sessions on demand, improving the flexibility and convenience of session management.
Smart Images

Figure CN119906751A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer processing technology, and in particular to a session management method, device, equipment, medium and product. Background Art
[0002] With the development of database technology, the scale of databases is increasing. In order to ensure the performance of database systems, sessions that interact with the database are usually managed.
[0003] At present, the method of database session management is usually to manage sessions with specific attributes according to the session's own attributes. This method cannot meet the needs of different users to manage session data, and there is also the problem of poor session management effect. Summary of the invention
[0004] The present invention provides a session management method, apparatus, device, medium and product to achieve querying of session data adapted to different session query objects while ensuring the security of session data and improving query efficiency. At the same time, it supports specific objects to manage target sessions on demand, thereby improving the flexibility and convenience of session management.
[0005] According to one aspect of the present invention, a session management method is provided, the method comprising:
[0006] Upon receiving a session query request, determining a first object identifier in the session query request; the first object identifier is an object identifier of a session query object;
[0007] In the case where the first object identifier satisfies a preset query condition, based on the first node according to the preset query condition satisfied and the session query request, obtaining the session data to be used; wherein the first node includes a first data storage node and / or a first computing node;
[0008] Sending the session data to be used to a client of the object to which the first object identifier belongs, so that the client generates a session termination instruction and feeds back when determining that a preset termination condition is satisfied based on the session data to be used;
[0009] When the preset query condition satisfied is a management object query condition and the session termination instruction sent by the client is received, releasing the target session in the session termination instruction based on the second node according to the session termination instruction;
[0010] The second node includes a second data storage node and / or a second computing node; the target session is a session between a client corresponding to the queried object and the second data storage node.
[0011] According to another aspect of the present invention, a session management device is provided, the device comprising:
[0012] A first object identifier determining module, configured to determine a first object identifier in a session query request upon receiving the session query request; the first object identifier is an object identifier of a session query object;
[0013] a module for acquiring session data to be used, configured to acquire the session data to be used based on the first node according to the preset query condition satisfied and the session query request when the first object identifier satisfies the preset query condition; wherein the first node includes a first data storage node and / or a first computing node;
[0014] A data sending module, configured to send the session data to be used to a client of the object to which the first object identifier belongs, so that the client generates a session termination instruction and feeds back when determining that a preset termination condition is satisfied based on the session data to be used;
[0015] A session termination module, configured to release a target session in the session termination instruction based on the second node according to the session termination instruction when the preset query condition satisfied is a management object query condition and the session termination instruction sent by the client is received;
[0016] The second node includes a second data storage node and / or a second computing node; the target session is a session between a client corresponding to the queried object and the second data storage node.
[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0018] at least one processor; and a memory in communication with the at least one processor; wherein,
[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the session management method described in any embodiment of the present invention.
[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the session management method described in any embodiment of the present invention when executed.
[0021] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the session management method as described in any embodiment of the present invention.
[0022] The technical solution of the embodiment of the present invention is as follows: when receiving a session query request, determining the first object identifier in the session query request; when the first object identifier satisfies a preset query condition, obtaining the session data to be used based on the first node according to the preset query condition satisfied and the session query request; sending the session data to be used to the client of the object to which the first object identifier belongs, so that when the client determines that the preset termination condition is satisfied based on the session data to be used, the session termination instruction is generated and fed back; when the preset query condition satisfied is a management object query condition and the session termination instruction sent by the client is received, releasing the target session in the session termination instruction based on the second node according to the session termination instruction, solves the problem that the prior art only supports session management based on its own data, resulting in failure to meet the needs of different users to manage session data, and poor session management effect, and can query the corresponding session data for the session query objects that meet different preset query conditions through different nodes, meet the session management needs, ensure the security of the session data, and improve the query efficiency. At the same time, it supports specific objects to manage target sessions on demand, and improves the flexibility and convenience of session management.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 is a flow chart of a session management method provided according to Embodiment 1 of the present invention;
[0026] Figure 2 is a schematic diagram of a session management method provided according to Embodiment 1 of the present invention;
[0027] Figure 3 is a timing diagram for characterizing a session management method provided according to the first embodiment of the present invention;
[0028] Figure 4 is a structural diagram of a session management device provided according to Embodiment 2 of the present invention;
[0029] Figure 5 It is a structural schematic diagram of an electronic device for implementing the session management method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Embodiment 1
[0033] Figure 1 1 is a flow chart of a session management method provided according to the first embodiment of the present invention. This embodiment is applicable to managing the session between the client and the database. The method can be executed by a session management device. The session management device can be implemented in the form of hardware and / or software. The session management device can be configured in a computing device. Figure 1 As shown, the method includes:
[0034] S110: When receiving a session query request, determine a first object identifier in the session query request.
[0035] The session query request may be a program or code for requesting information related to a specific session. The session refers to an interactive session between a client and a database. Exemplarily, when a connection request is initiated by any client, a session is established, and the session ends until the client disconnects or times out. The first object identifier is an object identifier of a session query object, which is used to identify the uniqueness of the session query object, such as an object ID, a serial number of a device, a database connection, etc. A session query object refers to a party that queries a session. For example, a session query object may be a user who is in a session or a user who manages a session.
[0036] In this embodiment, when the session query party wants to obtain information related to a specific session, it can send a session query request to the system. After receiving the session query request, the session query request can be parsed, the request content can be parsed, and the object identifier of the session query object can be extracted as the first object identifier. The advantage of determining the first object identifier is that it can accurately determine whether the session query object has query authority, thereby ensuring that the corresponding session data that is compatible with the object query authority can be fed back to the session query object.
[0037] In this embodiment, the session query request is based on a preset operation and / or a scheduled task according to a screening condition corresponding to at least one screening dimension; the screening dimension includes at least a session object dimension, a session state dimension, and a session time dimension.
[0038] The preset operation may be an operation actively triggered by a user to initiate a session query request. For example, the preset operation includes but is not limited to obtaining a session list, querying detailed information of a specific session, retrieving sessions related to specific conditions, etc. A scheduled task refers to a task that automatically executes a session query, and the session query task may be executed periodically at a preset time, date, or interval. A filtering dimension refers to a parameter used to refine the filtering of different session data. A session filtering condition may be a filtering requirement set when querying session data. For example, the filtering dimension is a session object dimension, and its corresponding filtering condition may be querying session data of which objects participate. The filtering dimension is a session state dimension, and its corresponding filtering condition may be querying session data under which session states. For example, the session state includes but is not limited to "active", "waiting", "completed", "timed out", or "abnormal", etc., such as querying currently active sessions. The filtering dimension is a session time dimension, and its corresponding filtering condition may be querying session data under which specific time, such as the start time, end time, or duration of a session, such as querying sessions occurring within a specific time period.
[0039] Specifically, a specific session query request can be generated by selecting a preset operation and combining the filtering conditions of one or more filtering dimensions; or a timed task can be set to periodically generate a specific session query request based on the filtering conditions corresponding to at least one filtering dimension. In this way, the system can search the database according to the received session query request and return the session data that meets the requirements. For example, see Figure 2 The first object identifier belongs to an object, and the client can input the screening condition and issue a query statement, that is, issue a session query request to the distributed database.
[0040] The technical solution provided in this embodiment supports users to set filtering conditions corresponding to multiple filtering dimensions to filter session data periodically or in real time, which can ensure the real-time and accuracy of query session data while meeting user query needs.
[0041] S120: When the first object identifier satisfies a preset query condition, based on the preset query condition satisfied by the first node and the session query request, obtain the session data to be used.
[0042] Among them, the preset query condition may refer to a condition for determining whether the object of the query session has the permission to query related session data, and which query permissions it has. The first node may be a processing node inside the database management system, used to process the session query request. The first node includes a first data storage node and / or a first computing node. The first data storage node is used to store session-related data, for example. These data may include session object information, session status, session time, etc. The session data to be used may refer to the session data queried according to the session query request. The first computing node is used to process the session query request, forward the session query request or the processed session query request, and for the session data queried according to the session query request.
[0043] In this embodiment, preset query conditions may be preconfigured. Optionally, the preset query condition may be that the object identifier exists in a preset identifier library. The preset identifier library includes object identifiers corresponding to objects with different query permissions, and query permission information associated with the object identifiers. When it is determined that there is an object identifier consistent with the first object identifier in the preset identifier library, it is considered that the first object identifier satisfies the preset query condition. Furthermore, the first node may be used to query the session query object for the to-be-used session data that satisfies its permissions from the first data storage node in combination with the satisfied preset query condition and the session query request.
[0044] It should be noted that the session data that can be queried by different query objects may be different. In order to ensure the accuracy of the session data query and the adaptability to the query object permissions, the first node can obtain the session data to be used based on the preset query conditions and the session query request: when the preset query conditions met are the management object query conditions, the session data to be used corresponding to the session query request is obtained based on the first node; when the preset query conditions met are the managed object query conditions, the session data to be used corresponding to the first object identifier is obtained based on the first node according to the session query request.
[0045] The management object query condition may be a condition for determining whether the object of the query session is the object of the management session, and what query permissions the object has. The managed object query condition may be a condition for determining whether the object of the query session is the object of the managed session, and what query permissions the object has. The query permission priority of the management session object is higher than the query permission priority of the managed session object, that is, the management session object can query the session data of the managed session object, and the managed session object cannot query the session data of the management session object.
[0046] In this embodiment, when the preset query condition satisfied is a management object query condition, the session query object is considered to be a management session object, and the first node can obtain the to-be-used session data corresponding to the session query request, that is, the obtained to-be-used session data is the session data that satisfies all the screening conditions in the session query request. When the preset query condition satisfied is a managed object query condition, the session query object is considered to be a managed session object, and the first node can obtain the to-be-used session data associated with the first object identifier according to the session query request. That is, the to-be-used session data at this time is the session data associated with the first object identifier that satisfies some of the screening conditions in the session query request.
[0047] The technical solution provided by the embodiment of the present invention can manage session query permissions according to the configured object identifier, allowing the management session object to view session data under specific permissions, while the managed session object can only view its own session data, thereby realizing refined query permission control over session data and ensuring the security and management convenience of session data.
[0048] It should be noted that in order to avoid providing session data of specific objects to session query objects, and to avoid management session objects initiating termination instructions for sessions between databases, preset database sessions and preset object sessions can be blocked by default, thereby improving the flexibility and security of session data management and ensuring the stability of database operation.
[0049] In this embodiment, before the first node obtains the session data to be used based on the preset query conditions satisfied and the session query request, the database to be queried can be determined based on the session query request, so as to determine the first node and the second node based on the database to be queried and the data storage type of the database to be queried.
[0050] The database to be queried refers to the database where the session data is stored. The data storage types include multi-shard type and single-shard type. The multi-shard type means that the data of the database is stored in multiple database instances. Each instance is responsible for storing a specific range or a specific type of data. The single-shard type means that the data in the database is stored in a single database instance, and all the data is stored in one instance.
[0051] Specifically, the session query request can be parsed to determine the database where the relevant session data in the query session query request is located, and the database is the database to be queried. Further, the database to be queried and the data storage type of the database to be queried can be combined to determine which node in the first node is responsible for querying the data and which node is responsible for storing the data, and which node in the second node is responsible for querying the data and which node is responsible for storing the data. This is to facilitate processing the session query request based on the first node and the second node, obtain the session data to be used, and achieve accuracy and efficiency in processing and responding to the session query request.
[0052] In this embodiment, based on the first node according to the preset query conditions and the session query request that are satisfied, the session data to be used is obtained, including: if the data storage type is a multi-shard type, based on the first computing node according to the preset query conditions and the session query request that are satisfied, the session data to be processed is obtained from each database to be queried, and the session data to be processed is integrated to obtain the session data to be used; if the data storage type is a single-shard type, the session query request is sent to the first data storage node based on the first computing node; based on the first data storage node according to the preset query conditions and the session query request that are satisfied, the session data to be used is obtained and fed back to the first computing node, so that the first computing node sends the received session data to be used to the client of the object to which the first object identifier belongs.
[0053] In practical applications, when the data storage type is a multi-shard type, the first computing node connected to the client to which the first object identifier belongs can obtain the corresponding session data to be processed from each database to be queried according to the preset query conditions and the session query request that are satisfied. It should be noted that when the first computing node queries data from different databases to be queried respectively, the session query request can be processed so that the processed session query request is compatible with the query specification of the corresponding database to be queried, thereby improving the query efficiency. Furthermore, the obtained session data to be processed can be integrated to form complete session data to be used. When the data storage type is a single-shard type, the first computing node connected to the client to which the first object identifier belongs sends the session query request to the first data storage node where the database to be queried is located. Further, when the first data storage node receives the session query request, it can obtain the session data to be used according to the preset query conditions and the session query request that are satisfied. The first data storage node feeds back the session data to be used to the first computing node, so that the first computing node sends the received session data to be used to the client of the object to which the first object identifier belongs. The technical solution provided by the embodiment of the present invention can improve query efficiency and response speed, while ensuring the accuracy of query session data, by determining which node to process session query requests to obtain session data to be used according to different data storage types.
[0054] S130: Send the session data to be used to the client of the object to which the first object identifier belongs, so that the client generates a session termination instruction and feeds back when determining that a preset termination condition is satisfied based on the session data to be used.
[0055] The preset termination condition may refer to a condition for determining whether to terminate a session. The client of the object to which the first object identifier belongs refers to a client that receives the session data to be used, for example, the client may be a user device, an application, or a server program. The session termination instruction may be a command or request for instructing to terminate a session.
[0056] In this embodiment, the session data to be used may be sent to the client of the object to which the first object identifier belongs, so that the client can process and analyze the session data to be used to determine whether a preset termination condition is met. Optionally, the preset termination condition may be when the idle time reaches a preset idle threshold, when the system resources reach an upper limit, when an error or abnormality occurs during the session, user operation, or other business logic. If it is determined based on the session data to be used that the preset termination condition is met, the client generates a session termination instruction and feeds it back to the system node, so that the system node executes a corresponding operation according to the session termination instruction to terminate the corresponding session, thereby improving the efficiency of session management.
[0057] For example, see Figure 2 After the client sends a session query request, the first node in the distributed database returns the session data to be used to the client. The client can aggregate and display the session data to be used and determine whether to send a session termination instruction. The timing relationship can be seen in Figure 3 .
[0058] S140: When the preset query condition satisfied is a management object query condition and a session termination instruction sent by the client is received, releasing a target session in the session termination instruction based on the second node according to the session termination instruction.
[0059] Among them, the second node includes a second data storage node and / or a second computing node. The target session is a session between the client corresponding to the queried object and the second data storage node. The second computing node can be a node connected to the client of the object to which the first object identifier belongs. The second data storage node can be a node connected to the client of the queried object. It should be noted that the concepts of "first node" and "second node" are relative, not absolute. For example, for a certain session management, node A among many nodes is the first node, and node B is the second node; but for the next session management, node B may be the first node and node A may be the second node, or both node A and node B may be the first node, or both may be the second node.
[0060] In this embodiment, when the preset query condition met is a management object query condition and a session termination instruction sent by the client is received, the second node may perform an operation of releasing the target session in the session termination instruction based on the session termination instruction. For example, the operation of releasing the target session may be clearing the session state (such as clearing all internal states and caches related to the session), releasing resources (releasing resources related to the session, such as memory, file handles, database connections, etc.), updating database records (marking the session as terminated or deleting the session record in the database), etc. Furthermore, the second node may also send a prompt message of successful session release to the client when releasing the target session in the session termination instruction, indicating that the session has been successfully terminated, so that the session query object is informed of the session termination. For example, see further. Figure 2 ,After the client sends the session termination instruction, the node terminates the target ,session and feeds back the prompt information to the client.
[0061] In this embodiment, releasing the target session in the session termination instruction based on the second node according to the session termination instruction includes: if the data storage type is a single-shard type, releasing the target session in the session termination instruction based on the second computing node; if the data storage type is a multi-shard type, sending the session termination instruction to the second data storage node corresponding to the database to be queried based on the second computing node, so that the second data storage node releases the target session in the session termination instruction according to the session termination instruction.
[0062] Specifically, when the data storage type is a single-shard type, the second computing node connected to the client to which the first object identifier belongs can be directly based on the session termination instruction to execute the operation of releasing the target session in the session termination instruction. If the data storage type is a multi-shard type, the session termination instruction can be sent to the second data storage node corresponding to the database to be queried based on the second computing node, so that each second data storage node executes the operation of releasing the target session in the session termination instruction according to the session termination instruction.
[0063] The technical solution provided in the embodiment of the present invention can ensure that the session can be correctly and safely terminated according to the client's request by determining which node to release the target session in the session termination instruction according to different data storage types. At the same time, it also improves data processing efficiency and response speed, and improves the flexibility and convenience of the system in processing session management tasks under different storage architectures.
[0064] The technical solution provided by the embodiment of the present disclosure determines the first object identifier in the session query request when receiving the session query request; when the first object identifier satisfies the preset query condition, based on the first node, obtains the session data to be used according to the preset query condition and the session query request; sends the session data to be used to the client of the object to which the first object identifier belongs, so that when the client determines that the preset termination condition is satisfied based on the session data to be used, it generates a session termination instruction and feedbacks; when the preset query condition satisfied is the management object query condition and the session termination instruction sent by the client is received, based on the second node, the target session in the session termination instruction is released according to the session termination instruction, which solves the problem that the existing technology only supports session management based on its own data, resulting in the inability to meet the needs of different users to manage session data and the poor session management effect. Different nodes can be used to query the corresponding session data for the session query objects that meet different preset query conditions, meet the session management needs, ensure the security of the session data, and improve the query efficiency. At the same time, it supports specific objects to manage target sessions on demand, and improves the flexibility and convenience of session management.
[0065] Embodiment 2
[0066] Figure 4 Schematic diagram of the structure of a session management device provided according to the second embodiment of the present invention. Figure 4 As shown, the device includes: a first object identification determination module 210 , a to-be-used session data acquisition module 220 , a data sending module 230 and a session termination module 240 .
[0067] The first object identifier determination module 210 is used to determine the first object identifier in the session query request when receiving the session query request; the first object identifier is the object identifier of the session query object; the session data acquisition module 220 to be used is used to acquire the session data to be used based on the first node according to the preset query condition satisfied and the session query request when the first object identifier satisfies the preset query condition; wherein the first node includes a first data storage node and / or a first computing node; the data sending module 230 is used to send the session data to be used to the client of the object to which the first object identifier belongs, so that the client generates a session termination instruction and feeds back when determining that the preset termination condition is satisfied based on the session data to be used; the session termination module 240 is used to release the target session in the session termination instruction based on the second node according to the session termination instruction when the preset query condition satisfied is the management object query condition and the session termination instruction sent by the client is received; wherein the second node includes a second data storage node and / or a second computing node; the target session is a session between the client corresponding to the queried object and the second data storage node.
[0068] The technical solution of this embodiment is as follows: when receiving a session query request, determining the first object identifier in the session query request; when the first object identifier satisfies the preset query condition, obtaining the session data to be used based on the first node according to the preset query condition and the session query request; sending the session data to be used to the client of the object to which the first object identifier belongs, so that when the client determines that the preset termination condition is satisfied based on the session data to be used, it generates a session termination instruction and feedbacks; when the preset query condition satisfied is the management object query condition and the session termination instruction sent by the client is received, releasing the target session in the session termination instruction based on the second node according to the session termination instruction, solves the problem that the prior art only supports session management based on its own data, resulting in failure to meet the needs of different users to manage session data, and poor session management effect, and can query the corresponding session data for the session query objects that meet different preset query conditions through different nodes, meet the session management needs, ensure the security of session data, and improve query efficiency. At the same time, it supports specific objects to manage target sessions on demand, improving the flexibility and convenience of session management.
[0069] Based on the above device, optionally, the session query request is generated based on preset operations and / or scheduled tasks according to filtering conditions corresponding to at least one filtering dimension; the filtering dimensions include at least session object dimension, session state dimension and session time dimension.
[0070] Based on the above device, optionally, the session data acquisition module 220 to be used includes:
[0071] a first node, configured to obtain, based on the first node, to-be-used session data corresponding to the session query request when the preset query condition satisfied is a management object query condition;
[0072] The first node is configured to obtain the to-be-used session data corresponding to the first object identifier based on the first node according to the session query request when the preset query condition satisfied is a managed object query condition.
[0073] On the basis of the above device, optionally, the device further includes:
[0074] The node determination unit is used to determine the database to be queried based on the session query request, and to determine the first node and the second node based on the database to be queried and the data storage type of the database to be queried.
[0075] Based on the above device, optionally, the session data acquisition module 220 to be used includes:
[0076] a first computing node, configured to, if the data storage type is a multi-shard type, obtain the session data to be processed from each of the databases to be queried based on the preset query condition satisfied by the first computing node and the session query request, and integrate the session data to be processed to obtain the session data to be used;
[0077] a first computing node, configured to send the session query request to a first data storage node corresponding to the database to be queried based on the first computing node if the data storage type is a single-shard type;
[0078] The first data storage node is used to obtain the session data to be used and feed it back to the first computing node based on the preset query condition satisfied by the first data storage node and the session query request, so that the first computing node sends the received session data to be used to the client of the object to which the first object identifier belongs.
[0079] Based on the above device, optionally, the session termination module 240 includes:
[0080] a second computing node, configured to release a target session in the session termination instruction based on the second computing node according to the session termination instruction if the data storage type is a single-shard type;
[0081] A second computing node is used for sending the session termination instruction to a second data storage node corresponding to the database to be queried based on the second computing node if the data storage type is a multi-shard type, so that the second data storage node releases the target session in the session termination instruction according to the session termination instruction.
[0082] The session management device provided in the embodiment of the present invention can execute the session management method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0083] Embodiment 3
[0084] Figure 5 Schematic diagram of the structure of an electronic device that implements the session management method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0085] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0086] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0087] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the session management method.
[0088] In some embodiments, the session management method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the session management method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the session management method in any other appropriate manner (e.g., by means of firmware).
[0089] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0090] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0091] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 foregoing.
[0092] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0093] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0094] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0095] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the session management method provided by any embodiment of the present invention.
[0096] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0097] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0098] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A session management method, characterized in that: include: Upon receiving the session query request, determining a first object identifier in the session query request; The first object identifier is an object identifier of a session query object; In the case where the first object identifier satisfies a preset query condition, based on the first node according to the preset query condition satisfied and the session query request, obtaining the session data to be used; wherein the first node includes a first data storage node and / or a first computing node; Sending the session data to be used to a client of the object to which the first object identifier belongs, so that the client generates a session termination instruction and feeds back when determining that a preset termination condition is satisfied based on the session data to be used; When the preset query condition satisfied is a management object query condition and the session termination instruction sent by the client is received, releasing the target session in the session termination instruction based on the second node according to the session termination instruction; The second node includes a second data storage node and / or a second computing node; the target session is a session between a client corresponding to the queried object and the second data storage node.
2. The method according to claim 1, characterized in that The session query request is generated based on a preset operation and / or a scheduled task according to a screening condition corresponding to at least one screening dimension; the screening dimension at least includes a session object dimension, a session state dimension and a session time dimension.
3. The method according to claim 1, characterized in that The acquiring the to-be-used session data based on the preset query condition satisfied by the first node and the session query request includes: In a case where the preset query condition satisfied is a management object query condition, acquiring, based on the first node, the to-be-used session data corresponding to the session query request; In a case where the preset query condition satisfied is a managed object query condition, based on the first node and according to the session query request, the to-be-used session data corresponding to the first object identifier is acquired.
4. The method according to claim 1 or 3, characterized in that: Before acquiring the to-be-used session data based on the preset query condition satisfied by the first node and the session query request, the method further includes: A database to be queried is determined based on the session query request, and a first node and a second node are determined based on the database to be queried and a data storage type of the database to be queried.
5. The method according to claim 4, characterized in that The acquiring the to-be-used session data based on the preset query condition satisfied by the first node and the session query request includes: If the data storage type is a multi-shard type, based on the first computing node, according to the preset query condition and the session query request that are satisfied, the session data to be processed is obtained from each of the databases to be queried, and the session data to be processed is integrated to obtain the session data to be used; If the data storage type is a single-shard type, sending the session query request to a first data storage node corresponding to the database to be queried based on the first computing node; Based on the preset query condition and the session query request that are satisfied, the first data storage node obtains the session data to be used and feeds it back to the first computing node, so that the first computing node sends the received session data to be used to the client of the object to which the first object identifier belongs.
6. The method according to claim 4, characterized in that The releasing the target session in the session termination instruction based on the second node according to the session termination instruction includes: If the data storage type is a single-shard type, releasing the target session in the session termination instruction based on the second computing node according to the session termination instruction; If the data storage type is a multi-shard type, the session termination instruction is sent to a second data storage node corresponding to the database to be queried based on the second computing node, so that the second data storage node releases the target session in the session termination instruction according to the session termination instruction.
7. A session management device, characterized in that: include: A first object identifier determining module, configured to determine a first object identifier in a session query request upon receiving the session query request; The first object identifier is an object identifier of a session query object; a module for acquiring session data to be used, configured to acquire the session data to be used based on the first node according to the preset query condition satisfied and the session query request when the first object identifier satisfies the preset query condition; wherein the first node includes a first data storage node and / or a first computing node; A data sending module, configured to send the session data to be used to a client of the object to which the first object identifier belongs, so that the client generates a session termination instruction and feeds back when determining that a preset termination condition is satisfied based on the session data to be used; A session termination module, configured to release a target session in the session termination instruction based on the second node according to the session termination instruction when the preset query condition satisfied is a management object query condition and the session termination instruction sent by the client is received; The second node includes a second data storage node and / or a second computing node; the target session is a session between a client corresponding to the queried object and the second data storage node.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory in communication with the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the session management method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the session management method according to any one of claims 1 to 6 when executed.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the session management method according to any one of claims 1 to 6.