WO2019024727A1 - 消息处理方法以及基站 - Google Patents

消息处理方法以及基站 Download PDF

Info

Publication number
WO2019024727A1
WO2019024727A1 PCT/CN2018/096941 CN2018096941W WO2019024727A1 WO 2019024727 A1 WO2019024727 A1 WO 2019024727A1 CN 2018096941 W CN2018096941 W CN 2018096941W WO 2019024727 A1 WO2019024727 A1 WO 2019024727A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
processor core
target
queue
processor
Prior art date
Application number
PCT/CN2018/096941
Other languages
English (en)
French (fr)
Inventor
朱小婷
何军
李忠星
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2019024727A1 publication Critical patent/WO2019024727A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/10Flow control between communication endpoints
    • H04W28/14Flow control between communication endpoints using intermediate storage
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the field of communication technologies, and more particularly to a message processing technique.
  • Packet ordering refers to processing messages or data packets in order of first in first out order, such that the order in which messages or data packets are received is consistent with the order in which the messages or data packets are sent.
  • all the pending messages in the base station are first cached in the message relay module, and the processor obtains the message from the message relay module and processes it as needed.
  • the message relay module has a message pool and a device register, and the message pool is used to cache all pending messages.
  • the processor accesses the device register in the message relay module through the bus, thereby triggering the message relay module to schedule the message from the message pool according to the principle of first in first out, and write the scheduled message.
  • a device register so that the processor can read the message from the device register.
  • the processor needs to consume a certain amount of information from the register of the message transfer module. The duration is such that each time the processor obtains a message from the message relay module, it takes a long time, affecting the performance of the processor to obtain the message, and thus affecting the performance of the processor processing the message.
  • the embodiment of the present application provides a message processing method and a base station, so as to improve the efficiency of the processor core to obtain a message and improve the performance of the processor core processing the message.
  • a first aspect of the present application provides a message processing method, in which a message relay module (a module for buffering a message requiring processor core processing in a base station) monitors a message in a processor core a message storage state corresponding to the queue; and if the message storage state indicates that no message is stored in the message queue of the processor core, determining, from the cached message, a target message to be pushed to the processor core, The target message is sent to the processor core such that the processor core stores the target message in a message queue within the processor core, such that the message relay module can push the message to the processor before the processor core needs to read the message.
  • a message relay module a module for buffering a message requiring processor core processing in a base station
  • Kernel when the processor core needs to read the message, it only needs to read the message from the message queue in the processor core, thereby avoiding the time required for the message relay module to wait for the message to be scheduled, and the processor core The time required to read the message in its internal message queue is also greatly reduced, which increases the time required for the processor core to read the message, thereby improving the time required. Get message processor performance, and help to improve the performance of a processor for processing messages.
  • the message relay module sends the target message to the processor.
  • the message storage state corresponding to the message queue of the processor core may also be set to a non-idle state, which indicates that a message is stored in the message queue of the processor core.
  • the message storage state may be represented by a valid flag bit of the processor core recorded in the message relay module. If the valid flag bit of the processor core is 1, the message queue of the processor core is in a non-idle state.
  • an idle notification may be sent to the message relay module.
  • the message relay module sets the message storage state to an idle state, wherein the message storage state is an idle state indicating a message queue of the processor core. No messages are stored in .
  • the valid flag bit of the processor core recorded in the message relay module is set to 0 to indicate that the message queue of the processor core is in an idle state.
  • the processor in a case where the processor of the base station is a multi-core processor, the processor includes a plurality of processor cores.
  • the message relay module can monitor the message queues of the multiple processor cores.
  • Corresponding message storage state eg, maintaining and monitoring the value of the valid flag bit corresponding to each processor core
  • the at least one processor core Determining a target processor core of the current message to be pushed; and determining, from the cached message, a target message to be pushed to the target processor core and transmitting the target message to the target processor core, thereby ensuring that the message queue can be idle in sequence
  • the processor core pushes the message.
  • the present application further provides a message processing method, in which a processor core receives a message sent by a message relay module and caches the message in a message queue in the processor core.
  • the processor core can read the message from the message queue, thereby eliminating the need to access the register of the message relay module, and avoiding waiting for the message relay module to dispatch the message to the message relay module.
  • the message queue is the space inside the processor core (eg, the storage space of the registers inside the processor core)
  • the message queue from the inside of the processor core is read relative to the message read from the message relay module. It takes less time to read the message, which greatly reduces the time required for the processor core to read the message and improves the message reading performance.
  • the processor core may also send an idle notification to the message relay module to not have the message information in the message queue of the processor core.
  • the message relay module is notified, so that the message relay module updates the message storage state corresponding to the message queue of the processor core.
  • the status value stored in the message queue can also be The status value can be stored in the status store in the message queue) set to 1, where the status value of 1 indicates that a message is stored in the message queue of the processor core.
  • the processor core can read the status value stored in the message queue, and when the status value is 1, read the message from the message queue.
  • the processor core when the processor core reads all the data of the message stored in the message queue, the status value is set to 0, and the status value of 0 indicates that there is no such unrepresented in the message queue. Read the message.
  • the processor core in order to be able to clarify the size of the message stored in the message queue and read the message from the message queue, it is advantageous to determine whether the data of the message in the message queue is completely fetched, and the message is sent in the processor core.
  • the value of the message size stored in the message queue may be set according to the bit occupied by the message (the number of bits of the data included in the message), and the value of the message is compared with the message.
  • the occupied bits are the same; correspondingly, the processor core can read the data of the message from the message queue according to the value of the message size, until all the data of the message is read out.
  • the application further provides a base station, where the base station includes: a processor and a message relay module, the processor includes at least one processor core, and the processor core has a message queue therein; the message is relayed
  • the module is a module in the base station for buffering messages that need to be processed by the processor core.
  • the message relay module is configured to monitor a message storage state corresponding to the message queue of the processor core; and when the message storage state indicates that the message queue of the processor core does not store a message, the message is cached. Determining a target message to be pushed to the processor core; sending the target message to the processor core.
  • the processor core is configured to cache the target message in a message queue in the processor core; when the message reading condition is met, the target message is read from the message queue of the processor core.
  • the message relay module is further configured to: after sending the target message to the processor core, set a message storage state corresponding to the message queue of the processor core to a non-idle state, The non-idle state indicates that a message is stored in the message queue of the processor core.
  • the processor core is further configured to: after reading the target message buffered in the message queue, send an idle notification to the message relay module, where the idle notification indicates that the processor core is in the message queue.
  • the message relay module is further configured to: when receiving the idle notification sent by the processor core, set a message storage state corresponding to the processor core to an idle state, where the idle state indicates There is no message stored in the message queue of the processor core.
  • the processor includes a plurality of processor cores; the message relay module is configured to monitor a message storage state corresponding to each of the message queues of the plurality of processor cores; Determining, from the at least one processor core, a target processor core of a current message to be pushed, wherein the message core corresponds to a message store, when there is at least one processor core in which the message storage state is an idle state The status of the idle state indicates that no message is stored in the message queue of the processor core; from the cached message, the target message to be pushed to the target processor core is determined; and the target message is sent to the target processing Kernel.
  • the processor core is further configured to set a state value stored in the message queue to 1 after the target message is cached in a message queue in the processor core, where A status value of 1 indicates that a message is stored in the message queue; correspondingly, when the processor reads the target message from the message queue of the processor core, specifically, the state value stored in the message queue is read; When the status value is 1, the target message is read from the message queue.
  • the processor core is further configured to set the status value to 0 when all data of the target message stored in the message queue is read out, and the status value is 0 to indicate the message queue. There are no messages that have not been read.
  • the processor core is further configured to: after the target message is cached in a message queue in the processor core, set the message queue to be stored according to a bit occupied by the target message.
  • the value of the message size the value of the message is the same as the bit occupied by the target message; correspondingly, when the processor core reads the target message from the message queue, it is specifically used according to the size of the message.
  • the value of the target message is read from the message queue until all data of the target message is read.
  • the message relay module determines, in the message from the cache, the target message to be pushed to the processor core, specifically for the message cached from the message cache space according to the first in first out principle. A target message to be pushed to the processor core is determined.
  • the third aspect of the embodiment of the present application is consistent with the design of the first aspect and the second aspect, and the technical means are similar.
  • the specific beneficial effects brought by the technical solution please refer to the first aspect and the second aspect, and details are not described herein.
  • FIG. 1 is a schematic structural diagram showing an application scenario of a message processing method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram showing internal message transmission of a base station according to an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a base station of the present application.
  • FIG. 4 is a schematic flowchart diagram of an embodiment of a message processing method according to the present application.
  • FIG. 5 is a flow chart showing the process of reading a message from a message queue by a processor core in the present application.
  • the message processing method and base station of the embodiments of the present application are applicable to a plurality of different communication systems.
  • an application scenario is taken as an example.
  • FIG. 1 a schematic structural diagram of an application scenario to which the message processing method of the present application is applied is shown.
  • the scenario may include: a base station 101, a terminal 102, and a Mobile Switching Center (MSC) 103.
  • MSC Mobile Switching Center
  • the base station can also be considered as a base station subsystem.
  • the terminal may include a user terminal such as a user equipment (User Equipment, UE).
  • the mobile switching center belongs to the equipment in the core network.
  • the core network may include other devices, which are not enumerated here.
  • the base station 101 is responsible for receiving the message sent by the terminal 102, and processing the message and then sending it to the mobile switching center 103.
  • the mobile switching center returns the message to the terminal 102, or other terminal, to communicate with the mobile switching center or other terminal.
  • the message mentioned in the embodiment of the present application may also be referred to as a package task, and one message is a package task.
  • the base station in the process of receiving and sending a message by the base station, the base station generates some to-be-processed messages, and the to-be-processed messages are cached in a message relay module having a packet order-preserving function in the base station, so that the processor sequentially Process the message in the message relay module.
  • FIG. 1 is only an application scenario in which the message processing method of the present application is applicable.
  • an application scenario in which a base station can receive a message to be processed may also have various other types. limit.
  • the base station may also generate some messages that need to be processed by the processor in the process of processing the service, and the messages are also first cached in the message relay module. In order for the CPU to get the message in turn and process it. For example, if the processor of the base station has multiple processor cores, there will be interactive messages between the processor cores, then the messages will be forwarded from one processor core to the message relay module, and then processed by another The kernel reads messages from the message relay module and processes them.
  • all the pending messages in the base station need to be cached in the message relay module, and then the processor can also obtain the pending message from the message relay module.
  • the information that needs to be processed or forwarded in the hardware module such as the accelerator in the base station, the security module, and the message processing engine module needs to be forwarded to the message relay module for buffering, and after the processor processes the message in the message relay module. And then forwarded to the corresponding hardware module or send the processed message to other devices than the base station.
  • a message processing scenario of a base station is taken as an example.
  • FIG. 2 a schematic diagram of a message being transmitted between hardwares in a base station is shown.
  • the message processing engine module in the base station parses the obtained message (which may also be referred to as a message)
  • the message is added to the message relay module; when the processor reads the message from the message relay module
  • the processor adds the processed message to the message relay module, so that the security engine module continues to process the message; correspondingly, the security engine module encrypts or decrypts the message obtained from the message relay module, and
  • the processed message is added to the message relay module; then, the processor obtains the message from the message relay module for processing, and sends the processed message to the traffic management module; finally, the traffic management module pushes the message to the message processing engine.
  • the network port of the module is the network port of the module.
  • the processor acquires the message from the message relay module twice.
  • FIG. 2 is only one scenario in which the base station processes the message.
  • the message relay module can be cached for processing by the processor, which is not limited in this application.
  • the manner in which the processor reads the message from the message relay module is changed to the message relay module actively pushing the message to be processed to the processor.
  • the composition of the base station is first introduced.
  • the base station includes a processor 30 and a message relay module 31.
  • the processor 30 may be a multi-core processor, which includes a plurality of processor cores 32, and each of the processor cores 32 may also be referred to as a core of the multi-core processor.
  • a message queue 321 is maintained in each processor core 32.
  • the message queue 321 is a storage space, and the message queue may include a data storage area 3211 for storing messages to be processed.
  • the message queue may further include
  • the status storage area 3212 is configured to record whether the data storage area stores a message and the size of the stored message.
  • the size of the message is also the bit occupied by the message (bits are also called bits). For example, the data contained in the message is 128 bits, 512 bits, and so on.
  • the state storage area stores two records of a status value and a message size, wherein the status value may be 0 or 1.
  • the status value When the status value is 0, the message queue does not exist; when the status value is 1, Indicates that there is a message in the message queue.
  • the value of the message size indicates the size of the data in the message currently stored in the message queue.
  • the message size may be 128 bits or 256 bits.
  • the processor core when the processor core stores the message to be processed in the data storage area of its message queue, the processor core sets the status value to 1, and sets the size of the message according to the number of bits of the data contained in the message. Value.
  • the status storage area 3212 of the message queue may also store the identifier of the message, such as the identifier of the message also recorded in the status storage area 3212 of the message queue.
  • the identifier of the message is represented by the MSG ID in FIG.
  • different message queues may be assigned different message queue identifiers.
  • the messages maintained by the processor core 0 are used.
  • the identifier of the queue is MSQG0
  • the identifier of the message queue maintained by processor core X is MSQGX.
  • the message queue maintained by the processor core is composed of a set of registers in the processor core.
  • the storage space of the set of registers is the storage space of the message queue.
  • the number of the registers included in the message queue may be set according to requirements, and may be determined according to the maximum value of the bits occupied by a message to be processed in the base station.
  • a message queue can include 9 registers, wherein the storage space of one register is used as a state storage area, and the storage space of another 8 registers is used as a data storage area.
  • each message queue corresponds to nine.
  • the storage area, each storage area is a storage space of a register, wherein the first register stores information such as a status value and a message size, and the storage space of the second to eighth registers respectively stores a message data.
  • the storage space of a register is 64 bits. If the size of a message is 128 bits, you can use the storage space of two registers. In this case, you can use the first and second. Register to store the message.
  • the message relay module is a module used in the base station to implement message relaying, and provides a message to be processed to the processor core according to the first in first out principle.
  • the message relay module 31 includes a message cache space 311.
  • the message cache space can also be regarded as a commonly known message pool. As shown in FIG. 3, the message pool is represented by a message pool. All messages sent by the other hardware in the base station to the message relay module are sequentially cached in the message cache space.
  • a message recording space 312 is maintained in the message relay module 31.
  • the status record space 312 is configured to record whether a message is stored in a message queue of each processor core in the processor. For any processor core, if there is a message to be processed in the message queue of the current processor core, the message relay module records the message queue of the processor core in the state storage space in a non-idle state; if the current time is processed If there is no pending message in the message queue of the kernel, the message relay queue in which the message relay module records the processor core in the state storage space is in an idle state.
  • the message relay module may record the respective valid flag bits of each processor core in the state storage space. If the message queue of the processor core is in a non-idle state, the valid flag of the processor core is set to 1 If the message queue of the processor core is idle, the valid flag of the processor core is set to zero.
  • the message relay module can retrieve the message to be processed from the message buffer space when the message queue of the processor core is in an idle state, and push the message to be processed to the processor core to be processed.
  • FIG. 3 is only a simplified schematic diagram of a base station, which does not constitute a limitation on a base station.
  • the base station may include more components than illustrated, for example, the base station may further include a transmitter, Components or modules such as receivers are not limited herein.
  • FIG. 4 a schematic flowchart of an embodiment of a message processing method according to the present application is shown.
  • the method in this embodiment is applied to a base station, and the method may include:
  • the message relay module monitors a valid flag bit of each processor core recorded in the state record space.
  • the valid flag of the processor core is used to indicate whether the message queue of the processor core is in an idle state. For example, when the valid flag of the processor core is 1, it indicates that the message queue in the processor core is stored in the message queue. The processed message; when the valid flag of the processor core is 0, there is no unprocessed message in the message queue in the processor core.
  • the specific introduction can be referred to the foregoing introduction, and details are not described herein again.
  • the message relay module can monitor the valid flag bits of each processor core in real time, or periodically scan the status record space according to a preset time interval to monitor the valid flag bits of each processor core.
  • a message is not cached in the message cache space of the message relay module, it indicates that there is no message in the message relay module that needs to be processed by the processor core, that is, the message relay module does not need to be in an idle state.
  • the processor core pushes the message request.
  • the message relay module does not need to detect whether the message queue of the processor core is in an idle state. Therefore, in step S401, the message relay module can also detect the message.
  • the cache space stores a message to be processed, it monitors the valid flag bits of each processor core.
  • the message relay module can schedule the message from the message buffer space and push it to the message.
  • Processor core Considering that there may be more than one processor core in the idle state of the message queue, the message relay module may sequentially push the message to the processor core with the valid flag bit being 0. Specifically, the message relay module may select a processor core that needs to push the message from the processor core whose valid flag is 0, and perform subsequent message push. For the purpose of distinguishing, the processor that needs to push the message is currently needed. The core is called the target processor core.
  • the processor core can be selected from the processor core with the at least one valid flag bit being 0.
  • a processor core with a valid flag bit of 0 can be randomly selected as the target processor core.
  • the processor core with the valid flag bit being 0 and the highest priority at the current time may be used as the target processor core in priority order.
  • the message relay module can set the valid flag bit of each processor core to 0. For example, in the initialization phase, the message relay module will each The valid flag bits of the processor cores are initialized to zero.
  • the message relay module determines the target processor core, and performs the subsequent steps, after the message is pushed to the target processor core, if there is an unprocessed message in the message relay module, the message is relayed.
  • the module repeats this step S402 until the message is pushed to all processor cores whose valid flag is zero.
  • the message relay module separately stores the valid flag bits of each processor core as an example, but it can be understood that if the message relay module records each processor core by other means.
  • the message storage state corresponding to the message queue in the message queue for example, the message storage state corresponding to the message queue of the recording processor core is an idle state, or is a non-idle state, etc., and the message storage state corresponding to the queue of other recording processor cores
  • the method is also applicable to the present application, as long as it can ensure that the message relay module can determine whether the message queue in the processor core is in an idle state.
  • step S403. The message relay module detects whether a message is stored in the message cache space of the message relay module. If yes, step S404 is performed; if no, the process returns to step S401.
  • the message cached in the message cache space is a message to be processed. If no message is stored in the message cache space, it indicates that there is no message in the base station that needs to be processed by the processor core. In this case, There is no need to perform subsequent steps, and it is possible to return to step S401 to continue to monitor the valid flag bits of the respective processor cores and wait for a message to be processed to appear in the message buffer space of the message relay module.
  • step S403 is not limited to that shown in FIG. 4. In an actual application, the step S403 may be performed before the target processor core is selected. Of course, if it is determined that the message buffer space of the message relay module stores the message to be processed before determining the processor core with the valid flag bit being 0, the step S403 need not be performed.
  • the message relay module determines, from the message cache space, a current target message to be processed.
  • a message to be processed (also referred to as to be scheduled) in the message buffer space is referred to as a target message.
  • the message relay module can determine the current target message to be processed from the message stored in the message cache space according to the principle of first in first out. Specifically, according to the storage moment of the message in the message cache space, the message with the highest storage time is selected from the message cache space as the current target message to be processed, so that the storage time front message is preferentially taken out.
  • the storage time refers to the moment when the message is stored in the message buffer space.
  • the message relay module does not need to distinguish which messages need to be allocated to which processor cores. In this case, only the first in first out is needed.
  • the target message with the highest storage time can be determined from the message cache space.
  • the message relay module needs to determine from the message cache space buffered by the target processor core according to the service that the target processor core is responsible for.
  • the target message for example, the target message is the message that belongs to the target processor core and is responsible for processing, and stores the message with the highest time.
  • the message relay module may also consider other factors when determining the target message, and is not limited herein.
  • the message relay module extracts the target message from the message cache space, and sends the target message to the target processor core.
  • the process in which the message relay module determines the target message from the message cache space and extracts the target message is the process of scheduling the message. It can be seen that, in the embodiment of the present application, the message relay module does not need to wait for the processor core to request the read message from the message relay module, but performs message scheduling when determining that the message queue in the processor core is in an idle state, thereby The target message to be processed by the processor core is sent to the processor core in advance before the processor core needs to process the target message.
  • the message relay module extracts the target message from the message cache space, which can be understood as: reading the target message from the message cache space, and deleting the target message stored in the message cache space, so that the message cache Messages stored in space belong to messages that have not yet been processed.
  • the message relay module sets the valid flag bit of the target processor core to 1, and returns to step S401.
  • the target processor core After the message relay module pushes the message to the target processor core, the target processor core stores the message pushed by the message relay module into the message queue, so that the message queue of the target processor core is no longer in an idle state. In this case, the message relay module sets the valid flag bit of the target processor core to 1, to record that the message queue of the target processor core is currently in a non-idle state.
  • the message relay module can continue to monitor the valid flag bits of each processor core, if there is still a processor with a valid flag bit at the current time. Core, the message relay module will continue to push messages to other processor cores until the valid flag bits of all processor cores are 0 or there is no pending message in the message buffer space.
  • the valid flag bit of the target processor core is set to 1, the same applies to the present embodiment if the process returns to step S402.
  • the message relay module caches the message in the message cache space, and caches the valid flag bit in the state record space as an example, but it can be understood that if the message relay module The cached messages in the same storage space and the idle state of the message queues in the respective processor cores are also applicable to the embodiments of the present application.
  • the processor core When the processor core receives the target message sent by the message relay module, the processor core stores the target message in a data storage area of the message queue in the processor core.
  • the processor core determines, according to the number of bits corresponding to the data in the target message, the target storage space that needs to store the target message from the data storage area of the message queue, and stores the target message in the target storage space.
  • the processor core can store the target message in a register in the message queue for storing the data.
  • the storage space of each register is 64 bits and the size of a target message is 256 bits
  • the target message can be stored for storing data according to the ordering of the registers for storing data. In the first four registers. For example, as explained in connection with FIG.
  • the message queue 321 is composed of nine registers, wherein the first register corresponds to the status memory 3212, and the second to ninth registers constitute the data storage area 3211, since the target message is 256 bits, the storage of the target message needs to occupy the second to fifth registers, that is, the registers marked with Date0, Date1, Date2, and Date3 in FIG.
  • the processor core in the step S407 can be regarded as the target processor core determined in the message relay module, although the target processor core determined by the message relay module is different at different times, but the received message is received.
  • the process of processing the target message by the processor core is the same.
  • the message sent by the processor core and sent by the message relay module is also referred to as a target message, but it can be understood that the target message can also be directly referred to in different places of the application. For the message.
  • the processor core sets the state value in the state storage area of the message queue to 1, and sets the value of the message size in the state storage area of the message queue according to the number of bits of the data included in the target message.
  • the setting the state value of the state storage area is convenient for the processor core to quickly determine whether the message to be processed is stored in the message queue according to the state value. Therefore, when the processor core stores the message pushed by the message relay module to the message queue, The status value in the state store can be set to 1 to indicate that an unprocessed message is stored in the message queue of the processor core.
  • the processor core may further set the value of the message according to the number of bits corresponding to the target message. For example, if the target message includes 128 bits of data, The size of the message may be 128 bits.
  • the message reading condition may also be a condition for the processor to obtain a message to be processed.
  • the message reading condition may be a process for the processor core to complete a message.
  • the message reading condition may also be set as needed. For other conditions, there is no restriction here.
  • the purpose of reading the status value and the message size is to assist subsequent reading of the message from the message queue to improve the convenience of message reading.
  • the processor core reads the target message stored in the data storage area of the message queue according to the value of the message size.
  • the processor core can directly read the target message to be processed from the message queue.
  • the value of the message size stored in the state storage area is used to determine which storage spaces in the data storage area store the data of the target message, thereby completing the reading of the target message.
  • the processor core may read all the data of the target message at a time, or read the data of the target message multiple times, when the processor core reads the target message from the data storage area in the message queue.
  • the number of times the processor core needs to read the target message is also related to the size of the target message.
  • the maximum number of bits read by the processor core per time may be preset, such that when the target message is read from the data storage area of the message queue, the data storage area may be Reading the maximum number of bits; then determining whether the data of the target message still exists in the data storage area according to the value of the message size, and if so, continuing to read the maximum bit from the data storage area A number of bits until all data of the target message stored in the data storage area has been read.
  • the message queue of each processor core includes a set of registers, it can also be read from the register of the message queue according to the possible size of the message and the minimum number of registers per read.
  • the message queue of each processor core includes 9 registers as an example. These 9 registers are register 0, register 1, register 2, register 3, register 4, register 5, register 6, register 7, and register. 8.
  • the storage space of the register 0 is a state storage area, and the storage space of the register 1 to the register 8 is a data storage area.
  • each register contains 64 bits, and each message contains no more than 64*8 bits, that is, each message contains a maximum of 512 bits.
  • the minimum number of bits that the processor core reads from the message queue each time is 128 bits, that is, the data stored in the two registers is read at a time, and the processor core is from the message queue.
  • the process of the processor core reading the target message may include:
  • the data belonging to the target message read from the register 1 and the register 2 is referred to as the first part of the target message.
  • the first part of the data may be part of the target message or all of the data of the target message.
  • step S502 Determine, according to the value of the message size, whether the data included in the target message is greater than 128 bits. If yes, execute step S503; if no, the target message is read.
  • the data of the target message is not completely read out, and the other registers also store the data of the target message. In this case, the subsequent steps need to be continued; if the target If the size of the message does not exceed 128 bits, the first part of the data of the target message is all the data of the target message, and all the data of the target message is read, and no further steps need to be performed.
  • the 128-bit of this step can be considered as the minimum number of bits per data read.
  • the minimum number of bits per read data can be set according to.
  • the 128-bit bit can also be set according to the amount of data that the base station needs to process. For other possible number of bits, for example, assume that the size of the message processed by the processor core in the base station can only be 128 bits, 256 bits or 512 bits, and the storage space of each register is 64 bits.
  • the data in the 128-bit/64-bit register can be read for the first time, that is, the data stored in the first two registers is read. Then, it is judged whether the message is greater than 128 bits. If yes, it indicates that the size of the target message may be 256 bits. In this case, the subsequent step S503 may be continued.
  • the data of the target message read from the register 3 and the register 4 is referred to as the second partial data, which is the partial data of the target message.
  • the first partial data and the second partial data need to be combined.
  • the data combined with the first partial data and the second partial data is referred to as the first combined data of the target message.
  • step S505. Determine, according to the value of the message size, whether the data included in the target message is greater than 256 bits. If yes, execute step S506; if not, determine that the first combined data is all data included in the target data.
  • the processor core reads the storage space of the register 1 to the register 4, and the storage space of the register 1 to the register 4 is 256 bits. Therefore, if the target message contains no more than 256 bits of data, The target message is read. In this case, the first combined data of the target message is all the data of the target message; if the target message contains more than 256 bits of data, it may still be stored in other registers. The data of the target message still needs to continue with the next steps.
  • the size of the message to be processed by the processor core of the base station is generally 128 bits, 256 bits, and 512 bits
  • the size of the target message is 512 bits, in which case the data of the remaining 256 bits of the target message can be read from register 5 to register 8.
  • the data read from register 5 to register 8 is referred to as the third portion of the target message.
  • step S506 is only an implementation manner.
  • the data of the target message may be read from the register 5 and the register 6 in a manner of reading up to 128 bits at a time, and then according to the message size. If the value of the target message is greater than 384, the data of the target message is continuously read from the register 7 and the register 8.
  • the size of the target message is 512 bits, it is necessary to sequentially combine the data read from the register 1 to the register 8, thereby combining all the data of the target message.
  • FIG. 5 is only for facilitating understanding that the processor core reads the target message from the message queue, and a reading manner is taken as an example. However, it can be understood that the processor core can be adopted according to actual needs. The other way to read the target message from the message queue is also applicable to the embodiment of the present application.
  • the message relay module actively pushes the message to the processor core, and the processor core will receive the message.
  • the incoming message is cached in the message queue, so that when the processor core needs to read the message, it only needs to read the message from the message queue in the processor core, thereby avoiding waiting for the message relay module to schedule the message.
  • Time, and the length of time required for the processor core to read messages from its internal message queue is greatly reduced, increasing the time required for the processor core to read the message, thereby improving the performance of the processor to obtain the message, and Helps improve the performance of the processor processing messages.
  • the processor core determines whether the data of the target message retrieved from the message queue is consistent with the value of the message size according to the value of the message size in the state storage area. If yes, the target message may be determined. The data is all taken out.
  • the state value of the state storage area can be set. Is 0 so that the processor core can know the condition of storing messages in the message queue.
  • the processor core sends an idle notification to the message relay module.
  • the idle notification is used to notify the message relay module of the information that the message queue in the processor core is in an idle state.
  • the message relay module may also send an idle notification to the message relay module.
  • step S411 the sequence of the step S411 and the step S412 is not limited to that shown in FIG. 4.
  • the step S412 may be performed while the step S411 is performed; or the message queue may be determined by the processor core.
  • the idle notification is sent to the message relay module, and the state value of the state storage area is set to 0.
  • the message relay module sets the valid flag bit of the processor core in the status recording space to 0 based on the idle notification.
  • the message relay module may record the message queue of the processor core in an idle state by other means when receiving the idle notification.
  • steps S412 to S413 are not necessary steps for the processor core to read the message, and are merely operations performed to ensure that the subsequent message relay module can continue to push the message to the processor core.
  • the processor is a multi-core processor as an example, but it can be understood that if the processor is a single-core processor, that is, the processor includes only one processor core.
  • the processor includes a single processor core
  • the message relay module detects that the message queue of the processor core is in an idle state, it can also determine that the message queue is to be pushed from the cached message.
  • the target message of the processor core and the target message is sent to the processor core.
  • the processor core also caches the received message in a message queue inside the processor core, and satisfies the processing.
  • the message reading condition of the core is read, the message is read from the message queue, and the process is similar to the process of the above processor core and the message relay module, and details are not described herein.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage.
  • the computer instructions can be routed from one website site, computer, server or data center to another website via wire (eg, coaxial cable, fiber optic, digital subscriber (DSL)) or wireless (eg, infrared, wireless, microwave, etc.) Transfer from a site, computer, server, or data center.
  • the computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media.
  • the usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a Solid State Disk (SSD)).

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请涉及通信技术领域,更具体的说涉及一种消息处理技术。在本申请的一种消息处理方法中,消息中转模块监控处理器核内的消息队列对应的消息存储状态;并在该消息存储状态表明该处理器核的消息队列中未存储有消息的情况下,从缓存的消息中确定出待推送给该处理器核的目标消息,并将该目标消息发送给处理器核,以使得处理器核将该目标消息存储到该处理器核内的消息队列中,并在满足消息读取条件时,从该处理器核内的消息队列中读取消息,从而避免了处理器核等待消息中转模块调度消息所需的耗时,也可以避免由于从消息中转模块的寄存器中读取消息所需的较高耗时,从而提高了处理器核获取消息的效率,提高了处理器核处理消息的性能。

Description

消息处理方法以及基站
本申请要求于2017年07月31日提交中国专利局、申请号为201710640484.X、发明名称为“消息处理方法以及基站”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,更具体地说,涉及一种消息处理技术。
背景技术
包保序是指按照先进先出顺序依次处理消息或者数据包,使得接收到消息或者数据包的顺序与发送该消息或数据包的顺序一致。在通信系统,为了实现包保序,基站中所有待处理的消息都会先缓存在消息中转模块中,处理器根据需要从该消息中转模块中获取消息并处理。
其中,消息中转模块中具有消息池和设备寄存器,消息池用于缓存所有待处理的消息。当处理器需要获取消息时,处理器会通过总线访问该消息中转模块内的设备寄存器,从而触发消息中转模块按照先进先出的原则,从消息池中调度消息,并将调度出的消息写入设备寄存器,这样,处理器便可以从设备寄存器中读取出消息。然而由于消息中转模块每次调度消息需要耗费一定的时长,而且,在消息中转模块将消息调度到该消息中转模块的寄存器之后,处理器从该消息中转模块的寄存器读取消息也需要耗费一定的时长,使得每次处理器从消息中转模块获取消息时,都需要耗费较长的时间,影响了处理器获取消息的性能,进而影响到处理器处理消息的性能。
发明内容
有鉴于此,本申请实施例提供了一种消息处理方法以及基站,以提高处理器核获取消息的效率,提高处理器核处理消息的性能。
为实现上述目的,本申请的第一方面提供了一种消息处理方法,在该方法中,消息中转模块(基站中用于缓存需要处理器核处理的消息的模块)监控处理器核内的消息队列对应的消息存储状态;并在该消息存储状态表明该处理器核的消息队列中未存储有消息的情况下,从缓存的消息中确定出待推送给该处理器核的目标消息,将该目标消息发送给处理器核,以使得处理器核将该目标消息存储到该处理器核内的消息队列中,这样,消息中转模块可以在处理器核需要读取消息之前,将消息推送给处理器核,当处理器核需要读取消息时,只需要从该处理器核内的消息队列中读取消息即可,从而避免了等待消息中转模块调度消息所需的时间,而且处理器核从其内部的消息队列中读取消息所需的时长也大大减少,提高了处理器核读取消息所需的耗时,进而提高了处理器获取消息的性能,并有利于提高处理器处理消息的性能。
在一种可能的设计中,为了能够保证该处理器核的消息队列对应的消息存储状态与该处理器核中消息队列内存储消息的状态一致,在消息中转模块将目标消息发送给该处理器 核之后,还可以将该处理器核的消息队列对应的消息存储状态设置为非空闲状态,该非空闲状态表明处理器核的消息队列中存储有消息。如,该消息存储状态可以通过消息中转模块中记录的该处理器核的有效标志位来表示,如果处理器核的有效标志位为1,则说明处理器核的消息队列处于非空闲状态。
在一种可能的设计中,为了使得消息中转模块能够及时获取该处理器核内的消息队列中是否存储有消息,在处理器核从该处理器核的消息队列中读取出消息之后,还可以向该消息中转模块发送空闲通知,相应的,消息中转模块在接收到该空闲通知时,将该消息存储状态设置为空闲状态,其中,消息存储状态为空闲状态表明该处理器核的消息队列中未存储有消息。如,将该消息中转模块中记录的该处理器核的有效标志位设置为0,以表示该处理器核的消息队列处于空闲状态。
在一种可能的设计中,在基站的处理器为多核处理器的情况下,该处理器包括多个处理器核,相应的,该消息中转模块可以监控该多个处理器核的消息队列各自对应的消息存储状态(如,维护并监控每个处理器核对应的有效标志位的取值),当存在消息存储状态为空闲状态的至少一个处理器核时,从该至少一个处理器核中,确定当前待推送消息的目标处理器核;并从缓存的消息中,确定待推送给该目标处理器核的目标消息并发送给该目标处理器核,从而保证可以依次向消息队列处于空闲状态的处理器核推送消息。
在本申请的第二方面,本申请还提供了又一种消息处理方法,在该方法中,处理器核接收消息中转模块发送的消息,并将消息缓存到该处理器核内的消息队列中,这样,当满足消息读取条件时,该处理器核可以从该消息队列中读取消息,从而无需再访问消息中转模块的寄存器,避免了等待消息中转模块将消息调度到该消息中转模块的寄存器中,而且由于消息队列为处理器核内部的空间(如,处理器核内部的寄存器的存储空间),因此,相对于从消息中转模块中读取消息,从该处理器核内部的消息队列中读取消息所需的耗时更少,从而大大减少了处理器核读取消息所需的耗时,提高了消息读取性能。
在一种可能的设计中,在处理器核从该消息队列中读取消息之后,该处理器核还可以向消息中转模块发送空闲通知,以将处理器核的消息队列中不存在消息的信息通知给消息中转模块,以便消息中转模块更新该处理器核的消息队列所对应的消息存储状态。
在一种可能的设计中,为了能够更方便的确定消息队列中是否存储有消息,在处理器核将消息缓存处理器核内的消息队列中之后,还可以将消息队列中存储的状态值(该状态值可以存储在消息队列中的状态存储区)设置为1,其中,该状态值为1表明该处理器核的消息队列中存储有消息。相应的,当满足消息读取条件时,该处理器核可以读取该消息队列中存储的状态值,并在该状态值为1时,从消息队列中读取消息。
在一种可能的设计中,在处理器核读取出该消息队列中存储的该消息的全部数据时,将该状态值设置为0,该状态值为0表明该消息队列中不存在未被读取的消息。
在一种可能的设计中,为了能够明确消息队列中存储的消息的大小,并从消息队列读取消息时,有利于确定消息队列中的消息的数据是否被全部取出,在处理器核将消息缓存到消息队列中之后,还可以根据消息所占据的比特位(消息中包含数据的比特位数),设置该消息队列中存储的消息大小的取值,该消息大小的取值与该消息所占据的比特位相同; 相对应的,该处理器核可以根据该消息大小的取值,从消息队列中读取该消息的数据,直至该消息的全部数据均被读取出。
在本申请的第三方面,本申请还提供了一种基站,该基站包括:处理器以及消息中转模块,该处理器包括至少一个处理器核,该处理器核内部具有消息队列;该消息中转模块为所述基站中用于缓存需要所述处理器核处理的消息的模块。其中,该消息中转模块,用于监控该处理器核的消息队列对应的消息存储状态;在该消息存储状态表明该处理器核的消息队列中未存储有消息的情况下,从缓存的消息中,确定待推送给该处理器核的目标消息;将该目标消息发送给该处理器核。相应的,处理器核,用于将该目标消息缓存在该处理器核内的消息队列中;在满足消息读取条件时,从该处理器核的消息队列中读取该目标消息。
在一种可能的设计中,该消息中转模块,还用于在将所述目标消息发送给处理器核之后,将所述处理器核的消息队列对应的消息存储状态设置为非空闲状态,所述非空闲状态表明所述处理器核的消息队列中存储有消息。
在一种可能的设计中,该处理器核,还用于在读取该消息队列中缓存的目标消息之后,向消息中转模块发送空闲通知,该空闲通知表明所述处理器核的消息队列中不存在消息;相应的,消息中转模块,还用于当接收到所述处理器核发送的空闲通知时,将所述处理器核对应的消息存储状态设置为空闲状态,所述空闲状态表明所述处理器核的消息队列中未存储有消息。
在一种可能的设计中,该处理器包括多个处理器核;该消息中转模块,具体用于监控所述多个处理器核的消息队列各自对应的消息存储状态;当所述多个处理器核中存在消息存储状态为空闲状态的至少一个处理器核时,从所述至少一个处理器核中,确定当前待推送消息的目标处理器核,其中,所述处理器核对应的消息存储状态为空闲状态表明所述处理器核的消息队列中未存储有消息;从缓存的消息中,确定待推送给所述目标处理器核的目标消息;将所述目标消息发送给所述目标处理器核。
在一种可能的设计中,该处理器核,还用于在将该目标消息缓存到该处理器核内的消息队列中之后,将该消息队列中存储的状态值设置为1,其中,该状态值为1表明该消息队列中存储有消息;相应的,处理器在从该处理器核的消息队列中读取该目标消息时,具体用于,读取该消息队列中存储的状态值;在该状态值为1时,从该消息队列中读取该目标消息。
在一种可能的设计中,处理器核,还用于当读取出该消息队列中存储的该目标消息的全部数据时,将该状态值设置为0,该状态值为0表明该消息队列中不存在未被读取的消息。
在一种可能的设计中,该处理器核,还用于在将该目标消息缓存到该处理器核内的消息队列中之后,根据该目标消息所占据的比特位,设置该消息队列中存储的消息大小的取值,该消息大小的取值与该目标消息所占据的比特位相同;相应的,处理器核在从该消息队列中读取该目标消息时,具体用于根据该消息大小的取值,从该消息队列中读取该目标消息的数据,直至该目标消息的全部数据均被读取出。
在一种可能的设计中,该消息中转模块在从缓存的消息中,确定待推送给该处理器核 的目标消息时,具体用于按照先进先出原则,从消息缓存空间缓存的消息中,确定出待推送给该处理器核的目标消息。
本申请实施例的第三方面与第一方面以及第二方面的设计思路一致,技术手段类似,技术方案带来的具体有益效果请参考第一方面以及第二方面,不再赘述。
附图说明
图1示出了本申请实施例的消息处理方法所适用的一种应用场景的组成结构示意图;
图2示出了本申请实施例的基站内部消息传递的示意图;
图3示出了本申请中基站的一种组成结构示意图;
图4示出了本申请一种消息处理方法一个实施例的流程示意图;
图5示出了本申请中的处理器核从消息队列中读取消息的一种流程示意图。
具体实施方式
本申请实施例的消息处理方法和基站,适用于多种不同的通信系统。为了便于理解,以一种应用场景为例进行介绍。
如,以移动通信系统为例,参见图1,其示出了本申请的消息处理方法所适用的一种应用场景的组成结构示意图。
该场景可以包括:基站101、终端102以及移动交换中心(Mobile Switching Center,MSC)103。
需要说明的是,该基站也可以认为是一个基站子系统。终端可以包括用户设备(User Equipment,UE)等用户终端。而该移动交换中心属于核心网中的设备,在核心网中除了包括移动交换中心之外,还可以包括其他设备,在此不一一列举。
其中,该基站101负责接收终端102发送的消息,并将消息处理之后发送给移动交换中心103。
移动交换中心将该消息处理之后返回给该终端102,或者其他终端,以实该现终端102与移动交换中心或者其他终端之间的通信。
其中,本申请实施例中所提到的消息也可以称为包任务,一条消息就是一个包任务。
可以理解的是,在基站接收到以及发送消息的过程中,基站就会产生一些待处理的消息,这些待处理的消息会缓存在基站中具备包保序功能的消息中转模块,以便处理器依次处理该消息中转模块中的消息。
需要说明的是,图1仅仅是本申请的消息处理方法所适用的一种应用场景,在实际应用中使得基站可以接收到待处理的消息的应用场景还可以有其他多种,在此不加以限制。
另外,除了基站从外部接收消息,并将消息处理后转发的情况之外,基站在处理业务的过程中,也可以会产生一些需要处理器处理的消息,这些消息也会先缓存在消息中转模块中,以便CPU依次获取消息并处理。如,在基站的处理器具有多个处理器核的情况下,处理器核之间会存在交互的消息,那么这些消息会先从一个处理器核转发到该消息中转模块,然后由另一个处理器核从该消息中转模块中读取消息并处理。
无论以上哪种情况,基站内所有的待处理消息都需要先缓存在该消息中转模块,然后处理器也可以从消息中转模块中获取到待处理消息。如,基站内加速器、安全模块以及报文处理引擎模块等硬件模块中所需处理或转发的消息都需要先转发给消息中转模块进行缓存,并由处理器对消息中转模块内的消息进行处理之后,再转发给相应的硬件模块或者将处理后的消息发送给基站之外的其他设备。
为了便于理解,以基站的一种消息处理场景为例进行介绍,参见图2,其示出了消息在基站内各个硬件之间传递的一种示意图。
结合图2可以看出,基站中的报文处理引擎模块对获取到的消息(也可以称为报文)进行解析之后,将消息添加到消息中转模块;当处理器从消息中转模块读取消息并处理之后,处理器将处理后的消息添加到该消息中转模块,以便安全引擎模块继续处理该消息;相应的,安全引擎模块对从消息中转模块获取到的消息进行加密或者解密处理,并将处理后的消息添加到该消息中转模块;然后,处理器再从消息中转模块获取消息进行处理,并将处理后的消息发送给流量管理模块;最后,流量管理模块将消息推送给报文处理引擎模块的网口。
由图2的流程可知,在该消息传递过程中,处理器从消息中转模块中获取消息的次数为两次。
当然,图2仅仅是基站处理消息的一种场景,在实际应用中,使得消息中转模块中缓存有可供处理器处理的消息的情况可以有多种,本申请对此不加以限制。
为了提高处理器获取消息的性能,在本申请实施例中,将处理器从消息中转模块读取消息的方式,变更为消息中转模块主动向处理器推送待处理的消息。为了便于理解本申请的方案,先对基站的组成结构进行介绍。
如,参见图3,其示出了本申请一种基站的组成结构示意图。如图3,该基站包括:处理器30和消息中转模块31。
为了提高消息处理性能,在本申请实施例中,该处理器30可以为多核处理器,其包括多个处理器核32,每个处理器核32也可以称为该多核处理器的内核。
在本申请实施例中,每个处理器核32内维护有一个消息队列321。消息队列321是一个存储空间,该消息队列可以包括数据存储区3211,该数据存储区3211用于存储待处理的消息。
为了快速确定数据存储区中是否存储有消息,以及数据存储区中存储的消息所占据的比特状态存储区用于记录数据存储区中是否存储有消息以及消息的大小,该消息队列中还可以包括状态存储区3212,其中,该状态存储区3212用于记录该数据存储区是否存储有消息,以及存储的消息的大小。其中,消息的大小也就是该消息所占据的比特位(比特位也称为比特),如,消息中包含的数据为128比特位、512比特位等等。
如,状态存储区存储有状态值以及消息大小这两个记录项,其中,状态值可以为0或1,当状态值为0时,表征消息队列中不存在消息;当状态值为1时,表示消息队列中存在消息。消息大小的取值表示消息队列中当前存储的消息中数据量的大小,如,该消息大小可以为 128比特位或者256比特位等。例如,当处理器核向其消息队列的数据存储区中存储待处理的消息时,处理器核将该状态值设置为1,并根据该消息包含的数据的比特位数,设置该消息大小的取值。
可以理解的是,为了区分出消息队列中所存储的消息,在该消息队列的状态存储区3212还可以存储消息的标识,如图3中消息队列的状态存储区3212中还记录的消息的标识,在图3中以MSG ID表示消息的标识。
当然,为了区分出不同处理器核所维护的消息队列,还可以为不同的消息队列分配不同的消息队列的标识,如,参见图3,在该图3中,处理器核0所维护的消息队列的标识为MSQG0,处理器核X所维护的消息队列的标识为MSQGX。
在一种可能的实现方式中,处理器核所维护的消息队列是由该处理器核内的一组寄存器构成,相应的,这一组寄存器的存储空间就是该消息队列的存储空间。其中,消息队列所包括的寄存器的数量可以根据需要设定,具体可以依据基站中待处理的一条消息所需占据的比特位的最大值来确定。
如,一个消息队列可以包括9个寄存器,其中,一个寄存器的存储空间作为状态存储区,另外8个寄存器的存储空间作为数据存储区,如,在图3中,每个消息队列对应着九个存储区域,每个存储区域就是一个寄存器的存储空间,其中,第一个寄存器中存储了状态值以及消息大小等信息,第二个到第八个寄存器的存储空间则分别存储一条消息所包含的数据。例如,假设一个寄存器的存储空间为64比特位,如果一条消息的大小为128比特位,则可以将需要占用两个寄存器的存储空间,在该种情况下,可以利用第一个以及第二个寄存器来存储该条消息。
在本申请实施例中,该消息中转模块为基站中用于实现消息中转,且按照先进先出原则向处理器核提供待处理的消息的模块。
其中,该消息中转模块31包括消息缓存空间311,该消息缓存空间也可以认为俗称的消息池,如图3中是以消息池表示消息缓存空间。其中,该基站中其他硬件发送给该消息中转模块的所有消息都会依次缓存在该消息缓存空间中。
同时,该消息中转模块31中还维护有一个状态记录空间312。其中,该状态记录空间312用于记录该处理器中每个处理器核的消息队列中是否存储有消息。对于任意一个处理器核,如果当前时刻处理器核的消息队列中存在待处理的消息,则该消息中转模块在该状态存储空间记录该处理器核的消息队列处于非空闲状态;如果当前时刻处理器核的消息队列中不存在待处理的消息,则该消息中转模块在该状态存储空间中记录有该处理器核的消息队列处于空闲状态。
如,消息中转模块可以在该状态存储空间中分别记录每个处理器核各自的有效标志位,如果处理器核的消息队列处于非空闲状态,则将该处理器核的有效标志位设置为1;如果该处理器核的消息队列处于空闲状态,则将该处理器核的有效标志位设置为0。
相应的,该消息中转模块可以在处理器核的消息队列处于空闲状态时,从该消息缓存空间中调取待处理的消息,并将待处理的消息推送给该待处理器核。
需要说明的是,图3仅仅是基站的一种简化示意图,其不构成对基站的限制,在实际中, 该基站可以包括比图示更多的部件,如,该基站还可以包括发射机、接收机等等部件或模块,在此不加以限制。
下面结合以上共性,对本申请实施例的消息处理方法进行详细介绍。
参见图4,其示出了本申请一种消息处理方法一个实施例的流程示意图,本实施例的方法应用于基站,该方法可以包括:
S401,消息中转模块监控状态记录空间中记录的各个处理器核的有效标志位。
其中,处理器核的有效标志位用于表征该处理器核的消息队列是否处于空闲状态,如,当处理器核的有效标志位为1,说明该处理器核内的消息队列中存储有未被处理的消息;当该处理器核的有效标志位为0,说明该处理器核内的消息队列中不存在未被处理的消息。当然,具体可参见前面的介绍,在此不再赘述。
其中,消息中转模块可以实时监控各个处理器核的有效标志位,也可以按照预先设定的时间间隔,定期扫描该状态记录空间,以监控每个处理器核的有效标志位。
可以理解的是,如果消息中转模块的消息缓存空间中未缓存有消息,则说明该消息中转模块中不存在需要处理器核处理的消息,也就是说,消息中转模块不存在需要向处于空闲状态的处理器核推送消息的需求,在该种情况下,消息中转模块也就无需检测处理器核的消息队列是否处于空闲状态,因此,在步骤S401中,可以消息中转模块也可以在检测到消息缓存空间存储有待处理的消息时,监控各个处理器核的有效标志位。
S402,当消息中转模块检测到当前存在至少一个有效标志位为0的处理器核时,从该至少一个有效标志位为0的处理器核中,确定当前待推送消息的目标处理器核。
如果处理器核的有效标志位为0,则说明该处理器核内部的消息队列中未存储有待处理的消息,在该种情况下,消息中转模块可以从消息缓存空间中调度消息,并推送给处理器核。而考虑到消息队列处于空闲状态的处理器核有可能不止一个,因此,消息中转模块可以依次向有效标志位为0的处理器核中推送消息。具体的,消息中转模块可以从有效标志位为0的处理器核中,选取出一个当前需要推送消息的处理器核,并执行后续的消息推送,为了便于区分,将当前需要推送消息的处理器核称为目标处理器核。
其中,从该至少一个有效标志位为0的处理器核中,选取目标处理器核的方式可以有多种,如,可以随机选取一个有效标志位为0的处理器核作为目标处理器核;又如,在处理器核存在优先顺序的情况下,可以按照优先顺序,将有效标志位为0且当前时刻优先级最靠前的处理器核作为目标处理器核。
可以理解的是,在消息中转模块未向任意处理器核推送过消息之前,消息中转模块可以将每个处理器核的有效标志位均设置为0,如,在初始化阶段,消息中转模块将每个处理器核的有效标志位的初始化为0。
可以理解的是,在消息中转模块确定出目标处理器核,并执行后续步骤,向该目标处理器核推送了消息之后,在消息中转模块中存在未被处理的消息的前提下,该消息中转模块会重复执行该步骤S402,直至完成向所有有效标志位为0的处理器核推送消息为止。
需要说明的是,在本申请实施例中,是以消息中转模块分别存储各个处理器核的有效标志位为例进行介绍,但是可以理解的是,如果消息中转模块通过其他方式记录各个处理 器核中的消息队列对应的消息存储状态的情况,如,记录处理器核的消息队列对应的消息存储状态为空闲状态,或者为非空闲状态等,对于其他记录处理器核的队列对应的消息存储状态的方式也适用于本申请,只要是能够保证该消息中转模块可以判断出处理器核中的消息队列中是否处于空闲状态即可。
S403,消息中转模块检测消息中转模块的消息缓存空间中是否存储有消息,如果是,则执行步骤S404;如果否,则返回步骤S401。
其中,消息缓存空间中缓存的消息均为待处理的消息,如果该消息缓存空间中未存储有消息,则说明当前时刻基站中不存在需要处理器核处理的消息,在该种情况下,则无需执行后续步骤,可以返回步骤S401,以继续监控各个处理器核的有效标志位,并等待消息中转模块的消息缓存空间中出现待处理的消息。
可以理解的是,该步骤S403并不限于图4所示,在实际应用中,也可以在选取目标处理器核之前,先执行该步骤S403。当然,如果在确定有效标志位为0的处理器核之前,已经确定该消息中转模块的消息缓存空间中存储有待处理的消息,则无需再执行该步骤S403。
S404,消息中转模块从该消息缓存空间中确定当前待处理的目标消息。
其中,为了便于区分,本申请实施例中,将消息缓存空间中当前待处理(也可以称为待调度)的消息称为目标消息。
如,该消息中转模块可以按照先进先出的原则,从该消息缓存空间存储的消息中,确定出当前待处理的目标消息。具体的,可以根据该消息缓存空间中消息的存储时刻,从该消息缓存空间中选取存储时刻最靠前的消息作为当前待处理的目标消息,从而使得存储时间靠前消息,被优先取出。其中,存储时间是指消息被存储到该消息缓存空间的时刻。
可以理解的是,在处理器中所有处理器核所处理的业务相同的情况下,消息中转模块无需区分哪些消息需要分配给哪些处理器核,在该种情况下,只需要按照先进先出的原则,从消息缓存空间中确定出存储时间最靠前的目标消息即可。但是,如果不同处理器核负责不同业务相关的消息,那么消息中转模块需要根据该目标处理器核所负责的业务,从消息缓存空间缓存的属于该目标处理器核所负责处理的消息中,确定出目标消息,如,目标消息为属于目标处理器核负责处理的消息中,存储时间最靠前的消息。
当然,在实际应用中,消息中转模块在确定目标消息时,还可能会考虑其他因素,在此不加以限制。
S405,消息中转模块从该消息缓存空间中取出该目标消息,将该目标消息发送给该目标处理器核。
其中,消息中转模块从消息缓存空间中确定目标消息以及取出目标消息的过程就是调度消息的过程。可见,在本申请实施例中,消息中转模块无需等待处理器核向消息中转模块请求读取消息,而是在确定出处理器核内的消息队列处于空闲状态时,便执行消息调度,从而可以在处理器核需要处理该目标消息之前,提前将处理器核所需处理的目标消息发送给处理器核。
可以理解的是,消息中转模块从该消息缓存空间取出该目标消息可以理解为,从该消息缓存空间中读取该目标消息,并删除该消息缓存空间中存储的该目标消息,这样,消息 缓存空间中存储的消息都属于尚未被处理的消息。
S406,消息中转模块将该目标处理器核的有效标志位设置为1,并返回步骤S401。
由于消息中转模块向目标处理器核推送了消息之后,目标处理器核会将消息中转模块推送的消息存储到消息队列中,使得该目标处理器核的消息队列不再处于空闲状态,在该种情况下,该消息中转模块会将该目标处理器核的有效标志位设置为1,以记录该目标处理器核的消息队列当前处于非空闲状态。
可以理解的是,消息中转模块向该目标处理器核推送了目标消息之后,该消息中转模块则可以继续监控各个处理器核的有效标志位,如果当前时刻仍存在有效标志位为0的处理器核,则该消息中转模块会继续向其他处理器核推送消息,直到所有处理器核的有效标志位均为0或者是消息缓存空间中不存在待处理的消息为止。当然,在实际应用中,将该目标处理器核的有效标志位设置为1之后,如果返回步骤S402也同样适用于本实施例。
需要说明的是,在本申请实施例中,是以消息中转模块将消息缓存在消息缓存空间,且将有效标志位缓存在状态记录空间为例进行说明,但是可以理解的是,如果消息中转模块在同一个存储空间分别缓存消息和各个处理器核中消息队列的空闲状态也同样适用于本申请实施例。
S407,处理器核接收到消息中转模块发送的目标消息时,将该目标消息存储到该处理器核中消息队列的数据存储区。
如,处理器核根据该目标消息中的数据所对应的比特数,从消息队列的数据存储区确定出需要存储该目标消息的目标存储空间,并将该目标消息存储到该目标存储空间中。
可以理解的是,在处理器核中的消息队列为一组寄存器所包含的存储空间的情况下,处理器核可以将目标消息存储到消息队列中用于存储数据的寄存器中。如,假设每个寄存器的存储空间为64比特位,而一条目标消息的大小为256比特位,那么可以将该按照用于存储数据的寄存器的排序,将该条目标消息存储到用于存储数据的前四个寄存器中。例如,结合图3进行说明,消息队列321由9个寄存器组成,其中,第一个寄存器相当于状态存储器3212,而第2个到第9个寄存器组成了数据存储区3211,由于该目标消息为256比特位,则存储该目标消息需要占据第2个至第5个寄存器,即图3中标注有Date0、Date1、Date2以及Date3的寄存器。
可以理解的是,该步骤S407中的处理器核可以认为是消息中转模块中确定出的目标处理器核,虽然在不同时刻该消息中转模块确定出的目标处理器核不同,但是对于接收到消息中转模块发送的目标消息的处理器核而言,处理器核处理该目标消息的过程却是相同的。
需要说明的是,为了便于统一,将处理器核接收到的由消息中转模块发送的消息也称为目标消息,但是可以理解的是,在本申请的不同地方,也可以将该目标消息直接称为消息。
S408,处理器核将该消息队列的状态存储区中的状态值设置为1,并根据该目标消息包含的数据的比特位数,设置该消息队列的状态存储区中的消息大小的取值。
其中,设置状态存储区的状态值有利于处理器核根据状态值快速确定出消息队列中是否存储有待处理的消息,因此,在处理器核将消息中转模块推送的消息存储到消息队列的 同时,可以将该状态存储区中的该状态值设置为1,以表明该处理器核的消息队列中存储有未处理的消息。
相应的,为了便于确定消息队列中存储的消息的大小,该处理器核还可以根据该目标消息对应的比特数,设置该消息大小的取值,如,该目标消息包含128比特的数据,则该消息大小的取值可以为128比特。
S409,在处理器核确定当前满足消息读取条件时,读取该处理器核中消息队列的状态存储区存储的状态值以及消息大小。
其中,该消息读取条件也可以为处理器获取待处理的消息的条件,如,消息读取条件可以为处理器核完成一条消息的处理,当然,该消息读取条件还可以为根据需要设置为其他条件,在此不加以限制。
其中,读取该状态值和消息大小的目的是为了辅助后续从消息队列中读取消息,以提高消息读取的便捷性。
S410,当该状态值为1时,处理器核依据该消息大小的取值,读取该消息队列的数据存储区中存储的目标消息。
在处理器核内部的消息队列存储有消息的情况下,处理器核可以直接从该消息队列中读取需要处理的目标消息。其中,根据状态存储区中存储的该消息大小的取值,有利于确定数据存储区中哪些存储空间中存储有该目标消息的数据,从而完成该目标消息的读取。
其中,处理器核从该消息队列中的数据存储区读取该目标消息时,也可以是一次读取出该目标消息的所有数据,也可以是多次读取该目标消息的数据。当然,处理器核读取该目标消息所需的次数也与该目标消息的大小有关。
如,在一种可能的实现方式中,可以预先设置处理器核每次读取的最大比特数,这样,在从该消息队列的数据存储区读取该目标消息时,可以从该数据存储区中读取该最大比特数个比特位;然后根据该消息大小的取值,判断该数据存储区中是否仍存在该目标消息的数据,如果是,继续从该数据存储区中读取该最大比特数个比特位,直至该数据存储区中存储的该目标消息的所有数据均被读取完为止。
可以理解的是,在每个处理器核的消息队列包括一组寄存器的情况下,也可以根据消息可能的大小,以及每次读取寄存器的最小个数,来从消息队列的寄存器中读取目标消息。如,仍以每个处理器核的消息队列包括9个寄存器为例,这9个寄存器依次为寄存器0、寄存器1、寄存器2、寄存器3、寄存器4、寄存器5、寄存器6、寄存器7和寄存器8,其中,寄存器0的存储空间为状态存储区,寄存器1到寄存器8的存储空间为数据存储区。同时,假设每个寄存器包含的比特位为64比特位,而每条消息包含的数据大小不会超过64*8个比特位,即每条消息最大包含数据为512比特位。在此基础上,假设处理器核每次从该消息队列读取数据的最小比特数为128比特位,即每次最少读取两个寄存器中存储的数据,则处理器核从该消息队列中读取目标消息的过程可以参见图5,由图5可知,该处理器核读取目标消息的过程可以包括:
S501,从消息队列的寄存器1和寄存器2中读取目标消息的数据,得到目标消息中的第一部分数据;
其中,为了便于区分,将从寄存器1和寄存器2中读取出的,属于该目标消息的数据称为目标消息的第一部分数据。根据目标消息的大小不同,该第一部分数据有可能是目标消息的一部分数据,也可以是目标消息的全部数据。
S502,根据该消息大小的取值,判断该目标消息包含的数据是否大于128比特位,如果是,则执行步骤S503;如果否,则目标消息读取完毕。
如果目标消息的大小超过128比特位,则说明目标消息的数据未被全部读取出,其他寄存器也存储有该目标消息的数据,在该种情况下,则需要继续执行后续步骤;如果该目标消息的大小不超过128比特位,则说明该目标消息的第一部分数据就是该目标消息的全部数据,目标消息的所有数据均读取完毕,无需再执行后续步骤。
其中,该步骤的128比特位可以认为是每次读取数据的最小比特数。其中,每次读取数据的最小比特数可以根据设定。
当然,设定每次读取数据的最小比特数仅仅是一种可能的实现方式,在实际应用中,也可以根据基站所需处理的消息所可能包含的数据量大小,将该128比特位设置为其他可能的比特数,如,假设基站中处理器核所处理的消息的大小只能是128比特位、256比特位或者512比特位,而在每个寄存器的存储空间为64比特位的情况下,则第一次可以读取128比特位/64比特位个寄存器内的数据,即读取前两个寄存器中存储的数据。然后判断该消息是否大于128比特,如果是,则说明该目标消息的大小可能是256比特位,在该种情况下,则可以继续执行后续步骤S503。
S503,从消息队列的寄存器3和寄存器4中读取目标消息的数据,得到目标消息中的第二部分数据。
与第一部分数据相似,将从寄存器3和寄存器4中读取出的该目标消息的数据称为第二部分数据,该第二部分数据为目标消息的部分数据。
S504,将第一部分数据与第二部分数据进行组合,得到目标消息的第一组合数据。
为了还原出该目标消息,需要将第一部分数据与第二部分数据组合,为了便于区分,将第一部分数据与第二部分数据组合后的数据称为目标消息的第一组合数据。
S505,根据该消息大小的取值,判断该目标消息包含的数据是否大于256比特位,如果是,则执行步骤S506;如果否,则确定第一组合数据为目标数据所包含的全部数据。
经过步骤S503,处理器核读取了寄存器1到寄存器4的存储空间,而寄存器1到寄存器4的存储空间为256比特位,因此,如果该目标消息包含的数据不大于256比特位,则说明目标消息读取完毕,在该种情况下,该目标消息的第一组合数据就是目标消息的全部数据;如果该目标消息包含的数据大小超过256比特位,则说明其他寄存器中仍可能会存储有目标消息的数据,仍需要继续执行后续步骤。
S506,从消息队列的寄存器5、寄存器6、寄存器7和寄存器8中读取目标消息的数据,得到目标消息中的第三部分数据。
考虑到基站的处理器核所需处理的消息的大小一般为128比特位、256比特位和512比特位,因此,如果该目标消息包含的数据超过256比特位,则说明该目标消息的大小为512比特位,在该种情况下,则可以从寄存器5到寄存器8中读取该目标消息剩余的256比特位的数 据。
为了便于区分,将从寄存器5到寄存器8读取出的数据称为该目标消息的第三部分数据。
当然,该步骤S506仅仅是一种实现方式,在实际应用中,可以按照每次最多读取128比特位的方式,先从寄存器5和寄存器6中读取该目标消息的数据,然后根据消息大小的取值,判断出目标消息的数据大于384,则继续从寄存器7和寄存器8中读取该目标消息的数据。
S507,将目标消息的第一组合数据与该第三部分数据进行组合,得到目标消息的所有数据。
可以理解的是,在目标消息的大小为512比特位的情况下,需要依次将寄存器1到寄存器8中读取出的数据进行组合,从而组合得到该目标消息的所有数据。
需要说明的是,图5仅仅是为了便于理解处理器核从消息队列中读取目标消息,而以一种读取方式为例进行介绍,但是可以理解的是,处理器核可以根据实际需要采用其他方式从消息队列中读取出该目标消息,对于其他方式也同样适用于本申请实施例。
可以理解的是,在该状态值为0时,说明该消息队列中不存在消息,在该种情况下,处理器核无法读取到消息,则无需进行任何处理。
可见,在本申请实施例中,在处理器核需要读取消息之前,如果处理器核的消息队列处于空闲状态,则消息中转模块会主动向处理器核推送消息,而且处理器核会将接收到的消息缓存在消息队列中,这样,当处理器核需要读取消息时,只需要从该处理器核内的消息队列中读取消息即可,从而避免了等待消息中转模块调度消息所需的时间,而且处理器核从其内部的消息队列中读取消息所需的时长也大大减少,提高了处理器核读取消息所需的耗时,进而提高了处理器获取消息的性能,并有利于提高处理器处理消息的性能。
S411,当处理器核确定该数据存储区中的目标消息的数据被全部取出时,将该消息队列的状态存储区的状态值设置为0。
如,处理器核依据该状态存储区中消息大小的取值,可以确定从消息队列中取出的该目标消息的数据是否与该消息大小的取值一致,如果是,则可以确定该目标消息的数据被全被取出。
在该数据存储区中存储的目标消息的数据被全部取出时,该数据存储区不存在未被处理的消息,即该数据存储区处于空闲状态,因此,可以将该状态存储区的状态值设置为0,以便处理器核可以了解到该消息队列中存储消息的情况。
S412,处理器核向消息中转模块发送空闲通知。
其中,该空闲通知用于将该处理器核内的消息队列处于空闲状态的信息通知给该消息中转模块。
可以理解的是,为了使得消息中转模块可以理解到该处理器核内的消息队列中是否存储有消息,在处理器核取出该消息队列中存储的消息之后,还可以向消息中转模块发送空闲通知。
需要说明的是,该步骤S411和步骤S412的顺序并不限于图4所示,在实际应用中,可以在执行步骤S411的同时,执行该步骤S412;也可以是在处理器核确定出消息队列内的消息的数据被全部取出时,先向消息中转模块发送空闲通知,再将该状态存储区的状态值设置 为0。
S413,消息中转模块基于该空闲通知,将状态记录空间中该处理器核的有效标志位设置为0。
为了使得消息中转模块中记录的各个处理器核的消息队列的空闲状态,与处理器核中消息队列中实际存储消息的状态一致,当该消息中转模块接收到某个处理器核发送给空闲通知时,会将该处理器核的有效标志位设置为0。
当然,在消息中转模块通过其他方式记录处理器核的消息队列中存储消息的情况,则消息中转模块在接收到该空闲通知时,也可以通过其他方式记录该处理器核的消息队列处于空闲状态。
需要说明的是,步骤S412到S413并非处理器核读取消息所必须的步骤,其仅仅是为了保证后续消息中转模块仍可以继续向处理器核推送消息而执行的操作。
需要说明的是,在以上实施例中是以处理器为多核处理器为例进行介绍,但是可以理解的是,如果处理器为单核处理器,即处理器仅仅包括一个处理器核的情况下,也同样适用于本申请实施例,在处理器包含单个处理器核的情况下,当消息中转模块检测到该处理器核的消息队列处于空闲状态,同样可以从缓存的消息中确定待推送给该处理器核的目标消息,并将该目标消息发送给该处理器核,相应的,处理器核也会将接收到的消息缓存在该处理器核内部的消息队列中,并在满足该处理器核的消息读取条件时,从该消息队列中读取消息,该过程与上面处理器核与消息中转模块的交互过程相似,在此不再赘述。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可能全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介绍传输。例如,所述计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘(Solid State Disk(SSD))等。
以上所述的具体实施方式,对本申请的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本申请的具体实施方式而已,并不用于限定本申请的保护范围,凡在本申请的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。

Claims (18)

  1. 一种消息处理方法,其特征在于,包括:
    监控处理器核的消息队列对应的消息存储状态,所述处理器核的消息队列为所述处理器核内部用于缓存消息的空间;
    在所述消息存储状态表明所述处理器核的消息队列中未存储有消息的情况下,从缓存的消息中,确定待推送给所述处理器核的目标消息;
    将所述目标消息发送给所述处理器核,以使得所述处理器核将所述目标消息缓存在所述处理器核的消息队列中,并在满足消息读取条件时,从所述消息队列中读取所述目标消息。
  2. 根据权利要求1所述的消息处理方法,其特征在于,在所述将所述目标消息发送给所述处理器核之后,还包括:
    将所述处理器核的消息队列对应的消息存储状态设置为非空闲状态,所述非空闲状态表明所述处理器核的消息队列中存储有消息。
  3. 根据权利要求1或2所述的消息处理方法,其特征在于,还包括:
    当接收到所述处理器核发送的空闲通知时,将所述消息存储状态设置为空闲状态,所述空闲状态表明所述处理器核的消息队列中未存储有消息,所述空闲通知为所述处理器核在读取出所述处理器核的消息队列中存储的消息之后,发送的。
  4. 根据权利要求1所述的消息处理方法,其特征在于,所述监控处理器核的消息队列对应的消息存储状态,包括:
    监控处理器的多个处理器核的消息队列各自对应的消息存储状态;
    所述在所述消息存储状态表明所述处理器核的消息队列中未存储有消息的情况下,从缓存的消息中,确定待推送给所述处理器核的目标消息,包括:
    当所述多个处理器核中存在消息存储状态为空闲状态的至少一个处理器核时,从所述至少一个处理器核中,确定当前待推送消息的目标处理器核,其中,所述处理器核对应的消息存储状态为空闲状态表明所述处理器核的消息队列中未存储有消息;
    从缓存的消息中,确定待推送给所述目标处理器核的目标消息;
    所述将所述目标消息发送给所述处理器核,包括:
    将所述目标消息发送给所述目标处理器核。
  5. 根据权利要求1所述的消息处理方法,其特征在于,所述从缓存的消息中,确定待推送给所述处理器核的目标消息,包括:
    按照先进先出的原则,从消息缓存空间缓存的消息中,确定出当前时刻待推送给所述处理器核的目标消息。
  6. 一种消息处理方法,其特征在于,包括:
    处理器核接收消息中转模块发送的消息,所述消息中转模块为基站中用于缓存需要所述处理器核处理的消息的模块;
    所述处理器核将所述消息缓存到所述处理器核内的消息队列中;
    当满足消息读取条件时,所述处理器核从所述消息队列中读取所述消息。
  7. 根据权利要求6所述的消息处理方法,其特征在于,在所述处理器核从所述消息队列中读取所述消息之后,还包括:
    向所述消息中转模块发送空闲通知,所述空闲通知表明所述处理器核的消息队列中不存在消息。
  8. 根据权利要求6所述的消息处理方法,其特征在于,在所述处理器核将所述消息缓存到所述处理器核内的消息队列中之后,还包括:
    将所述消息队列中存储的状态值设置为1,其中,所述状态值为1表明所述消息队列中存储有消息;
    所述当满足消息读取条件时,所述处理器核从所述消息队列中读取所述消息,包括:
    当满足消息读取条件时,所述处理器核读取所述消息队列中存储的状态值;
    在所述状态值为1时,所述处理器核从所述消息队列中读取所述消息。
  9. 根据权利要求8所述的消息处理方法,其特征在于,在所述处理器核从所述消息队列中读取所述消息之后,还包括:
    当读取出所述消息队列中存储的所述消息的全部数据时,将所述状态值设置为0,所述状态值为0表明所述消息队列中不存在未被读取的消息。
  10. 根据权利要求6或8所述的消息处理器方法,其特征在于,在所述处理器核将所述消息缓存到所述处理器核内的消息队列中之后,还包括:
    根据所述消息所占据的比特位,设置所述消息队列中存储的消息大小的取值,所述消息大小的取值与所述消息所占据的比特位相同;
    所述处理器核从所述消息队列中读取所述消息,包括:
    所述处理器核根据所述消息大小的取值,从所述消息队列中读取所述消息的数据,直至所述消息的全部数据均被读取出。
  11. 一种基站,其特征在于,包括:
    处理器以及消息中转模块,所述处理器包括至少一个处理器核,所述处理器核内部具有消息队列;所述消息中转模块为所述基站中用于缓存需要所述处理器核处理的消息的模块;
    其中,所述消息中转模块,用于监控所述处理器核的消息队列对应的消息存储状态;在所述消息存储状态表明所述处理器核的消息队列中未存储有消息的情况下,从缓存的消息中,确定待推送给所述处理器核的目标消息;将所述目标消息发送给所述处理器核;
    所述处理器核,用于将所述目标消息缓存在所述处理器核内的消息队列中;在满足消息读取条件时,从所述处理器核内的消息队列中读取所述目标消息。
  12. 根据权利要求11所述的基站,其特征在于,所述消息中转模块,还用于在将所述目标消息发送给所述处理器核之后,将所述处理器核的消息队列对应的消息存储状态设置为非空闲状态,所述非空闲状态表明所述处理器核的消息队列中存储有消息。
  13. 根据权利要求11所述的基站,其特征在于,所述处理器核,还用于在从所述处理器核内的消息队列中读取出所述目标消息之后,向所述消息中转模块发送空闲通知,所述空闲通知表明所述处理器核的消息队列中不存在消息;
    所述消息中转模块,还用于当接收到所述处理器核发送的空闲通知时,将所述处理器核对应的消息存储状态设置为空闲状态,所述空闲状态表明所述处理器核的消息队列中未存储有消息。
  14. 根据权利要求11所述的基站,其特征在于,所述处理器包括多个处理器核;
    所述消息中转模块,具体用于监控所述多个处理器核的消息队列各自对应的消息存储状态;当所述多个处理器核中存在消息存储状态为空闲状态的至少一个处理器核时,从所述至少一个处理器核中,确定当前待推送消息的目标处理器核,其中,所述处理器核对应的消息存储状态为空闲状态表明所述处理器核的消息队列中未存储有消息;从缓存的消息中,确定待推送给所述目标处理器核的目标消息;将所述目标消息发送给所述目标处理器核。
  15. 根据权利要求11所述的基站,其特征在于,所述处理器核,还用于在将所述目标消息缓存到所述处理器核内的消息队列中之后,将所述消息队列中存储的状态值设置为1,其中,所述状态值为1表明所述消息队列中存储有消息;
    所述处理器核在从所述处理器核内的消息队列中读取所述目标消息时,具体用于,读取所述消息队列中存储的状态值;在所述状态值为1时,从所述消息队列中读取所述目标消息。
  16. 根据权利要求15所述的基站,其特征在于,所述处理器核,还用于当读取出所述消息队列中存储的所述目标消息的全部数据时,将所述状态值设置为0,所述状态值为0表明所述消息队列中不存在未被读取的消息。
  17. 根据权利要求11或15所述的基站,其特征在于,所述处理器核,还用于在将所述目标消息缓存到所述处理器核内的消息队列中之后,根据所述目标消息所占据的比特位,设置所述消息队列中存储的消息大小的取值,所述消息大小的取值与所述目标消息所占据的比特位相同;
    所述处理器核在从所述消息队列中读取所述目标消息时,具体用于根据所述消息大小的取值,从所述消息队列中读取所述目标消息的数据,直至所述目标消息的全部数据均被读取出。
  18. 根据权利要求11所述的基站,其特征在于,所述消息中转模块在从缓存的消息中,确定待推送给所述处理器核的目标消息时,具体用于按照先进先出原则,从消息缓存空间缓存的消息中,确定出待推送给所述处理器核的目标消息。
PCT/CN2018/096941 2017-07-31 2018-07-25 消息处理方法以及基站 WO2019024727A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710640484.X 2017-07-31
CN201710640484.XA CN107613529B (zh) 2017-07-31 2017-07-31 消息处理方法以及基站

Publications (1)

Publication Number Publication Date
WO2019024727A1 true WO2019024727A1 (zh) 2019-02-07

Family

ID=61064108

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/096941 WO2019024727A1 (zh) 2017-07-31 2018-07-25 消息处理方法以及基站

Country Status (2)

Country Link
CN (1) CN107613529B (zh)
WO (1) WO2019024727A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112616090A (zh) * 2020-12-07 2021-04-06 青岛海信传媒网络技术有限公司 显示设备系统升级方法及显示设备
CN113177883A (zh) * 2021-05-18 2021-07-27 深圳市数存科技有限公司 一种基于数据队列的排列传输系统
CN114253741A (zh) * 2021-12-02 2022-03-29 国汽智控(北京)科技有限公司 多核微处理器的核间通信方法和多核微处理器
CN113177883B (zh) * 2021-05-18 2024-06-07 深圳市数存科技有限公司 一种基于数据队列的排列传输系统

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107613529B (zh) * 2017-07-31 2021-06-01 上海华为技术有限公司 消息处理方法以及基站
CN110225102B (zh) * 2019-05-23 2022-06-03 北京小米移动软件有限公司 推送信息的方法、设备及系统
CN111290856B (zh) * 2020-03-23 2023-08-25 优刻得科技股份有限公司 数据处理装置和方法
CN114564420B (zh) * 2022-01-19 2023-08-18 中国电子科技集团公司第十研究所 多核处理器共享并行总线的方法
CN114979056B (zh) * 2022-05-20 2023-12-29 甬矽电子(宁波)股份有限公司 一种电子邮件处理方法、装置、存储介质及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110255543A1 (en) * 2010-04-15 2011-10-20 Huawei Technologies Co., Ltd. Method and system for processing data
CN102638402A (zh) * 2012-03-28 2012-08-15 中兴通讯股份有限公司 流媒体双缓存技术中填充数据的方法及装置
CN106095604A (zh) * 2016-06-21 2016-11-09 京信通信技术(广州)有限公司 一种多核处理器的核间通信方法及装置
CN107613529A (zh) * 2017-07-31 2018-01-19 上海华为技术有限公司 消息处理方法以及基站

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012092894A2 (zh) * 2012-02-01 2012-07-12 华为技术有限公司 一种多核处理器系统
CN106959929B (zh) * 2017-03-17 2020-08-04 数据通信科学技术研究所 一种多端口访问的存储器及其工作方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110255543A1 (en) * 2010-04-15 2011-10-20 Huawei Technologies Co., Ltd. Method and system for processing data
CN102638402A (zh) * 2012-03-28 2012-08-15 中兴通讯股份有限公司 流媒体双缓存技术中填充数据的方法及装置
CN106095604A (zh) * 2016-06-21 2016-11-09 京信通信技术(广州)有限公司 一种多核处理器的核间通信方法及装置
CN107613529A (zh) * 2017-07-31 2018-01-19 上海华为技术有限公司 消息处理方法以及基站

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112616090A (zh) * 2020-12-07 2021-04-06 青岛海信传媒网络技术有限公司 显示设备系统升级方法及显示设备
CN113177883A (zh) * 2021-05-18 2021-07-27 深圳市数存科技有限公司 一种基于数据队列的排列传输系统
CN113177883B (zh) * 2021-05-18 2024-06-07 深圳市数存科技有限公司 一种基于数据队列的排列传输系统
CN114253741A (zh) * 2021-12-02 2022-03-29 国汽智控(北京)科技有限公司 多核微处理器的核间通信方法和多核微处理器
CN114253741B (zh) * 2021-12-02 2022-11-08 国汽智控(北京)科技有限公司 多核微处理器的核间通信方法和多核微处理器

Also Published As

Publication number Publication date
CN107613529B (zh) 2021-06-01
CN107613529A (zh) 2018-01-19

Similar Documents

Publication Publication Date Title
WO2019024727A1 (zh) 消息处理方法以及基站
US11620255B2 (en) Time sensitive networking device
CN110402568B (zh) 一种通信的方法及装置
US8019902B2 (en) Network adapter with shared database for message context information
US7263103B2 (en) Receive queue descriptor pool
US10218645B2 (en) Low-latency processing in a network node
US7870306B2 (en) Shared memory message switch and cache
WO2020236275A1 (en) System and method for facilitating dynamic command management in a network interface controller (nic)
US9774651B2 (en) Method and apparatus for rapid data distribution
US6615282B1 (en) Adaptive messaging
EP1629644A1 (en) Method and system for maintenance of packet order using caching
US20190146845A1 (en) Lock Allocation Method and Apparatus, and Computing Device
CN111698274B (zh) 数据处理方法及装置
CN116471242A (zh) 基于rdma的发送端、接收端、数据传输系统及方法
US6058437A (en) D.M.A. device that handles cache misses by managing an address of an area allotted via a daemon processor
US20190050253A1 (en) Memory register interrupt based signaling and messaging
US11188394B2 (en) Technologies for synchronizing triggered operations
JP2009116561A (ja) データ転送システム
CN116074250B (zh) 流表处理方法、系统、设备和存储介质
JP2015536063A (ja) ファースト−イン−ファースト−アウトトランスポート機構からのランダムアクセスメッセージ取り出しの方法
KR101328621B1 (ko) 패킷 전달 방법 및 시스템
WO2023078210A1 (zh) 报文处理方法及装置、通信系统
JP2022125546A (ja) セキュリティシステム、セキュリティ装置、方法、及びプログラム
CN118069387A (zh) 一种基于硬件多线程的rdma数据发送队列管理方法及装置
Chen et al. DMA shared byte counters in a parallel computer

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18840712

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18840712

Country of ref document: EP

Kind code of ref document: A1