An information processing method, device and storage medium
By integrating IMS into 5GC electronic devices, the problem of data synchronization between IMS and 5GC database is solved based on priority processing of write requests and token queue mechanism, achieving data consistency and efficient synchronization, and ensuring that critical requests are processed first.
Patent Information
- Application Number
- CN202411376136.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-09-29
AI Technical Summary
When integrating the IP Multimedia Subsystem (IMS) into electronic devices that support 5GC, how can we ensure that the data in the IMS database remains synchronized with the data in the database of the electronic devices that support 5GC?
In response to a write request received from a user terminal, its priority is determined, and the request is placed into a preset token queue based on the priority. The context information of the user terminal is synchronously written to the hash table of the IMS and the electronic device using the token mechanism in the preset token queue.
It achieves consistency and synchronization of data between IMS and electronic device databases, improves the controllability and efficiency of the data writing process, ensures that critical or urgent requests are processed first, and reduces waiting time.
Smart Images

Figure CN119299433B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to an information processing method, apparatus and storage medium. Background Technology
[0002] In order to enable the lightweight 5G Core Network (5GC) to support traditional voice functions such as voice and video calls, the Internet Protocol (IP) Multimedia Subsystem (IMS) needs to be integrated into electronic devices that support 5GC.
[0003] However, since typical lightweight 5GC and IMS use different databases for data storage and management, ensuring that the data in the IMS database is synchronized with the data in the database of the 5GC-enabled electronic device is a technical problem that the industry urgently needs to solve when integrating IMS into 5GC-enabled electronic devices. Summary of the Invention
[0004] To address the aforementioned technical problems, embodiments of this application provide an information processing method, apparatus, and storage medium.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] In a first aspect, embodiments of this application provide an information processing method applied to an electronic device equipped with an Internet Protocol IP Multimedia Subsystem (IMS), the method comprising:
[0007] In response to receiving a write request from a user terminal, the priority of the write request is determined;
[0008] Based on the priority of the write request, the write request is placed into a preset token queue;
[0009] Based on the position of the write request in the preset token queue and the token associated with the preset token queue, the context information of the user terminal is synchronously written into the first hash table in the first database corresponding to the IMS and the second hash table in the second database corresponding to the electronic device.
[0010] In some embodiments, determining the priority of the write request in response to receiving a write request from a user terminal includes:
[0011] In response to receiving the write request, obtain the message type and expiration time corresponding to the write request;
[0012] The priority is determined based on the message type and the expiration time.
[0013] In some embodiments, determining the priority based on the message type and the expiration time includes:
[0014] The message type and the expiration time are fuzzed to obtain a first value corresponding to the message type and a second value corresponding to the expiration time;
[0015] The priority is obtained by calculating the first value, the first weight corresponding to the message type, the second value, and the second weight corresponding to the expiration time using the central average method.
[0016] In some embodiments, placing the write request into a preset token queue based on the priority of the write request includes:
[0017] If the preset token queue is empty, the write request will be placed at any position in the preset token queue.
[0018] If the preset token queue is not empty, the write request is placed into the preset token queue based on the priority of the write request and the priority of the requests already placed in the preset token queue.
[0019] In some embodiments, the preset token queue includes at least one of the already placed requests, and placing the write request into the preset token queue based on the priority of the write request and the priority of the already placed requests in the preset token queue includes one of the following:
[0020] If at least one of the placed requests has a higher priority than the write request, the write request is placed in the preset token queue after at least one of the placed requests.
[0021] If at least one of the placed requests has a lower priority than the write request, the write request is placed in the preset token queue at a position preceding at least one of the placed requests;
[0022] If the priority of the first request is higher than the priority of the write request, and the priority of the second request is lower than the priority of the write request, then the write request is placed in the preset token queue in a position after the first request and before the second request.
[0023] Wherein, the at least one of the placed requests includes: the first request and the second request.
[0024] In some embodiments, the step of synchronously writing the context information of the user terminal into a first hash table in the first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device, based on the position of the write request in the preset token queue and the token associated with the preset token queue, includes:
[0025] In response to the fact that the information at the front position of the preset token queue before the specified position is empty, the state of the token is identified;
[0026] In response to the token being in an unused state, the access permission of the token is assigned to the write request, thereby changing the write request into a current request that is in an executing state;
[0027] Based on the current request, the context information is synchronously written into the first hash table in the first database corresponding to the IMS, and the second hash table in the second database corresponding to the electronic device.
[0028] In some embodiments, the information processing method further includes:
[0029] In response to the context information, synchronous writing to the first hash table and the second hash table is completed, and it is determined that the current request execution has ended;
[0030] In response to the completion of the current request, the token is released and its status is updated from the used state to the unused state.
[0031] In some embodiments, the information processing method further includes:
[0032] In response to the completion of the initialization of the first hash table, the information in the first hash table is exported to the initial second database to obtain the second database containing the second hash table.
[0033] Secondly, embodiments of this application provide an information processing apparatus applied to an electronic device deployed with the Internet Protocol IP Multimedia Subsystem (IMS), the apparatus comprising:
[0034] The determining unit is configured to determine the priority of the write request in response to receiving a write request sent by a user terminal;
[0035] The unit is configured to place the write request into a preset token queue based on the priority of the write request;
[0036] The writing unit is configured to synchronously write the context information of the user terminal into a first hash table in the first database corresponding to the IMS and a second hash table in the second database corresponding to the electronic device, based on the position of the write request in the preset token queue and the token associated with the preset token queue.
[0037] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the information processing method described in the first aspect. Attached Figure Description
[0038] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is one of the flowcharts illustrating an information processing method provided in an embodiment of this application;
[0040] Figure 2 A second schematic flowchart illustrating an information processing method provided in an embodiment of this application;
[0041] Figure 3 A schematic diagram illustrating a structure for calculating the priority of write requests, provided in an embodiment of this application;
[0042] Figure 4 A schematic diagram illustrating the calculation of write request priority using the center-average method, provided as an embodiment of this application;
[0043] Figure 5 The third schematic flowchart of an information processing method provided in this application embodiment;
[0044] Figure 6 The fourth schematic flowchart of an information processing method provided in this application embodiment;
[0045] Figure 7 Fifth of a flowchart illustrating an information processing method provided in this application embodiment;
[0046] Figure 8 A flowchart illustrating an information processing method provided in this application is shown in Figure 6.
[0047] Figure 9 A schematic diagram illustrating how the r_contact parameter in P-CSCF is mapped to a Redis in-memory database, as provided in this application embodiment;
[0048] Figure 10 A schematic diagram of a distributed system architecture provided in an embodiment of this application;
[0049] Figure 11 This is a schematic diagram of the structure of an information processing device provided in an embodiment of this application;
[0050] Figure 12 This is a schematic diagram of the physical structure of an electronic device deployed with the Internet Protocol IP Multimedia Subsystem (IMS) according to an embodiment of this application. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the embodiments of this application.
[0052] It should be noted that in the description of the embodiments of this application, the terms "first," "second," etc., are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited. For example, the first object can be one or more.
[0053] To facilitate a clearer understanding of the various embodiments of this application, some relevant background knowledge will be introduced as follows.
[0054] To meet the demands of the 5G private network market, lightweight 5GC devices need to integrate support for traditional voice functions such as voice and video calls. To achieve this, electronic devices supporting lightweight 5GC typically integrate IMS (Integrated Video Service). IMS is an architectural framework for providing IP multimedia services, supporting various network access methods and multimedia services. By integrating IMS into electronic devices supporting lightweight 5GC, support for traditional voice functions can be achieved while maintaining compatibility with existing networks and service systems.
[0055] However, since IMS and 5GC are defined and standardized by different standardization organizations, and are designed and developed by different teams, there are significant differences between them in the selection of technology stacks and the application of technology platforms.
[0056] Typical lightweight 5GC systems use the in-memory database Redis for data storage and management, while IMS, based on the OpenIMSCore open-source framework, typically uses the relational database MariaDB. Therefore, when integrating IMS into electronic devices that use the in-memory database Redis, it is necessary to ensure that the data in the IMS in-memory hash table is synchronized with the key-value data in the 5GC's Redis.
[0057] This application provides an information processing method, apparatus, and storage medium that can effectively ensure the consistency and synchronization of data in the IMS memory hash table entries with data in the memory database of electronic devices supporting 5GC.
[0058] The information processing method, apparatus, and storage medium provided in the embodiments of this application will be described exemplarily below with reference to the accompanying drawings.
[0059] Figure 1 This is one of the flowcharts illustrating an information processing method provided in an embodiment of this application. The method is applied to an electronic device equipped with an Internet Protocol (IP) Multimedia Subsystem (IMS), such as... Figure 1 As shown, the method includes:
[0060] S101. In response to receiving a write request sent by a user terminal, determine the priority of the write request.
[0061] It should be noted that the user terminal in this application embodiment is a device that can access and communicate with the IMS network, such as a smartphone, tablet computer, desktop computer, and dedicated IMS landline terminal.
[0062] It's important to note that a write request sent by a user terminal is a request sent from the user terminal to the IMS network to perform a specific write operation within the IMS network. For example, a user sends messages (such as text messages, pictures, audio, and video multimedia messages) to an electronic device deployed with IMS via their user terminal. These messages are sent to the IMS network as write requests and processed and forwarded by the corresponding functional entities within the IMS network. As another example, when a user wants to engage in a voice call, video call, or instant messaging session with another user, the user terminal sends a session establishment request to the IMS network. These requests contain the parameters and configuration information required for the session so that the IMS network can correctly establish and maintain the session.
[0063] It should be noted that in an IMS network, write requests sent by user terminals are passed to functional entities responsible for handling such requests, such as the Call Session Control Function (CSCF). The CSCF is the core control node of the IMS network, responsible for processing signaling messages (Session Initiation Protocol, SIP) and providing functions such as user access control, network authentication, session control, service triggering, and Quality of Service (QoS) control.
[0064] In this embodiment, upon receiving a write request from a user terminal, the priority of the write request can be determined in response to the request. It should be noted that different write requests may correspond to different user needs and service quality requirements. By determining the priority of write requests, it can be ensured that the needs of critical business or urgent services are met, thereby improving user satisfaction. Furthermore, the processing power, bandwidth, and storage resources of electronic devices are limited. By determining the priority of write requests, it can be ensured that high-priority requests are processed first, thereby optimizing resource utilization efficiency.
[0065] In some embodiments, different Quality of Service Class Identifier (QCI) values can be assigned to different service types based on user or business needs. The QCI value defines QoS parameters such as transmission priority, packet delay budget, and packet error rate, thereby indirectly determining the priority of write requests.
[0066] In some embodiments, the priority of write requests can be determined based on the current system load.
[0067] S102. Based on the priority of the write request, the write request is placed into a preset token queue.
[0068] It should be noted that a token queue is a collection of write requests that need to be executed, serving two purposes: (1) maintaining the execution order of write requests; and (2) ensuring mutual exclusion among write requests. Both of these are achieved through tokens. The rule is: only the write request that obtains the token can be executed, and the token is returned after execution. Since there is only one token in the token queue, only one write request is in the execution state at any given time.
[0069] In this embodiment of the application, the write request can be placed in the corresponding position in the preset token queue based on the priority of the write request sent by the user terminal.
[0070] In some embodiments, the position in the preset token queue where the write request should be placed can be determined based on the priority of the write request sent by the user terminal and the priority of requests already placed in the preset token queue.
[0071] S103. Based on the position of the write request in the preset token queue and the token associated with the preset token queue, the context information of the user terminal is synchronously written into the first hash table of the first database corresponding to the IMS and the second hash table of the second database corresponding to the electronic device.
[0072] It should be noted that the default token queue is associated with only one token, and only write requests that have obtained the token can be executed.
[0073] It should be noted that the context information of a user terminal refers to a set of data related to the current state, operation, or session of the user terminal, and this set of data may include at least the following information:
[0074] 1. User identity information, including user ID (a unique identifier for the user) and username or nickname (the user's display name in the system);
[0075] 2. Terminal information, including terminal ID (a unique identifier for the user terminal), terminal type (such as mobile phone, tablet computer, etc.), operating system and version (the operating system and its version number running on the user terminal);
[0076] 3. Network status information, including IP address (the IP address of the user terminal, which may be used for geolocation or network access control) and network type (such as Wi-Fi, 4G / 5G, etc., which may affect the speed and stability of data transmission).
[0077] 4. Session information, including session ID (a unique identifier for the user's current session), session start time (the time the session was created), and session duration (the time the session has already lasted or the expected duration).
[0078] It should be noted that the first database corresponding to IMS and the second database corresponding to electronic devices are different databases, and the first database and the second database can be any existing database. This application embodiment does not make any specific limitation on this.
[0079] In some embodiments, the context information of the user terminal can be synchronously written into the first hash table of the first database corresponding to the IMS and the second hash table of the second database corresponding to the electronic device, based on the position of the write request sent by the user terminal in the preset token queue and the usage status of the token associated with the preset token queue, so as to achieve consistency and synchronization between the data in the first database corresponding to the IMS and the data in the second database corresponding to the electronic device.
[0080] In some embodiments, a key and value for a first hash table in the first database corresponding to the IMS can be constructed based on the context information of the user terminal. The key can be a user ID, a session ID, or a combination thereof, and the value is a hash table containing the specific context information of the user terminal. Furthermore, the context information of the user terminal can be written into the first hash table in the first database using hash table operation commands of the first database.
[0081] In some embodiments, the electronic device deployed with IMS may be an electronic device that supports lightweight 5GC, and the second database corresponding to the electronic device may be the in-memory database Redis.
[0082] It's worth noting that Redis is a high-performance key-value database that supports various data structures, such as strings, lists, sets, sorted sets, and hash tables. Among these data structures, hash tables are an important data structure used by Redis to store key-value pairs.
[0083] In some embodiments, where the second database is a Redis in-memory database, the key and value of a hash table entry in Redis can be constructed based on the user terminal's context information. The key can be a user ID, session ID, or a combination thereof, and the value is a hash table containing the specific context information of the user terminal. Furthermore, Redis hash table operation commands can be used to write the user terminal's context information into the second hash table in the Redis in-memory database.
[0084] It is understood that the information processing method provided in this application, in response to receiving a write request sent by a user terminal, first determines the priority of the write request, then places the write request into a preset token queue based on the priority, and then, based on the position of the write request in the preset token queue and the token associated with the preset token queue, synchronously writes the context information of the user terminal into the first hash table of the first database corresponding to the IMS and the second hash table of the second database corresponding to the electronic device. In this way, by introducing priority processing and a token queue mechanism, not only is the controllability and efficiency of the data writing process improved, but the consistency and synchronization of the data in the first database corresponding to the IMS and the data in the second database corresponding to the electronic device can also be effectively ensured.
[0085] In some embodiments, determining the priority of the write request in response to receiving a write request from a user terminal includes:
[0086] In response to receiving the write request, obtain the message type and expiration time corresponding to the write request;
[0087] The priority is determined based on the message type and the expiration time.
[0088] It should be noted that the message type refers to the category or type of the user message sending the write request, which identifies the operation the user terminal wants the electronic device to perform or the type of resource it requests. The message type is usually a string or an enumeration value.
[0089] It should be noted that the expiration time refers to the expiration date of the authentication token. When a user terminal interacts with an electronic device, in order to verify the user terminal's identity and permissions, the electronic device requires the user terminal to include a valid authentication token in the write request.
[0090] It should be noted that the message type and expiration time can both be obtained from the user message corresponding to the write request.
[0091] In some embodiments, the user message corresponding to the write request sent by the user terminal can be parsed to obtain the message type and expiration time.
[0092] It should be noted that different message types may have different impacts on the system. For example, some types of requests may involve modifying critical data, while other types of requests may simply be querying data. Therefore, different priority weights can be assigned to different types of messages according to predefined rules or strategies.
[0093] In some embodiments, if the expiration time of a write request is very close to the current time (e.g., the time difference between the expiration time and the current time is less than a set value), it can be determined that the request needs to be processed first, and a higher priority weight is assigned to the request; if the expiration time of the request is still a long time away from the current time, it can be determined that the request does not need to be processed immediately, and a lower priority weight is assigned to the request.
[0094] In some embodiments, the priority weight of the message type can be combined with the priority weight corresponding to the urgency of the expiration time, and the priority of the write request can be determined by a certain algorithm (such as weighted summation).
[0095] For example, Figure 2 This is a second schematic flowchart illustrating an information processing method provided in an embodiment of this application, as shown below. Figure 2 As shown, the method includes:
[0096] S201. In response to receiving a write request sent by a user terminal, obtain the message type and expiration time corresponding to the write request.
[0097] S202. Determine the priority of the write request based on the message type and the expiration time.
[0098] S203. Based on the priority of the write request, place the write request into a preset token queue.
[0099] S204. Based on the position of the write request in the preset token queue and the token associated with the preset token queue, the context information of the user terminal is synchronously written into the first hash table of the first database corresponding to the IMS and the second hash table of the second database corresponding to the electronic device.
[0100] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0101] It is understood that by determining the priority of a write request based on the message type and expiration time corresponding to the write request, the implementation of this application can intelligently sort the execution order of write requests based on their urgency and importance, ensuring that critical or urgent write requests are processed first, thereby reducing the waiting time for write request execution and improving processing efficiency.
[0102] In some embodiments, determining the priority based on the message type and the expiration time includes:
[0103] The message type and the expiration time are fuzzed to obtain a first value corresponding to the message type and a second value corresponding to the expiration time;
[0104] The priority is obtained by calculating the first value, the first weight corresponding to the message type, the second value, and the second weight corresponding to the expiration time using the central average method.
[0105] It's important to note that fuzzy algorithms (also known as fuzzy logic or fuzzy reasoning) are mathematical methods based on fuzzy set theory, used to handle fuzzy or uncertain information. The core of this algorithm lies in transforming human fuzzy concepts and language into mathematical expressions, thus better handling problems that are difficult to describe precisely in traditional binary logic. Fuzzy sets are the foundation of fuzzy algorithms; they allow elements in a set to belong to that set with a certain membership degree, rather than a simple "belongs" or "does not belong" state. The membership degree is typically a value between 0 and 1, representing the degree to which an element belongs to the set.
[0106] It should be noted that the first weight corresponding to the message type and the second weight corresponding to the expiration time can respectively represent the height of their respective fuzzy sets, and can be adaptively set based on actual applications. This application embodiment does not specifically limit this.
[0107] In this embodiment of the application, the message type and expiration time corresponding to the write request can be fuzzed to obtain the first value corresponding to the message type and the second value corresponding to the expiration time. Then, the center average method is used to calculate the first value corresponding to the message type, the first weight corresponding to the message type, the second value corresponding to the expiration time, and the second weight corresponding to the expiration time to obtain the priority of the write request.
[0108] For example, Figure 3 This application provides a schematic diagram of a structure for calculating the priority of write requests, as shown in the embodiments of the present application. Figure 3 As shown, two pieces of information in the user message corresponding to the write request are used as input parameters of the fuzzy algorithm: the message type (represented by T) corresponding to the write request and the expiration time (represented by TE) corresponding to the write request; the output parameter is P, and the larger the value of P, the higher the priority.
[0109] In some embodiments, if the message type is REQUES, the first weight corresponding to the message type can be set to 1; if the message type is INVITE, the first weight corresponding to the message type can be set to 0.75; if the message type is OTHERS, the first weight corresponding to the message type can be set to 0.5.
[0110] In some embodiments, if the expiration time is greater than or equal to 3600 milliseconds, the second weight corresponding to the expiration time can be set to 0.5; if the expiration time is greater than 1200 milliseconds and less than 3600 milliseconds, the second weight corresponding to the expiration time can be set to 0.75; if the expiration time is less than or equal to 1200 milliseconds, the second weight corresponding to the expiration time can be set to 1.
[0111] In some embodiments, the center averaging method can be used to fuzzify the message type and expiration time. By performing a weighted average of the centers of multiple fuzzy sets, with the weights set to the heights of the corresponding fuzzy sets, a fuzzy output is calculated and used as the priority of the write request. The specific calculation is shown in equation (1):
[0112]
[0113] Among them, y i w is the center of the i-th fuzzy set i Let y be the height (i.e., weight) of the i-th fuzzy set. * This indicates a fuzzy output, which is the desired priority P.
[0114] For example, Figure 4 This application provides a schematic diagram illustrating the calculation of write request priority using the center-average method, as shown in the embodiment. Figure 4 As shown, where y 1 w1 represents the center of the fuzzy set corresponding to the message type, w1 represents the height of the fuzzy set corresponding to the message type, and y represents the center of the fuzzy set corresponding to the message type. 2 w1 represents the center of the fuzzy set corresponding to the expiration time, and w2 represents the height of the fuzzy set corresponding to the expiration time.
[0115] For example, Figure 5 This is a third flowchart illustrating an information processing method provided in an embodiment of this application, as shown below. Figure 5 As shown, the method includes:
[0116] S501. In response to receiving a write request sent by a user terminal, obtain the message type and expiration time corresponding to the write request.
[0117] S502. The message type and the expiration time are fuzzed to obtain a first value corresponding to the message type and a second value corresponding to the expiration time.
[0118] S503. Using the central average method, calculate the priority of the write request by taking the first value, the first weight corresponding to the message type, the second value, and the second weight corresponding to the expiration time.
[0119] S504. Based on the priority of the write request, place the write request into a preset token queue.
[0120] S505. Based on the position of the write request in the preset token queue and the token associated with the preset token queue, the context information of the user terminal is synchronously written into the first hash table of the first database corresponding to the IMS and the second hash table of the second database corresponding to the electronic device.
[0121] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0122] It is understood that, in this embodiment of the application, by fuzzing the message type and expiration time corresponding to the write request, a first value corresponding to the message type and a second value corresponding to the expiration time are obtained. Then, the central average method is used to calculate the first value, the first weight, the second value, and the second weight of the message type, which can effectively obtain the priority of the write request. This realizes the intelligent sorting of the execution order of the write requests based on their urgency and importance, ensuring that critical or urgent write requests can be processed first, thereby reducing the waiting time for the execution of write requests and improving processing efficiency.
[0123] In some embodiments, placing the write request into a preset token queue based on the priority of the write request includes:
[0124] If the preset token queue is empty, the write request will be placed at any position in the preset token queue.
[0125] If the preset token queue is not empty, the write request is placed into the preset token queue based on the priority of the write request and the priority of the requests already placed in the preset token queue.
[0126] It's important to note that when adding a write request to the preset token queue, the current state of the preset token queue (i.e., whether it's empty) and the relationship between the priority of the write request and the priorities of requests already placed in the preset token queue should be considered. Specifically, first check if the preset token queue is empty. If it is, meaning there are no requests yet, the write request can be placed at any position in the queue (since the queue is empty, placing the write request in any position will not affect the correctness of subsequent operations). If the preset token queue is not empty, the placement of the write request can be determined based on its priority and the priorities of requests already placed in the queue. Specifically, the priority of the write request can be compared with the priorities of requests already placed in the queue. If the priority of the write request is higher than the priority of requests already placed, the write request can be placed at the beginning (head) of the queue to ensure faster processing. If the priority of the write request is lower than or equal to the priority of requests already placed, the write request should be added after the requests already placed to maintain the queue's order. That is, based on the priority comparison result, the write request is inserted into the appropriate position in the preset token queue.
[0127] For example, Figure 6 This is a fourth flowchart illustrating an information processing method provided in an embodiment of this application, as shown below. Figure 6As shown, the method includes:
[0128] S601. In response to receiving a write request sent by a user terminal, obtain the message type and expiration time corresponding to the write request.
[0129] S602. The message type and the expiration time are fuzzed to obtain a first value corresponding to the message type and a second value corresponding to the expiration time.
[0130] S603. Using the center average method, calculate the priority of the write request by taking the first value, the first weight corresponding to the message type, the second value, and the second weight corresponding to the expiration time.
[0131] S604. If the preset token queue is empty, place the write request at any position in the preset token queue.
[0132] S605. If the preset token queue is not empty, the write request is placed into the preset token queue based on the priority of the write request and the priority of the requests already placed in the preset token queue.
[0133] S606. Based on the position of the write request in the preset token queue and the token associated with the preset token queue, the context information of the user terminal is synchronously written into the first hash table of the first database corresponding to the IMS and the second hash table of the second database corresponding to the electronic device.
[0134] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0135] It is understood that, by determining the position of the write request in the preset token queue based on the current state of the preset token queue (i.e. whether it is empty) and the relationship between the priority of the write request and the priority of the requests already placed in the preset token queue, this application embodiment can ensure that higher priority requests can be processed faster, especially when system resources are limited or overloaded, and can ensure that critical business or urgent tasks are processed in a timely manner.
[0136] In some embodiments, the preset token queue includes at least one of the already placed requests, and placing the write request into the preset token queue based on the priority of the write request and the priority of the already placed requests in the preset token queue includes one of the following:
[0137] If at least one of the placed requests has a higher priority than the write request, the write request is placed in the preset token queue after at least one of the placed requests.
[0138] If at least one of the placed requests has a lower priority than the write request, the write request is placed in the preset token queue at a position preceding at least one of the placed requests;
[0139] If the priority of the first request is higher than the priority of the write request, and the priority of the second request is lower than the priority of the write request, then the write request is placed in the preset token queue in a position after the first request and before the second request.
[0140] Wherein, the at least one of the placed requests includes: the first request and the second request.
[0141] For example, if the preset token queue includes already placed requests A, B, and C, and the priorities of already placed requests A, B, and C are all higher than the priority of write request D, then write request D can be placed in the preset token queue after already placed requests A, B, and C, to ensure that the high-priority already placed requests A, B, and C can be processed first.
[0142] For example, if the preset token queue includes requests A, B, and C, and the priorities of requests A, B, and C are all lower than the priority of write request D, then write request D can be placed in the preset token queue before requests A, B, and C to ensure that the high-priority write request D can be processed first.
[0143] For example, if the preset token queue includes already placed request A and already placed request B, and the priority of already placed request A is higher than the priority of write request D, and the priority of already placed request B is lower than the priority of write request D, then write request D can be placed in the preset token queue after already placed request A and before already placed request B, so as to ensure that already placed request A, write request D and already placed request B are processed in order of priority.
[0144] It is understood that the embodiments of this application determine the position of the write request in the preset token queue based on the relationship between the priority of the write request and the priority of the requests already placed in the preset token queue. This can ensure that higher priority requests can be processed faster, especially when system resources are limited or overloaded, and can ensure that critical business or urgent tasks are processed in a timely manner.
[0145] In some embodiments, the step of synchronously writing the context information of the user terminal into a first hash table in the first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device, based on the position of the write request in the preset token queue and the token associated with the preset token queue, includes:
[0146] In response to the fact that the information at the front position of the preset token queue before the specified position is empty, the state of the token is identified;
[0147] In response to the token being in an unused state, the access permission of the token is assigned to the write request, thereby changing the write request into a current request that is in an executing state;
[0148] Based on the current request, the context information is synchronously written into the first hash table in the first database corresponding to the IMS, and the second hash table in the second database corresponding to the electronic device.
[0149] It should be noted that if the information at the front end of the preset token queue before the write request position is empty, it indicates that the request before the write request position in the preset token queue has been processed. At this time, the status of the token associated with the preset token queue can be identified. If the status of the token is unused, the calling permission of the token can be assigned to the write request to change the write request to the current request in the execution state. Then, based on the current request, the context information of the user terminal is synchronously written to the first hash table in the first database corresponding to IMS and the second hash table in the second database corresponding to the electronic device.
[0150] In some embodiments, if the token is identified as being in use, it indicates that the token may currently be used to process requests sent by other user terminals. After the token's status changes from being in use to being unused, the token's access permission can be assigned to a write request to change the write request to a current request in an execution state. Then, based on the current request, the context information of the user terminal is synchronously written to the first hash table in the first database corresponding to the IMS and the second hash table in the second database corresponding to the electronic device.
[0151] For example, Figure 7This is the fifth flowchart illustrating an information processing method provided in an embodiment of this application, as shown below. Figure 7 As shown, the method includes:
[0152] S701. In response to receiving a write request sent by a user terminal, determine the priority of the write request.
[0153] S702. Based on the priority of the write request, the write request is placed into a preset token queue.
[0154] S703. In response to the fact that the information at the front end of the preset token queue before the position of the write request in the preset token queue is empty, the state of the token is identified.
[0155] S704. In response to the token being in an unused state, the token's access permission is assigned to the write request, thereby changing the write request into a current request in an executing state.
[0156] S705. Based on the current request, the context information is synchronously written into the first hash table in the first database corresponding to the IMS and the second hash table in the second database corresponding to the electronic device.
[0157] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0158] It is understood that the embodiments of this application adopt a token-based synchronization mechanism, which uses tokens to ensure the orderly writing of requests, thereby ensuring that higher priority requests can be processed faster, especially when system resources are limited or overloaded, and ensuring that critical business or urgent tasks are processed in a timely manner.
[0159] In some embodiments, the method further includes:
[0160] In response to the context information, synchronous writing to the first hash table and the second hash table is completed, and it is determined that the current request execution has ended;
[0161] In response to the completion of the current request, the token is released and its status is updated from the used state to the unused state.
[0162] It's important to note that when a process or thread completes a task that requires a token to execute, it needs to return the token to the system. This typically occurs when the task is completed, a system error occurs, or resources need to be released. The token return process can be implemented by calling a specific system function or method. This function or method is responsible for transferring the token from the current process's or thread's holding state to the system or token pool. After the token is returned, the system needs to update the token's state, which may include marking the token as available, updating the token quantity, or modifying other state information associated with the token.
[0163] In this embodiment of the application, after the context information of the user terminal is synchronously written into the first hash table of the first database corresponding to the IMS and the second hash table of the second database corresponding to the electronic device based on the current request, the context information can be synchronously written into the first hash table and the second hash table in response to the completion of the synchronous writing of the context information, the current request execution is determined to be completed, and then the token associated with the preset token queue is released in response to the completion of the current request execution, and the status of the token is updated from the used state to the unused state.
[0164] For example, Figure 8 This is a sixth flowchart illustrating an information processing method provided in an embodiment of this application, as shown below. Figure 8 As shown, the method includes:
[0165] S801. In response to receiving a write request sent by a user terminal, determine the priority of the write request.
[0166] S802. Based on the priority of the write request, place the write request into a preset token queue.
[0167] S803. In response to the fact that the information at the front end of the preset token queue before the position of the write request in the preset token queue is empty, the state of the token is identified.
[0168] S804. In response to the token being in an unused state, the token's access permission is assigned to the write request, thereby changing the write request into a current request in an executing state.
[0169] S805. Based on the current request, the context information is synchronously written into the first hash table in the first database corresponding to the IMS and the second hash table in the second database corresponding to the electronic device.
[0170] S806. In response to the context information, complete the synchronous writing to the first hash table and the second hash table, and determine that the current request execution has ended.
[0171] S807. In response to the completion of the current request, release the token and update the token's status from the used state to the unused state.
[0172] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0173] It is understood that the embodiments of this application improve the system's throughput and response speed by using and releasing tokens, enabling other waiting requests to obtain tokens and execute them.
[0174] In some embodiments, the method further includes:
[0175] In response to the completion of the initialization of the first hash table, the information in the first hash table is exported to the initial second database to obtain the second database containing the second hash table.
[0176] In this embodiment of the application, after the first hash table is initialized, the information in the first hash table can be exported to the initial second database, thereby obtaining a second database with a second hash table, so that the data in the first database and the second database are consistent.
[0177] In some embodiments, when there are multiple first hash tables in the first database, a first identifier corresponding to each first hash table can be determined, and the first identifier corresponding to each first hash table can be used as the key in the second hash table, and the content of each first hash table can be used as the value corresponding to the key in the second hash table.
[0178] It should be noted that the IMS system contains seven primary hash tables related to user context information: Proxy Call Session Control Function (P-CSCF) registrar, P-CSCF subscription dialogs, Serving Call Session Control Function (S-CSCF) authentication, S-CSCF registration, S-CSCF dialogs, and Interrogating Call Session Control Function (I-CSCF) lists. These seven primary hash tables store information related to P-CSCF registration and subscription, S-CSCF authentication, registration, and sessions, and I-CSCF lists, respectively. Information from these seven primary hash tables can be exported and written to the initial secondary database.
[0179] For example, Figure 9 This application provides a schematic diagram illustrating how to map the r_contact parameter in P-CSCF to a Redis in-memory database, as shown in the embodiments of this application. Figure 9 As shown, the keys written to the hash table in the Redis in-memory database are obtained by decomposing various hash table variables in the IMS system. The data writing process can include:
[0180] 1. The IMS system connects to the Redis database;
[0181] 2. Determine if there are any business processes that need to be processed, such as user registration or session updates;
[0182] 3. If it is determined that there are business processes such as user registration and session updates that need to be processed, each CSCF processes the business information, parses the parameters that need to be written, and passes the parsed data packet to the token queue. This token queue is used to temporarily store the data to be written to the Redis database so that it can be written in order later.
[0183] 4. Iterate through the data packets in the token queue, and for each data packet in the token queue, call the token preemption write mechanism to realize the IMS system writing to the Redis database;
[0184] 5. End the loop and process: The loop ends when all data packets in the token queue have been processed (i.e., all data packets that need to be written to the Redis database have been written).
[0185] Understandably, hot data backup can be achieved by writing data from the IMS database to the Redis database. Redis Sentinel is a high-availability solution for Redis, ensuring the stability and reliability of the Redis service.
[0186] For example, Figure 10 A schematic diagram of a distributed system architecture provided for an embodiment of this application, such as... Figure 10 As shown, the system includes two resource nodes, node1 and node2. Building upon the original sentinel mode, each resource node's deployment unit (pod) adds a monitoring module, `monitor`, responsible for monitoring the sentinel's detection status of the cluster. If the sentinel detects that the peer node is in a state of subjective attack or that a client is offline, it triggers the promotion of the current pod's Redis instance to the primary database. The two pods maintain the same number of Redis instance groups: one for caching (Redis-HA) and the other for persistence (Redis-HA-for-persist). Here, NF stands for Network Service, handling network requests and data transmission, while `sideCar` is a service container used to enhance or extend the main service's functionality, such as log collection, monitoring, and security.
[0187] In some embodiments, the Append Only File (AOF) feature can be enabled in the Redis configuration file (it is disabled by default), and the AOF filename stored locally can be specified. An always-always configuration strategy is used to ensure data is synchronized to disk and to prevent loss of business configurations. The configuration information may include:
[0188] appendonly: Redis persistence method. To enable AOF, you need to change this to "yes".
[0189] appendfilename: AOF filename; backupIMS.aof;
[0190] appendfsync: Configuration of AOF persistence strategy; fsync.
[0191] It's important to note that `no` means `fsync` is not performed, allowing the operating system to ensure data synchronization to disk. This is the fastest option, but less secure. `always` means `fsync` is performed on every write operation to guarantee data synchronization to disk, offering high reliability but lower efficiency. `everysec` means `fsync` is performed once per second, potentially resulting in the loss of one second of data. `everysec` is usually chosen to balance security and efficiency.
[0192] Understandable, Figure 10 The Redis master (i.e., the primary Redis database) can be used to process real-time data, while the Redis standby (i.e., the standby Redis database) serves as a backup to the master database and can take over the service when the master fails, effectively achieving hot data backup and ensuring data continuity and availability. Furthermore, the embodiments of this application can bring at least the following beneficial effects: maximizing the use of the existing 5GC high-availability framework with minimal workload; involving only modifications to IMS, exhibiting strong portability and suitable for cloud deployment and appliance deployment scenarios; and enabling fast fault recovery, achieving second-level fault recovery.
[0193] The information processing apparatus provided in the embodiments of this application is described below. The information processing apparatus described below and the information processing method described above can be referred to in correspondence.
[0194] Figure 11 This is a schematic diagram of an information processing device provided in an embodiment of this application. The device is applied to an electronic device deployed with the Internet Protocol IP Multimedia Subsystem (IMS). Figure 11 As shown, the device includes: a determining unit 1110, an inserting unit 1120, and a writing unit 1130; wherein:
[0195] The determining unit 1110 is configured to determine the priority of the write request in response to receiving a write request sent by a user terminal;
[0196] The input unit 1120 is configured to input the write request into a preset token queue based on the priority of the write request.
[0197] The writing unit 1130 is configured to synchronously write the context information of the user terminal into the first hash table of the first database corresponding to the IMS and the second hash table of the second database corresponding to the electronic device, based on the position of the write request in the preset token queue and the token associated with the preset token queue.
[0198] The information processing apparatus provided in this application embodiment, in response to receiving a write request sent by a user terminal, first determines the priority of the write request, then places the write request into a preset token queue based on the priority, and then, based on the position of the write request in the preset token queue and the token associated with the preset token queue, synchronously writes the context information of the user terminal into a first hash table in the first database corresponding to the IMS and a second hash table in the second database corresponding to the electronic device. In this way, by introducing priority processing and a token queue mechanism, not only is the controllability and efficiency of the data writing process improved, but the consistency and synchronization of the data in the first database corresponding to the IMS and the data in the second database corresponding to the electronic device can also be effectively ensured.
[0199] In some embodiments, the determining unit 1110 is further configured to: in response to receiving the write request, obtain the message type and expiration time corresponding to the write request; and determine the priority based on the message type and the expiration time.
[0200] In some embodiments, the determining unit 1110 is further configured to: fuzzify the message type and the expiration time to obtain a first value corresponding to the message type and a second value corresponding to the expiration time; and use the center average method to calculate the first value, the first weight corresponding to the message type, the second value, and the second weight corresponding to the expiration time to obtain the priority.
[0201] In some embodiments, the placement unit 1120 is further configured to: place the write request at any position in the preset token queue when the preset token queue is empty; and place the write request into the preset token queue based on the priority of the write request and the priority of requests already placed in the preset token queue when the preset token queue is not empty.
[0202] In some embodiments, the preset token queue includes at least one of the placed requests, and the placement unit 1120 is further configured to: place the write request in the preset token queue after at least one of the placed requests if the priority of at least one placed request is higher than the priority of the write request; place the write request in the preset token queue before at least one of the placed requests if the priority of at least one placed request is lower than the priority of the write request; place the write request in the preset token queue after the first request and before the second request if the priority of the first request is higher than the priority of the write request and the priority of the second request is lower than the priority of the write request; wherein the at least one placed request includes: the first request and the second request.
[0203] In some embodiments, the writing unit 1130 is further configured to: identify the state of the token in response to the information at the front end position before the position in the preset token queue being empty; allocate the calling permission of the token to the writing request in response to the state of the token being unused, so as to change the writing request to a current request in an executing state; and synchronously write the context information into the first hash table in the first database corresponding to the IMS and the second hash table in the second database corresponding to the electronic device based on the current request.
[0204] In some embodiments, the apparatus further includes:
[0205] The release unit is configured to, in response to the context information, complete the synchronous writing to the first hash table and the second hash table, determine that the current request execution has ended; in response to the end of the current request execution, release the token, and update the token's status from the used state to the unused state.
[0206] In some embodiments, the apparatus further includes:
[0207] The export unit is configured to export information from the first hash table to an initial second database in response to the completion of the initialization of the first hash table, so as to obtain a second database with the second hash table.
[0208] It should be noted that the information processing apparatus provided in this application embodiment can implement all the method steps implemented in the above information processing method embodiment and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0209] Figure 12A schematic diagram of the physical structure of an electronic device deployed with the Internet Protocol IP Multimedia Subsystem (IMS) is provided for an embodiment of this application, as shown below. Figure 12 As shown, the electronic device may include a processor 1210, a communications interface 1220, a memory 1230, and a communication bus 1240, wherein the processor 1210, the communications interface 1220, and the memory 1230 communicate with each other via the communication bus 1240. The processor 1210 may call executable data instructions stored in the memory 1230 to perform some or all of the steps in the information processing methods provided in the above embodiments.
[0210] Furthermore, the executable data instructions stored in the aforementioned memory 1230 can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the related technology, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0211] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements some or all of the steps in the information processing methods provided in the above embodiments.
[0212] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can perform some or all of the steps in the information processing methods provided in the above embodiments.
[0213] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0214] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, embodiments of this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage) containing computer-usable program code.
[0215] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0216] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0217] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0218] The above description is merely an optional embodiment of this application and is not intended to limit the scope of protection of this application.
Claims
1. An information processing method applied to an electronic device equipped with an Internet Protocol IP Multimedia Subsystem (IMS), the method comprising: In response to receiving a write request from a user terminal, the priority of the write request is determined; Based on the priority of the write request, the write request is placed into a preset token queue; In response to the fact that the information at the front end of the preset token queue before the write request position is empty, the state of the token is identified; In response to the token being in an unused state, the access permission of the token is assigned to the write request, thereby changing the write request into a current request that is in an executing state; Based on the current request, the context information is synchronously written to the first hash table in the first database corresponding to the IMS and the second hash table in the second database corresponding to the electronic device; wherein, the first database is a relational database and the second database is an in-memory database; the context information includes at least one of the following: user identity information, terminal information, network status information and session information.
2. The method according to claim 1, wherein determining the priority of the write request in response to receiving a write request sent by a user terminal includes: In response to receiving the write request, obtain the message type and expiration time corresponding to the write request; The priority is determined based on the message type and the expiration time.
3. The method according to claim 2, wherein determining the priority based on the message type and the expiration time includes: The message type and the expiration time are fuzzed to obtain a first value corresponding to the message type and a second value corresponding to the expiration time; The priority is obtained by calculating the first value, the first weight corresponding to the message type, the second value, and the second weight corresponding to the expiration time using the central average method.
4. The method according to any one of claims 1 to 3, wherein placing the write request into a preset token queue based on the priority of the write request includes: If the preset token queue is empty, the write request will be placed at any position in the preset token queue. If the preset token queue is not empty, the write request is placed into the preset token queue based on the priority of the write request and the priority of the requests already placed in the preset token queue.
5. The method according to claim 4, wherein the preset token queue includes at least one of the already placed requests, and the step of placing the write request into the preset token queue based on the priority of the write request and the priority of the already placed requests in the preset token queue includes one of the following: If at least one of the placed requests has a higher priority than the write request, the write request is placed in the preset token queue after at least one of the placed requests. If at least one of the placed requests has a lower priority than the write request, the write request is placed in the preset token queue at a position preceding at least one of the placed requests; If the priority of the first request is higher than the priority of the write request, and the priority of the second request is lower than the priority of the write request, the write request is placed in the preset token queue at a position after the first request and before the second request; wherein, the at least one of the placed requests includes: the first request and the second request.
6. The method according to claim 1, further comprising: In response to the context information, synchronous writing to the first hash table and the second hash table is completed, and it is determined that the current request execution has ended; In response to the completion of the current request, the token is released and its status is updated from the used state to the unused state.
7. The method according to claim 6, further comprising: In response to the completion of the initialization of the first hash table, the information in the first hash table is exported to the initial second database to obtain the second database containing the second hash table.
8. An information processing apparatus, applied to an electronic device equipped with an Internet Protocol (IP) Multimedia Subsystem (IMS), the apparatus comprising: The determining unit is configured to determine the priority of the write request in response to receiving a write request sent by a user terminal; The unit is configured to place the write request into a preset token queue based on the priority of the write request; The writing unit is configured to identify the state of the token in response to the information at the front end of the preset token queue before the write request position being empty; In response to the token being in an unused state, the access permission of the token is assigned to the write request, thereby changing the write request into a current request that is in an executing state; Based on the current request, the context information is synchronously written to the first hash table in the first database corresponding to the IMS and the second hash table in the second database corresponding to the electronic device; wherein, the first database is a relational database and the second database is an in-memory database; the context information includes at least one of the following: user identity information, terminal information, network status information and session information.
9. A computer-readable storage medium storing computer-executable instructions that, when executed, enable the implementation of the information processing method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
IMS business automatic starting method, apparatus and network element
CN107579945A
Data processing method and device and readable storage medium
CN116027982A
