CN119299433A - Information processing method, device and storage medium - Google Patents
Information processing method, device and storage medium Download PDFInfo
- Publication number
- CN119299433A CN119299433A CN202411376136.2A CN202411376136A CN119299433A CN 119299433 A CN119299433 A CN 119299433A CN 202411376136 A CN202411376136 A CN 202411376136A CN 119299433 A CN119299433 A CN 119299433A
- Authority
- CN
- China
- Prior art keywords
- request
- priority
- write request
- hash table
- token queue
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000010365 information processing Effects 0.000 title claims abstract description 38
- 238000003672 processing method Methods 0.000 title claims abstract description 30
- 238000000034 method Methods 0.000 claims abstract description 57
- 230000004044 response Effects 0.000 claims abstract description 50
- 230000001360 synchronised effect Effects 0.000 claims description 11
- 230000008859 change Effects 0.000 claims description 9
- 238000004891 communication Methods 0.000 abstract description 7
- 238000005516 engineering process Methods 0.000 abstract description 5
- 230000006870 function Effects 0.000 description 20
- 238000010586 diagram Methods 0.000 description 18
- 230000008569 process Effects 0.000 description 15
- 238000004590 computer program Methods 0.000 description 14
- 238000012545 processing Methods 0.000 description 13
- 238000004422 calculation algorithm Methods 0.000 description 5
- 230000007246 mechanism Effects 0.000 description 4
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 3
- 238000013523 data management Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 230000002688 persistence Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000011084 recovery Methods 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000007717 exclusion Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000012067 mathematical method Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/10—Architectures or entities
- H04L65/1016—IP multimedia subsystem [IMS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/321—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
- H04L9/3213—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Power Engineering (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请公开了一种信息处理方法、装置及存储介质,应用于部署有网际互连协议IP多媒体子系统IMS的电子设备,涉及通信技术领域。所述方法包括:响应于接收到用户终端发送的写入请求,确定所述写入请求的优先级;基于所述写入请求的优先级,将所述写入请求放入预设令牌队列;基于所述写入请求在所述预设令牌队列中的位置和所述预设令牌队列关联的令牌,将所述用户终端的上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。
The present application discloses an information processing method, device and storage medium, which are applied to electronic devices deployed with an Internet Multimedia Subsystem (IMS) of an Internet Protocol, and relate to the field of communication technology. The method comprises: in response to receiving a write request sent by a user terminal, determining the priority of the write request; based on the priority of the write request, placing the write request into a preset token queue; based on the position of the write request in the preset token queue and the token associated with the preset token queue, synchronously writing the context information of the user terminal into a first hash table in a first database corresponding to the IMS, and a second hash table in a second database corresponding to the electronic device.
Description
技术领域Technical Field
本申请涉及通信技术领域,尤其涉及一种信息处理方法、装置及存储介质。The present application relates to the field of communication technology, and in particular to an information processing method, device and storage medium.
背景技术Background Art
为了使轻量级5G核心网(5G Core Network,5GC)一体化支持语音通话和视频通话等传统话音功能,需要将网际互连协议(Internet Protocol,IP)多媒体子系统(IPMultimedia Subsystem,IMS)集成到支持5GC的电子设备中。In order to enable the lightweight 5G Core Network (5GC) to support traditional voice functions such as voice calls and video calls, it is necessary to integrate the Internet Protocol (IP) Multimedia Subsystem (IMS) into electronic devices that support 5GC.
然而,由于典型的轻量级5GC和IMS使用不同的数据库进行数据存储与管理,因此,在将IMS集成到支持5GC的电子设备中时,如何确保IMS对应数据库中的数据与支持5GC的电子设备对应数据库中的数据保持同步,是业界目前亟待解决的技术问题。However, since typical lightweight 5GC and IMS use different databases for data storage and management, when integrating IMS into electronic devices that support 5GC, how to ensure that the data in the corresponding database of IMS is synchronized with the data in the corresponding database of electronic devices that support 5GC is a technical problem that the industry urgently needs to solve.
发明内容Summary of the invention
针对上述技术问题,本申请实施例提供一种信息处理方法、装置及存储介质。In response to the above technical problems, embodiments of the present application provide an information processing method, device, and storage medium.
本申请实施例的技术方案是这样实现的:The technical solution of the embodiment of the present application is implemented as follows:
第一方面,本申请实施例提供一种信息处理方法,应用于部署有网际互连协议IP多媒体子系统IMS的电子设备,所述方法包括:In a first aspect, an embodiment of the present application provides an information processing method, which is applied to an electronic device deployed with an Internet Protocol IP Multimedia Subsystem IMS, and the method includes:
响应于接收到用户终端发送的写入请求,确定所述写入请求的优先级;In response to receiving a write request sent by a user terminal, determining a priority of the write request;
基于所述写入请求的优先级,将所述写入请求放入预设令牌队列;Based on the priority of the write request, placing the write request into a preset token queue;
基于所述写入请求在所述预设令牌队列中的位置和所述预设令牌队列关联的令牌,将所述用户终端的上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。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 a first hash table in a first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device.
在一些实施例中,所述响应于接收到用户终端发送的写入请求,确定所述写入请求的优先级,包括:In some embodiments, in response to receiving a write request sent by a user terminal, determining the priority of the write request includes:
响应于接收到所述写入请求,获取所述写入请求对应的报文类型和过期时间;In response to receiving the write request, obtaining a message type and an expiration time corresponding to the write request;
基于所述报文类型和所述过期时间,确定所述优先级。The priority is determined based on the message type and the expiration time.
在一些实施例中,所述基于所述报文类型和所述过期时间,确定所述优先级,包括:In some embodiments, determining the priority based on the message type and the expiration time includes:
对所述报文类型和所述过期时间进行模糊化,得到所述报文类型对应的第一取值和所述过期时间对应的第二取值;Fuzzifying 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;
采用中心平均法,对所述第一取值、所述报文类型对应的第一权重、所述第二取值以及所述过期时间对应的第二权重进行计算,得到所述优先级。The center average method is used 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.
在一些实施例中,所述基于所述写入请求的优先级,将所述写入请求放入预设令牌队列,包括:In some embodiments, placing the write request into a preset token queue based on the priority of the write request includes:
在所述预设令牌队列为空的情况下,将所述写入请求放入所述预设令牌队列中的任一位置处;When the preset token queue is empty, placing the write request at any position in the preset token queue;
在所述预设令牌队列不为空的情况下,基于所述写入请求的优先级和所述预设令牌队列中已放入请求的优先级,将所述写入请求放入所述预设令牌队列。When the preset token queue is not empty, the write request is placed in 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.
在一些实施例中,所述预设令牌队列中包括至少一个所述已放入请求,所述基于所述写入请求的优先级和所述预设令牌队列中已放入请求的优先级,将所述写入请求放入所述预设令牌队列,包括以下之一:In some embodiments, the preset token queue includes at least one of the 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 placed requests in the preset token queue includes one of the following:
在至少一个所述已放入请求的优先级均高于所述写入请求的优先级的情况下,将所述写入请求放入所述预设令牌队列中处于至少一个所述已放入请求之后的位置;In the case where the priority of at least one of the placed requests is higher than the priority of the write request, placing the write request in the preset token queue at a position after at least one of the placed requests;
在至少一个所述已放入请求的优先级低于所述写入请求的优先级的情况下,将所述写入请求放入所述预设令牌队列中处于至少一个所述已放入请求之前的位置;In the case where the priority of at least one of the placed requests is lower than the priority of the write request, placing the write request in the preset token queue at a position before at least one of the placed requests;
在第一请求的优先级高于所述写入请求的优先级,且第二请求的优先级低于所述写入请求的优先级的情况下,将所述写入请求放入所述预设令牌队列中处于所述第一请求之后且处于所述第二请求之前的位置;When 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, placing the write request in the preset token queue after the first request and before the second request;
其中,所述至少一个所述已放入请求包括:所述第一请求和所述第二请求。The at least one placed request includes: the first request and the second request.
在一些实施例中,所述基于所述写入请求在所述预设令牌队列中的位置和所述预设令牌队列关联的令牌,将所述用户终端的上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表,包括:In some embodiments, based on the position of the write request in the preset token queue and the token associated with the preset token queue, 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 the second database corresponding to the electronic device includes:
响应于所述预设令牌队列中处于所述位置之前的前端位置上的信息为空,识别所述令牌的状态;In response to the information at the front position before the position in the preset token queue being empty, identifying the state of the token;
响应于所述令牌的状态为未使用状态,将所述令牌的调用权限分配至所述写入请求,以将所述写入请求变更为处于执行状态的当前请求;In response to the state of the token being an unused state, allocating the calling permission of the token to the write request to change the write request to a current request in an execution state;
基于所述当前请求,将所述上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。Based on the current request, the context information is synchronously written into a first hash table in a first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device.
在一些实施例中,所述信息处理方法还包括:In some embodiments, the information processing method further includes:
响应于所述上下文信息,完成同步写入所述第一哈希表和所述二哈希表,确定所述当前请求执行结束;In response to the context information, completing synchronous writing into the first hash table and the second hash table, and determining that the execution of the current request is completed;
响应于所述当前请求执行结束,释放所述令牌,并将所述令牌的状态从使用状态更新为所述未使用状态。In response to the current request execution being completed, the token is released, and the state of the token is updated from the used state to the unused state.
在一些实施例中,所述信息处理方法还包括:In some embodiments, the information processing method further includes:
响应于所述第一哈希表完成初始化,将所述第一哈希表中的信息导出至初始第二数据库,以得到有所述第二哈希表的所述第二数据库。In response to the completion of 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 having the second hash table.
第二方面,本申请实施例提供一种信息处理装置,应用于部署有网际互连协议IP多媒体子系统IMS的电子设备,所述装置包括:In a second aspect, an embodiment of the present application provides an information processing device, which is applied to an electronic device deployed with an Internet Protocol IP Multimedia Subsystem IMS, and the device includes:
确定单元,被配置为响应于接收到用户终端发送的写入请求,确定所述写入请求的优先级;a determining unit, configured to, in response to receiving a write request sent by a user terminal, determine a priority of the write request;
放入单元,被配置为基于所述写入请求的优先级,将所述写入请求放入预设令牌队列;a placing unit configured to place the write request into a preset token queue based on the priority of the write request;
写入单元,被配置为基于所述写入请求在所述预设令牌队列中的位置和所述预设令牌队列关联的令牌,将所述用户终端的上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。The writing unit is configured to synchronously write the context information of the user terminal into a first hash table in a 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.
第三方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序被处理器运行时,实现如第一方面所述的信息处理方法。In a third aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the information processing method described in the first aspect is implemented.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
图1为本申请实施例提供的一种信息处理方法的流程示意图之一;FIG1 is a flow chart of an information processing method according to an embodiment of the present application;
图2为本申请实施例提供的一种信息处理方法的流程示意图之二;FIG2 is a second flow chart of an information processing method provided in an embodiment of the present application;
图3为本申请实施例提供的一种计算写入请求的优先级的结构示意图;FIG3 is a schematic diagram of a structure for calculating the priority of a write request provided by an embodiment of the present application;
图4为本申请实施例提供的一种利用中心平均法计算写入请求的优先级的示意图;FIG4 is a schematic diagram of calculating the priority of a write request using a center average method according to an embodiment of the present application;
图5为本申请实施例提供的一种信息处理方法的流程示意图之三;FIG5 is a third flow chart of an information processing method provided in an embodiment of the present application;
图6为本申请实施例提供的一种信息处理方法的流程示意图之四;FIG6 is a fourth flow chart of an information processing method provided in an embodiment of the present application;
图7为本申请实施例提供的一种信息处理方法的流程示意图之五;FIG7 is a fifth flow chart of an information processing method provided in an embodiment of the present application;
图8为本申请实施例提供的一种信息处理方法的流程示意图之六;FIG8 is a sixth flow chart of an information processing method provided in an embodiment of the present application;
图9为本申请实施例提供的一种将P-CSCF中的r_contact部分参数映射至Redis内存数据库的示意图;FIG9 is a schematic diagram of mapping some parameters of r_contact in P-CSCF to a Redis memory database provided by an embodiment of the present application;
图10为本申请实施例提供的一种分布式系统架构示意图;FIG10 is a schematic diagram of a distributed system architecture provided in an embodiment of the present application;
图11为本申请实施例提供的一种信息处理装置的结构示意图;FIG11 is a schematic diagram of the structure of an information processing device provided in an embodiment of the present application;
图12为本申请实施例提供的一种部署有网际互连协议IP多媒体子系统IMS的电子设备的实体结构示意图。FIG. 12 is a schematic diagram of the physical structure of an electronic device deployed with an Internet Multimedia Subsystem IMS of the Internet Protocol IP provided in an embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有付出创造性劳动的前提下所获得的所有其他实施例,都属于本申请实施例保护的范围。In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present application.
需要说明的是,在本申请实施例的描述中,术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便于本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。It should be noted that in the description of the embodiments of the present 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 the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.
为了便于更加清晰地理解本申请各实施例,首先对一些相关的背景知识进行如下介绍。In order to facilitate a clearer understanding of the embodiments of the present application, some relevant background knowledge is first introduced as follows.
面向第五代移动通信(5th Generation,5G)专网市场的需求,轻量级5GC需要一体化支持语音通话和视频通话等传统话音功能。为了实现语音通话和视频通话功能,支持轻量级5GC的电子设备通常会集成IMS。IMS是一个用于提供IP多媒体服务的架构框架,它支持多种网络接入方式和多媒体业务。通过将IMS集成到支持轻量级5GC的电子设备中,可以实现对传统话音功能的支持,同时保持与现有网络和业务系统的兼容性。In response to the needs of the private network market for the fifth generation of mobile communications (5G), lightweight 5GC needs to support traditional voice functions such as voice calls and video calls. In order to achieve voice and video call functions, electronic devices that support lightweight 5GC usually integrate IMS. IMS is an architecture framework for providing IP multimedia services. It supports multiple network access methods and multimedia services. By integrating IMS into electronic devices that support lightweight 5GC, support for traditional voice functions can be achieved while maintaining compatibility with existing networks and business systems.
然而,由于IMS和5GC分别由不同的标准化组织负责定义和规范,而且在设计和开发过程中由不同的团队负责,因此两者在技术栈的选择和技术中台的应用上存在显著的差异。However, since IMS and 5GC are defined and specified by different standardization organizations and are designed and developed by different teams, there are significant differences between the two in the choice of technology stack and the application of technology middle platform.
典型的轻量级5GC通常使用内存数据库Redis进行数据存储与管理,而基于OpenIMSCore开源框架的IMS通常使用关系型数据库Mariadb进行数据存储与管理。因此,在将IMS集成到使用内存数据库Redis的轻量级5GC对应的电子设备中时,需要确保IMS内存HASH表项中的数据与5GC的Redis中的Key-value数据保持同步。Typical lightweight 5GCs usually use the in-memory database Redis for data storage and management, while IMS based on the OpenIMSCore open source framework usually uses the relational database Mariadb for data storage and management. Therefore, when integrating IMS into electronic devices corresponding to lightweight 5GCs using the in-memory database Redis, it is necessary to ensure that the data in the IMS in-memory HASH table items is synchronized with the key-value data in the 5GC's Redis.
本申请实施例提供一种信息处理方法、装置及存储介质,能够有效确保IMS内存哈希表项中的数据与支持5GC的电子设备的内存数据库中的数据的一致性和同步性。The embodiments of the present application provide an information processing method, device, and storage medium, which can effectively ensure the consistency and synchronization of data in an IMS memory hash table entry and data in a memory database of an electronic device supporting 5GC.
下面结合本申请实施例中的附图,对本申请实施例提供的信息处理方法、装置及存储介质进行示例性地介绍。The following is an illustrative introduction to the information processing method, device and storage medium provided in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application.
图1为本申请实施例提供的一种信息处理方法的流程示意图之一,该方法应用于部署有网际互连协议IP多媒体子系统IMS的电子设备,如图1所示,该方法包括:FIG. 1 is one of the flow diagrams of an information processing method provided in an embodiment of the present application. The method is applied to an electronic device deployed with an Internet Protocol IP Multimedia Subsystem IMS. As shown in FIG. 1 , the method includes:
S101、响应于接收到用户终端发送的写入请求,确定所述写入请求的优先级。S101. In response to receiving a write request sent by a user terminal, determine a priority of the write request.
需要说明的是,本申请实施例中的用户终端是能够接入IMS网络并与之进行通信的设备,例如可以包括智能手机、平板电脑、桌面电脑和专门的IMS固话终端等。It should be noted that the user terminal in the embodiment of the present application is a device that can access the IMS network and communicate with it, for example, it may include a smart phone, a tablet computer, a desktop computer, and a dedicated IMS fixed-line terminal.
需要说明的是,用户终端发送的写入请求是用户终端向IMS网络发送的一种请求,用于在IMS网络中执行特定的写入操作。例如,用户通过用户终端发送消息(如文本消息、图片、音频和视频等多媒体消息)给部署有IMS的电子设备。这些消息将作为写入请求被发送到IMS网络,并由IMS网络中的相应功能实体进行处理和转发。又例如,当用户想要与其他用户进行语音通话、视频通话或即时消息会话时,用户终端会向IMS网络发送会话建立请求。这些请求包含了会话所需的参数和配置信息,以便IMS网络能够正确地建立和维护会话。It should be noted that the write request sent by the user terminal is a request sent by the user terminal to the IMS network, which is used to perform a specific write operation in the IMS network. For example, a user sends a message (such as a text message, picture, audio, video and other multimedia messages) to an electronic device deployed with IMS through a user terminal. These messages will be sent to the IMS network as a write request and processed and forwarded by the corresponding functional entities in the IMS network. For another example, when a user wants to have a voice call, video call or instant messaging session with other users, the user terminal will send 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.
需要说明的是,在IMS网络中,用户终端发送的写入请求会被传递到负责处理此类请求的功能实体,如呼叫会话控制功能(Call Session Control Function,CSCF)。CSCF是IMS网络的核心控制节点,负责处理信令消息(Session Initiation Protocol,SIP),提供用户访问控制、网络鉴权认证、会话控制、业务触发和服务质量(Quality of Service,QoS)控制等功能。It should be noted that in the IMS network, the write request sent by the user terminal will be passed to the functional entity responsible for processing such requests, such as the Call Session Control Function (CSCF). CSCF is the core control node of the IMS network, responsible for processing signaling messages (Session Initiation Protocol, SIP), providing user access control, network authentication, session control, service triggering and quality of service (QoS) control functions.
本申请实施例中,在接收到用户终端发送的写入请求时,可以响应于该写入请求,确定该写入请求的优先级。需要说明的是,不同的写入请求可能对应着不同的用户需求和服务质量要求。通过确定写入请求的优先级,可以确保关键业务或紧急服务的需求得到满足,提升用户满意度。另外,电子设备的处理能力、带宽和存储等资源是有限的。通过确定写入请求的优先级,可以确保高优先级的请求能够优先得到处理,从而优化资源的使用效率。In an embodiment of the present application, upon receiving a write request sent by a user terminal, the priority of the write request can be determined in response to the write request. It should be noted that different write requests may correspond to different user needs and service quality requirements. By determining the priority of the write request, it can be ensured that the needs of key businesses or emergency services are met, thereby improving user satisfaction. In addition, the processing power, bandwidth, storage and other resources of electronic devices are limited. By determining the priority of the write request, it can be ensured that high-priority requests can be processed first, thereby optimizing the efficiency of resource use.
在一些实施例中,可以基于用户或业务的需求,为不同的服务类型分配不同的服务质量类标识符(QoS Class Identifier,QCI)值。QCI值定义了传输优先级、包延迟预算和包错误率等QoS参数,从而间接决定了写入请求的优先级。In some embodiments, different service types may be assigned different QoS Class Identifier (QCI) values based on user or business requirements. The QCI value defines QoS parameters such as transmission priority, packet delay budget, and packet error rate, thereby indirectly determining the priority of the write request.
在一些实施例中,可以基于当前的系统负载情况确定写入请求的优先级。In some embodiments, the priority of the write request may be determined based on the current system load conditions.
S102、基于所述写入请求的优先级,将所述写入请求放入预设令牌队列。S102: Based on the priority of the write request, put the write request into a preset token queue.
需要说明的是,一个令牌队列是一系列需要执行的写入请求的集合,包括如下两点作用:(1)保持写入请求执行顺序;(2)保证写入请求间互斥执行。这两点均是通过令牌实现的。规则是:只有获得令牌的写入请求才能执行,执行完毕后将令牌归还。由于令牌队列中只有一个令牌,因此,任何时候只有一个写入请求处于执行状态。It should be noted that a token queue is a collection of write requests that need to be executed, which has the following two functions: (1) maintaining the execution order of write requests; (2) ensuring mutual exclusion between write requests. Both of these are achieved through tokens. The rule is: only write requests that obtain tokens can be executed, and the tokens are returned after execution. Since there is only one token in the token queue, only one write request is in execution at any time.
本申请实施例中,可以基于用户终端发送的写入请求的优先级,将该写入请求放入到预设令牌队列中的相应位置。In an embodiment of the present application, the write request sent by the user terminal can be placed in a corresponding position in a preset token queue based on the priority of the write request.
在一些实施例中,可以基于用户终端发送的写入请求的优先级,以及预设令牌队列中已放入请求的优先级,确定应该将该写入请求放入到预设令牌队列中的位置。In some embodiments, the position where the write request should be placed in the preset token queue can be determined based on the priority of the write request sent by the user terminal and the priority of the requests already placed in the preset token queue.
S103、基于所述写入请求在所述预设令牌队列中的位置和所述预设令牌队列关联的令牌,将所述用户终端的上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。S103: Based on the position of the write request in the preset token queue and the token associated with the preset token queue, synchronously write the context information of the user terminal into a first hash table in a first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device.
需要说明的是,预设令牌队列只关联一个令牌,只有获得令牌的写入请求才能执行。It should be noted that the preset token queue is associated with only one token, and only write requests that obtain the token can be executed.
需要说明的是,用户终端的上下文信息是指与用户终端当前状态、操作或会话相关的数据集合,该数据集合中可以至少包括如下信息:It should be noted that the context information of the user terminal refers to a data set related to the current state, operation or session of the user terminal, and the data set may include at least the following information:
1、用户身份信息,包括用户ID(唯一标识用户的标识符)、用户名或昵称(用户在系统中的显示名称);1. User identity information, including user ID (an identifier that uniquely identifies a user), user name or nickname (the user's display name in the system);
2、终端信息,包括终端ID(唯一标识用户终端的标识符)、终端类型(如手机、平板电脑等)、操作系统及版本(用户终端运行的操作系统及其版本号);2. Terminal information, including terminal ID (an identifier that uniquely identifies the user terminal), terminal type (such as mobile phone, tablet computer, etc.), operating system and version (the operating system and version number running on the user terminal);
3、网络状态信息,包括IP地址(用户终端的IP地址,可能用于地理位置定位或网络访问控制)、网络类型(如Wi-Fi、4G/5G等,可能影响数据传输的速度和稳定性);3. Network status information, including IP address (IP address of the user terminal, which may be used for geographic location or network access control) and network type (such as Wi-Fi, 4G/5G, etc., which may affect the speed and stability of data transmission);
4、会话信息,包括会话ID(唯一标识用户当前会话的标识符)、会话开始时间(会话创建的时间点)、会话持续时间(会话已经持续的时间或预计的持续时间)。4. Session information, including session ID (an identifier that uniquely identifies the user's current session), session start time (the time when the session was created), and session duration (how long the session has lasted or how long it is expected to last).
需要说明的是,IMS对应第一数据库与电子设备对应第二数据库是不同的数据库,且第一数据库与第二数据库可以是现有的任意数据库,本申请实施例对此不作具体限定。It should be noted that the first database corresponding to the IMS and the second database corresponding to the electronic device are different databases, and the first database and the second database can be any existing databases, which is not specifically limited in the embodiment of the present application.
在一些实施例中,可以基于用户终端发送的写入请求在预设令牌队列中的位置和预设令牌队列关联的令牌的使用状态,将用户终端的上下文信息同步写入IMS对应第一数据库中的第一哈希表,及电子设备对应第二数据库中的第二哈希表,以实现IMS对应第一数据库中的数据与电子设备对应第二数据库中的数据的一致性与同步性。In some embodiments, 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, the context information of the user terminal can be 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, so as to achieve 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.
在一些实施例中,可以基于用户终端的上下文信息,构建IMS对应第一数据库中的第一哈希表的键(Key)和值(Value)。键可以是用户ID、会话ID或它们的组合,值则是一个哈希表,包含用户终端的具体上下文信息。进而,可以使用第一数据库的哈希表操作命令,将用户终端的上下文信息写入第一数据库中的第一哈希表。In some embodiments, the key and value of the 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 the hash table operation command of the first database.
在一些实施例中,部署有IMS的电子设备可以是支持轻量级5GC的电子设备,该电子设备对应的第二数据库可以是内存数据库Redis。In some embodiments, the electronic device deployed with IMS may be an electronic device supporting lightweight 5GC, and the second database corresponding to the electronic device may be an in-memory database Redis.
需要说明的是,Redis是一个高性能的键值对(Key-Value)数据库,支持多种类型的数据结构,如字符串(Strings)、列表(Lists)、集合(Sets)、有序集合(Sorted Sets)和哈希表(Hashes)等。在这些数据结构中,哈希表是Redis用于存储键值对的一种重要的数据结构。It should be noted that Redis is a high-performance key-value database that supports multiple types of data structures, such as strings, lists, sets, sorted sets, and hash tables, etc. Among these data structures, hash tables are an important data structure used by Redis to store key-value pairs.
在一些实施例中,在第二数据库为内存数据库Redis的情况下,可以基于用户终端的上下文信息,构建Redis中哈希表项的键(Key)和值(Value)。键可以是用户ID、会话ID或它们的组合,值则是一个哈希表,包含用户终端的具体上下文信息。进而,可以使用Redis的哈希表操作命令,将用户终端的上下文信息写入Redis内存数据库中的第二哈希表。In some embodiments, when the second database is a memory database Redis, the key (Key) and value (Value) of the hash table item in Redis 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 hash table operation command of Redis can be used to write the context information of the user terminal into the second hash table in the Redis memory database.
可以理解的是,本申请实施例提供的信息处理方法,通过响应于接收到用户终端发送的写入请求,首先确定该写入请求的优先级,然后基于该优先级,将写入请求放入预设令牌队列,进而基于写入请求在预设令牌队列中的位置和预设令牌队列关联的令牌,将用户终端的上下文信息同步写入IMS对应第一数据库中的第一哈希表,及电子设备对应第二数据库中的第二哈希表,如此,通过引入优先级处理和令牌队列机制,不仅提高了数据写入过程的可控性和效率,而且能够有效确保IMS对应第一数据库中的数据与电子设备对应第二数据库中的数据的一致性与同步性。It can be understood that the information processing method provided in the embodiment of the present application, in response to receiving a write request sent by a user terminal, first determines the priority of the write request, and then, based on the priority, puts the write request into a preset token queue, 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 in the first database corresponding to the IMS and the second hash table in the second database corresponding to the electronic device. In this way, by introducing priority processing and token queue mechanism, not only the controllability and efficiency of the data writing process are improved, but also 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 be effectively ensured.
在一些实施例中,所述响应于接收到用户终端发送的写入请求,确定所述写入请求的优先级,包括:In some embodiments, in response to receiving a write request sent by a user terminal, determining the priority of the write request includes:
响应于接收到所述写入请求,获取所述写入请求对应的报文类型和过期时间;In response to receiving the write request, obtaining a message type and an expiration time corresponding to the write request;
基于所述报文类型和所述过期时间,确定所述优先级。The priority is determined based on the message type and the expiration time.
需要说明的是,报文类型指的是该发送写入请求的用户报文所属的类别或类型,其用于标识用户终端希望电子设备执行的操作或请求的资源类型。报文类型通常是一个字符串或枚举值。It should be noted that the message type refers to the category or type to which the user message for sending the write request belongs, and is used to identify the operation that the user terminal wants the electronic device to perform or the resource type requested. The message type is usually a string or an enumeration value.
需要说明的是,过期时间指的是认证令牌的有效期截止时间。在用户终端与电子设备进行交互时,为了验证用户终端的身份和权限,电子设备会要求用户终端在写入请求中包含一个有效的认证令牌。It should be noted that the expiration time refers to the expiration time of the authentication token. When a user terminal interacts with an electronic device, in order to verify the identity and authority of the user terminal, the electronic device requires the user terminal to include a valid authentication token in the write request.
需要说明的是,报文类型和过期时间均可以从写入请求对应的用户报文中获得。It should be noted that both the message type and the expiration time can be obtained from the user message corresponding to the write request.
在一些实施例中,可以对用户终端发送的写入请求对应的用户报文进行解析,获得报文类型和过期时间。In some embodiments, the user message corresponding to the write request sent by the user terminal may be parsed to obtain the message type and expiration time.
需要说明的是,不同的报文类型可能对系统的影响不同。例如,某些类型的请求可能涉及对关键数据的修改,而其他类型的请求可能只是查询数据。因此,可以根据预定义的规则或策略,为不同类型的报文分配不同的优先级权重。It should be noted that different message types may have different impacts on the system. For example, some types of requests may involve the modification of critical data, while other types of requests may only query data. Therefore, different priority weights can be assigned to different types of messages according to predefined rules or policies.
在一些实施例中,如果写入请求的过期时间非常接近当前时间(例如过期时间与当前时间的时差小于一个设定值),则可以确定该请求需要被优先处理,则为该请求分配一个较高的优先级权重;如果请求的过期时间距离当前时间还有一段较长时长,则可以确定该请求不需要立即处理,则为该请求分配一个较低的优先级权重。In some embodiments, if the expiration time of a write request is very close to the current time (for example, 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.
在一些实施例中,可以将报文类型的优先级权重与过期时间的紧迫性对应的优先级权重相结合,通过某种算法(如加权求和)综合确定写入请求的优先级。In some embodiments, the priority weight of the message type may be combined with the priority weight corresponding to the urgency of the expiration time, and the priority of the write request may be comprehensively determined through a certain algorithm (such as weighted summation).
示例性地,图2为本申请实施例提供的一种信息处理方法的流程示意图之二,如图2所示,该方法包括:For example, FIG2 is a second flow chart of an information processing method provided in an embodiment of the present application. As shown in FIG2 , the method includes:
S201、响应于接收到用户终端发送的写入请求,获取所述写入请求对应的报文类型和过期时间。S201. In response to receiving a write request sent by a user terminal, obtain a message type and an expiration time corresponding to the write request.
S202、基于所述报文类型和所述过期时间,确定所述写入请求的优先级。S202: Determine the priority of the write request based on the message type and the expiration time.
S203、基于所述写入请求的优先级,将所述写入请求放入预设令牌队列。S203: Based on the priority of the write request, put the write request into a preset token queue.
S204、基于所述写入请求在所述预设令牌队列中的位置和所述预设令牌队列关联的令牌,将所述用户终端的上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。S204: Based on the position of the write request in the preset token queue and the token associated with the preset token queue, synchronously write the context information of the user terminal into a first hash table in a first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
可以理解的是,本申请实施例通过基于写入请求对应的报文类型和过期时间确定写入请求的优先级,可以实现基于写入请求的紧急程度和重要性智能地对写入请求的执行顺序进行排序,确保了关键或紧急的写入请求能够优先得到处理,从而减少了写入请求执行的等待时间,并提高了处理效率。It can be understood that the embodiments of the present application determine the priority of the write request based on the message type and expiration time corresponding to the write request, so that the execution order of the write request can be intelligently sorted based on the urgency and importance of the write request, thereby ensuring that critical or urgent write requests can be processed first, thereby reducing the waiting time for the execution of the write request and improving processing efficiency.
在一些实施例中,所述基于所述报文类型和所述过期时间,确定所述优先级,包括:In some embodiments, determining the priority based on the message type and the expiration time includes:
对所述报文类型和所述过期时间进行模糊化,得到所述报文类型对应的第一取值和所述过期时间对应的第二取值;Fuzzifying 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;
采用中心平均法,对所述第一取值、所述报文类型对应的第一权重、所述第二取值以及所述过期时间对应的第二权重进行计算,得到所述优先级。The center average method is used 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.
需要说明的是,模糊算法(也称为模糊逻辑或模糊推理)是一种基于模糊集合理论的数学方法,用于处理模糊或不确定性信息。该算法的核心在于将人类的模糊概念和语言转化为数学表达,从而更好地处理在传统二值逻辑中难以精确描述的问题。其中模糊集合是模糊算法的基础,它允许集合中的元素以一定的隶属度属于该集合,而不是简单的“属于”或“不属于”两种状态。隶属度通常是一个0到1之间的数值,表示元素属于集合的程度。It should be noted that fuzzy algorithm (also called fuzzy logic or fuzzy reasoning) is a mathematical method based on fuzzy set theory, which is used to process fuzzy or uncertain information. The core of this algorithm is to convert human fuzzy concepts and language into mathematical expressions, so as to better deal with problems that are difficult to accurately describe in traditional binary logic. Among them, fuzzy sets are the basis of fuzzy algorithms, which allow elements in a set to belong to the set with a certain degree of membership, rather than simply "belonging" or "not belonging". The degree of membership is usually a value between 0 and 1, indicating the degree to which an element belongs to the set.
需要说明的是,报文类型对应的第一权重和过期时间对应的第二权重可以分别表示各自模糊集的高度,可以基于实际应用进行适应性设置,本申请实施例对此不作具体限定。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. The embodiments of the present application do not make specific limitations on this.
本申请实施例中,可以对写入请求对应的报文类型和过期时间分别进行模糊化,获得报文类型对应的第一取值和过期时间对应的第二取值,进而采用中心平均法,对报文类型对应的第一取值、报文类型对应的第一权重、过期时间对应的第二取值以及过期时间对应的第二权重进行计算,得到写入请求的优先级。In an embodiment of the present application, the message type and expiration time corresponding to the write request can be fuzzified respectively to obtain a first value corresponding to the message type and a second value corresponding to the expiration time, and then the central 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.
示例性地,图3为本申请实施例提供的一种计算写入请求的优先级的结构示意图,如图3所示,将写入请求对应的用户报文中的两个信息作为模糊算法的输入参数,分别为:写入请求对应的报文类型(以T表示)和写入请求对应的过期时间(以TE表示);输出参数为P,P值越大表征优先级越高。Exemplarily, Figure 3 is a structural diagram of a method for calculating the priority of a write request provided in an embodiment of the present application. As shown in Figure 3, two information in the user message corresponding to the write request are used as input parameters of the fuzzy algorithm, namely: the message type corresponding to the write request (represented by T) and the expiration time corresponding to the write request (represented by TE); the output parameter is P, and the larger the P value, the higher the priority.
在一些实施例中,若报文类型为REQUES类型,可以设置该报文类型对应的第一权重为1;若报文类型为INVITE类型,可以设置该报文类型对应的第一权重为0.75;若报文类型为OTHERS类型,可以设置该报文类型对应的第一权重为0.5。In some embodiments, if the message type is a REQUES type, the first weight corresponding to the message type can be set to 1; if the message type is an INVITE type, the first weight corresponding to the message type can be set to 0.75; if the message type is an OTHERS type, the first weight corresponding to the message type can be set to 0.5.
在一些实施例中,若过期时间大于或等于3600毫秒,可以设置该过期时间对应的第二权重为0.5;若过期时间大于1200毫秒且小于3600毫秒,可以设置该过期时间对应的第二权重为0.75;若过期时间小于或等于1200毫秒,可以设置该过期时间对应的第二权重为1。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.
在一些实施例中,可以采用中心平均法对报文类型和过期时间进行模糊化。通过对多个模糊集中心进行加权平均,将权重设置为相应模糊集的高度,计算得到模糊输出,并将该模糊输出作为写入请求的优先级。具体计算如式(1)所示:In some embodiments, the center average method can be used to fuzzify the message type and expiration time. By taking a weighted average of the centers of multiple fuzzy sets, setting the weight to the height of the corresponding fuzzy set, calculating the fuzzy output, and using the fuzzy output as the priority of the write request. The specific calculation is shown in formula (1):
其中,yi为第i个模糊集的中心,wi为第i个模糊集的高度(即权重),y*表示模糊输出,即为所求的优先级P。Among them, yi is the center of the i-th fuzzy set, wi is the height (i.e., weight) of the i-th fuzzy set, and y * represents the fuzzy output, which is the required priority P.
示例性地,图4为本申请实施例提供的一种利用中心平均法计算写入请求的优先级的示意图,如图4所示,其中,y1表示报文类型对应的模糊集的中心,w1表示报文类型对应的模糊集的高度,y2表示过期时间对应的模糊集的中心,w2表示过期时间对应的模糊集的高度。Exemplarily, Figure 4 is a schematic diagram of a method for calculating the priority of a write request using the central average method provided in an embodiment of the present application, as shown in Figure 4, wherein y1 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, y2 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.
示例性地,图5为本申请实施例提供的一种信息处理方法的流程示意图之三,如图5所示,该方法包括:For example, FIG5 is a flowchart of a third information processing method provided in an embodiment of the present application. As shown in FIG5 , the method includes:
S501、响应于接收到用户终端发送的写入请求,获取所述写入请求对应的报文类型和过期时间。S501. In response to receiving a write request sent by a user terminal, obtain a message type and an expiration time corresponding to the write request.
S502、对所述报文类型和所述过期时间进行模糊化,得到所述报文类型对应的第一取值和所述过期时间对应的第二取值。S502: 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.
S503、采用中心平均法,对所述第一取值、所述报文类型对应的第一权重、所述第二取值以及所述过期时间对应的第二权重进行计算,得到所述写入请求的优先级。S503: Using the center average method, 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 of the write request.
S504、基于所述写入请求的优先级,将所述写入请求放入预设令牌队列。S504: Based on the priority of the write request, put the write request into a preset token queue.
S505、基于所述写入请求在所述预设令牌队列中的位置和所述预设令牌队列关联的令牌,将所述用户终端的上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。S505: Based on the position of the write request in the preset token queue and the token associated with the preset token queue, synchronously write the context information of the user terminal into a first hash table in a first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
可以理解的是,本申请实施例通过对写入请求对应的报文类型和过期时间分别进行模糊化,获得报文类型对应的第一取值和过期时间对应的第二取值,进而采用中心平均法,对报文类型对应的第一取值、报文类型对应的第一权重、过期时间对应的第二取值以及过期时间对应的第二权重进行计算,可以有效得到写入请求的优先级,实现了基于写入请求的紧急程度和重要性智能地对写入请求的执行顺序进行排序,确保了关键或紧急的写入请求能够优先得到处理,从而减少了写入请求执行的等待时间,并提高了处理效率。It can be understood that the embodiment of the present application fuzzifies the message type and expiration time corresponding to the write request respectively, obtains the first value corresponding to the message type and the second value corresponding to the expiration time, and then adopts the central average method 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, so as to effectively obtain the priority of the write request, and realize intelligent sorting of the execution order of the write request based on the urgency and importance of the write request, ensuring that critical or urgent write requests can be processed first, thereby reducing the waiting time for the execution of the write request and improving the processing efficiency.
在一些实施例中,所述基于所述写入请求的优先级,将所述写入请求放入预设令牌队列,包括:In some embodiments, placing the write request into a preset token queue based on the priority of the write request includes:
在所述预设令牌队列为空的情况下,将所述写入请求放入所述预设令牌队列中的任一位置处;When the preset token queue is empty, placing the write request at any position in the preset token queue;
在所述预设令牌队列不为空的情况下,基于所述写入请求的优先级和所述预设令牌队列中已放入请求的优先级,将所述写入请求放入所述预设令牌队列。When the preset token queue is not empty, the write request is placed in 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.
需要说明的是,在将写入请求放入预设令牌队列时,可以考虑预设令牌队列的当前状态(即是否为空)以及写入请求的优先级和预设令牌队列中已放入请求的优先级之间的关系。具体来说,首先检查预设令牌队列是否为空,如果预设令牌队列为空,表示预设令牌队列中还没有任何请求,则可以直接将写入请求放入预设令牌队列中的任一位置处(由于预设令牌队列为空,所以将写入请求放在哪个位置都不会影响后续操作的正确性);如果预设令牌队列不为空,则可以基于写入请求的优先级和预设令牌队列中已放入请求的优先级来确定如何放置写入请求。具体地,可以将写入请求的优先级与预设令牌队列中已放入请求的优先级进行比较,如果写入请求的优先级高于已放入请求的优先级,那么可以将写入请求放置在预设令牌队列的前面(头部),以确保它能够更快地被处理;如果写入请求的优先级低于或等于已放入请求的优先级,那么应该将写入请求添加到已放入请求的后面,以保持队列的顺序性。即根据优先级比较结果,在预设令牌队列的适当位置插入写入请求。It should be noted that when placing a write request into the preset token queue, 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 request already placed in the preset token queue can be considered. Specifically, first check whether the preset token queue is empty. If the preset token queue is empty, it means that there is no request in the preset token queue. Then the write request can be directly placed in any position in the preset token queue (since the preset token queue is empty, the correctness of subsequent operations will not be affected by placing the write request in any position); if the preset token queue is not empty, how to place the write request can be determined based on the priority of the write request and the priority of the request already placed in the preset token queue. Specifically, the priority of the write request can be compared with the priority of the request already placed in the preset token queue. If the priority of the write request is higher than the priority of the request already placed, then the write request can be placed in front of the preset token queue (head) to ensure that it can be processed faster; if the priority of the write request is lower than or equal to the priority of the request already placed, then the write request should be added to the back of the request already placed to maintain the order of the queue. That is, according to the priority comparison result, the write request is inserted into the appropriate position of the preset token queue.
示例性地,图6为本申请实施例提供的一种信息处理方法的流程示意图之四,如图6所示,该方法包括:For example, FIG6 is a fourth flowchart of an information processing method provided in an embodiment of the present application. As shown in FIG6 , the method includes:
S601、响应于接收到用户终端发送的写入请求,获取所述写入请求对应的报文类型和过期时间。S601: In response to receiving a write request sent by a user terminal, obtain a message type and an expiration time corresponding to the write request.
S602、对所述报文类型和所述过期时间进行模糊化,得到所述报文类型对应的第一取值和所述过期时间对应的第二取值。S602: 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.
S603、采用中心平均法,对所述第一取值、所述报文类型对应的第一权重、所述第二取值以及所述过期时间对应的第二权重进行计算,得到所述写入请求的优先级。S603: 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 of the write request.
S604、在预设令牌队列为空的情况下,将所述写入请求放入所述预设令牌队列中的任一位置处。S604: When the preset token queue is empty, place the write request at any position in the preset token queue.
S605、在预设令牌队列不为空的情况下,基于所述写入请求的优先级和所述预设令牌队列中已放入请求的优先级,将所述写入请求放入所述预设令牌队列。S605: When the preset token queue is not empty, based on the priority of the write request and the priority of the requests already put into the preset token queue, put the write request into the preset token queue.
S606、基于所述写入请求在所述预设令牌队列中的位置和所述预设令牌队列关联的令牌,将所述用户终端的上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。S606: Based on the position of the write request in the preset token queue and the token associated with the preset token queue, synchronously write the context information of the user terminal into a first hash table in a first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
可以理解的是,本申请实施例通过基于预设令牌队列的当前状态(即是否为空)以及写入请求的优先级和预设令牌队列中已放入请求的优先级之间的关系,确定写入请求在预设令牌队列中应放置的位置,可以确保优先级更高的请求能够更快地被处理,尤其是在系统资源有限或发生过载时,能够确保关键业务或紧急任务得到及时处理。It can be understood that the embodiment of the present application determines the position where the write request should be placed 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, thereby ensuring that requests with higher priority can be processed more quickly, especially when system resources are limited or overloaded, and ensuring that critical business or emergency tasks are processed in a timely manner.
在一些实施例中,所述预设令牌队列中包括至少一个所述已放入请求,所述基于所述写入请求的优先级和所述预设令牌队列中已放入请求的优先级,将所述写入请求放入所述预设令牌队列,包括以下之一:In some embodiments, the preset token queue includes at least one of the 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 placed requests in the preset token queue includes one of the following:
在至少一个所述已放入请求的优先级均高于所述写入请求的优先级的情况下,将所述写入请求放入所述预设令牌队列中处于至少一个所述已放入请求之后的位置;In the case where the priority of at least one of the placed requests is higher than the priority of the write request, placing the write request in the preset token queue at a position after at least one of the placed requests;
在至少一个所述已放入请求的优先级低于所述写入请求的优先级的情况下,将所述写入请求放入所述预设令牌队列中处于至少一个所述已放入请求之前的位置;In the case where the priority of at least one of the placed requests is lower than the priority of the write request, placing the write request in the preset token queue at a position before at least one of the placed requests;
在第一请求的优先级高于所述写入请求的优先级,且第二请求的优先级低于所述写入请求的优先级的情况下,将所述写入请求放入所述预设令牌队列中处于所述第一请求之后且处于所述第二请求之前的位置;When 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, placing the write request in the preset token queue after the first request and before the second request;
其中,所述至少一个所述已放入请求包括:所述第一请求和所述第二请求。The at least one placed request includes: the first request and the second request.
举例来说,若预设令牌队列中包括已放入请求A、已放入请求B和已放入请求C,且已放入请求A、已放入请求B和已放入请求C的优先级均高于写入请求D的优先级,则可以将该写入请求D放入预设令牌队列中处于已放入请求A、已放入请求B和已放入请求C之后的位置,以确保高优先级的已放入请求A、已放入请求B和已放入请求C可以被优先处理。For example, if the preset token queue includes placed request A, placed request B and placed request C, and the priorities of placed request A, placed request B and placed request C are all higher than the priority of write request D, then the write request D can be placed in the preset token queue after placed request A, placed request B and placed request C to ensure that the high-priority placed request A, placed request B and placed request C can be processed first.
举例来说,若预设令牌队列中包括已放入请求A、已放入请求B和已放入请求C,且已放入请求A、已放入请求B和已放入请求C的优先级均低于写入请求D的优先级,则可以将该写入请求D放入预设令牌队列中处于已放入请求A、已放入请求B和已放入请求C之前的位置,以确保高优先级的写入请求D可以被优先处理。For example, if the preset token queue includes request A, request B and request C, and the priorities of request A, request B and request C are all lower than the priority of write request D, then the write request D can be placed in the preset token queue before request A, request B and request C to ensure that the high-priority write request D can be processed first.
举例来说,若预设令牌队列中包括已放入请求A和已放入请求B,且已放入请求A的优先级高于写入请求D的优先级,且已放入请求B的优先级低于写入请求D的优先级,则可以将写入请求D放入预设令牌队列中处于已放入请求A之后且处于已放入请求B之前的位置,以确保按优先级的高低依次处理已放入请求A、写入请求D和已放入请求B。For example, if the preset token queue includes placed request A and placed request B, and the priority of placed request A is higher than the priority of write request D, and the priority of 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 placed request A and before placed request B to ensure that placed request A, write request D and placed request B are processed in order of priority.
可以理解的是,本申请实施例通过基于写入请求的优先级和预设令牌队列中已放入请求的优先级之间的关系,确定写入请求在预设令牌队列中应放置的位置,可以确保优先级更高的请求能够更快地被处理,尤其是在系统资源有限或发生过载时,能够确保关键业务或紧急任务得到及时处理。It can be understood that the embodiment of the present application determines the position where the write request should be placed 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, thereby ensuring that requests with higher priority can be processed more quickly, especially when system resources are limited or overloaded, and can ensure that critical business or emergency tasks are processed in a timely manner.
在一些实施例中,所述基于所述写入请求在所述预设令牌队列中的位置和所述预设令牌队列关联的令牌,将所述用户终端的上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表,包括:In some embodiments, based on the position of the write request in the preset token queue and the token associated with the preset token queue, 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 the second database corresponding to the electronic device includes:
响应于所述预设令牌队列中处于所述位置之前的前端位置上的信息为空,识别所述令牌的状态;In response to the information at the front position before the position in the preset token queue being empty, identifying the state of the token;
响应于所述令牌的状态为未使用状态,将所述令牌的调用权限分配至所述写入请求,以将所述写入请求变更为处于执行状态的当前请求;In response to the state of the token being an unused state, allocating the calling permission of the token to the write request to change the write request to a current request in an execution state;
基于所述当前请求,将所述上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。Based on the current request, the context information is synchronously written into a first hash table in a first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device.
需要说明的是,若预设令牌队列中处于写入请求位置之前的前端位置上的信息为空,则表征预设令牌队列中处于写入请求位置之前的请求已被处理,则此时可以识别与预设令牌队列关联的令牌的状态,如果该令牌的状态为未使用状态,则可以将该令牌的调用权限分配至写入请求,以将该写入请求变更为处于执行状态的当前请求,进而基于该当前请求,将用户终端的上下文信息同步写入IMS对应第一数据库中的第一哈希表,及电子设备对应第二数据库中的第二哈希表。It should be noted that if the information at the front position before the write request position in the preset token queue 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 authority of the token can be assigned to the write request to change the write request to a current request in the execution state, and then based on the current request, 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.
在一些实施例中,若识别到令牌的状态为使用状态,表征该令牌当前可能被用于处理其他用户终端发送的请求,待令牌的状态由使用状态变更为未使用状态之后,可以将该令牌的调用权限分配至写入请求,以将该写入请求变更为处于执行状态的当前请求,进而基于该当前请求,将用户终端的上下文信息同步写入IMS对应第一数据库中的第一哈希表,及电子设备对应第二数据库中的第二哈希表。In some embodiments, if the token is identified as being in use, indicating that the token may currently be used to process requests sent by other user terminals, after the token's state is changed from being in use to being unused, the token's calling permission can be assigned to a write request to change the write request to a current request in execution, and then based on the current request, the user terminal's 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.
示例性地,图7为本申请实施例提供的一种信息处理方法的流程示意图之五,如图7所示,该方法包括:For example, FIG. 7 is a flowchart of a fifth information processing method provided in an embodiment of the present application. As shown in FIG. 7 , the method includes:
S701、响应于接收到用户终端发送的写入请求,确定所述写入请求的优先级。S701: In response to receiving a write request sent by a user terminal, determine a priority of the write request.
S702、基于所述写入请求的优先级,将所述写入请求放入预设令牌队列。S702: Based on the priority of the write request, put the write request into a preset token queue.
S703、响应于所述预设令牌队列中处于所述写入请求在所述预设令牌队列中的位置之前的前端位置上的信息为空,识别所述令牌的状态。S703: In response to the information at the front position of the preset token queue before the position of the write request in the preset token queue being empty, identify the status of the token.
S704、响应于所述令牌的状态为未使用状态,将所述令牌的调用权限分配至所述写入请求,以将所述写入请求变更为处于执行状态的当前请求。S704: In response to the token being in an unused state, assigning the calling permission of the token to the write request to change the write request to a current request in an execution state.
S705、基于所述当前请求,将所述上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。S705: Based on the current request, synchronously write the context information into a first hash table in a first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
可以理解的是,本申请实施例采用了令牌抢占式的同步机制,使用令牌保证请求的有序写入,从而可以确保优先级更高的请求能够更快地被处理,尤其是在系统资源有限或发生过载时,能够确保关键业务或紧急任务得到及时处理。It can be understood that the embodiment of the present application adopts a token-preemptive synchronization mechanism, which uses tokens to ensure the orderly writing of requests, thereby ensuring that higher priority requests can be processed more quickly, especially when system resources are limited or overloaded, to ensure that critical business or emergency tasks are processed in a timely manner.
在一些实施例中,所述方法还包括:In some embodiments, the method further comprises:
响应于所述上下文信息,完成同步写入所述第一哈希表和所述二哈希表,确定所述当前请求执行结束;In response to the context information, completing synchronous writing into the first hash table and the second hash table, and determining that the execution of the current request is completed;
响应于所述当前请求执行结束,释放所述令牌,并将所述令牌的状态从使用状态更新为所述未使用状态。In response to the current request execution being completed, the token is released, and the state of the token is updated from the used state to the unused state.
需要说明的是,当一个进程或线程完成了其需要令牌才能执行的任务后,需要将令牌归还给系统,通常发生在任务完成、系统发生错误或需要释放资源时。归还令牌的过程可以通过调用一个特定的系统函数或方法实现。这个函数或方法负责将令牌从当前进程或线程的持有状态转移到系统或令牌池中。在令牌被归还后,系统需要更新令牌的状态,可以包括将令牌标记为可用、更新令牌的数量或修改与令牌相关的其他状态信息。It should be noted that when a process or thread completes the task that requires a token to execute, it needs to return the token to the system, which usually happens when the task is completed, the system has an error, or resources need to be released. The process of returning the token 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 or thread to the system or token pool. After the token is returned, the system needs to update the status of the token, which may include marking the token as available, updating the number of tokens, or modifying other status information related to the token.
本申请实施例中,基于当前请求,将用户终端的上下文信息同步写入IMS对应第一数据库中的第一哈希表,及电子设备对应第二数据库中的第二哈希表之后,可以响应于上下文信息完成同步写入第一哈希表和第二哈希表,确定当前请求执行结束,进而响应于当前请求执行结束,释放预设令牌队列关联的令牌,并将该令牌的状态从使用状态更新为未使用状态。In an embodiment of the present application, based on the current request, after 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, the synchronous writing of the first hash table and the second hash table can be completed in response to the context information, and the execution of the current request is determined to be completed. Then, in response to the execution of the current request, the token associated with the preset token queue is released, and the status of the token is updated from a used state to an unused state.
示例性地,图8为本申请实施例提供的一种信息处理方法的流程示意图之六,如图8所示,该方法包括:For example, FIG8 is a sixth flowchart of an information processing method provided in an embodiment of the present application. As shown in FIG8 , the method includes:
S801、响应于接收到用户终端发送的写入请求,确定所述写入请求的优先级。S801: In response to receiving a write request sent by a user terminal, determine a priority of the write request.
S802、基于所述写入请求的优先级,将所述写入请求放入预设令牌队列。S802: Based on the priority of the write request, put the write request into a preset token queue.
S803、响应于所述预设令牌队列中处于所述写入请求在所述预设令牌队列中的位置之前的前端位置上的信息为空,识别所述令牌的状态。S803: In response to the information at the front position of the preset token queue before the position of the write request in the preset token queue being empty, identify the status of the token.
S804、响应于所述令牌的状态为未使用状态,将所述令牌的调用权限分配至所述写入请求,以将所述写入请求变更为处于执行状态的当前请求。S804: In response to the token being in an unused state, assigning the calling permission of the token to the write request to change the write request to a current request in an execution state.
S805、基于所述当前请求,将所述上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。S805: Based on the current request, synchronously write the context information into a first hash table in a first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device.
S806、响应于所述上下文信息,完成同步写入所述第一哈希表和所述二哈希表,确定所述当前请求执行结束。S806: In response to the context information, complete synchronous writing into the first hash table and the second hash table, and determine that the execution of the current request is completed.
S807、响应于所述当前请求执行结束,释放所述令牌,并将所述令牌的状态从使用状态更新为所述未使用状态。S807: In response to the completion of the execution of the current request, release the token, and update the status of the token from the used status to the unused status.
需要说明的是,本实施例中与其它实施例中相同步骤和相同内容的说明,可以参照其它实施例中的描述,此处不再赘述。It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
可以理解的是,本申请实施例通过令牌的使用和释放机制,使得其他等待的请求可以获取令牌并执行,从而提高了系统的吞吐量和响应速度。It can be understood that the embodiment of the present application uses and releases the token so that other waiting requests can obtain the token and execute it, thereby improving the throughput and response speed of the system.
在一些实施例中,所述方法还包括:In some embodiments, the method further comprises:
响应于所述第一哈希表完成初始化,将所述第一哈希表中的信息导出至初始第二数据库,以得到有所述第二哈希表的所述第二数据库。In response to the completion of 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 having the second hash table.
本申请实施例中,在第一哈希表完成初始化之后,可以将第一哈希表中的信息导出至初始第二数据库,从而得到有第二哈希表的第二数据库,使得第一数据库与第二数据库中的数据具有一致性。In an embodiment of the present application, after the first hash table is initialized, the information in the first hash table can be exported to an initial second database, thereby obtaining a second database with a second hash table, so that the data in the first database is consistent with the data in the second database.
在一些实施例中,在第一数据库中有多个第一哈希表的情况下,可以确定各第一哈希表分别对应的第一标识,将各第一哈希表分别对应的第一标识作为第二哈希表中的键(Key),并将各第一哈希表中的内容分别作为第二哈希表中与键(Key)对应的值(Value)。In some embodiments, when there are multiple first hash tables in the first database, the first identifiers corresponding to each first hash table can be determined, and the first identifiers corresponding to each first hash table can be used as keys (Key) in the second hash table, and the contents of each first hash table can be used as values (Value) corresponding to the keys (Key) in the second hash table.
需要说明的是,IMS系统中存在涉及用户上下文信息的第一哈希表共有7个,分别为:代理呼叫会话控制功能注册(Proxy Call Session Control Function registrar,P-CSCF registrar)、代理呼叫会话控制功能会话订阅(P-CSCF subscription dialogs)、服务呼叫会话控制功能鉴权(Serving Call Session Control Function authentication,S-CSCF authentication)、服务呼叫会话控制功能注册(S-CSCF registrar)、服务呼叫会话控制功能会话(S-CSCF dialogs)、查询呼叫会话控制功能列表(Interrogating CallSession Control Function lists,I-CSCF lists)I-CSCF lists。这7个第一哈希表分别存储P-CSCF的注册、会话订阅,S-CSCF鉴权、注册、会话,I-CSCF列表的信息,可以将这7个第一哈希表中的信息导出并写入到初始第二数据库中。It should be noted that there are 7 first hash tables involving user context information in the IMS system, namely: Proxy Call Session Control Function registrar (P-CSCF registrar), Proxy Call Session Control Function session subscription (P-CSCF subscription dialogs), Serving Call Session Control Function authentication (S-CSCF authentication), Serving Call Session Control Function registration (S-CSCF registrar), Serving Call Session Control Function session (S-CSCF dialogs), Interrogating Call Session Control Function lists (I-CSCF lists) I-CSCF lists. These 7 first hash tables store information about P-CSCF registration, session subscription, S-CSCF authentication, registration, session, and I-CSCF list, respectively. The information in these 7 first hash tables can be exported and written into the initial second database.
示例性地,图9为本申请实施例提供的一种将P-CSCF中的r_contact部分参数映射至Redis内存数据库的示意图,如图9所示,写入Redis内存数据库的哈希表中的Key,由IMS系统中的各个哈希表变量拆解开而得。其中,数据写入流程可以包括:For example, FIG9 is a schematic diagram of mapping some parameters of r_contact in P-CSCF to Redis memory database provided by an embodiment of the present application. As shown in FIG9 , the key in the hash table written into the Redis memory database is obtained by disassembling each hash table variable in the IMS system. The data writing process may include:
1、IMS系统连接Redis数据库;1. The IMS system connects to the Redis database;
2、判断是否存在用户注册、会话更新等需要处理的业务;2. Determine whether there are any services that need to be processed, such as user registration and session update;
3、如果确定存在用户注册、会话更新等需要处理的业务,则各CSCF处理业务信息,解析需要写入的参数,并将解析后的数据包传入到令牌队列,这个令牌队列用于暂存待写入Redis数据库的数据,以便后续按顺序写入;3. If it is determined that there are services that need to be processed, such as user registration and session update, each CSCF processes the service information, parses the parameters to be written, and passes the parsed data packets 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 sequence later.
4、循环遍历令牌队列中的数据包,而且,对于令牌队列中的每个数据包,调用令牌抢占的写入机制,实现IMS系统向Redis数据库的写入;4. Loop through the data packets in the token queue, and for each data packet in the token queue, call the token preemption write mechanism to implement the IMS system writing to the Redis database;
5、结束循环和流程:当令牌队列中的所有数据包都被处理完毕(即所有需要写入Redis数据库的数据包都已完成写入),循环结束。5. End the loop and process: When all the data packets in the token queue have been processed (that is, all the data packets that need to be written to the Redis database have been written), the loop ends.
可以理解的是,通过将IMS对应数据库中的数据写入Redis数据库,可以实现数据热备份。Redis sentinel(哨兵)是Redis的一个高可用性解决方案,确保Redis服务的稳定性和可靠性。It is understandable that by writing the data in the IMS corresponding database into the Redis database, data hot backup can be achieved. Redis sentinel is a high availability solution for Redis, ensuring the stability and reliability of the Redis service.
示例性地,图10为本申请实施例提供的一种分布式系统架构示意图,如图10所示,包括两个资源节点node1和node2,且在原来哨兵模式的基础上,每个资源节点中的部署单元pod增加一个监控模块monitor,负责监控哨兵sentinel对集群的检测状态,如果发现对端节点处于主观或者客户下线,就会触发当前pod的Redis实例升级为主数据库。两个pod的Redis实例组数保持一致,一个用于做缓存(Redis-ha)、一个用于持久化场景(Redis-ha-for-persist)。其中,NF为网络服务,用于处理网络请求和数据传输,sideCar为服务容器,用于增强或扩展主服务的功能,例如日志收集、监控和安全等。Exemplarily, FIG10 is a schematic diagram of a distributed system architecture provided by an embodiment of the present application. As shown in FIG10, two resource nodes node1 and node2 are included, and on the basis of the original sentinel mode, a monitoring module monitor is added to the deployment unit pod in each resource node, which is responsible for monitoring the detection status of the cluster by the sentinel. If the peer node is found to be in subjective state or the customer is offline, the Redis instance of the current pod will be triggered to upgrade to the main database. The number of Redis instance groups of the two pods is consistent, one for caching (Redis-ha) and the other for persistence scenarios (Redis-ha-for-persist). Among them, NF is a network service for processing network requests and data transmission, and sideCar is a service container for enhancing or expanding the functions of the main service, such as log collection, monitoring, and security.
在一些实施例中,可以在Redis配置文件中开启追加文件(Append Only File,AOF)功能(默认是禁用的),同时指定本地存储的AOF文件名,采用always方式配置策略,保证数据同步到磁盘,避免业务配置丢失。其中,配置信息可以包括:In some embodiments, the Append Only File (AOF) function can be enabled in the Redis configuration file (disabled by default), and the AOF file name for local storage can be specified, and the always configuration policy can be used to ensure that data is synchronized to the disk to avoid loss of business configuration. The configuration information may include:
appendonly:Redis持久化方式,启用AOF需要修改为是(yes);appendonly: Redis persistence mode. To enable AOF, you need to change it to yes.
appendfilename:AOF文件名;backupIMS.aof;appendfilename: AOF file name; backupIMS.aof;
appendfsync:AOF持久化策略的配置;fsync。appendfsync: Configuration of AOF persistence strategy; fsync.
需要说明的是,no表示不执行fsync,由操作系统保证数据同步到磁盘,速度最快,但是安全性不高;always表示每次写入都执行fsync,以保证数据同步到磁盘,可靠性高,但效率较低;everysec表示每秒执行一次fsync,可能会导致丢失这1秒数据。通常选择everysec,兼顾安全性和效率。It should be noted that no means that fsync is not executed, and the operating system ensures that data is synchronized to the disk. It has the fastest speed, but low security. always means that fsync is executed every time a write is made to ensure that data is synchronized to the disk. It has high reliability but low efficiency. everysec means that fsync is executed once per second, which may result in the loss of 1 second of data. Everysec is usually selected to balance security and efficiency.
可以理解的是,图10中的Redis主(即Redis主数据库)可以用于处理实时数据,而Redis备(即Redis备数据库)则作为主数据库的备份,可以用于在Redis主出现故障时接管服务,有效实现了数据热备份,能够保证数据的连续性和可用性。此外,本申请实施例可以至少带来如下有益效果:最大程度利用现有的5GC高可用框架,实现的工作最小;只涉及IMS的修改,可移植性强,适用于云化部署和一体机部署场景;故障恢复快,可实现秒级故障恢复。It is understandable that the Redis master (i.e., the Redis master database) in FIG10 can be used to process real-time data, while the Redis standby (i.e., the Redis standby database) is a backup of the master database and can be used to take over the service when the Redis master fails, effectively realizing data hot backup and ensuring data continuity and availability. In addition, the embodiments of the present application can at least bring the following beneficial effects: maximize the use of the existing 5GC high-availability framework, with minimal work; only involve the modification of IMS, with strong portability, suitable for cloud deployment and all-in-one deployment scenarios; fast fault recovery, which can achieve fault recovery in seconds.
下面对本申请实施例提供的信息处理装置进行描述,下文描述的信息处理装置与上文描述的信息处理方法可相互对应参照。The information processing device provided in the embodiment of the present application is described below. The information processing device described below and the information processing method described above can be referenced to each other.
图11为本申请实施例提供的一种信息处理装置的结构示意图,该装置应用于部署有网际互连协议IP多媒体子系统IMS的电子设备。如图11所示,该装置包括:确定单元1110、放入单元1120和写入单元1130;其中:FIG11 is a schematic diagram of the structure of an information processing device provided in an embodiment of the present application, and the device is applied to an electronic device deployed with an Internet Protocol IP Multimedia Subsystem IMS. As shown in FIG11 , the device includes: a determination unit 1110, a placing unit 1120, and a writing unit 1130; wherein:
确定单元1110,被配置为响应于接收到用户终端发送的写入请求,确定所述写入请求的优先级;The determining unit 1110 is configured to determine the priority of the write request in response to receiving the write request sent by the user terminal;
放入单元1120,被配置为基于所述写入请求的优先级,将所述写入请求放入预设令牌队列;The placing unit 1120 is configured to place the write request into a preset token queue based on the priority of the write request;
写入单元1130,被配置为基于所述写入请求在所述预设令牌队列中的位置和所述预设令牌队列关联的令牌,将所述用户终端的上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。The writing unit 1130 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.
本申请实施例提供的信息处理装置,通过响应于接收到用户终端发送的写入请求,首先确定该写入请求的优先级,然后基于该优先级,将写入请求放入预设令牌队列,进而基于写入请求在预设令牌队列中的位置和预设令牌队列关联的令牌,将用户终端的上下文信息同步写入IMS对应第一数据库中的第一哈希表,及电子设备对应第二数据库中的第二哈希表,如此,通过引入优先级处理和令牌队列机制,不仅提高了数据写入过程的可控性和效率,而且能够有效确保IMS对应第一数据库中的数据与电子设备对应第二数据库中的数据的一致性与同步性。The information processing device provided in the embodiment of the present application, in response to receiving a write request sent by a user terminal, first determines the priority of the write request, and then, based on the priority, puts the write request into a preset token queue, 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 a first database corresponding to the IMS and a second hash table in a second database corresponding to the electronic device. In this way, by introducing priority processing and a token queue mechanism, not only the controllability and efficiency of the data writing process are improved, but also 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 be effectively ensured.
在一些实施例中,所述确定单元1110还被配置为:响应于接收到所述写入请求,获取所述写入请求对应的报文类型和过期时间;基于所述报文类型和所述过期时间,确定所述优先级。In some embodiments, the determination unit 1110 is further configured to: in response to receiving the write request, obtain a message type and an expiration time corresponding to the write request; and determine the priority based on the message type and the expiration time.
在一些实施例中,所述确定单元1110还被配置为:对所述报文类型和所述过期时间进行模糊化,得到所述报文类型对应的第一取值和所述过期时间对应的第二取值;采用中心平均法,对所述第一取值、所述报文类型对应的第一权重、所述第二取值以及所述过期时间对应的第二权重进行计算,得到所述优先级。In some embodiments, the determination 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 a central 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.
在一些实施例中,所述放入单元1120还被配置为:在所述预设令牌队列为空的情况下,将所述写入请求放入所述预设令牌队列中的任一位置处;在所述预设令牌队列不为空的情况下,基于所述写入请求的优先级和所述预设令牌队列中已放入请求的优先级,将所述写入请求放入所述预设令牌队列。In some embodiments, the placement unit 1120 is further configured to: when the preset token queue is empty, place the write request at any position in the preset token queue; when the preset token queue is not empty, place the write request 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.
在一些实施例中,所述预设令牌队列中包括至少一个所述已放入请求,所述放入单元1120还被配置为以下之一:在至少一个所述已放入请求的优先级均高于所述写入请求的优先级的情况下,将所述写入请求放入所述预设令牌队列中处于至少一个所述已放入请求之后的位置;在至少一个所述已放入请求的优先级低于所述写入请求的优先级的情况下,将所述写入请求放入所述预设令牌队列中处于至少一个所述已放入请求之前的位置;在第一请求的优先级高于所述写入请求的优先级,且第二请求的优先级低于所述写入请求的优先级的情况下,将所述写入请求放入所述预设令牌队列中处于所述第一请求之后且处于所述第二请求之前的位置;其中,所述至少一个所述已放入请求包括:所述第一请求和所述第二请求。In some embodiments, the preset token queue includes at least one of the placed requests, and the placement unit 1120 is further configured as one of the following: when the priority of at least one of the placed requests is higher than the priority of the write request, the write request is placed in the preset token queue at a position after at least one of the placed requests; when the priority of at least one of the placed requests is lower than the priority of the write request, the write request is placed in the preset token queue at a position before at least one of the placed requests; when the priority of a first request is higher than the priority of the write request and the priority of a 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 placed request includes: the first request and the second request.
在一些实施例中,所述写入单元1130还被配置为:响应于所述预设令牌队列中处于所述位置之前的前端位置上的信息为空,识别所述令牌的状态;响应于所述令牌的状态为未使用状态,将所述令牌的调用权限分配至所述写入请求,以将所述写入请求变更为处于执行状态的当前请求;基于所述当前请求,将所述上下文信息同步写入所述IMS对应第一数据库中的第一哈希表,及所述电子设备对应第二数据库中的第二哈希表。In some embodiments, the write unit 1130 is further configured to: in response to the information at the front position before the position in the preset token queue being empty, identify the state of the token; in response to the state of the token being unused, assign the calling authority of the token to the write request to change the write request to a current request in an execution state; based on the current request, synchronously write the context information to the first hash table in the first database corresponding to the IMS, and to the second hash table in the second database corresponding to the electronic device.
在一些实施例中,所述装置还包括:In some embodiments, the apparatus further comprises:
释放单元,被配置为响应于所述上下文信息,完成同步写入所述第一哈希表和所述二哈希表,确定所述当前请求执行结束;响应于所述当前请求执行结束,释放所述令牌,并将所述令牌的状态从使用状态更新为所述未使用状态。The release unit is configured to complete the synchronous writing of the first hash table and the second hash table in response to the context information, determine that the current request execution is completed; in response to the completion of the current request execution, release the token and update the state of the token from the used state to the unused state.
在一些实施例中,所述装置还包括:In some embodiments, the apparatus further comprises:
导出单元,被配置为响应于所述第一哈希表完成初始化,将所述第一哈希表中的信息导出至初始第二数据库,以得到有所述第二哈希表的所述第二数据库。The export unit is configured to export the information in the first hash table to an initial second database in response to the completion of initialization of the first hash table, so as to obtain the second database having the second hash table.
在此需要说明的是,本申请实施例提供的上述信息处理装置,能够实现上述信息处理方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。It should be noted here that the above-mentioned information processing device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned information processing method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.
图12为本申请实施例提供的一种部署有网际互连协议IP多媒体子系统IMS的电子设备的实体结构示意图,如图12所示,该电子设备可以包括:处理器(processor)1210、通信接口(Communications Interface)1220、存储器(memory)1230和通信总线1240,其中,处理器1210、通信接口1220和存储器1230通过通信总线1240完成相互间的通信。处理器1210可以调用存储器1230中存储的可执行数据指令,以执行上述各实施例所提供的信息处理方法中的部分或全部步骤。FIG12 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present application and equipped with an Internet Multimedia Subsystem (IMS) of an Internet Protocol (IP). As shown in FIG12 , the electronic device may include: a processor (processor) 1210, a communications interface (Communications Interface) 1220, a memory (memory) 1230, and a communication bus 1240, wherein the processor 1210, the communications interface 1220, and the memory 1230 communicate with each other through the communication bus 1240. The processor 1210 may call executable data instructions stored in the memory 1230 to execute some or all of the steps in the information processing methods provided by the above embodiments.
此外,上述的存储器1230中存储的可执行数据指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器或者网络设备等)执行本申请各实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁盘或者光盘等各种可以存储程序代码的介质。In addition, the executable data instructions stored in the above-mentioned memory 1230 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The software product is stored in a storage medium, including several instructions to enable 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 method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当该计算机程序被处理器运行时,实现上述各实施例所提供的信息处理方法中的部分或全部步骤。An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, part or all of the steps in the information processing method provided in the above embodiments are implemented.
本申请实施例还提供一种计算机程序产品,该计算机程序产品包括存储在计算机可读存储介质中的计算机程序,该计算机程序包括程序指令,当该程序指令被计算机执行时,计算机能够执行上述各实施例所提供的信息处理方法中的部分或全部步骤。An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute some or all of the steps in the information processing method provided in the above embodiments.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请实施例可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application embodiment is described with reference to the flowchart and/or block diagram of the method, device (system) and computer program product according to the present application embodiment. It should be understood that each flow process and/or box in the flow chart and/or block diagram and the combination of the flow chart and/or box in the flow chart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart or multiple flows and/or one box or multiple boxes of the block chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
以上所述,仅为本申请的可选实施例而已,并非用于限定本申请的保护范围。The above description is merely an optional embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411376136.2A CN119299433A (en) | 2024-09-29 | 2024-09-29 | Information processing method, device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411376136.2A CN119299433A (en) | 2024-09-29 | 2024-09-29 | Information processing method, device and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN119299433A true CN119299433A (en) | 2025-01-10 |
Family
ID=94156486
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202411376136.2A Pending CN119299433A (en) | 2024-09-29 | 2024-09-29 | Information processing method, device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN119299433A (en) |
-
2024
- 2024-09-29 CN CN202411376136.2A patent/CN119299433A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10630779B2 (en) | System and method for using VoIP session continuity information using logical scalable units | |
| US10523545B2 (en) | System and method for managing VoIP session continuity information using logical scalable units | |
| CN102611735B (en) | A kind of load-balancing method of application service and system | |
| CN107465767A (en) | A kind of method and system of data syn-chronization | |
| CN110149392A (en) | A kind of management method and device of PUSH message | |
| WO2020104988A1 (en) | Fast session restoration for latency sensitive middleboxes | |
| CN109542659A (en) | Using more activating methods, equipment, data center's cluster and readable storage medium storing program for executing | |
| CN107111510B (en) | Method and device for operating VNF packet | |
| CN106817432A (en) | The method of virtual resource elastic stretch, system and equipment under cloud computing environment | |
| CN113206877A (en) | Session keeping method and device | |
| US11544119B2 (en) | Business rules processing framework for implementing new desired functionality in a telecommunication application | |
| CN114900449B (en) | Resource information management method, system and device | |
| CN108062243A (en) | Generation method, task executing method and the device of executive plan | |
| CN114363963A (en) | Load balancing selection method and system for cloud-native UPF signaling plane | |
| CN108111333A (en) | A kind of flow limitation method and system based on WEB | |
| CN108228310B (en) | Method and device for balanced deployment of virtual network functions | |
| EP2266281B1 (en) | Dynamic service generation in ims network | |
| CN110149365B (en) | Service adaptation method, apparatus, system, and computer-readable medium | |
| WO2012134361A1 (en) | Method and arrangement for providing update notifications in a telecommunication network | |
| US7647401B1 (en) | System and method for managing resources of a network load balancer via use of a presence server | |
| CN110351107A (en) | Configuring management method and device | |
| CN119299433A (en) | Information processing method, device and storage medium | |
| US10819777B1 (en) | Failure isolation in a distributed system | |
| CN118734282A (en) | Data processing method, device, equipment and computer readable storage medium | |
| CN112889247B (en) | VNF service instantiation method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |