Message processing method and device, storage medium and computer device
Patent Information
- Application Number
- CN202610856222.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-12
- Publication Date
- 2026-08-21
AI Technical Summary
[0003]目前的5G信令摘要报文处理方案,在将处理设备与服务器物理网线直连的基础上,服务器将解析出的5G信令摘要报文,通过现场可编程门阵列(Field ProgrammableGate Array,FPGA)网卡将分配至处理设备的数据核,再由数据核在内核态下完成对5G信令摘要报文的处理,这种方式不仅存在因需要将处理设备与服务器通过物理网线直连造成的部署灵活性差问题,而且由于处理过程全在内核态下完成,所以仅支持处理基于用户数据报协议(User Datagram Protocol,UDP)的无状态信令摘要报文,无法支持处理基于传输控制协议(Transmission Control Protocol,TCP)的有状态且需要连接管理的信令摘要报文
[0010]本公开实施例提供的一种报文处理方法、装置、存储介质和计算机设备,通过将多个处理核心划分为数据核与三类功能独立的控制核,并为数据核和每类控制核分别设置对应的功能,可以充分简化各个处理核心的报文处理流程,提高各个处理核心的处理效率。通过在第一控制核上设置与两种协议类型分别对应的用户态线程和端口,可以实现利用端口和线程的网络通信能力,直接接收通过网络传输的各种协议类型下的信令摘要报文,既摆脱了对于报文处理设备与服务器之间需要通过物理网线直连的依赖,又可以实现对TCP协议类型与UDP协议类型的报文的兼容处理,提高了部署灵活性与报文处理灵活性。通过使用共享内存的方式实现信令摘要报文在第一控制核和第二控制核之间的传输,既可以减少第一控制核中的目标用户态线程与第二控制核中内核态报文分配线程之间的进程间通信消耗,又可以提高报文传输和处理效率,从而提高报文处理业务的业务性能。并且,与传输控制协议TCP类型的目标用户态线程在将信令摘要报文写入共享内存时,通过执行与目标协议类型相匹配的响应操作,可以充分满足TCP协议类型的信令摘要报文的连接响应需求,实现了对TCP类型的处理支持。
Smart Images

Figure CN122621301A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a message processing method, apparatus, storage medium, and computer device. Background Technology
[0002] 5G signaling digest messages are the core data carrier for 5G network signaling analysis, status monitoring, and data management. Efficient and complete processing of these messages is crucial to ensuring the stable operation of 5G network equipment.
[0003] Current 5G signaling digest message processing solutions, based on a direct physical network cable connection between the processing device and the server, involve the server parsing the 5G signaling digest message and then distributing it to the data core of the processing device via a Field Programmable Gate Array (FPGA) network card. The data core then processes the 5G signaling digest message in kernel mode. This approach not only suffers from poor deployment flexibility due to the need for a direct physical network cable connection between the processing device and the server, but also only supports processing stateless signaling digest messages based on the User Datagram Protocol (UDP) because the entire processing is done in kernel mode. It cannot support processing stateful signaling digest messages based on the Transmission Control Protocol (TCP) that require connection management.
[0004] Therefore, how to achieve compatible processing of TCP and UDP protocol messages while getting rid of the constraints of direct connection deployment has become a technical issue worthy of attention. Summary of the Invention
[0005] In view of this, this application provides a message processing method, apparatus, storage medium, and computer device to overcome the deployment constraints of direct physical connection between the device and the server and to achieve compatible processing of TCP and UDP protocol messages.
[0006] Specifically, this application is implemented through the following technical solution: In a first aspect, embodiments of this disclosure provide a message processing method applied to a message processing device. The device includes multiple processing cores, which are divided into a first number of data cores and a second number of control cores. The second number of control cores includes a first control core, a second control core, and multiple third control cores. The first control core is at least configured with a first user-mode thread for listening to a Transmission Control Protocol (TCP) port and a second user-mode thread for listening to a User Datagram Protocol (UDP) port. The method includes: The received signaling digest message is sent to the target protocol port that matches the target protocol type, according to the target protocol type used by the signaling digest message; Using the target user-mode thread in the first control core used to listen to the target protocol port, the signaling digest message is obtained, the signaling digest message is written to shared memory, and a response operation matching the target protocol type is executed; Using the message allocation thread in the second control core, the signaling digest message is read from the shared memory at a preset reading interval, and the signaling digest message is allocated to the target control core among the plurality of third control cores according to the message information of the signaling digest message; The target control core is used to process the signaling digest message.
[0007] Secondly, embodiments of this disclosure provide a message processing apparatus applied to a message processing device. The device includes multiple processing cores, which are divided into a first number of data cores and a second number of control cores. The second number of control cores includes a first control core, a second control core, and multiple third control cores. The first control core is at least provided with a first user-mode thread for listening to a Transmission Control Protocol (TCP) port and a second user-mode thread for listening to a User Datagram Protocol (UDP) port. The apparatus includes: The sending module is used to send the received signaling digest message to the target protocol port that matches the target protocol type, according to the target protocol type used by the signaling digest message; The storage module is used to acquire the signaling digest message using the target user-mode thread in the first control core that is used to listen to the target protocol port, write the signaling digest message into shared memory, and execute a response operation that matches the target protocol type. The reading module is used to read the signaling digest message from the shared memory according to a preset reading interval using the message allocation thread in the second control core, and allocate the signaling digest message to the target control core among the plurality of third control cores according to the message information of the signaling digest message; The processing module is used to process the signaling digest message using the target control core.
[0008] Thirdly, embodiments of this disclosure also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the first aspect described above.
[0009] Fourthly, an optional implementation of this disclosure also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in the first aspect described above.
[0010] This disclosure provides a message processing method, apparatus, storage medium, and computer device. By dividing multiple processing cores into data cores and three functionally independent control cores, and assigning corresponding functions to each data core and each type of control core, the message processing flow of each processing core can be significantly simplified, improving the processing efficiency of each processing core. By setting user-mode threads and ports corresponding to two different protocol types on the first control core, the network communication capabilities of the ports and threads can be utilized to directly receive signaling digest messages of various protocol types transmitted over the network. This eliminates the reliance on a direct physical network cable connection between the message processing device and the server, and also enables compatible processing of TCP and UDP protocol types, improving deployment and message processing flexibility. Using shared memory to transmit signaling digest messages between the first and second control cores reduces inter-process communication overhead between the target user-mode thread in the first control core and the kernel-mode message allocation thread in the second control core, improving message transmission and processing efficiency, thereby enhancing the service performance of message processing services. Furthermore, when the target user-space thread of the Transmission Control Protocol (TCP) type writes the signaling digest message to the shared memory, it can fully meet the connection response requirements of the TCP protocol type signaling digest message by executing a response operation that matches the target protocol type, thus realizing support for TCP type processing.
[0011] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] Figure 1 This is a flowchart illustrating a message processing method applied to a message processing device according to an exemplary embodiment of this application; Figure 2 This is a flowchart illustrating the signaling digest message reading step of a message processing method according to an exemplary embodiment of this application; Figure 3 This is a schematic diagram illustrating the operation flow of a message processing method according to an exemplary embodiment of this application; Figure 4 This is a schematic diagram of a message processing apparatus shown in an exemplary embodiment of this application; Figure 5 This is a schematic diagram of the structure of a computer device shown in an exemplary embodiment of this application. Detailed Implementation
[0013] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0014] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0015] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0016] Research has revealed that existing 5G signaling digest message processing schemes rely on a direct network cable connection between the device and the server. The server then sends the parsed 5G signaling digest message to the device via the network cable. Upon receiving the 5G signaling digest message, the device uses its FPGA network card to allocate it to one of multiple data cores based on the International Mobile Subscriber Identity (IMSI) field obtained from parsing the message. This data core then parses the message in kernel mode and sends the parsing result to a matching logic memory chip for post-processing. This processing scheme has the following drawbacks: 1. The entire parsing process—from the network card to the data core, from parsing to processing, and finally to the logic processing chip—is performed in kernel mode. This only supports message processing for stateless protocols like UDP that do not require bidirectional responses, and cannot support message processing for protocols like TCP that require bidirectional responses such as connection establishment, data acknowledgment, and connection termination. 2. Due to the strong reliance on direct physical network cable connection between devices and servers, the deployment flexibility of the message processing flow is poor.
[0017] Based on the above research, this disclosure provides a message processing method, apparatus, storage medium, and computer device. By dividing multiple processing cores into data cores and three types of functionally independent control cores, and setting corresponding functions for each data core and each type of control core, the message processing flow of each processing core can be significantly simplified, and the processing efficiency of each processing core can be improved. By setting user-mode threads and ports corresponding to two protocol types on the first control core, the network communication capabilities of ports and threads can be utilized to directly receive signaling digest messages of various protocol types transmitted over the network. This eliminates the dependence on a direct physical network cable connection between the message processing device and the server, and also enables compatible processing of TCP and UDP protocol types, improving deployment flexibility and message processing flexibility. By using shared memory to transmit signaling digest messages between the first and second control cores, the inter-process communication overhead between the target user-mode thread in the first control core and the kernel-mode message allocation thread in the second control core can be reduced, and the message transmission and processing efficiency can be improved, thereby improving the service performance of message processing services. Furthermore, when the target user-space thread of the Transmission Control Protocol (TCP) type writes the signaling digest message to the shared memory, it can fully meet the connection response requirements of the TCP protocol type signaling digest message by executing a response operation that matches the target protocol type, thus realizing support for TCP type processing.
[0018] The shortcomings of the above solutions are the result of the inventor's practical experience and careful research. Therefore, the discovery process of the above problems and the solutions proposed in this disclosure below should be considered as the inventor's contribution to this disclosure.
[0019] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0020] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0021] It should be noted that the specific terms mentioned in the embodiments of this disclosure include: Kernel mode: Kernel mode refers to the operating system running at a higher privilege level, capable of directly accessing hardware devices and system resources, and executing the operating system kernel code. The operating system kernel is the lowest-level software in the system; it manages the entire system's resources and processes and provides system call interfaces to the outside world. Programs in kernel mode primarily perform low-level operations, such as driver development and system services.
[0022] User mode refers to a program running at a lower privilege level, unable to directly access low-level system resources such as hardware devices and kernel code. When a program executes in user mode, it needs to send system call requests to the operating system, which then performs the relevant operations on behalf of the program. Programs in user mode primarily execute application logic, such as text editors, browsers, and music players.
[0023] Data Core: The core of the message processing equipment responsible for efficiently processing message forwarding tasks in the data plane.
[0024] Control core: The core of the message processing equipment responsible for protocol negotiation and management operations in the control plane.
[0025] To facilitate understanding of the embodiments of this application, a message processing method disclosed in this disclosure will first be described in detail. The execution subject of the message processing method provided in this disclosure is generally a terminal device or other processing device with certain computing capabilities, such as a message processing device. The message processing device serves as a physical server or dedicated network device for receiving, distributing, and parsing 5G signaling digest messages.
[0026] The following describes a message processing method provided in this disclosure, taking any message processing device as the executing entity.
[0027] like Figure 1 The flowchart shown is a message processing method applied to a message processing device according to an embodiment of this application, which may include the following steps: S101: Using the data core, the received signaling digest message is sent to the target protocol port that matches the target protocol type, according to the target protocol type used in the signaling digest message.
[0028] Here, the message processing device may include multiple processing cores, each of which can be a Central Processing Unit (CPU). These multiple processing cores can be divided into a first number of data cores and a second number of control cores. The second number of control cores may include a first control core, a second control core, and multiple third control cores. The second number can be greater than the first number. For example, if the number of message processing devices is N, and N is, for example, 16, the first number can be 1, and the second number can be less than or equal to N-1. The number of first control cores, second control cores, and third control cores can also be pre-defined. Typically, the number of third control cores is greater than the number of first control cores and also greater than the number of second control cores.
[0029] A data core refers to a processing core in a message processing device that is pre-divided into multiple processing cores and dedicated to receiving signaling digest messages and transmitting the messages to the protocol ports mentioned later. The number of data cores is preferably one. This is because if multiple data cores are used, when multiple data cores receive signaling digest messages at the same time and write them to shared memory by the target user-mode thread, the writing order of multiple signaling digest messages may be inconsistent with the original order of multiple signaling digest messages, resulting in out-of-order processing of messages and causing processing abnormalities.
[0030] The first control core runs the first user-mode thread and the second user-mode thread, and is responsible for writing signaling digest packets to shared memory. There can also be only one first control core. The first user-mode thread, as a server thread running in user mode, can listen on a TCP port to obtain signaling digest packets received on that port. The first user-mode thread, also as a server thread running in user mode, can listen on a UDP port to obtain signaling digest packets received on that port.
[0031] The second control core runs the packet allocation thread and is responsible for forwarding the signaling digest packets read by the packet allocation thread to the third control core. The packet allocation thread is a pre-defined thread that has the ability to read shared memory and allocate packets to the third control core.
[0032] A signaling digest message is a data unit generated by 5G network or access network equipment from the original signaling interaction flow by extracting key fields based on signaling information and performing preprocessing. Signaling digest messages can be digest messages from various mobile communication technology versions, such as 4G signaling digest messages, 5G signaling digest messages, and 6G signaling digest messages. For ease of description, the following text will use 5G signaling digest messages as an example.
[0033] Protocol types include Transmission Control Protocol (TCP) and User Datagram Protocol (UDP); the target protocol type refers to the protocol type used by the currently received signaling digest message. For example, if the currently received signaling digest message is a TCP message, the target protocol type is TCP; if the currently received signaling digest message is a UDP message, the target protocol type is UDP.
[0034] The protocol ports can specifically include a first protocol port corresponding to the TCP protocol and a second protocol port corresponding to the UDP protocol; the target protocol port is the protocol port corresponding to the target protocol type. Both the first and second protocol ports are pre-configured communication ports. Based on these two communication ports, packets located within the communication range corresponding to the ports can be directly received. The communication range can include, for example, a port range or a network segment range.
[0035] In practice, a pre-defined data core can be used to receive any pending 5G signaling digest message sent by the server over the network. Then, for the received 5G signaling digest message, the target protocol type used by the message is determined from TCP and UDP types. Based on the identified target protocol type, the target protocol port for receiving the 5G signaling digest message is determined from a first protocol port and a second protocol port. For example, if the target protocol type is TCP, the first protocol port is determined as the target protocol port; if the target protocol type is UDP, the second protocol port is determined as the target protocol port. Finally, the data core is used to send the signaling digest message to the target protocol port.
[0036] In this way, all 5G signaling digest messages in this application are received, identified in terms of protocol type, and sent via a single data core, which can fundamentally avoid the problem of out-of-order signaling digest messages caused by multi-core reception.
[0037] S102: Utilize the target user-mode thread in the first control core, which is used to listen to the target protocol port, to obtain the signaling digest message, write the signaling digest message to the shared memory, and execute a response operation that matches the target protocol type.
[0038] Here, the first control core runs server-side listening threads corresponding to the TCP and UDP protocols, respectively, to receive messages from the data core to the first control core and write the received signaling digest messages into shared memory. User-mode threads can specifically include a first user-mode thread listening to the first protocol port and a second user-mode thread listening to the second protocol port. The target user-mode thread refers to the user-mode thread corresponding to the target protocol port. For example, if the target protocol type of the signaling digest message is TCP, then the target protocol port is the first protocol port, and the target user-mode thread is the first user-mode thread. Shared memory is a memory area that can be read and written by both the first and second control cores. Its storage space size is pre-allocated in memory based on the expected message processing throughput. The message processing throughput can be determined based on the peak message traffic in the application scenario of the message processing device.
[0039] A response operation is an acknowledgment or reply operation that the receiver returns to the sender after receiving data during network communication.
[0040] In practical implementation, a first user-mode thread in the first control core can continuously listen to the first protocol port corresponding to the TCP protocol, and a second user-mode thread in the first control core can continuously listen to the second protocol port corresponding to the UDP protocol. When the data core sends a signaling digest message to the target protocol port, the target user-mode thread continuously listening to that target protocol port obtains the complete signaling digest message from the target protocol port. Then, the first control core can use the target user-mode thread to write the obtained signaling digest message to shared memory and execute a matching response operation based on the target protocol type. For example, an acknowledgment response or an empty response.
[0041] S103: Using the message allocation thread in the second control core, read the signaling digest message from the shared memory according to the preset reading interval, and allocate the signaling digest message to the target control core in multiple third control cores according to the message information of the signaling digest message.
[0042] Here, the second control core refers to the control core used to read and distribute signaling digest messages from shared memory; the number of second control cores can be one. The message distribute thread runs on the second control core and is used to implement message reading and distribution. Message information is obtained by extracting key fields carried in the signaling digest message, which can be used as the basis for distributing the signaling digest message. The third control core is used for signaling digest message parsing and message processing; the number of third control cores can be multiple. The length of the preset time interval can be set empirically, and this application embodiment does not impose specific limitations. To improve the timeliness of message processing, the preset time interval can be extremely small, such as every millisecond or every second, to ensure that the message distribute thread can immediately read the message after the target user-space thread writes it to shared memory, achieving real-time response in message processing. The target control core is the third control core determined by message distribution and responsible for processing the current signaling digest message.
[0043] In practice, a message allocation thread running on the second control core continuously and in real-time reads signaling digest messages from shared memory at preset reading intervals. After parsing the read signaling digest messages, the message allocation thread can extract key fields as message information. Based on this message information, a target control core can be determined from the third control cores, and the signaling digest message can be allocated to that target control core. For example, the association relationships between each third control core and various message information can be pre-configured, and the message allocation thread determines the target control core based on these association relationships and the message information extracted from the current signaling digest message.
[0044] S104: Use the target control kernel to process the signaling digest messages.
[0045] In practice, for any target control core, it can obtain the signaling digest message assigned to it, and then perform matching message processing operations on the signaling digest message according to the bound service processing logic. After processing, the target control core waits for and processes the next signaling digest message assigned to it. For example, the message processing operation may involve extracting information from each field of the message and determining, based on the information from each field, which logic processing chip to send the signaling digest message to or what kind of post-processing operation to perform on the signaling digest message.
[0046] In one embodiment, the step of "writing the signaling digest message to shared memory" in S102 can be implemented according to the following steps A1~A2: A1: Use the target user-mode thread to obtain the current first write cursor value of the shared memory; the first write cursor value is used to indicate the current write position in the shared memory.
[0047] Here, a write cursor and a read cursor are configured in the shared memory. The cursor values corresponding to the write and read cursors are dynamically updated according to the real-time writing and reading of packets. Specifically, the write cursor value indicates the storage location in the shared memory where signaling digest packets can currently be written; the read cursor value indicates the storage location in the shared memory where signaling digest packets are currently to be read. The first write cursor value indicates the position pointed to by the write cursor at the current moment, indicating the location where the current signaling digest packet is written.
[0048] In practice, before writing the signaling digest message, the target user-space thread first reads the first write cursor value stored in the shared memory to determine the starting write address for this write operation.
[0049] A2: Write the signaling digest message to the shared memory according to the first write cursor value, and update the first write cursor value according to the memory space of the shared memory and the amount of messages already written to the shared memory.
[0050] Here, the shared memory space is used to indicate the total capacity of the shared memory. The number of packets written to the shared memory is the total number of signaling digest packets stored in the shared memory when this write operation is completed.
[0051] In practice, the target user-space thread writes the signaling digest message into shared memory, starting from the storage address indicated by the first write cursor value. After writing, the first write cursor value is updated based on the total capacity of shared memory and the total number of signaling digest messages already stored in shared memory. Specifically, if the difference between the total capacity of shared memory and the total number of messages is greater than or equal to the size of a single signaling digest message, the first write cursor value can be updated using the end address of the latest signaling digest message written to shared memory. If the difference between the total capacity of shared memory and the total number of messages is less than the size of a single signaling digest message, the first write cursor value can be updated based on the starting address of the shared memory.
[0052] Understandably, since each signaling digest message has a consistent size and the shared memory space is fixed, the cursor values corresponding to the shared memory can be pre-determined based on the message size and memory space size. These cursor values include a minimum cursor value and a maximum cursor value. After writing the current signaling digest message into the shared memory, the first cursor value can be updated based on the first write cursor value and the maximum cursor value used when writing the current signaling digest message. If the first write cursor value is equal to the maximum cursor value, it can be updated to the minimum cursor value; if the first write cursor value is equal to or less than the maximum cursor value, it can be updated to the next cursor value.
[0053] In one embodiment, the "execute corresponding response operation for the target protocol type" step in S102 can correspond to different response operations depending on the target protocol type. Specifically: When the target protocol type is Transmission Control Protocol, the response operation matching the target protocol type is a connection response operation; or, when the target protocol type is User Datagram Protocol, the response operation matching the target protocol type is empty.
[0054] Here, the connection response operation can specifically refer to connection confirmation, data reception acknowledgment, and other response processing conforming to the TCP transmission specification, performed according to the TCP protocol. When the target protocol type is UDP, since this is a stateless protocol type, it does not require a response, so the response operation for the UDP type can be empty.
[0055] In practice, if the target protocol type of the current signaling digest message is TCP, the target user-space thread (i.e., the first user-space thread) can execute the corresponding connection response operation to complete the protocol handshake or data acknowledgment operation with the sender, thereby completing the TCP protocol acknowledgment. If the target protocol type of the current signaling digest message is UDP, the target user-space thread (i.e., the second user-space thread) does not execute any response operation due to the connectionless nature of UDP, and only completes the action of writing the message to shared memory before returning to the listening state.
[0056] In one embodiment, the step S103, "using the message allocation thread in the second control core to read signaling digest messages from shared memory according to a preset reading interval, and allocating the signaling digest messages to target control cores among multiple third control cores according to the message information of the signaling digest messages," can be implemented according to the following steps B1~B4: B1: Using the message allocation thread, according to the preset read interval, obtain the current first read cursor value and second write cursor value of the shared memory. The first read cursor value is used to indicate the current read position in the shared memory.
[0057] Here, the read cursor is a location identifier stored in shared memory, used to indicate the starting memory address of the read operation. The first read cursor value indicates the starting memory read position of the current message allocation thread's read operation; the second write cursor value indicates the latest write address of the shared memory at the current moment. When the first read cursor value and the second write cursor value are the same, it indicates that all signaling digest messages written in the shared memory have been read completely, and there are no unread messages in the shared memory at this time; if the two are inconsistent, it indicates that there are unread messages in the shared memory at this time.
[0058] That is, the first read cursor value and the second write cursor value together define the range of the signaling digest message for the same read operation.
[0059] In practice, when each preset reading interval is reached, the message allocation thread can first read the current read cursor value and write cursor value in the shared memory, and define them as the first read cursor value and the second write cursor value, respectively.
[0060] B2: If the second write cursor value and the first read cursor value are inconsistent, determine the message reading method and the reading position of each message based on the relationship between the second write cursor value and the first read cursor value.
[0061] Here, the message reading mode is used to indicate the order in which signaling digest messages are read from shared memory. The message reading location refers to the memory location of each signaling digest message to be read, and each message reading location determines the range to be read.
[0062] In practice, during this read operation, it can be determined whether the second write cursor value and the first read cursor value are consistent. If they are, it can be determined that there is currently no signaling digest message to be read, and the process can continue to wait until the next preset time interval. If not, the message allocation thread can be used to compare the size relationship between the obtained second write cursor value and the first read cursor value, and based on this size relationship, the message reading method and the message reading position corresponding to this read operation can be determined.
[0063] B3: According to the message reading method, sequentially read the signaling digest messages at each message reading position from the shared memory, and allocate the signaling digest messages to the target control cores among the multiple third control cores based on the message information of the currently read signaling digest messages.
[0064] In practice, the message allocation thread sequentially reads signaling digest messages from the shared memory at each determined message reading location according to the established message reading method, and then performs distribution for the currently read signaling digest message. Each time the message allocation thread reads a signaling digest message, it can immediately parse the message and extract the message information. Based on the message information, it determines the target control core corresponding to the signaling digest message among multiple third control cores. This process of reading, parsing, and allocating is repeated until the processing of the signaling digest messages at each determined message reading location is complete.
[0065] B4: In response to the completion of reading the signaling digest messages at each message reading position, update the first read cursor value using the second write cursor value.
[0066] In practice, when the message allocation thread confirms that all signaling digest messages at all message read positions within the current read range have been read, it can set the first read cursor value to the second write cursor value. That is, when it is confirmed that all signaling digest messages to be read have been read, the position of the first read cursor is updated so that the updated first read cursor and the second write cursor point to the same position in shared memory.
[0067] In one embodiment, regarding step B2 above, the message reading method and each message reading position can be determined using different methods based on the specific size relationship between the second write cursor value and the first read cursor value. Specifically, when the second write cursor value is greater than the first read cursor value, determining the message reading position includes each second read cursor value located between the second write cursor value and the first read cursor value, and determining the message reading method as reading in the order of each second read cursor value.
[0068] Here, the message reading method is a continuous sequential reading method, that is, according to the position order of each second read cursor value, each signaling digest message within the difference range between the second write cursor value and the first read cursor value is read in sequence.
[0069] In practice, when the second write cursor value is greater than the first read cursor value, all signaling digest messages within the interval formed by the second write cursor value and the first read cursor value are to be read. Within this interval, each second read cursor value is determined sequentially based on the first read cursor value, where the second read cursor value includes the first read cursor value. The second read cursor value is used to indicate the storage location of the signaling digest messages to be read in shared memory. Simultaneously, it can be determined that the message reading method is to read sequentially in ascending order of the second read cursor value.
[0070] Alternatively, if the second write cursor value is less than the first read cursor value, the message read position is determined to include each third read cursor value located between the second write cursor value and the preset maximum cursor value, and each fourth read cursor value located between the preset starting cursor value and the second write cursor value, and the message read method is determined to be that each third read cursor value is read first, and each fourth read cursor value is read later.
[0071] Here, the default starting cursor value is the minimum cursor value corresponding to the starting address of the shared memory. The default maximum cursor value is the maximum cursor value determined by the total capacity of the shared memory region. When the write cursor reaches the default maximum cursor value, the next write operation will return to the starting address corresponding to the minimum cursor value and start writing again. The third read cursor value is used to indicate the signaling digest message position between the second write cursor value and the default maximum cursor value. The fourth read cursor value is used to indicate the signaling digest message position between the minimum cursor value and the second write cursor value.
[0072] In specific implementation, when the second write cursor value is less than the first read cursor value, the signaling digest messages stored in the shared memory are divided into two parts: the first part consists of messages corresponding to the third read cursor values between the second write cursor value and the preset maximum cursor value; the second part consists of messages corresponding to the fourth read cursor values between the preset starting cursor value and the second write cursor value. Since the write time of the messages in the first part is later than the write time of the messages in the second part, according to the first-in-first-out principle, the message reading method can be determined as follows: first read the signaling digest messages at the memory locations indicated by the third read cursor values in the first part, and then read the signaling digest messages at the memory locations indicated by the fourth read cursor values in the second part. The reading order of the signaling digest messages at the memory locations indicated by the third read cursor values is according to the order of the third read cursor values; similarly, the reading order of the signaling digest messages at the memory locations indicated by the fourth read cursor values is according to the order of the fourth read cursor values, thereby realizing the reading of all signaling digest messages in the shared memory.
[0073] Understandably, if there are no update errors in the shared memory read / write cursors and no abnormalities in the message reading process, the memory area between the second write cursor value and the first read cursor value should be empty (i.e., there are no signaling digest messages). Therefore, even if the message is read in the order of the fourth read cursor value, messages in this memory area will not be read repeatedly. However, if there are update errors in the shared memory read / write cursors and / or abnormalities in the message reading process, such as read interruptions or cursor update anomalies, it may result in unread signaling digest messages in the memory area between the second write cursor value and the first read cursor value, even if the second write cursor value is less than the first read cursor value. In this case, reading the entire shared memory space ensures that potentially unread signaling digest messages are read promptly, avoiding omissions and thus guaranteeing the integrity of the message reading.
[0074] For example, assuming the shared memory has a preset maximum cursor value of 100, the current first read cursor value is 80, and the second write cursor value is 20. Since the second write cursor value of 20 is less than the first read cursor value of 80, the signaling digest packets corresponding to each of the third read cursor values within the range of 80 to 100 can be read sequentially. After reading this range, the signaling digest packets corresponding to each of the fourth read cursor values between the preset starting cursor value of 0 and 20 can be read sequentially. This reading method can cover the reading of all signaling digest packets to be read in normal scenarios, and can also promptly read historical signaling digest packets in the shared memory that have not been read normally, even if an anomaly causes the write cursor to be less than the read cursor, thus avoiding data loss.
[0075] One possible implementation, when the second write cursor value is less than the first read cursor value, is to first read the signaling digest messages corresponding to each read cursor value between the first read cursor and the preset maximum cursor value, and then read the signaling digest messages corresponding to each read cursor value between the preset starting cursor value and the second write cursor value. This reading method only reads the latest valid signaling digest message within the current write cycle, resulting in simpler reading logic and shorter single read time, making it suitable for business scenarios with extremely high real-time requirements for signaling processing. The method of reading the entire memory space is more suitable for business scenarios with extremely high requirements for signaling integrity, where no signaling digest message loss is permissible. The two methods can be flexibly selected according to actual business needs.
[0076] like Figure 2 The diagram shown is a schematic flowchart of the signaling digest message reading process of a message processing method provided in an embodiment of this application.
[0077] When the first read cursor value and the second write cursor value obtained by the message allocation thread in the second control core are inconsistent, the system first determines whether the second write cursor value is greater than the first read cursor value. If the determination result is "yes," then the system sequentially reads the signaling digest messages corresponding to each second read cursor value located between the first read cursor value and the second write cursor value. In other words, the first read cursor value is used as the starting position for this read, and the cursor value preceding the second write cursor value is used as the ending position for this read, sequentially reading the signaling digest messages between the first read cursor value and the second write cursor value. After the read is completed, the first read cursor value is set as the second write cursor value for this read operation, making the updated first read cursor value the same as the second write cursor value, and the read operation ends. Understandably, in the case of various signaling digest messages located between the first read cursor value and the second write cursor value, the first read cursor value can be updated once for each signaling digest message read. In this way, when all signaling digest messages located between the first read cursor value and the second write cursor value have been read, the first read cursor value and the second write cursor value will be aligned.
[0078] When the judgment result is "No," meaning the second write cursor value is less than the first read cursor value, the signaling digest summary messages corresponding to each third read cursor value between the second write cursor value and the preset maximum cursor value need to be read sequentially. Then, the signaling digest summary messages corresponding to each fourth read cursor value between the preset starting cursor value and the second write cursor value need to be read sequentially. After reading, the first read cursor value is set as the second write cursor value for this read operation, making the updated first read cursor value the same as the second write cursor value, and the read operation ends. Understandably, if the signaling digest summary messages corresponding to the third read cursor value are read first, and then the signaling digest summary messages corresponding to the fourth read cursor values are read, the third read cursor value can also be updated after each signaling digest message is read. In this way, when all the signaling digest messages corresponding to the third and fourth read cursor values have been read, the first read cursor value and the second write cursor value are aligned.
[0079] By first judging, then reading, and finally updating, it can be ensured that even if there are unread signaling digest messages, sequential reading can be achieved regardless of how many unread signaling digest messages are present, and the first read cursor value can be uniformly updated to the second write cursor value, thus guaranteeing the consistency of shared memory read and write status.
[0080] Since the shared memory space is pre-allocated based on the expected amount of signaling digest packets to be stored, data intervals can be directly divided using the first read cursor value and the second write cursor value. Address wraparound is achieved when the cursor value reaches the preset maximum cursor value, supporting three reading modes: continuous read, full read, and segmented wraparound read, without data overwriting. Furthermore, the packet writing thread (and the target user-space thread) and the packet allocation thread can directly access the same shared memory segment. Throughout the process of reading and distributing packets according to the cursor position, the overhead of inter-process communication between user space and the kernel is reduced, improving the performance of business processing.
[0081] In one embodiment, the step of "allocating the signaling digest message to the target control core among multiple third control cores according to the message information of the signaling digest message" in S103 can be implemented according to the following steps C1~C3: C1: Parse the signaling digest message to obtain the preset field information of the signaling digest message.
[0082] Here, the preset field information refers to key fields predefined in the signaling digest message format, used to identify and distinguish signaling digest messages. Specifically, the preset field information can be the International Mobile Subscriber Identity (IMSI) field, which is also a mandatory field in signaling digest messages.
[0083] In practice, a message allocation thread can be used to parse the signaling digest messages read from shared memory and extract the IMSI field from the message as a preset field information. This field can be used as the basis for subsequent message allocation for subsequent target control core allocation.
[0084] Furthermore, the primary key of the message can be obtained by parsing the signaling digest message. The message primary key is a globally unique identifier field for each signaling digest message, used to uniquely identify, locate, and associate a complete signaling digest message or a specific service record within a signaling digest message. Specifically, the IMSI field identifies the user to whom the message belongs; different messages from the same user share the same IMSI. The message primary key identifies the individual message itself. For example, the message primary key can be a message sequence number, message ID, message index, unique message number, etc., without limitation.
[0085] C2: Determine the message information based on the preset field information, and determine the target control core from multiple third control cores based on the message information and the number of third control cores.
[0086] Here, message information refers to the characteristic information generated based on preset field information, used to uniquely identify the destination of a message. Optionally, message information can also be generated based on the IMSI field and the message primary key.
[0087] In practice, the parsed preset field information, or the parsed preset field information and the message primary key, can be used to determine the message information. Then, a Cyclic Redundancy Check (CRC) fast verification algorithm is used to calculate the CRC result corresponding to the message information. This calculation result is then moduloed by the total number of third control cores to obtain the modulo result. Afterward, based on the modulo result and the core identifier of each third control core, a target control core can be selected from the third control cores.
[0088] For example, the CRC algorithm mentioned above can be the CRC32 algorithm, which has a fast calculation speed and uniform output distribution. It can ensure uniform load balancing of signaling digest messages among multiple third control cores with extremely low computational overhead.
[0089] Meanwhile, since the CRC calculation result of the preset field information (IMSI) from the same user is fixed, it can be ensured that all signaling digest messages of the same user are assigned to the same target control core. This can maintain the timing and state consistency of the same user session, and also make the signaling digest messages evenly distributed among the third control cores, thus achieving efficient load balancing.
[0090] C3: Distribute the signaling digest message to the lockless queue corresponding to the target control core; among them, a third control core has a lockless queue pre-configured.
[0091] Here, a lock-free queue (kFIFO) is a first-in-first-out (FIFO) data structure that does not rely on traditional synchronization mechanisms such as mutexes and semaphores. It achieves safe data transfer between multiple threads through only CPU atomic operations, avoiding thread blocking and context switching overhead caused by lock contention. When the operating system of the message processing device starts up or before the message processing flow begins, a corresponding lock-free queue can be pre-configured for each third control core, and related resources can be configured for the corresponding lock-free queue. After configuration, a queue clearing operation must be performed on the lock-free queue to remove any remaining historical signaling digest messages, ensuring the accuracy of the new round of processing. After configuration and clearing operations, the lock-free queue is bound to the corresponding third control core, waiting to receive allocated signaling digest messages. There is a one-to-one correspondence between the third control core and the lock-free queue, with an equal number of each.
[0092] In practice, a message allocation thread can be used to write the signaling digest message to the lock-free queue corresponding to the target control core by calling the kfifo_in() function. Since the number of third control cores is equal to the number of lock-free queues, the step of "determining the target control core from multiple third control cores based on message information and the number of third control cores" can also be understood as determining the lock-free queue to which the signaling digest message is to be allocated based on the message information and the total number of lock-free queues.
[0093] In one embodiment, S104 described above can be implemented according to the following steps: Using a message reading thread in the target control core, a circular reading strategy and a first-in-first-out order of messages are adopted to read signaling digest messages from the lock-free queue corresponding to the target control core, and the target control core is used to process the currently read signaling digest messages; wherein, a third control core is pre-configured with a message reading thread.
[0094] Here, the message reading thread is a thread running on the third control core, responsible for reading messages from the lock-free queue corresponding to its third control core. There is a one-to-one correspondence between the message reading threads and the third control core and the lock-free queue, and the number of each thread is equal.
[0095] The circular read strategy involves the message reading thread continuously checking the corresponding lock-free queue for the existence of a signaling digest message. If it exists, it is read; otherwise, the loop continues. The first-in, first-out (FIFO) order means that the signaling digest message that enters the lock-free queue first is read by the message reading thread first. Message processing refers to all relevant operations performed by the target control core on the read signaling digest message according to actual business requirements.
[0096] In practical implementation, for any target control core, the message reading thread can check whether the lock-free queue corresponding to the target control core is empty at preset time intervals. If it is, it can wait for the next preset time interval. If the lock-free queue corresponding to the target control core is not empty, the message reading thread can schedule the `kfifo_out()` function to read the signaling digest messages in the lock-free queue corresponding to the target control core in a first-in-first-out order. For example, when it is detected that the lock-free queue is not empty, the queue contains three signaling digest messages in the order of storage time: message 1, message 2, and message 3. The message reading thread then reads the signaling digest messages in the lock-free queue in the order of message 1-message 2-message 3. For any currently read signaling digest message, after it is assigned to the target control core for processing, the message reading thread immediately returns and continues to read the lock-free queue corresponding to the target control core in a loop. For the target control core, it can be used to perform message processing for each read signaling digest message in sequence. For example, the target control core identifies the corresponding signaling digest message and determines that the signaling digest message needs to be allocated to FPGA chip 1. It processes the signaling digest message according to the requirements of FPGA chip 1, converts the signaling digest message into target data in the format required by FPGA chip 1, and then sends the target data directly to the corresponding FPGA chip 1 through the bound Direct Memory Access (DMA) channel.
[0097] like Figure 3 The diagram shown is a schematic representation of the operation flow of a message processing method provided in an embodiment of this application.
[0098] Phase 1: The data core receives the message and sends it to the target protocol port that matches the target protocol type used by the message, and then proceeds to Phase 2.
[0099] Phase 2: The first control core uses the target user-mode thread to obtain the packet at the target protocol port and determines whether the packet is a signaling digest packet. If not, i.e., the packet is not a signaling digest packet, the current processing flow is exited directly; if so, i.e., the packet is a signaling digest packet, the target user-mode thread writes the signaling digest packet into shared memory, executes the response operation matching the target protocol type, and proceeds to Phase 3.
[0100] Phase 3: Using the message allocation thread of the second control core, each signaling digest message to be processed is read sequentially from shared memory. Based on the message information of the currently read signaling digest message, it is allocated to the lock-free queue corresponding to the target control core among multiple third control cores, and then proceeds to Phase 4. (The process continues in...) Figure 3The third control core shown includes CPU2 to CPUN.
[0101] Phase 4: For each of the multiple third control cores, when it is designated as the target control core, it can perform message processing on the allocated signaling digest messages. Specifically, when each third control core has signaling digest messages allocated in its corresponding lock-free queue, each third control core can process the signaling digest messages in its respective lock-free queue in parallel.
[0102] This application achieves precise binding between the processing flow of each processing core and its corresponding thread by re-dividing and configuring the number of data cores and control cores in the message processing device, thus avoiding resource waste. By setting user-mode threads corresponding to UDP and TCP protocols on the first control core, compatible processing of UDP and TCP protocol messages is achieved. Using shared memory as the carrier for signaling digest message interaction between user-mode threads and kernel-mode message allocation threads reduces inter-process communication overhead and significantly lowers data transmission latency, thereby improving the service performance of signaling digest message processing.
[0103] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0104] Based on the same inventive concept, this disclosure also provides a message processing device corresponding to the message processing method. Since the principle of the device in this disclosure for solving the problem is similar to the message processing method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0105] like Figure 4 The diagram shown is a schematic representation of a message processing apparatus provided in an embodiment of this disclosure, comprising: The sending module 401 is used to send the received signaling digest message to the target protocol port that matches the target protocol type according to the target protocol type used by the signaling digest message using the data core; Storage module 402 is used to acquire the signaling digest message using the target user-mode thread in the first control core that is used to listen to the target protocol port, write the signaling digest message into shared memory, and execute a response operation that matches the target protocol type. The reading module 403 is used to read the signaling digest message from the shared memory according to a preset reading interval using the message allocation thread in the second control core, and allocate the signaling digest message to the target control core among the plurality of third control cores according to the message information of the signaling digest message; The processing module 404 is used to process the signaling digest message using the target control core.
[0106] In one possible implementation, the storage module 402, when writing the signaling digest message to the shared memory, is used to: Using the target user-mode thread, obtain the current first write cursor of the shared memory; the first write cursor is used to indicate the current write position in the shared memory; According to the first write cursor, the signaling digest message is written to the shared memory, and the first write cursor is updated according to the memory space of the shared memory and the amount of messages already written to the shared memory.
[0107] In one possible implementation, when the target protocol type is a transmission control protocol type, the response operation that matches the target protocol type is a connection response operation; Alternatively, if the target protocol type is User Datagram Protocol type, the response operation matching the target protocol type is empty.
[0108] In one possible implementation, the reading module 403, when using the message allocation thread in the second control core to read the signaling digest message from the shared memory at a preset reading interval, and allocating the signaling digest message to a target control core among the plurality of third control cores according to the message information of the signaling digest message, is used to: Using the message allocation thread, the current first read cursor value and second write cursor value of the shared memory are obtained according to a preset reading interval. The first read cursor value is used to indicate the current read position in the shared memory. If the second write cursor value and the first read cursor value are inconsistent, the message reading method and the message reading position are determined according to the size relationship between the second write cursor value and the first read cursor value. According to the message reading method, the signaling digest messages at each message reading position are sequentially read from the shared memory, and for the currently read signaling digest message, the signaling digest message is allocated to the target control core among the plurality of third control cores according to the message information of the signaling digest message; In response to the completion of reading all signaling digest messages at each message reading position, the first read cursor value is updated using the second write cursor value.
[0109] In one possible implementation, the reading module 403, when determining the message reading method and each message reading position based on the size relationship between the second write cursor value and the first read cursor value, is used to: When the second write cursor value is greater than the first read cursor value, the message read position is determined to include each of the second read cursor values located between the second write cursor value and the first read cursor value, and the message read method is determined to be reading in the order of the second read cursor values. When the second write cursor value is less than the first read cursor value, the message read position is determined to include each third read cursor value located between the second write cursor value and the preset maximum cursor value, and each fourth read cursor value located between the starting address and the second write cursor value. The message read method is determined to be that each third read cursor value is read first, and each fourth read cursor value is read later.
[0110] In one possible implementation, the reading module 403, when allocating the signaling digest message to a target control core among the plurality of third control cores based on the message information of the signaling digest message, is configured to: The signaling digest message is parsed to obtain the preset field information of the signaling digest message; Based on the preset field information, the message information is determined, and based on the message information and the number of third control cores, the target control core is determined from multiple third control cores; The signaling digest message is allocated to the lockless queue corresponding to the target control core; wherein, a third control core is pre-configured with a lockless queue.
[0111] In one possible implementation, the processing module 404, when processing the signaling digest message using the target control core, is configured to: Using the message reading thread in the target control core, a circular reading strategy and a first-in-first-out order of messages are adopted to read signaling digest messages from the lock-free queue corresponding to the target control core, and the target control core is used to process the currently read signaling digest messages; wherein, a third control core is pre-configured with a message reading thread.
[0112] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0113] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0114] Based on the same technical concept, embodiments of this application also provide a computer device. (Refer to...) Figure 5 The diagram shown is a structural schematic of a computer device provided in an embodiment of this application, comprising: The processor 501, memory 502, and bus 503 are included. Memory 502 stores machine-readable instructions executable by the processor 501. The processor 501 executes the machine-readable instructions stored in memory 502. When the machine-readable instructions are executed by the processor 501, the processor 501 executes the above-described S101~S104.
[0115] The aforementioned memory 502 includes a main memory 5021 and an external memory 5022. The main memory 5021, also known as internal memory, is used to temporarily store the computational data in the processor 501, as well as the data exchanged with external memory such as a hard disk 5022. The processor 501 exchanges data with the external memory 5022 through the main memory 5021. When the computer device is running, the processor 501 and the memory 502 communicate through the bus 503, so that the processor 501 executes the execution instructions mentioned in the above method embodiments.
[0116] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the message processing method described in the above-described method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0117] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the message processing method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0118] The computer program product can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0119] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interface; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0120] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0121] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0122] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0123] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A message processing method, characterized in that, The device is applied to a message processing equipment, which includes multiple processing cores, which are divided into a first number of data cores and a second number of control cores; the second number of control cores includes a first control core, a second control core, and multiple third control cores. The first control core is equipped with at least a first user-mode thread for listening to the Transmission Control Protocol (TCP) port and a second user-mode thread for listening to the User Datagram Protocol (UDP) port. The method includes: The received signaling digest message is sent to the target protocol port that matches the target protocol type, according to the target protocol type used by the signaling digest message; Using the target user-mode thread in the first control core used to listen to the target protocol port, the signaling digest message is obtained, the signaling digest message is written to shared memory, and a response operation matching the target protocol type is executed; Using the message allocation thread in the second control core, the signaling digest message is read from the shared memory at a preset reading interval, and the signaling digest message is allocated to the target control core among the plurality of third control cores according to the message information of the signaling digest message; The target control core is used to process the signaling digest message.
2. The method according to claim 1, characterized in that, The step of writing the signaling digest message into shared memory includes: Using the target user-mode thread, obtain the current first write cursor value of the shared memory; the first write cursor value is used to indicate the current write position in the shared memory; According to the first write cursor value, the signaling digest message is written to the shared memory, and the first write cursor value is updated according to the memory space of the shared memory and the amount of messages already written to the shared memory.
3. The method according to claim 1, characterized in that, When the target protocol type is a transmission control protocol type, the response operation that matches the target protocol type is a connection response operation; Alternatively, if the target protocol type is User Datagram Protocol type, the response operation matching the target protocol type is empty.
4. The method according to claim 1, characterized in that, The step of using the message allocation thread in the second control core to read the signaling digest message from the shared memory at a preset reading interval, and allocating the signaling digest message to the target control core among the plurality of third control cores according to the message information of the signaling digest message, includes: Using the message allocation thread, the current first read cursor value and second write cursor value of the shared memory are obtained according to a preset reading interval. The first read cursor value is used to indicate the current read position in the shared memory. If the second write cursor value and the first read cursor value are inconsistent, the message reading method and the message reading position are determined according to the size relationship between the second write cursor value and the first read cursor value. According to the message reading method, the signaling digest messages at each message reading position are sequentially read from the shared memory, and for the currently read signaling digest message, the signaling digest message is allocated to the target control core among the plurality of third control cores according to the message information of the signaling digest message; In response to the completion of reading all signaling digest messages at each message reading position, the first read cursor value is updated using the second write cursor value.
5. The method according to claim 4, characterized in that, The step of determining the message reading method and the reading position of each message based on the relationship between the second write cursor value and the first read cursor value includes: When the second write cursor value is greater than the first read cursor value, the message read position is determined to include each of the second read cursor values located between the second write cursor value and the first read cursor value, and the message read method is determined to be reading in the order of the second read cursor values. When the second write cursor value is less than the first read cursor value, the message reading position is determined to include each third read cursor value located between the second write cursor value and the preset maximum cursor value, and each fourth read cursor value located between the preset starting cursor value and the second write cursor value. The message reading method is determined to be that each third read cursor value is read first, and each fourth read cursor value is read later.
6. The method according to claim 1, characterized in that, The step of allocating the signaling digest message to a target control core among the plurality of third control cores based on the message information of the signaling digest message includes: The signaling digest message is parsed to obtain the preset field information of the signaling digest message; Based on the preset field information, the message information is determined, and based on the message information and the number of third control cores, the target control core is determined from multiple third control cores; The signaling digest message is allocated to the lockless queue corresponding to the target control core; wherein, a third control core is pre-configured with a lockless queue.
7. The method according to claim 6, characterized in that, The step of processing the signaling digest message using the target control core includes: Using the message reading thread in the target control core, a circular reading strategy and a first-in-first-out order of messages are adopted to read signaling digest messages from the lock-free queue corresponding to the target control core, and the target control core is used to process the currently read signaling digest messages; wherein, a third control core is pre-configured with a message reading thread.
8. A message processing apparatus, characterized in that, The device is applied to a message processing equipment, which includes multiple processing cores, which are divided into a first number of data cores and a second number of control cores; the second number of control cores includes a first control core, a second control core, and multiple third control cores. The first control core is equipped with at least a first user-mode thread for listening to the Transmission Control Protocol (TCP) port and a second user-mode thread for listening to the User Datagram Protocol (UDP) port. The device includes: The sending module is used to send the received signaling digest message to the target protocol port that matches the target protocol type, according to the target protocol type used by the signaling digest message; The storage module is used to acquire the signaling digest message using the target user-mode thread in the first control core that is used to listen to the target protocol port, write the signaling digest message into shared memory, and execute a response operation that matches the target protocol type. The reading module is used to read the signaling digest message from the shared memory according to a preset reading interval using the message allocation thread in the second control core, and allocate the signaling digest message to the target control core among the plurality of third control cores according to the message information of the signaling digest message; The processing module is used to process the signaling digest message using the target control core.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes, it implements the steps of the method as described in any one of claims 1 to 7.