CN115858158A - Method, device and equipment for processing session message and computer readable storage medium - Google Patents

Method, device and equipment for processing session message and computer readable storage medium Download PDF

Info

Publication number
CN115858158A
CN115858158A CN202211523412.4A CN202211523412A CN115858158A CN 115858158 A CN115858158 A CN 115858158A CN 202211523412 A CN202211523412 A CN 202211523412A CN 115858158 A CN115858158 A CN 115858158A
Authority
CN
China
Prior art keywords
session message
session
bucket
sub
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211523412.4A
Other languages
Chinese (zh)
Inventor
李良斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing SoundAI Technology Co Ltd
Original Assignee
Beijing SoundAI Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing SoundAI Technology Co Ltd filed Critical Beijing SoundAI Technology Co Ltd
Priority to CN202211523412.4A priority Critical patent/CN115858158A/en
Publication of CN115858158A publication Critical patent/CN115858158A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The present disclosure relates to a method, an apparatus, a device and a computer readable storage medium for processing a session message, wherein the method comprises: acquiring at least one session message of the sub-bucket; for each session message in the at least one session message, judging the session message in real time, and judging whether the session message is disconnected or overdue; and if the session message is disconnected or overdue, releasing the memory resource occupied by the session message in the sub-bucket. According to the method and the device, the session information is judged in real time, and if the session information is disconnected or overdue, the memory resources occupied by the session information are released, so that the memory resources are reasonably distributed, the resource waste is reduced, and the user experience is improved.

Description

Method, device and equipment for processing session message and computer readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for processing a session message.
Background
A distributed application program coordination service software (ZooKeeper) adopts a bucket dividing strategy for session management of temporary nodes, the expiration time of each bucket is absolute, all sessions in the buckets need to generate a valid heartbeat before the expiration time of the bucket arrives, so that the sessions move to the next bucket, if the next bucket is not entered before the time arrives, the ZooKeeper processes all sessions in the bucket according to the expired sessions when the expiration time arrives, and deletes the temporary nodes corresponding to the buckets.
However, the sub-bucket can only judge whether the session is expired when the expiration time is reached, so that the session is expired and not responded in time, the service is delayed to respond, and the resource waste is caused.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, an apparatus, a device, and a computer-readable storage medium for processing a session message, so as to reasonably allocate memory resources, reduce resource waste, and improve user experience.
In a first aspect, an embodiment of the present disclosure provides a method for processing a session message, including:
acquiring at least one session message of the sub-bucket;
for each session message in the at least one session message, judging the session message in real time, and judging whether the session message is disconnected or overdue;
and if the session message is disconnected or overdue, releasing the memory resource occupied by the session message in the sub-bucket.
In some embodiments, before the determining, in real time, whether the session message is disconnected or expired, the method further includes:
and awakening the judgment thread, and turning on a judgment switch of the judgment thread.
In some embodiments, the releasing the memory resources occupied by the session messages in the buckets includes:
moving the conversation message from the sub-bucket to a target sub-bucket, the target sub-bucket being a next sub-bucket of the 5 sub-buckets;
deleting the session message and the temporary node corresponding to the session message, and releasing the memory resource occupied by the session message in the sub-bucket.
In some embodiments, the method further comprises:
and if the session message is not disconnected, continuously acquiring the session message.
0 in some embodiments, memory resources occupied by the session messages in the sub-buckets are released
Thereafter, the method further comprises:
determining whether other session messages exist in the sub-bucket, wherein the other session messages are session messages which are not judged except the at least one session message;
and closing the judgment of the judgment thread according to the fact that no other session messages exist in the sub-bucket, and opening 5.
In some embodiments, after turning off the judgment switch of the judgment thread, the method further comprises:
and releasing the memory resource occupied by the judgment thread, and controlling the judgment thread to enter a waiting state.
In some embodiments, the obtaining at least one session message for a bucket comprises:
acquiring a server address;
creating the sub-buckets according to the server addresses;
obtaining at least one session message of the sub-bucket.
In a second aspect, an embodiment of the present disclosure provides a processing apparatus for a session message, including: 5, an obtaining module, configured to obtain at least one session message of the sub-bucket;
the judging module is used for judging the session message in real time aiming at each session message in the at least one session message and judging whether the session message is disconnected or overdue;
and the release module is used for releasing the memory resources occupied by the session messages in the sub-buckets if the session messages are disconnected or expired.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method of the first aspect.
In a fifth aspect, the disclosed embodiments also provide a computer program product comprising a computer program or instructions, which when executed by a processor, implement the method of the first aspect.
The conversation message processing method, the conversation message processing device, the conversation message processing equipment and the computer-readable storage medium are used for acquiring at least one conversation message of a sub-bucket; aiming at each conversation message in at least one conversation message, carrying out real-time judgment on the conversation message, judging whether the conversation message is disconnected or overdue, and judging in real time to ensure that each conversation message can be judged in time; if the session message is disconnected or overdue, the memory resource occupied by the session message in the sub-bucket is released, the memory resource occupied by the session message is released in real time when the session is disconnected or overdue, the problem of overload caused by unified judgment of sessions in all sub-buckets when the expiration time of the sub-bucket is reached is avoided, the memory resource is reasonably distributed, the resource waste is reduced, the throughput of the terminal is improved under the conditions that the memory resource needs to be contended and the time consumption of the session is low, and the user experience is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a flowchart of a processing method of a session message according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of an application scenario provided by the embodiment of the present disclosure;
fig. 3 is a flowchart of a processing method of a session message according to another embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a processing apparatus for a session message according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
A distributed application program coordination service software (ZooKeeper) adopts a bucket dividing strategy for session management of temporary nodes, namely time is divided into continuous time periods (each time period corresponds to one ZooKeeper bucket) according to expiration time, when a session is initially established, the session is placed into a bucket where the current time period is located, the expiration time of each bucket is absolute, all sessions in the buckets need to generate an effective heartbeat before the expiration time of the bucket arrives, so that the sessions move to the next bucket, and if the sessions do not enter the next bucket before the time arrives, the ZooKeeper can process all sessions in the bucket according to the expired sessions when the expiration time arrives, and the temporary nodes corresponding to the buckets are deleted.
However, the sub-bucket can only judge whether the session is expired when the expiration time is reached, so that the session is not responded in time due to expiration, service delay response is caused, and resource waste is caused. For example, if a session needs 300ms for processing itself, but the expiration time of the bucket is 5s, then when using Zookeeper as the locking medium, the longest waiting time for the next session to successfully acquire the lock is 5s, and similar to such a scenario that the request amount is large and the processing time of the session itself is short, the bucket-dividing policy has limitations. To address this problem, embodiments of the present disclosure provide a method for processing a session message, and the method is described below with reference to specific embodiments.
Fig. 1 is a flowchart of a processing method of a session message according to an embodiment of the present disclosure. The method can be executed by a processing device of the session message, which can be implemented in a software and/or hardware manner, and the processing device of the session message can be configured in an electronic device, such as a server or a terminal, where the terminal specifically includes a mobile phone, a computer, or a tablet computer, etc. In addition, the method may be applied to the application scenario shown in fig. 2, which includes the server 21 and the terminal 22. It can be understood that the processing method of the session message provided by the embodiment of the present disclosure may also be applied in other scenarios.
The processing method of the session message shown in fig. 1 is described below with reference to the application scenario shown in fig. 2, and for example, the terminal 22 in fig. 2 may execute the method. The method comprises the following specific steps:
s101, acquiring at least one session message of the sub-bucket.
ZooKeeper is a distributed, open-source distributed application coordination service, is an open-source implementation of Google (Google) coarse-grained lock service (Chubby), and is an important component of a distributed system infrastructure (Hadoop) and a distributed storage system (Hbase). It is a software that provides a consistent service for distributed applications, and the functions provided include: configuration maintenance, domain name service, distributed synchronization, group service, etc. The ZooKeeper aims to package complex and error-prone key services and provide a simple and easy-to-use interface and a system with high performance and stable functions for users.
The conversation is mainly to be handed over or approved within a specified period, and a feedback opinion or behavior is certain.
In some embodiments, as shown in fig. 2, after the terminal 22 initializes, at least one session message of the ZooKeeper bucket is acquired by the server 21. The initialization of the terminal 22 specifically includes the following steps: the method comprises the steps that a terminal 22 initializes a ZooKeeper object, during initialization, a monitoring manager is created, a session default monitoring object is set, the default detection object is stored in the monitoring manager, a ZooKeeper server address list manager is constructed, the address of a server 21 is convenient to store, a terminal 22 network connector is created, the terminal 22 network connector is used for managing network interaction between the terminal 22 and the server 21, a request sending queue of the terminal 22 and a corresponding waiting queue of the server 21 are initialized, the terminal 22 creates 3 network threads, one is a management thread and is used for managing all network interfaces between the terminal 22 and the server 21, the other is a processing thread and is used for processing events of the terminal 22, the other is a judging thread and is used for judging whether sessions of the terminal 22 are disconnected or expired, meanwhile, the terminal 22 distributes a socket word of the network connector to the management thread to serve as a processor of a bottom network interface, and a pending event queue in the processing thread is initialized and is used for storing all events waiting to be processed by the terminal 22.
S102, aiming at each conversation message in the at least one conversation message, judging the conversation message in real time, and judging whether the conversation message is disconnected or overdue.
For each session message in the at least one session message in the sub-bucket, the terminal 22 determines the session message in real time, and determines whether the session message is disconnected or expired. For example, the current time is 15:00, after the session message of the sub-bucket is obtained at the current time, judging the session message at the current time, and judging whether the session message is disconnected or overdue. Specifically, the session disconnection is a thing that a session is ended and the processing of the session itself is completed; when the session expires, i.e. after a certain time, the system or software automatically considers that the processing is abandoned, i.e. after the user logs in the website, the user session data on the server 21 is destroyed because the user has not interacted with the server 21 for a long time. It is understood that the current time is 15:00 is only used as an example, the current time may be other times, and this embodiment is not limited in particular.
Optionally, the basic attributes of the session include: the identification number of the session, the timeout time of one session, the time point when the next session is timed out, and whether the current session is already in a closed state.
Specifically, the Session Identity document (Session id) is used to uniquely identify a Session, and each time the client establishes a connection, the Zookeeper server assigns a globally unique Session id to the client.
Specifically, the TimeOut time (TimeOut) of a session, when the client constructs a Zookeeper instance, configures a TimeOut parameter for specifying the TimeOut time of the session. The Zookeeper server calculates and determines the time of TimeOut according to the TimeOut parameter sent by the connected client
Specifically, the timeout point (TickTime) of the next session is convenient for the Zookeeper to manage the session by the so-called bucket-dividing policy, and meanwhile, efficient one-time examination and cleaning of the session can be realized. TickTime is a 13-bit Long type value that is typically close to Timeout, but not exactly equal
Specifically, whether the current session is already in a closed state (isclosing). If the server detects that the timeout time for the current session has expired, the iscloseng attribute is marked as closed so that even if there are more requested accesses for this session, they will not be processed.
S103, if the session message is disconnected or overdue, releasing the memory resource occupied by the session message in the sub-bucket.
If the session message is disconnected or expired, the terminal 22 releases the memory resource occupied by the session message in the bucket.
Optionally, if the terminal 22 determines that the session message is not disconnected, the terminal continues to acquire the session message and maintains the integrity of the session message.
The embodiment of the disclosure obtains at least one session message of the sub-bucket; aiming at each session message in at least one session message, carrying out real-time judgment on the session message, judging whether the session message is disconnected or overdue, and judging in real time to ensure that each session message can be judged in time; if the session message is disconnected or overdue, the memory resources occupied by the session message in the sub-buckets are released, the memory resources occupied by the session message are released in real time when the session is disconnected or overdue, the problem of overlarge load caused by unified judgment of sessions in all sub-buckets when the expiration time of the sub-buckets is reached is avoided, the memory resources are reasonably distributed, the resource waste is reduced, the throughput of the terminal is improved under the conditions that the memory resources need to be contended and the time consumption of the session is low, and the user experience is improved.
Fig. 3 is a flowchart of a processing method of a session message according to another embodiment of the present disclosure, as shown in fig. 3, the method includes the following steps:
s301, at least one session message of the sub-bucket is obtained.
Specifically, the implementation process and principle of S301 and S101 are the same, and are not described herein again.
S302, waking up the judgment thread, and turning on a judgment switch of the judgment thread.
When the terminal 22 acquires the session message, it automatically wakes up the judgment thread, and controls the wake-up judgment thread to turn on the judgment switch.
S303, aiming at each conversation message in the at least one conversation message, judging the conversation message in real time, and judging whether the conversation message is disconnected or overdue.
Specifically, the implementation process and principle of S303 and S102 are the same, and are not described herein again.
S304, if the session message is disconnected or overdue, the session message is moved from the sub-bucket to a target sub-bucket, and the target sub-bucket is the next sub-bucket of the sub-buckets.
If the session message is disconnected, the session message generates a valid heartbeat and the terminal 22 moves the session message from the bucket to the next bucket of the bucket.
If the session message is expired, the session message is processed according to the expired session, namely, the session message is abandoned to be claimed again, and the next session message is entered. In some embodiments, the processing of expired sessions includes skipping next session messages, customizing an expiration policy. The expired session is processed to jump to the next session message in this embodiment, and it is understood that in other embodiments, the expired session may be processed by other policies, and this embodiment is not limited.
S305, deleting the session message and the temporary node corresponding to the session message, and releasing the memory resource occupied by the session message in the sub-bucket.
Deleting the session message and the temporary node corresponding to the session message in the sub-bucket, and releasing the memory resource occupied by the session message in the sub-bucket.
The embodiment of the disclosure adds the judgment process of the judgment thread through specific description, avoids the problem of overload caused by unified judgment of sessions in all sub-buckets when the sub-bucket expiration time is reached, reasonably allocates memory resources, and reduces resource waste.
In some embodiments, after releasing the memory resources occupied by the session messages in the sub-bucket, the method further comprises: determining whether other session messages exist in the bucket, wherein the other session messages are session messages which are not judged except the at least one session message; and closing a judgment switch of the judgment thread based on no other session messages in the sub-bucket.
The terminal 22 determines whether there are other session messages that are not determined in the bucket, besides the at least one session message; if the sub-bucket has other session messages needing to be judged besides the at least one session message, judging the other session messages, judging whether the other session messages are disconnected or expired, and then executing the steps after judging the other session messages, wherein the steps are the same as the steps after judging the at least one session message. The terminal 22 determines whether there are other session messages that are not determined in the bucket, besides the at least one session message; and if the session messages except the at least one session message do not have other session messages needing to be judged in the bucket, closing a judgment switch of the judgment thread.
Optionally, after the judgment switch of the judgment thread is turned off, the method further includes: and releasing the memory resources occupied by the judgment thread, and controlling the judgment thread to enter a waiting state.
After the judgment switch of the judgment thread is closed, the terminal 22 releases the memory resource occupied by the judgment thread, controls the judgment thread to enter a waiting state, and waits for acquiring a new session message.
According to the embodiment of the disclosure, how to close the judgment thread is described, and after the judgment thread is closed, the memory resource occupied by the judgment thread is released, the judgment thread is controlled to enter the waiting state, the memory resource of the judgment thread with the judgment performance is also released, and the waste of the resource is further reduced.
In some embodiments, the obtaining at least one session message for a bucket comprises: acquiring a server address; creating the sub-buckets according to the server addresses; obtaining at least one session message of the sub-bucket.
After the initialization of the terminal 22 is completed, a server address of the server 21 is obtained, the terminal 22 establishes a Transmission Control Protocol (TPC) connection with the server 21 through the server address, constructs a sub-bucket according to the TPC connection, generates an event, and obtains at least one session message of the sub-bucket.
The disclosed embodiments pass
Fig. 4 is a schematic structural diagram of a processing apparatus for a session message according to an embodiment of the present disclosure. The processing means of the session message may be the terminal as described in the above embodiments, or the processing means of the session message may be a component or assembly in the terminal. The processing apparatus for a session message provided in the embodiment of the present disclosure may execute the processing flow provided in the embodiment of the processing method for a session message, as shown in fig. 6, the processing apparatus 40 for a session message includes: an acquisition module 41, a judgment module 42 and a release module 43; the obtaining module 41 is configured to obtain at least one session message of each bucket; a determining module 42, configured to determine, in real time, each of the at least one session message, whether the session message is disconnected or expired; a releasing module 43, configured to release the memory resource occupied by the session message in the sub-bucket if the session message is disconnected or expired.
Optionally, the processing device 40 for the session message further includes: and the awakening module 44 is used for awakening the judgment thread and turning on a judgment switch of the judgment thread.
Optionally, the releasing module 43 is further configured to move the session message from the sub-bucket to a target sub-bucket, where the target sub-bucket is a next sub-bucket of the sub-buckets; deleting the session message and the temporary node corresponding to the session message, and releasing the memory resource occupied by the session message in the sub-bucket.
Optionally, the obtaining module 41 is further configured to continue to obtain the session message if the session message is not disconnected.
Optionally, the processing apparatus 40 for session message further includes: a determining module 45, configured to determine whether there are other session messages in the sub-bucket, where the other session messages are session messages that are not determined except the at least one session message; and closing a judgment switch of the judgment thread based on no other session messages in the sub-bucket.
Optionally, the releasing module 43 is further configured to release the memory resource occupied by the determining thread, and control the determining thread to enter a waiting state.
Optionally, the obtaining module 41 is further configured to obtain a server address; creating the sub-buckets according to the server addresses; at least one session message of the bucket is obtained.
The processing apparatus for session messages in the embodiment shown in fig. 4 can be used to execute the technical solution of the above method embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device may be a terminal as described in the above embodiments. As shown in fig. 7, the electronic device 70 may execute the processing flow provided in the embodiment of the processing method for a session message, where: memory 71, processor 72, computer programs and communication interface 73; wherein a computer program is stored in the memory 71 and is configured to execute the processing method of the conversation message as described above by the processor 72.
In addition, the embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the processing method of the session message described in the above embodiment.
Furthermore, the embodiments of the present disclosure also provide a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the method for processing the conversation message as described above is implemented.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with 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"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
acquiring at least one session message of the sub-bucket;
aiming at each conversation message in the at least one conversation message, judging the conversation message in real time, and judging whether the conversation message is disconnected or overdue;
and if the session message is disconnected or overdue, releasing the memory resource occupied by the session message in the sub-bucket.
In addition, the electronic device may also perform other steps in the processing method of the conversation message as described above.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It is noted that, in this document, relational terms such as "first" and "second," and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein. .

Claims (10)

1. A method for processing a session message, the method comprising:
acquiring at least one session message of the sub-bucket;
for each session message in the at least one session message, judging the session message in real time, and judging whether the session message is disconnected or overdue;
and if the session message is disconnected or overdue, releasing the memory resource occupied by the session message in the sub-bucket.
2. The method of claim 1, wherein before the determining the session message in real time and determining whether the session message is disconnected or expired, the method further comprises:
and awakening the judgment thread, and turning on a judgment switch of the judgment thread.
3. The method of claim 1, wherein the releasing memory resources occupied by the session messages in the buckets comprises:
moving the session message from the sub-bucket to a target sub-bucket, the target sub-bucket being a next sub-bucket of the sub-buckets;
deleting the session message and the temporary node corresponding to the session message, and releasing the memory resource occupied by the session message in the sub-bucket.
4. The method of claim 1, further comprising:
and if the session message is not disconnected, continuously acquiring the session message.
5. The method of claim 1, wherein after releasing memory resources occupied by the session messages in the bucket, the method further comprises:
determining whether other session messages exist in the sub-bucket, wherein the other session messages are session messages which are not judged except the at least one session message;
and closing a judgment switch of the judgment thread based on no other session messages in the sub-bucket.
6. The method of claim 5, wherein after turning off a decision switch of the decision thread, the method further comprises:
and releasing the memory resource occupied by the judgment thread, and controlling the judgment thread to enter a waiting state.
7. The method of claim 1, wherein obtaining at least one session message for a bucket comprises:
acquiring a server address;
creating the sub-buckets according to the server addresses;
obtaining at least one session message of the sub-bucket.
8. An apparatus for processing a session message, the apparatus comprising:
the acquisition module is used for acquiring at least one session message of the sub-bucket;
the judging module is used for judging the session message in real time aiming at each session message in the at least one session message and judging whether the session message is disconnected or overdue;
and the release module is used for releasing the memory resources occupied by the session messages in the sub-buckets if the session messages are disconnected or expired.
9. An electronic device, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202211523412.4A 2022-11-30 2022-11-30 Method, device and equipment for processing session message and computer readable storage medium Pending CN115858158A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211523412.4A CN115858158A (en) 2022-11-30 2022-11-30 Method, device and equipment for processing session message and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211523412.4A CN115858158A (en) 2022-11-30 2022-11-30 Method, device and equipment for processing session message and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115858158A true CN115858158A (en) 2023-03-28

Family

ID=85668491

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211523412.4A Pending CN115858158A (en) 2022-11-30 2022-11-30 Method, device and equipment for processing session message and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115858158A (en)

Similar Documents

Publication Publication Date Title
EP3709664B1 (en) Stream pushing method, system and server
US20170222889A1 (en) Method and Device for Providing Network Service, Evaluating Policy Rule and Selecting Service Assembly
CN104219316A (en) Method and device for processing call request in distributed system
CN110633442A (en) Pushing method and device and electronic equipment
US11102319B2 (en) Method, system and server for stream-pushing
WO2021170033A1 (en) Network configuration method and apparatus
CN111131188A (en) Communication connection method, server, client, and storage medium
US11700189B2 (en) Method for performing task processing on common service entity, common service entity, apparatus and medium for task processing
CN113517985A (en) File data processing method and device, electronic equipment and computer readable medium
US20140201376A1 (en) Method and system for the handling of redundant long poll
CN114675960A (en) Computing resource allocation method and device and nonvolatile storage medium
CN112752352B (en) Method and equipment for determining I-SMF (intermediate session management function)
CN115858158A (en) Method, device and equipment for processing session message and computer readable storage medium
CN111781848A (en) Server connection method, device and system based on intelligent household equipment
WO2016197783A2 (en) Method and apparatus for controlling message transmission
US9705742B2 (en) Method and apparatus for enabling M2M service and H2H service to coexist
CN116232884A (en) Proxy instance management method, device, electronic equipment and storage medium
CN114143903A (en) Method, device, equipment and medium for configuring network slice PDU session
CN114051030A (en) Communication method, communication device, smart community system and storage medium
CA3168264A1 (en) Selection of service-providing network functions in a 3gpp communication network
JP2022547726A (en) Event notification method, system, server device, computer storage medium
CN104023059A (en) Service agent method of relieving response of service equipment
US20190312929A1 (en) Information synchronization method and device
Zhai et al. An improved DDS publish/subscribe automatic discovery algorithm
US20230354107A1 (en) Adjustment of network handover processing based on service time requirements

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination