Signaling timeout session retrieval method and device based on combination of mapping table and linked list

By combining mapping tables with linked lists to build a combined container, the impact of session container timeout processing on performance in traditional signaling decoding analysis systems is solved, and efficient timeout session retrieval and processing is achieved, ensuring the system's processing performance and the stability of business services.

CN115238131BActive Publication Date: 2025-05-06GUANGDONG EASTONE CENTURY TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210574470.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-25
Publication Date
2025-05-06
Estimated Expiration
2042-05-25

AI Technical Summary

Technical Problem

When traditional signaling decoding analysis systems process large-scale network data, the session container timeout processing mechanism has a great impact on performance, resulting in congestion in processing data flow.

Method used

By combining the mapping table with the linked list, a combined container is built, and the orderliness of the linked list is used for precise access to the timeout session, avoiding traversal and search operations in traditional methods.

Benefits of technology

It realizes efficient retrieval and processing timeout data elements while maintaining the system's processing capabilities, reduces the impact on business functions, and ensures the normal use of business services and the processing performance of business threads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115238131B_ABST
    Figure CN115238131B_ABST
Patent Text Reader

Abstract

The present invention discloses a signaling timeout session retrieval method and device based on the combination of a mapping table and a linked list, the method comprising: first 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 to implement linked list operations in the mapping table; then using the combined container as a session container, when signaling data is input, inserting the key value into the combined container according to the session association algorithm, and updating the operation information of the real value record; when the inspection cycle time is reached, executing the timeout processing flow. The present invention can use linked list access to perform accurate access processing on the timeout session during the timeout processing process, avoiding traditional mapping table traversal and search operations that have a greater impact on system performance, thereby reducing the impact on business functions, ensuring the normal use of business services, and ensuring the processing performance of business threads, and can be widely used in the field of computer and communication technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computers and communications, in particular to a signaling timeout session retrieval method and device based on the combination of a mapping table and a linked list. Background Art

[0002] The signaling decoding and analysis system is one of the main means of analyzing network data. Realizing signaling session generation is one of the main functions of the signaling decoding and analysis system.

[0003] In the signaling decoding and analysis system, there are many functional requirements such as mapping tables, such as network protocol session mapping tables, user information relationship mapping tables, etc. The mapping table is used to store key-value pairs, and the corresponding real value can be quickly found through the key value. The conventional practice is to use the map data structure to implement key-value relationship mapping. The system requires that while ensuring the normal processing of continuously connected signaling messages, it is necessary to regularly clear the expired data in the mapping table to ensure the robustness of the processing system. As the scale of the network grows, the session container timeout processing mechanism in the signaling decoding and analysis system has an increasingly greater impact on performance, so it is necessary to implement an efficient session container timeout retrieval method.

[0004] The traditional implementation method traverses each element of the mapping table to determine whether the element has reached the timeout threshold. However, a mapping table may contain a large number of data elements, and only a few elements need to be processed each time due to timeout. Associative containers are implemented based on various algorithms, and the access process through iterators cannot guarantee access in the order of timeout. Therefore, the traditional implementation method needs to traverse all elements to ensure that there are no omissions, which greatly reduces the timeout retrieval performance and causes congestion in the processing data flow in big data scenarios. Summary of the invention

[0005] In view of this, the embodiments of the present invention provide a signaling timeout session retrieval method and device based on a combination of a mapping table and a linked list, so as to support retrieval of timeout data elements by key value or by sequence while maintaining system processing capability.

[0006] One aspect of the present invention provides a signaling timeout session retrieval method based on a combination of a mapping table and a linked list, comprising:

[0007] Construct real value type structure;

[0008] According to the real value type structure, the mapping table and the linked list are combined to obtain a combined container, so as to implement linked list operations in the mapping table;

[0009] The combined container is used as a session container. When signaling data is input, the key value is formed according to the session association algorithm and then inserted into the combined container, and the operation information of the real value record is updated; wherein the operation information includes the last processing time information; and an ordered linked list increasing by the last processing time is maintained in the combined container;

[0010] When the inspection cycle time is reached, the timeout processing flow is executed.

[0011] Optionally, the method further comprises a step of expanding the real value type structure, which step specifically comprises:

[0012] A real-value derived class is constructed with a predefined real-value type as a base class; wherein three member variables are newly added in the real-value derived class, namely, a real-value pointer, a next real-value pointer, and an iterator node pointer value of the current element; and the three member variables are set to null values ​​by default;

[0013] The real values ​​of the mapping table are organized into an ordered linked list through the pointer variables of the adjacent upper and lower real-valued derived classes;

[0014] Get the iterator value of the current element through the iterator node pointer value, which is used for deletion when the retrieval times out.

[0015] Optionally, combining the mapping table and the linked list according to the real value type structure to obtain a combined container to implement linked list operations in the mapping table includes:

[0016] A new combined target container is constructed with the standard mapping table container as the base class; wherein the target container maintains an internal ordered linked list; the class of the target container is provided with two member variables, namely, an internal linked list head pointer and an internal linked list tail pointer;

[0017] The target container class performs the following operations: obtaining a linked list head operation, obtaining a linked list tail operation, inserting an element operation, searching for an element operation, subscripting an element operation, deleting an element operation through an iterator, deleting an element operation through a key value, and clearing a mapping table container operation.

[0018] Optionally, the operation of obtaining the linked list head is used to return the value of the internal linked list head pointer;

[0019] The operation of obtaining the tail of the linked list is used to return the value of the tail pointer of the internal linked list;

[0020] The insert element operation is used to input an element value and return a pairing type value for judging whether the iterator value after insertion is the newly inserted value; the insert element operation comprises the following steps: calling the insert element operation of the base class mapping table to insert the element value and returning a pairing type return value; obtaining a real value from the iterator value of the pairing type return value; obtaining the content pointer value of the iterator from the pairing type return value and saving it to the obtained real value; taking the linked list node of the obtained real value from the linked list, inserting it to the end of the linked list, and returning a pairing type return value;

[0021] The find element operation is used to input a key value and return an iterator of the element mapped by the key value in a mapping table; the find element operation specifically includes the following steps: calling the find element operation of the base class mapping table to find the key value and returning an iterator type return value; if the key value is found, obtaining the real value from the iterator type return value, taking the linked list node of the obtained real value out of the internal linked list, and inserting it into the end of the linked list;

[0022] The subscript operation is used to input a key value and return a real value mapped by the key value in a mapping table; the subscript operation specifically includes the following steps: calling the insert element operation to insert an element value, the element value is composed of the input key value and a real value whose value is a default value; extracting the real value from the return value of the insert element operation as the return value of this operation;

[0023] The operation of deleting an element through an iterator is used to input an iterator value and has no return value; the operation of deleting an element through an iterator specifically includes the following steps: determining whether the iterator value is the tail iterator value of the base class mapping table, if so, completing the operation, otherwise obtaining a real value from the iterator value, and taking the real value linked list node out of the internal linked list; calling the delete element operation of the base class mapping table to delete the element pointed to by the iterator value;

[0024] The operation of deleting elements by key value is used to input a key value and return the number of elements deleted; the operation of deleting elements by key value specifically includes the following steps: calling the search element operation of the base class mapping table to search for the 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 1;

[0025] The clear mapping table container operation is used to clear all elements in the mapping table, without input values ​​and return values; the clear mapping table container operation specifically includes the following steps: using the clear mapping table container operation of the base class mapping table; setting the head and tail pointers of the internal linked list to null values.

[0026] Optionally, when the inspection cycle time is reached, executing a timeout processing flow includes:

[0027] Use the Get Link List Head operation to get the internal link list head node pointer;

[0028] Determine whether the pointer obtained is valid. If not, it means that the linked list is empty, and the timeout processing flow ends; if valid, execute the next step;

[0029] Determine whether the last processing time of the real value pointed to by the pointer obtained exceeds the defined time threshold; if it does not exceed the threshold, it means that there will be no timeout session for subsequent nodes in the linked list at the current time, and the retrieval of the remaining nodes can be skipped, ending the timeout processing flow; if it exceeds the threshold, execute the next step;

[0030] Execute the end session operation or the output record operation; and obtain the corresponding mapping table iterator value from the real value pointed to by the obtained pointer; then call the delete element operation to delete the element node pointed to by the iterator value;

[0031] Return to the step of obtaining the pointer of the internal linked list head node using the Get Linked List Head Operation, and determine other nodes in the internal linked list.

[0032] Another aspect of the embodiment of the present invention further provides a signaling timeout session retrieval device based on a combination of a mapping table and a linked list, comprising:

[0033] The first module is used to build a real value type structure;

[0034] The second module is used to combine the mapping table and the linked list according to the real value type structure to obtain a combined container, so as to implement linked list operations in the mapping table;

[0035] The third module is used to use the combined container as a session container, and when signaling data is input, the key value is formed according to the session association algorithm and then inserted into the combined container, and the operation information of the real value record is updated; wherein the operation information includes the last processing time information; and the combined container maintains an ordered linked list that increases by the last processing time;

[0036] The fourth module is used to execute the timeout processing flow when the inspection cycle time is reached.

[0037] Another aspect of an embodiment of the present invention further provides an electronic device, including a processor and a memory;

[0038] The memory is used to store programs;

[0039] The processor executes the program to implement the method described above.

[0040] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the method as described above.

[0041] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.

[0042] The embodiment of the present invention first constructs a real value type structure; then, according to the real value type structure, the mapping table and the linked list are combined to obtain a combined container to implement linked list operations in the mapping table; then, the combined container is used as a session container, and when signaling data is input, the key value is composed according to the session association algorithm and inserted into the combined container, and the operation information of the real value record is updated; wherein, the operation information includes the last processing time information; the combined container maintains an ordered linked list that increases according to the last processing time; when the inspection cycle time is reached, the timeout processing flow is executed. The present invention can use linked list access to perform precise access processing on the timeout session during the timeout processing process, avoiding traditional mapping table traversal and search operations that have a greater impact on system performance, thereby reducing the impact on business functions, ensuring the normal use of business services, and ensuring the processing performance of business threads. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0044] Figure 1 A schematic diagram of a real value type structure provided by an embodiment of the present invention;

[0045] Figure 2 A flowchart of a signaling session timeout processing process provided by an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of a specific embodiment of timeout processing provided by an embodiment of the present invention;

[0047] Figure 4 The present invention provides an overall step flow chart of the embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0049] In view of the problems existing in the prior art, the present invention proposes a data structure algorithm combining a mapping table and a linked list, which supports accessing data elements through key values ​​or in a sequential manner; in addition, the present invention proposes a processing method for retrieving timed-out data elements while maintaining the system processing capacity.

[0050] Specifically, one aspect of the present invention provides a signaling timeout session retrieval method based on a combination of a mapping table and a linked list, referring to Figure 4 , the method specifically comprises the following steps:

[0051] Construct real value type structure;

[0052] According to the real value type structure, the mapping table and the linked list are combined to obtain a combined container, so as to implement linked list operations in the mapping table;

[0053] The combined container is used as a session container. When signaling data is input, the key value is formed according to the session association algorithm and then inserted into the combined container, and the operation information of the real value record is updated; wherein the operation information includes the last processing time information; and an ordered linked list increasing by the last processing time is maintained in the combined container;

[0054] When the inspection cycle time is reached, the timeout processing flow is executed.

[0055] Optionally, the method further comprises a step of expanding the real value type structure, which step specifically comprises:

[0056] A real-value derived class is constructed with a predefined real-value type as a base class; wherein three member variables are newly added in the real-value derived class, namely, a real-value pointer, a next real-value pointer, and an iterator node pointer value of the current element; and the three member variables are set to null values ​​by default;

[0057] The real values ​​of the mapping table are organized into an ordered linked list through the pointer variables of the adjacent upper and lower real-valued derived classes;

[0058] Get the iterator value of the current element through the iterator node pointer value, which is used for deletion when the retrieval times out.

[0059] Optionally, combining the mapping table and the linked list according to the real value type structure to obtain a combined container to implement linked list operations in the mapping table includes:

[0060] A new combined target container is constructed with the standard mapping table container as the base class; wherein the target container maintains an internal ordered linked list; the class of the target container is provided with two member variables, namely, an internal linked list head pointer and an internal linked list tail pointer;

[0061] The target container class performs the following operations: obtaining a linked list head operation, obtaining a linked list tail operation, inserting an element operation, searching for an element operation, subscripting an element operation, deleting an element operation through an iterator, deleting an element operation through a key value, and clearing a mapping table container operation.

[0062] Optionally, the operation of obtaining the linked list head is used to return the value of the internal linked list head pointer;

[0063] The operation of obtaining the tail of the linked list is used to return the value of the tail pointer of the internal linked list;

[0064] The insert element operation is used to input an element value and return a pairing type value for judging whether the iterator value after insertion is the newly inserted value; the insert element operation comprises the following steps: calling the insert element operation of the base class mapping table to insert the element value and returning a pairing type return value; obtaining a real value from the iterator value of the pairing type return value; obtaining the content pointer value of the iterator from the pairing type return value and saving it to the obtained real value; taking the linked list node of the obtained real value from the linked list, inserting it to the end of the linked list, and returning a pairing type return value;

[0065] The find element operation is used to input a key value and return an iterator of the element mapped by the key value in a mapping table; the find element operation specifically includes the following steps: calling the find element operation of the base class mapping table to find the key value and returning an iterator type return value; if the key value is found, obtaining the real value from the iterator type return value, taking the linked list node of the obtained real value out of the internal linked list, and inserting it into the end of the linked list;

[0066] The subscript operation is used to input a key value and return a real value mapped by the key value in a mapping table; the subscript operation specifically includes the following steps: calling the insert element operation to insert an element value, the element value is composed of the input key value and a real value whose value is a default value; extracting the real value from the return value of the insert element operation as the return value of this operation;

[0067] The operation of deleting an element through an iterator is used to input an iterator value and has no return value; the operation of deleting an element through an iterator specifically includes the following steps: determining whether the iterator value is the tail iterator value of the base class mapping table, if so, completing the operation, otherwise obtaining a real value from the iterator value, and taking the real value linked list node out of the internal linked list; calling the delete element operation of the base class mapping table to delete the element pointed to by the iterator value;

[0068] The operation of deleting elements by key value is used to input a key value and return the number of elements deleted; the operation of deleting elements by key value specifically includes the following steps: calling the search element operation of the base class mapping table to search for the 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 1;

[0069] The clear mapping table container operation is used to clear all elements in the mapping table, without input values ​​and return values; the clear mapping table container operation specifically includes the following steps: using the clear mapping table container operation of the base class mapping table; setting the head and tail pointers of the internal linked list to null values.

[0070] Optionally, when the inspection cycle time is reached, executing a timeout processing flow includes:

[0071] Use the Get Link List Head operation to get the internal link list head node pointer;

[0072] Determine whether the pointer obtained is valid. If not, it means that the linked list is empty, and the timeout processing flow ends; if valid, execute the next step;

[0073] Determine whether the last processing time of the real value pointed to by the obtained pointer exceeds the defined time threshold; if it does not exceed the threshold, it means that there will be no timeout session for subsequent nodes in the linked list at the current time, and the retrieval of the remaining nodes can be skipped, ending the timeout processing flow; if it exceeds the threshold, execute the next step;

[0074] Execute the end session operation or the output record operation; and obtain the corresponding mapping table iterator value from the real value pointed to by the obtained pointer; then call the delete element operation to delete the element node pointed to by the iterator value;

[0075] Return to the step of obtaining the pointer of the internal linked list head node using the Get Linked List Head Operation, and determine other nodes in the internal linked list.

[0076] Another aspect of the embodiment of the present invention further provides a signaling timeout session retrieval device based on a combination of a mapping table and a linked list, comprising:

[0077] The first module is used to build a real value type structure;

[0078] The second module is used to combine the mapping table and the linked list according to the real value type structure to obtain a combined container, so as to implement linked list operations in the mapping table;

[0079] The third module is used to use the combined container as a session container, and when signaling data is input, the key value is formed according to the session association algorithm and then inserted into the combined container, and the operation information of the real value record is updated; wherein the operation information includes the last processing time information; and the combined container maintains an ordered linked list that increases by the last processing time;

[0080] The fourth module is used to execute the timeout processing flow when the inspection cycle time is reached.

[0081] Another aspect of an embodiment of the present invention further provides an electronic device, including a processor and a memory;

[0082] The memory is used to store programs;

[0083] The processor executes the program to implement the method described above.

[0084] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the method as described above.

[0085] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.

[0086] The specific implementation principle of the present invention is described in detail below in conjunction with the accompanying drawings:

[0087] The solution of the present invention introduces how to use the combination of mapping table and linked list to realize the implementation method of session timeout retrieval. Taking C++ language as an example, the following is an explanation of the steps of designing real value type structure, combining mapping table and linked list, and timeout retrieval processing flow.

[0088] 1. Design real value type structure

[0089] The diagram of real value type construction is as follows Figure 1 As shown. Generally, a mapping table stores key-value relationships, that is, a pair of key value (Key)-real value (Mapped) represents a mapping relationship, and has the functions of adding, searching, updating, and deleting mapping relationships. A pair of key value-real value constitutes a set of element types. For example, in C++, the element type (value_type) of std::map is defined as std::pair<const Key,Mapped> .

[0090] In order to implement linked list operations in the mapping table, the present invention designs to expand the real value type, that is, to construct a real value derived class with the user-defined real value type as the base class. The real value derived class adds three member variables, namely, the previous real value pointer, the next real value pointer, and the iterator node pointer value of the current element. The three newly added member variables are set to null values ​​by default.

[0091] 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, which is used for deletion when the retrieval is timed out.

[0092] 2. Combination of mapping table and linked list

[0093] In order to implement linked list operations in the mapping table, the mapping table type needs to be extended. Specifically, the standard mapping table container stl::map is used as the base class to construct a new combined container (link_map), which maintains an internal ordered linked list.

[0094] The link_map class adds two member variables, namely the internal linked list head pointer and the internal linked list tail pointer, and the default values ​​of both are null.

[0095] The link_map class adds the following steps:

[0096] 1) Get the linked list header operation

[0097] This operation directly returns the value of the internal linked list head pointer.

[0098] 2) Get the tail of the linked list

[0099] This directly returns the value of the internal linked list tail pointer.

[0100] 3) Insert element operation

[0101] This operation takes an element value as input and returns a pairing type value of the inserted iterator value and whether it is newly inserted.

[0102] The operation process is as follows:

[0103] Step 1, call the insert element operation of the base class mapping table to insert the element value, and return a pair type return value.

[0104] Step 2, get the real value from the iterator value of the return value of step 1.

[0105] Step 3, obtain the content pointer value of the iterator from the return value of step 1, and save it to the real value obtained in step 2.

[0106] Step 4, take out the real-valued linked list node obtained in step 2 from the linked list and insert it to the end of the linked list.

[0107] Step 5, return the return value of step 1.

[0108] 4) Find element operation

[0109] This operation takes a key value as input and returns an iterator to the elements in the mapping table to which the key value is mapped.

[0110] The operation process is as follows:

[0111] Step 1, call the find element operation of the base class mapping table to find the key value and return an iterator type return value.

[0112] Step 2: If the key value is not found, go to step 5.

[0113] Step 3: If the key value is found, get the real value from the return value of step 1.

[0114] Step 4, take out the real-valued linked list node obtained in step 3 from the internal linked list and insert it to the end of the linked list.

[0115] Step 5, return the return value of step 1.

[0116] 5) Subscript operation

[0117] This operation inputs a key value and returns the real value mapped to the key value in a mapping table.

[0118] The operation process is as follows:

[0119] Step 1, call the insert element operation implemented above to insert an element value, which consists of the input key value and a real value with a default value.

[0120] Step 2: extract the real value from the return value of the element insertion operation in step 1 and return it as the return value of this operation.

[0121] 6) Deleting elements through iterators

[0122] This operation takes an iterator value as input and has no return value.

[0123] The operation process is as follows:

[0124] Step 1, determine whether the iterator value is the tail iterator value of the base class mapping table, if so, complete the operation, otherwise go to step 2.

[0125] Step 2, obtain the real value from the iterator value, and take the real value linked list node out of the internal linked list.

[0126] Step 3: Call the delete element operation of the base class mapping table to delete the element pointed to by the iterator value.

[0127] 7) Delete element operation by key value

[0128] This operation takes a key value as input and returns the number of elements deleted.

[0129] The operation process is as follows:

[0130] Step 1, call the find element operation of the base class mapping table to find the key value and return an iterator type return value.

[0131] Step 2: If the iterator for the key value is found, call the element deletion operation implemented above to delete the element corresponding to the iterator value returned in step 1, and return 1; otherwise, return 0.

[0132] 8) Clear the mapping table container operation

[0133] This operation clears all elements in the mapping table, with no input or return values.

[0134] The operation process is as follows:

[0135] Step 1, call the clear mapping table container operation of the base class mapping table.

[0136] Step 2, set the head and tail pointers of the internal linked list to null values.

[0137] 3. Timeout processing flow

[0138] In the signaling decoding and analysis system, the composite container constructed above is used as a session container. When signaling data is input, the key value (key) is composed according to the session association algorithm, and the insert element operation is called to insert it into the composite container, and the real value records the last processing time (proc_time) and other information are updated. At this time, the composite container maintains an ordered linked list that increases by the last processing time.

[0139] refer to Figure 2 When the inspection cycle time is reached, the timeout processing flow is executed. The specific steps are as follows:

[0140] Step 1: Use the Get Linked List Head operation to obtain the internal linked list head node pointer.

[0141] Step 2, determine whether the pointer obtained in step 1 is valid. If not, it means that the linked list is empty, and the timeout processing flow ends; if valid, execute the next step.

[0142] Step 3, determine whether the last processing time of the real value pointed to by the pointer obtained in step 1 exceeds the defined time threshold. If it does not exceed the threshold, it means that there will be no timeout session for subsequent nodes in the linked list at the current time, and the search of the remaining nodes can be skipped, ending this timeout processing process; if it exceeds the threshold, execute the next step.

[0143] Step 4: Perform corresponding end session and output record operations. Obtain the corresponding mapping table iterator value from the real value pointed to by the pointer in step 1. Then call the delete element operation to delete the element node pointed to by the iterator value.

[0144] Step 5, go to step 1 and repeat the judgment of other nodes in the internal linked list.

[0145] Figure 3 for Figure 2 A timeout processing schematic diagram of a signaling session timeout processing method is shown.

[0146] exist Figure 3 In the example shown, the current session container contains 8 session nodes. When the timeout threshold is 4, it means that sessions with a timeout period of less than 4 need to be timed out. Because all nodes have been sorted in ascending order by the last processing time in a linked list, it is only necessary to start searching from the head of the linked list and stop when a session with a timeout period of not less than 4 is encountered, completing this timeout processing process.

[0147] In summary, the specific improvements of the present invention are shown in the following aspects:

[0148] 1. Implementation method of mapping table and linked list combined container. This solution realizes the encapsulation processing of mapping table and linked list operations, and realizes a container structure that can query and access the mapping table through key values, and can also perform bidirectional sequential access through the head and tail of the linked list; it solves the problem that the mapping table container cannot be accessed sequentially according to business requirements during the development process of the existing technology, and can be widely used in the field of computer and communication technology.

[0149] 2. The container adopts the implementation method of supporting linked list access by using the extended real value type. The iterator is always valid after the mapping table node is inserted and before it is deleted. The iterator node value is saved in the real value to achieve fast switching between the linked list access mode and the mapping table iterator access mode, and achieve high-performance retrieval in the timeout processing business scenario. Placing the linked list extension field in the real value type instead of the extended key value type, following the rule that the key value cannot be modified after insertion, improves the versatility of this solution in various mapping tables.

[0150] 3. The linked list movement operation is encapsulated and processed inside the composite container, avoiding access to the linked list related fields from the outside and improving the robustness of the encapsulation structure. When inserting or searching a node by key value, the position of the node in the internal linked list is modified synchronously to ensure that the nodes are arranged in order in the linked list.

[0151] Compared with the prior art, the implementation method of the mapping table and linked list combined with the container proposed in the present invention does not change the way of using key values ​​to associate signaling sessions, and the original system operation of adding or updating sessions does not need to be modified; at the same time, in the timeout processing process, the linked list access can be used to accurately access the timeout session, avoiding the traditional mapping table traversal and search operations that have a great impact on system performance. Thereby reducing the impact on business functions, ensuring the normal use of business services, and ensuring the processing performance of business threads.

[0152] The present invention encapsulates the linked list access operation inside the container, avoids accessing the linked list related fields from the outside, and ensures the robustness and maintainability of the code.

[0153] The present invention supports implementation on various mapping table containers such as ordered key value maps and unordered key value hash maps. Because the present invention adopts an implementation method of extending real value types to support linked list access, it avoids extending and modifying the key value type, and therefore does not need to re-implement mapping table element node positioning functions such as less than judgment or hash calculation for the extended key value type.

[0154] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0155] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features described may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0156] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0157] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0158] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0159] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0160] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0161] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0162] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A signaling timeout session retrieval method based on a combination of a mapping table and a linked list, characterized in that: include: Construct real value type structures; According to the real value type structure, the mapping table and the linked list are combined to obtain a combined container, so as to implement linked list operations in the mapping table; The combined container is used as a session container. When signaling data is input, the key value is formed according to the session association algorithm and then inserted into the combined container, and the operation information of the real value record is updated; wherein the operation information includes the last processing time information; and an ordered linked list increasing by the last processing time is maintained in the combined container; When the inspection cycle time is reached, the timeout processing flow is executed; The step of combining the mapping table and the linked list according to the real value type structure to obtain a combined container to implement linked list operations in the mapping table includes: A new combined target container is constructed with the standard mapping table container as the base class; wherein the target container maintains an internal ordered linked list; the class of the target container is provided with two member variables, namely, an internal linked list head pointer and an internal linked list 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 for an element operation, subscripting an element operation, deleting an element operation through an iterator, deleting an element operation through a key value, and clearing a mapping table container operation; When the inspection cycle time is reached, the timeout processing flow is executed, including: Use the Get Link List Head operation to get the internal link list head node pointer; Determine whether the pointer obtained is valid. If not, it means that the linked list is empty, and the timeout processing flow ends; if valid, execute the next step; Determine whether the last processing time of the real value pointed to by the obtained pointer exceeds the defined time threshold; if it does not exceed the threshold, it means that there will be no timeout session for subsequent nodes in the linked list at the current time, skip the retrieval of the remaining nodes, and end the timeout processing flow; if it exceeds the threshold, execute the next step; Execute the end session operation or the output record operation; and obtain the corresponding mapping table iterator value from the real value pointed to by the obtained pointer; then call the delete element operation to delete the element node pointed to by the iterator value; Return to the step of obtaining the pointer of the internal linked list head node using the Get Linked List Head Operation, and determine other nodes in the internal linked list.

2. The signaling timeout session retrieval method based on the combination of a mapping table and a linked list according to claim 1 is characterized in that: The method further comprises the step of expanding the real value type structure, which specifically comprises: A real-value derived class is constructed with a predefined real-value type as a base class; wherein three member variables are newly added in the real-value derived class, namely, a real-value pointer, a next real-value pointer, and an iterator node pointer value of the current element; and the three member variables are set to null values ​​by default; The real values ​​of the mapping table are organized into an ordered linked list through the pointer variables of the adjacent upper and lower real-valued derived classes; Get the iterator value of the current element through the iterator node pointer value, which is used for deletion when the retrieval times out.

3. The signaling timeout session retrieval method based on the combination of a mapping table and a linked list according to claim 1 is characterized in that: The operation of obtaining the linked list head is used to return the value of the internal linked list head pointer; The operation of obtaining the tail of the linked list is used to return the value of the tail pointer of the internal linked list; The insert element operation is used to input an element value and return a pairing type value for judging whether the iterator value after insertion is the newly inserted value; the insert element operation comprises the following steps: calling the insert element operation of the base class mapping table to insert the element value and returning a pairing type return value; obtaining a real value from the iterator value of the pairing type return value; obtaining the content pointer value of the iterator from the pairing type return value and saving it to the obtained real value; taking the linked list node of the obtained real value from the linked list, inserting it to the end of the linked list, and returning a pairing type return value; The find element operation is used to input a key value and return an iterator of the element mapped by the key value in a mapping table; the find element operation specifically includes the following steps: calling the find element operation of the base class mapping table to find the key value and returning an iterator type return value; if the key value is found, obtaining the real value from the iterator type return value, taking the linked list node of the obtained real value out of the internal linked list, and inserting it into the end of the linked list; The subscript operation is used to input a key value and return a real value mapped by the key value in a mapping table; the subscript operation specifically includes the following steps: calling the insert element operation to insert an element value, the element value is composed of the input key value and a real value whose value is a default value; extracting the real value from the return value of the insert element operation as the return value of this operation; The operation of deleting an element through an iterator is used to input an iterator value and has no return value; the operation of deleting an element through an iterator specifically includes the following steps: determining whether the iterator value is the tail iterator value of the base class mapping table, if so, completing the operation, otherwise obtaining a real value from the iterator value, and taking the real value linked list node out of the internal linked list; calling the delete element operation of the base class mapping table to delete the element pointed to by the iterator value; The operation of deleting elements by key value is used to input a key value and return the number of elements deleted; the operation of deleting elements by key value specifically includes the following steps: calling the search element operation of the base class mapping table to search for the 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 1; The clear mapping table container operation is used to clear all elements in the mapping table, without input values ​​and return values; the clear mapping table container operation specifically includes the following steps: using the clear mapping table container operation of the base class mapping table; setting the head and tail pointers of the internal linked list to null values.

4. A device for implementing the signaling timeout session retrieval method based on the combination of a mapping table and a linked list as described in any one of claims 1 to 3, characterized in that: include: The first module is used to build a real value type structure; The second module is used to combine the mapping table and the linked list according to the real value type structure to obtain a combined container, so as to implement linked list operations in the mapping table; The third module is used to use the combined container as a session container, and when signaling data is input, the key value is formed according to the session association algorithm and then inserted into the combined container, and the operation information of the real value record is updated; wherein the operation information includes the last processing time information; and the combined container maintains an ordered linked list that increases by the last processing time; The fourth module is used to execute the timeout processing flow when the inspection cycle time is reached.

5. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: The storage medium stores a program, and the program is executed by a processor to implement the method according to any one of claims 1 to 3.

7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Data synchronization method, device, system and equipment based on tree structure

    CN111475510A

  • Multi-thread traversal method and device for map mapping table based on memory pool

    CN113238857A