CN115238131A - Method and device for searching signaling timeout session based on combination of mapping table and linked list - Google Patents

Method and device for searching signaling timeout session based on combination of mapping table and linked list Download PDF

Info

Publication number
CN115238131A
CN115238131A CN202210574470.3A CN202210574470A CN115238131A CN 115238131 A CN115238131 A CN 115238131A CN 202210574470 A CN202210574470 A CN 202210574470A CN 115238131 A CN115238131 A CN 115238131A
Authority
CN
China
Prior art keywords
value
mapping table
real
linked list
iterator
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
CN202210574470.3A
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.)
Eastone Century Technology Co ltd
Original Assignee
Eastone Century 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 Eastone Century Technology Co ltd filed Critical Eastone Century Technology Co ltd
Priority to CN202210574470.3A priority Critical patent/CN115238131A/en
Publication of CN115238131A publication Critical patent/CN115238131A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a method and a device for searching signaling timeout session based on combination of a mapping table and a linked list, wherein the method comprises the following steps: firstly, constructing a real-value type structure; then, combining the mapping table and the linked list according to the real-value type structure to obtain a combined container so as to realize linked list operation in the mapping table; then, the combined container is used as a session container, when signaling data are input, key values are formed according to a session association algorithm and then are inserted into the combined container, and operation information of real value records is updated; when the check cycle time is reached, a timeout processing flow is executed. The invention can utilize the linked list access to carry out accurate access processing on the overtime session in the overtime processing process, and avoids the operation that the traditional mapping table traversal and search and the like have great influence on the system performance, thereby reducing the influence on the service function, ensuring the normal use of the service and the processing performance of the service thread, and being widely applied to the technical field of computers and communication.

Description

Method and device for searching signaling timeout session based on combination of mapping table and linked list
Technical Field
The invention relates to the technical field of computers and communication, in particular to a method and a device for searching signaling timeout session based on combination of a mapping table and a linked list.
Background
The signaling decoding analysis system is one of the main means for analyzing the network data. The realization of signaling session generation is one of the main functions of the signaling decoding analysis system.
In a signaling decoding analysis system, functional requirements such as a plurality of mapping tables are involved, such as a network protocol session mapping table, a user information relation mapping table and the like. The mapping table is used for storing key-value pairs, and corresponding real values can be quickly found through the key values. It is conventional practice to implement key-value relationship mapping using map data structures. The system requires that while ensuring normal processing of continuously accessed signaling messages, the system needs to regularly clear the expired data of the mapping table, thereby ensuring the robustness of the processing system. With the increase of network scale, the session container timeout processing mechanism in the signaling decoding analysis system has an increasing impact on performance, so that it is necessary to implement a set of efficient session container timeout retrieval method.
The conventional implementation method determines whether each element of the mapping table reaches a timeout threshold by traversing the element. However, typically a mapping table may contain a large number of data elements, with only a few elements that need to be processed each time due to a timeout. The association container is realized based on various different algorithms, and access according to the overtime sequence cannot be guaranteed in the access process of the iterator, so that the traditional realization method needs to traverse all elements to ensure no omission, overtime retrieval performance is greatly reduced, and congestion can be caused in processing data flow in a big data scene.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for retrieving a signaling timeout session based on a combination of a mapping table and a linked list, so as to support retrieving timeout data elements by key values or in a sequential manner while maintaining system processing capability.
One aspect of the present invention provides a method for searching a signaling timeout session based on a combination of a mapping table and a linked list, comprising:
constructing a real-value type structure;
combining a mapping table and a linked list according to the real-valued type structure to obtain a combined container so as to realize linked list operation in the mapping table;
when the signaling data are input, forming key values according to a session association algorithm and then inserting the key values into the combined container, and updating the operation information of the real value record; wherein the operation information includes last processing time information; maintaining an ordered linked list in the combined container, which is increased progressively according to the last processing time;
when the check cycle time is reached, a timeout processing flow is executed.
Optionally, the method further includes a step of expanding the real-valued type structure, where the step specifically includes:
constructing a real-value derived class by taking a predefined real-value type as a base class; wherein, 3 member variables are newly added in the real value derivation class, which are respectively a real value pointer, a next real value pointer and an iterator node pointer value of the current element; the 3 member variables are set to null values by default;
organizing real values of a mapping table into an ordered linked list through pointer variables of adjacent upper and lower real value derived classes;
and acquiring the iterator value of the current element through the iterator node pointer value, and carrying out deletion operation when overtime retrieval is carried out.
Optionally, the combining, according to the real value type structure, the mapping table and the linked list to obtain a combined container, so as to implement a linked list operation in the mapping table, includes:
constructing a new combined target container by taking the standard mapping table container as a base class; wherein an internal ordered linked list is maintained within the target container; the class of the target container is internally provided with 2 member variables which are respectively an internal chain table head pointer and an internal chain table tail pointer;
the class of the target container performs the following operations: obtaining a linked list head operation, obtaining a linked list tail operation, inserting an element operation, searching an element operation, subscripting an operation, deleting an element operation through an iterator, deleting an element operation through a key value, and emptying a mapping list container operation.
Optionally, the get list head operation is configured to return a value of an internal list head pointer;
the chain table tail obtaining operation is used for returning the value of the internal chain table tail pointer;
the insert element operation is used for inputting an element value and returning a pairing type value for judging whether the inserted iterator value is a new insert value or not; the insert element operation comprises the steps of: calling an insertion element operation insertion element value of the base class mapping table, and returning a pairing type return value; obtaining a real value from an iterator value of the pairing type return value; acquiring a content pointer value of the iterator from the pairing type return value, and storing the content pointer value into the acquired real value; taking out the link table node of the obtained real value from the link table, inserting the link table node into the tail part of the link table, and returning a pairing type return value;
the search element operation is used for inputting a key value and returning to an iterator of an element mapped by the key value in a mapping table; the search element operation specifically comprises the following steps: calling a search element of the base class mapping table to operate a search key value and returning an iterator type return value; if the key value is found, acquiring a real value from the iterator type return value, taking out the link table node of the acquired real value from an internal link table, and inserting the link table node into the tail part of the link table;
the subscript operation is used for inputting a key value and returning a real value mapped by the key value in a mapping table; the subscript operation specifically comprises the steps of: calling an insertion element operation to insert an element value, wherein the element value is composed of an input key value and a real value with a value as a default value; extracting a real value from a return value of the insert element operation to be used as a return value of the operation to return;
the delete element by iterator operation is used for inputting an iterator value without a return value; the operation of deleting elements through the iterator specifically comprises the following steps: judging whether the iterator value is the tail iterator value of the base class mapping table or not, if so, finishing the operation, otherwise, obtaining a real value from the iterator value, and taking out the real value linked list node from the internal linked list; calling a deleting element operation of the base class mapping table to delete the element pointed by the iterator value;
the operation of deleting elements through key values is used for inputting a key value and returning the deleted element quantity value; the operation of deleting elements by key values specifically comprises the following steps: calling a search element of the base class mapping table to operate a search key value and returning an iterator type return value; if the iterator of the key value is found, calling the element corresponding to the iterator type return value, and returning to 1;
the clear mapping table container operation is used for clearing all elements in the mapping table without an incoming value and a return value; the operation of emptying the mapping table container specifically comprises the following steps: using an empty mapping table container operation of the base class mapping table; and setting the head pointer and the tail pointer of the internal linked list to be null values.
Optionally, when the check cycle time is reached, executing a timeout processing flow, including:
acquiring an internal chaining head node pointer by using the operation of acquiring the chaining head;
judging whether the acquired pointer is valid, if not, indicating that the linked list is empty, and ending the overtime processing flow; if the result is valid, executing the next step;
judging whether the last processing time of the real value pointed by the acquired pointer exceeds a defined time threshold value or not; if the time does not exceed the threshold, the subsequent nodes in the linked list at the current time do not have overtime conversation, the retrieval of the rest nodes can be skipped, and the overtime processing flow is ended; if the threshold value is exceeded, the next step is executed;
executing a session ending operation or a recording output operation; acquiring a corresponding mapping table iterator value from the real value pointed by the acquired pointer; then, calling a delete element operation to delete the element node pointed by the iterator value;
and returning to the step of acquiring the internal link list head node pointer by using the acquisition link list head operation, and judging other nodes of the internal link list.
Another aspect of the embodiments of the present invention further provides a device for retrieving a signaling timeout session based on a combination of a mapping table and a linked list, including:
a first module for constructing a real-valued type structure;
the second module is used for combining the mapping table and the linked list according to the real-valued type structure to obtain a combined container so as to realize linked list operation in the mapping table;
a third module, configured to use the combined container as a session container, form key values according to a session association algorithm and insert the key values into the combined container when signaling data is input, and update operation information of the real-valued record; wherein the operation information includes last processing time information; maintaining an ordered linked list in the combined container, which is increased progressively according to the last processing time;
and the fourth module is used for executing the overtime processing flow when the checking period time is reached.
Another aspect of the embodiments of the present invention further provides an electronic device, including a processor and a memory;
the memory is used for storing programs;
the processor executes the program to implement the method as described above.
Another aspect of the embodiments of the present invention also provides a computer-readable storage medium, which stores a program, where the program is executed by a processor to implement the method as described above.
The embodiment of the invention also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and the computer instructions executed by the processor cause the computer device to perform the foregoing method.
The embodiment of the invention firstly constructs a real-valued type structure; then, combining a mapping table and a linked list according to the real-value type structure to obtain a combined container so as to realize linked list operation in the mapping table; then, the combined container is used as a session container, when signaling data are input, key values are formed according to a session association algorithm and then are inserted into the combined container, and operation information of real value records is updated; wherein the operation information includes last processing time information; maintaining an ordered linked list in the combined container, wherein the ordered linked list is increased according to the last processing time; when the check cycle time is reached, a timeout processing flow is executed. The invention can utilize the linked list access to carry out accurate access processing on the overtime session in the overtime processing process, and avoids the operation that the traditional mapping table traversal, search and the like have great influence on the system performance, thereby reducing the influence on the service function, ensuring the normal use of the service and ensuring the processing performance of the service thread.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a diagram illustrating a real-valued type structure according to an embodiment of the present invention;
fig. 2 is a flowchart of a signaling session timeout processing procedure according to an embodiment of the present invention;
fig. 3 is a diagram illustrating an embodiment of timeout processing according to the present invention;
FIG. 4 is a flowchart of the overall steps provided by the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Aiming at the problems in the prior art, the invention provides a data structure algorithm combining a mapping table and a linked list, which supports the access of data elements through key values or in a sequential mode; in addition, the invention provides a processing method for searching the overtime data element under the condition of keeping the system processing capacity.
Specifically, an aspect of the present invention provides a method for retrieving a signaling timeout session based on a combination of a mapping table and a linked list, and referring to fig. 4, the method specifically includes the following steps:
constructing a real-value type structure;
combining a mapping table and a linked list according to the real value type structure to obtain a combined container so as to realize linked list operation in the mapping table;
when the signaling data are input, forming key values according to a session association algorithm and then inserting the key values into the combined container, and updating the operation information of the real value record; wherein the operation information includes last processing time information; maintaining an ordered linked list in the combined container, wherein the ordered linked list is increased according to the last processing time;
when the check cycle time is reached, a timeout processing flow is executed.
Optionally, the method further includes a step of expanding the real-valued type structure, where the step specifically includes:
constructing a real-value derived class by taking a predefined real-value type as a base class; wherein, 3 member variables are newly added in the real value derivation class, which are respectively a real value pointer, a next real value pointer and an iterator node pointer value of the current element; the 3 member variables are set to null values by default;
organizing real values of a mapping table into an ordered linked list through pointer variables of adjacent upper and lower real value derived classes;
and acquiring the iterator value of the current element through the iterator node pointer value, and carrying out deletion operation when overtime retrieval is carried out.
Optionally, the combining, according to the real-valued type structure, a mapping table and a linked list to obtain a combined container, so as to implement a linked list operation in the mapping table, including:
constructing a new combined target container by taking the standard mapping table container as a base class; wherein an internal ordered linked list is maintained within the target container; the target container is internally provided with 2 member variables which are an internal chain table head pointer and an internal chain table tail pointer respectively;
the class of the target container performs the following operations: obtaining a chain table head operation, obtaining a chain table tail operation, inserting an element operation, searching an element operation, subscripting an operation, deleting an element operation through an iterator, deleting an element operation through a key value, and emptying a mapping table container operation.
Optionally, the get list head operation is configured to return a value of an internal list head pointer;
the chain table tail obtaining operation is used for returning the value of the internal chain table tail pointer;
the insert element operation is used for inputting an element value and returning a pairing type value for judging whether the inserted iterator value is a new insert value; the insert element operation comprises the steps of: calling an insertion element operation insertion element value of the base class mapping table, and returning a pairing type return value; obtaining a real value from an iterator value of the pairing type return value; acquiring a content pointer value of the iterator from the pairing type return value, and storing the content pointer value into the acquired real value; taking out the link table node of the obtained real value from the link table, inserting the link table node into the tail part of the link table, and returning a pairing type return value;
the search element operation is used for inputting a key value and returning to an iterator of an element mapped by the key value in a mapping table; the find element operation specifically comprises the following steps: calling a search element of the base class mapping table to operate a search key value and returning an iterator type return value; if the key value is found, acquiring a real value from the iterator type return value, taking out the link table node of the acquired real value from an internal link table, and inserting the link table node into the tail part of the link table;
the subscript operation is used for inputting a key value and returning a real value mapped by the key value in a mapping table; the subscript operation specifically comprises the steps of: calling an insertion element operation to insert an element value, wherein the element value is composed of an input key value and a real value with a value as a default value; extracting a real value from the return value of the insert element operation to be used as the return value of the operation to return;
the delete element by iterator operation is used for inputting an iterator value without a return value; the operation of deleting elements through the iterator specifically comprises the following steps: judging whether the iterator value is the tail iterator value of the base class mapping table or not, if so, finishing the operation, otherwise, obtaining a real value from the iterator value, and taking out the real value linked list node from the internal linked list; calling a deleting element operation of the base class mapping table to delete the element pointed by the iterator value;
the operation of deleting elements through key values is used for inputting a key value and returning the deleted element quantity value; the operation of deleting elements by key values specifically comprises the following steps: calling a search element of the base class mapping table to operate a search key value and returning an iterator type return value; if the iterator of the key value is found, calling the iterator type to return an element corresponding to the value, and returning to 1;
the clear mapping table container operation is used for clearing all elements in the mapping table without an incoming value and a return value; the operation of emptying the mapping table container specifically comprises the following steps: using an empty mapping table container operation of the base class mapping table; and setting the head pointer and the tail pointer of the internal linked list to be null values.
Optionally, when the check cycle time is reached, executing a timeout processing procedure, including:
acquiring an internal chaining header node pointer by using an acquisition chaining header operation;
judging whether the acquired pointer is valid, if not, indicating that the linked list is empty, and ending the timeout processing flow; if the result is valid, executing the next step;
judging whether the last processing time of the real value pointed by the acquired pointer exceeds a defined time threshold value or not; if the time does not exceed the threshold, the subsequent nodes in the linked list at the current time do not have overtime conversation, the retrieval of the rest nodes can be skipped, and the overtime processing flow is ended; if the threshold value is exceeded, executing the next step;
executing a session ending operation or an output recording operation; acquiring a corresponding mapping table iterator value from the real value pointed by the acquired pointer; then, calling a delete element operation to delete the element node pointed by the iterator value;
and returning to the step of acquiring the head node pointer of the internal link list by using the operation of acquiring the head of the internal link list, and judging other nodes of the internal link list.
Another aspect of the embodiments of the present invention further provides a device for retrieving a signaling timeout session based on a combination of a mapping table and a linked list, including:
a first module for constructing a real-valued type structure;
the second module is used for combining the mapping table and the linked list according to the real-valued type structure to obtain a combined container so as to realize linked list operation in the mapping table;
a third module, configured to use the combined container as a session container, form key values according to a session association algorithm and insert the key values into the combined container when signaling data is input, and update operation information of the real-valued record; wherein the operation information includes last processing time information; maintaining an ordered linked list in the combined container, which is increased progressively according to the last processing time;
and the fourth module is used for executing the overtime processing flow when the checking period time is reached.
Another aspect of the embodiments of the present invention further provides an electronic device, including a processor and a memory;
the memory is used for storing programs;
the processor executes the program to implement the method as described above.
Yet another aspect of the embodiments of the present invention provides a computer-readable storage medium, which stores a program, which is executed by a processor to implement the method as described above.
The embodiment of the invention also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and the computer instructions executed by the processor cause the computer device to perform the foregoing method.
The following detailed description of the specific implementation principles of the present invention is made with reference to the accompanying drawings:
the scheme of the invention introduces a method for realizing the session timeout retrieval by combining a mapping table and a linked list. Taking C + + language as an example, explanation is made from steps of designing a real-valued type structure, combining a mapping table and a linked list, searching a processing flow overtime, and the like.
1. Designing real-valued type structures
The real-valued type construction diagram is shown in fig. 1. Generally, a storage Key-value relationship of a mapping table, that is, a pair of Key values (keys) -real values (Mapped) represents a mapping relationship, and has functions of adding, searching, updating, and deleting the mapping relationship. A pair of Key-real values constitutes a set of element types, e.g., std:: map's element type (value _ type) is defined as std:: pair < const Key, mapped > in C + +.
In order to realize the linked list operation in the mapping table, the invention designs to expand the real value type, namely, the real value type defined by a user is taken as a base class to construct a real value derived class. And adding 3 new member variables of the real-value derivation class, wherein the three new member variables are respectively a last real-value pointer, a next real-value pointer and an iterator node pointer value of the current element. The 3 newly added member variables are set to null values by default.
The real values of the mapping table can be organized into an ordered linked list through the upper and lower real value derived class pointer variables. The iterator value of the current element can be obtained through the iterator node pointer value, and the iterator value is used for deleting operation during overtime retrieval.
2. Mapping table and linked list combination
In order to realize the linked list operation in the mapping table, the type of the mapping table needs to be expanded, specifically, a standard mapping table container stl:: map is used as a base class, a new combined container (link _ map) is constructed, and an internal ordered linked list is maintained in the container.
And 2 new member variables are added to the link _ map class, wherein the new member variables are respectively an internal chain table head pointer and an internal chain table tail pointer, and default values of the internal chain table head pointer and the internal chain table tail pointer are null values.
The link _ map class adds the following operation steps:
1) Get chain header operation
This operation returns the value of the internal chaining head pointer directly.
2) Get chain tail operation
This returns the value of the internal linked list tail pointer directly.
3) Insert element manipulation
This operation inputs an element value and returns an inserted iterator value and whether or not a new pairing type value is inserted.
The operation processing flow is as follows:
step 1, calling an insertion element operation insertion element value of a base class mapping table, and returning a pairing type return value.
And 2, acquiring a real value from the iterator value of the return value in the step 1.
And 3, acquiring the content pointer value of the iterator from the return value in the step 1, and storing the content pointer value into the real value acquired in the step 2.
And 4, taking out the real value linked list nodes obtained in the step 2 from the linked list and inserting the real value linked list nodes into the tail part of the linked list.
And 5, returning to the return value of the step 1.
4) Lookup element operations
The operation inputs a key value and returns an iterator of the element mapped by the key value in a mapping table.
The operation processing flow is as follows:
step 1, calling a search element of a base class mapping table to operate a search key value, and returning an iterator type return value.
And 2, if the key value is not found, turning to the step 5.
And 3, if the key value is found, acquiring a real value from the return value in the step 1.
And 4, taking out the real value linked list nodes obtained in the step 3 from the internal linked list and inserting the real value linked list nodes into the tail part of the linked list.
And 5, returning to the return value of the step 1.
5) Subscript operation
The operation inputs a key value and returns a real value mapped by the key value in a mapping table.
The operation processing flow is as follows:
step 1, calling the above-implemented insert element operation to insert an element value, where the element value is composed of an input key value and a real value whose value is a default value.
And 2, extracting a real value from the return value of the element inserting operation in the step 1 and returning the real value as the return value of the operation.
6) Delete element operations by iterator
The operation enters an iterator value, with no return value.
The operation processing flow is as follows:
and step 1, judging whether the iterator value is the tail iterator value of the base class mapping table, if so, finishing the operation, otherwise, turning to the step 2.
And 2, acquiring a real value from the iterator value, and taking out the real value linked list node from the internal linked list.
And 3, calling a deleting element of the base class mapping table to operate and delete the element pointed by the iterator value.
7) Delete element operations by key value
This operation inputs a key value and returns the deleted element quantity value.
The operation processing flow is as follows:
step 1, calling a search element of a base class mapping table to operate a search key value and returning an iterator type return value.
Step 2, if the iterator of the key value is found, the deletion element operation realized above is called to delete the element corresponding to the iterator value returned in the step 1, and the element is returned to 1; otherwise 0 is returned.
8) Emptying map container operations
This operation clears all elements in the mapping table, with no incoming and return values.
The operation processing flow is as follows:
step 1, calling the operation of emptying the mapping table container of the base class mapping table.
And step 2, setting the head pointer and the tail pointer of the internal linked list to be null values.
3. Timeout processing flow
In the signaling decoding analysis system, the combined container constructed above is used as a session container, when signaling data is input, key values (key) are formed according to a session association algorithm, an insertion element operation is called to be inserted into the combined container, and information such as real value record final processing time (proc _ time) is updated. An ordered linked list is maintained in the composite container that is incremented by the last processing time.
Referring to fig. 2, when the check cycle time is reached, a timeout processing flow is executed, which includes the following specific steps:
and step 1, acquiring an internal chaining header node pointer by using the operation of acquiring the chaining header.
Step 2, judging whether the pointer obtained in the step 1 is effective, if not, indicating that the linked list is empty, and ending the overtime processing flow; if so, executing the next step.
And 3, judging whether the last processing time of the real value pointed by the pointer obtained in the step 1 exceeds a defined time threshold value. If the time does not exceed the threshold, the subsequent nodes in the linked list at the current time do not have overtime conversation, the retrieval of the rest nodes can be skipped, and the overtime processing flow is ended; if the threshold is exceeded, the next step is performed.
And 4, performing corresponding session ending and record outputting operations. And acquiring a corresponding mapping table iterator value from the real value pointed by the pointer acquired in the step 1. A delete element operation is then invoked to delete the element node to which the iterator value points.
And 5, turning to the step 1 to repeatedly judge other nodes of the internal linked list.
Fig. 3 is a schematic diagram of timeout processing of the signaling session timeout processing method shown in fig. 2.
In the example shown in fig. 3, the current session container contains 8 session nodes. When the timeout threshold is 4, it indicates that the session with timeout time less than 4 needs to be timed out. Because all the nodes are arranged in the ascending order of the final processing time in a linked list mode, the searching is only started from the head of the linked list, and the searching can be stopped when a session with the timeout time not less than 4 is encountered, so that the timeout processing flow is completed.
In conclusion, the specific improvements of the invention are shown in the following aspects:
1. the mapping table and the linked list are combined with the container. The scheme realizes the encapsulation processing of the operations of the mapping table and the linked list, and realizes a container structure which can not only carry out mapping table query access through key values, but also carry out bidirectional sequential access through the head and the tail of the linked list; the problem that mapping table containers cannot be sequentially accessed according to service requirements in the development process in the prior art is solved, and the method and the device can be widely applied to the technical field of computers and communication.
2. The container adopts an implementation method of expanding real-value type to support linked list access. By utilizing the characteristic that the iterator is always effective before the mapping table node is deleted after being inserted, the iterator node value is stored in the real value, the quick switching between a linked list access mode and a mapping table iterator access mode is realized, and the high-performance retrieval is realized under the condition of overtime processing service. The linked list extension field is placed in a real value type instead of an extension key value type, and the rule that the key value cannot be modified after being inserted is followed, so that the universality of the scheme applied to various mapping tables is improved.
3. The chain table moving operation package is processed in the combined container, so that the related fields of the chain table are prevented from being accessed from the outside, and the robustness of the package structure is improved. When some node is inserted or searched by key value, the position of node in internal chain table is synchronously modified to ensure the ordered arrangement of node in chain table.
Compared with the prior art, the implementation method of the combination of the mapping table and the linked list container does not change the mode of using the key value to carry out signaling session association, and the original new adding or updating session operation of the system does not need to be modified; meanwhile, in the timeout processing process, the linked list access can be utilized to carry out accurate access processing on the timeout session, and operations such as traditional mapping table traversal and lookup which greatly affect the system performance are avoided. Therefore, the influence on the business function is reduced, the normal use of the business service is ensured, and the processing performance of the business thread is ensured.
The invention packages the chain table access operation in the container, avoids accessing the related fields of the chain table from the outside, and ensures the robustness and maintainability of the code.
The invention supports the realization on various mapping table containers such as key value ordered maps, key value unordered hash maps and the like. Because the invention adopts the realization method of the expanded real value type to support the access of the linked list, the expanded modification of the key value type is avoided, and the mapping table element node positioning function smaller than judgment or hash calculation and the like does not need to be realized again on the expanded key value type.
In alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. 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/acts involved. Furthermore, the embodiments presented and described in the flow charts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are performed independently.
Furthermore, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the described functions and/or features may be integrated in a single physical device and/or software module, or one or more functions and/or features may be implemented in a separate physical device or software module. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be understood within the ordinary skill of an engineer, given the nature, function, and internal relationship of the modules. Accordingly, those skilled in the art can, using ordinary skill, practice the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative of and not intended to limit the scope of the invention, which is to be determined from the appended claims along with their full scope of equivalents.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (9)

1. The method for searching the signaling timeout session based on the combination of the mapping table and the linked list is characterized by comprising the following steps:
constructing a real-value type structure;
combining a mapping table and a linked list according to the real-valued type structure to obtain a combined container so as to realize linked list operation in the mapping table;
when the signaling data are input, forming key values according to a session association algorithm and then inserting the key values into the combined container, and updating the operation information of the real value record; wherein the operation information includes last processing time information; maintaining an ordered linked list in the combined container, wherein the ordered linked list is increased according to the last processing time;
when the check cycle time is reached, a timeout processing flow is executed.
2. The method for searching for a signaling timeout session based on a combination of a mapping table and a linked list according to claim 1, further comprising a step of expanding the real-valued type structure, the step specifically comprising:
constructing a real-value derived class by taking a predefined real-value type as a base class; wherein, the real-valued derived class is added with 3 member variables which are respectively a real-valued pointer, a next real-valued pointer and an iterator node pointer value of the current element; the 3 member variables are set to null values by default;
organizing real values of a mapping table into an ordered linked list through pointer variables of adjacent upper and lower real value derived classes;
and acquiring the iterator value of the current element through the iterator node pointer value, and carrying out deletion operation when overtime retrieval is carried out.
3. The method for retrieving the signaling timeout session based on the combination of the mapping table and the linked list according to claim 1, wherein the step of combining the mapping table and the linked list according to the real-valued type structure to obtain a combined container so as to implement the linked list operation in the mapping table comprises:
constructing a new combined target container by taking the standard mapping table container as a base class; wherein an internal ordered linked list is maintained within the target container; the class of the target container is internally provided with 2 member variables which are respectively an internal chain table head pointer and an internal chain table tail pointer;
the class of the target container performs the following operations: obtaining a chain table head operation, obtaining a chain table tail operation, inserting an element operation, searching an element operation, subscripting an operation, deleting an element operation through an iterator, deleting an element operation through a key value, and emptying a mapping table container operation.
4. The method for retrieving signaling time-out session based on mapping table combined with linked list according to claim 3,
the get list head operation is used for returning the value of the internal list head pointer;
the chain table tail obtaining operation is used for returning the value of the internal chain table tail pointer;
the insert element operation is used for inputting an element value and returning a pairing type value for judging whether the inserted iterator value is a new insert value or not; the insert element operation comprises the steps of: calling an insertion element operation insertion element value of the base class mapping table, and returning a pairing type return value; obtaining a real value from an iterator value of the pairing type return value; acquiring a content pointer value of the iterator from the pairing type return value, and storing the content pointer value into the acquired real value; taking out the link table node of the obtained real value from the link table, inserting the link table node into the tail part of the link table, and returning a pairing type return value;
the search element operation is used for inputting a key value and returning to an iterator of an element mapped by the key value in a mapping table; the find element operation specifically comprises the following steps: calling a search element of the base class mapping table to operate a search key value and returning an iterator type return value; if the key value is found, acquiring a real value from the iterator type return value, taking out the link table node of the acquired real value from the internal link table, and inserting the link table node into the tail part of the link table;
the subscript operation is used for inputting a key value and returning a real value mapped by the key value in a mapping table; the subscript operation specifically comprises the steps of: calling an insertion element operation to insert an element value, wherein the element value is composed of an input key value and a real value with a value as a default value; extracting a real value from the return value of the insert element operation to be used as the return value of the operation to return;
the delete element by iterator operation is used for inputting an iterator value without returning value; the operation of deleting elements through the iterator specifically comprises the following steps: judging whether the iterator value is the tail iterator value of the base class mapping table or not, if so, finishing the operation, otherwise, obtaining a real value from the iterator value, and taking out the real value linked list node from the internal linked list; calling a deleting element operation of the base class mapping table to delete the element pointed by the iterator value;
deleting the element through the key value, wherein the deleting operation is used for inputting a key value and returning the deleted element quantity value; the operation of deleting elements by key values specifically comprises the following steps: calling a search element of the base class mapping table to operate a search key value and returning an iterator type return value; if the iterator of the key value is found, calling the iterator type to return an element corresponding to the value, and returning to 1;
the clear mapping table container operation is used for clearing all elements in the mapping table without an incoming value and a return value; the operation of emptying the mapping table container specifically comprises the following steps: using an empty mapping table container operation of the base class mapping table; and setting the head pointer and the tail pointer of the internal linked list to be null values.
5. The method as claimed in claim 1, wherein the step of performing timeout processing when the check period time is reached comprises:
acquiring an internal chaining header node pointer by using an acquisition chaining header operation;
judging whether the acquired pointer is valid, if not, indicating that the linked list is empty, and ending the timeout processing flow; if the result is valid, executing the next step;
judging whether the last processing time of the real value pointed by the acquired pointer exceeds a defined time threshold value or not; if the time does not exceed the threshold, the subsequent nodes in the linked list at the current time do not have overtime conversation, the retrieval of the rest nodes can be skipped, and the overtime processing flow is ended; if the threshold value is exceeded, the next step is executed;
executing a session ending operation or an output recording operation; acquiring a corresponding mapping table iterator value from the real value pointed by the acquired pointer; then, calling a delete element operation to delete the element node pointed by the iterator value;
and returning to the step of acquiring the head node pointer of the internal link list by using the operation of acquiring the head of the internal link list, and judging other nodes of the internal link list.
6. A signaling timeout session retrieval device based on combination of a mapping table and a linked list is characterized by comprising:
a first module for constructing a real-valued type structure;
the second module is used for combining the mapping table and the linked list according to the real-valued type structure to obtain a combined container so as to realize linked list operation in the mapping table;
a third module, configured to use the combined container as a session container, form key values according to a session association algorithm and insert the key values into the combined container when signaling data is input, and update operation information of the real-valued record; wherein the operation information includes last processing time information; maintaining an ordered linked list in the combined container, wherein the ordered linked list is increased according to the last processing time;
and the fourth module is used for executing the overtime processing flow when the check cycle time is reached.
7. An electronic device comprising a processor and a memory;
the memory is used for storing programs;
the processor executing the program implements the method of any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that the storage medium stores a program, which is executed by a processor to implement the method according to any one of claims 1 to 5.
9. A computer program product comprising a computer program, characterized in that the computer program realizes the method according to any of claims 1 to 5 when executed by a processor.
CN202210574470.3A 2022-05-25 2022-05-25 Method and device for searching signaling timeout session based on combination of mapping table and linked list Pending CN115238131A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210574470.3A CN115238131A (en) 2022-05-25 2022-05-25 Method and device for searching signaling timeout session based on combination of mapping table and linked list

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210574470.3A CN115238131A (en) 2022-05-25 2022-05-25 Method and device for searching signaling timeout session based on combination of mapping table and linked list

Publications (1)

Publication Number Publication Date
CN115238131A true CN115238131A (en) 2022-10-25

Family

ID=83667842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210574470.3A Pending CN115238131A (en) 2022-05-25 2022-05-25 Method and device for searching signaling timeout session based on combination of mapping table and linked list

Country Status (1)

Country Link
CN (1) CN115238131A (en)

Similar Documents

Publication Publication Date Title
US20170063695A1 (en) Full flow retrieval optimized packet capture
CN110147204B (en) Metadata disk-dropping method, device and system and computer-readable storage medium
CN107368527B (en) Multi-attribute index method based on data stream
CN110990402B (en) Format conversion method from row storage to column storage, query method and device
CN107545021A (en) A kind of date storage method and device
CN107357843B (en) Massive network data searching method based on data stream structure
CN111190904A (en) Method and device for hybrid storage of graph-relational database
CN106503008B (en) File storage method and device and file query method and device
CN114490060A (en) Memory allocation method and device, computer equipment and computer readable storage medium
CN112988908A (en) Block chain data storage method and device and electronic equipment
CN114780502A (en) Database method, system, device and medium based on compressed data direct computation
US8515976B2 (en) Bit string data sorting apparatus, sorting method, and program
CN115935020A (en) Graph data storage method and device
CN111752941B (en) Data storage and access method and device, server and storage medium
CN103399904A (en) Data processing method and data processing system
CN117435912A (en) Data packet index and retrieval method based on network data packet attribute value length characteristics
CN112988909A (en) Block chain data storage method and device and electronic equipment
CN108073709B (en) Data recording operation method, device, equipment and storage medium
CA2731799C (en) Process for representing and handling multigraphs based on the use of bitmaps
CN115238131A (en) Method and device for searching signaling timeout session based on combination of mapping table and linked list
CN115576947A (en) Data management method and device, combined library, electronic equipment and storage medium
CN112988911B (en) Block chain data storage method and device and electronic equipment
CN110825846B (en) Data processing method and device
CN112307272B (en) Method, device, computing equipment and storage medium for determining relation information between objects
CN112527196B (en) Cache read-write method and device, computer readable storage medium and electronic equipment

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