CN107193673A - A kind of message processing method and equipment - Google Patents

A kind of message processing method and equipment Download PDF

Info

Publication number
CN107193673A
CN107193673A CN201710509548.2A CN201710509548A CN107193673A CN 107193673 A CN107193673 A CN 107193673A CN 201710509548 A CN201710509548 A CN 201710509548A CN 107193673 A CN107193673 A CN 107193673A
Authority
CN
China
Prior art keywords
message
shared drive
processor
kernel state
packet sending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710509548.2A
Other languages
Chinese (zh)
Other versions
CN107193673B (en
Inventor
黄墀晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks Co Ltd
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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN201710509548.2A priority Critical patent/CN107193673B/en
Publication of CN107193673A publication Critical patent/CN107193673A/en
Application granted granted Critical
Publication of CN107193673B publication Critical patent/CN107193673B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F9/546Message passing systems or structures, e.g. queues
    • 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
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]

Landscapes

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

Abstract

The invention discloses a kind of message processing method and equipment, the domain name mapping speed for lifting dns server, and then lift the QPS of dns server.This method includes:Message processor intercepts message by the first process in kernel state;The message processor receives the first message that user equipment is sent by packet sending and receiving process, and by first packet storage to shared drive;Wherein, the shared drive can be in the first process access of User space;First process is switched to User space by the message processor by kernel state, and first message is read from the shared drive by first process;The message processor handles first message by first process, generates response message according to result, and response message storage is arrived into the shared drive by first process.

Description

A kind of message processing method and equipment
Technical field
The present invention relates to communication technical field, more particularly to a kind of message processing method and equipment.
Background technology
Domain name system (Domain Name System, DNS) server be used to storing in network the domain name of All hosts and The corresponding Internet protocol of the domain name (Internet Protocol, IP) address.User equipment need to lead to when carrying out domain name access Cross dns server to carry out domain name mapping and return to the corresponding IP address of the domain name, so as to be conducted interviews according to IP address.Wherein, Domain name mapping protection query rate (Query Per Second, QPS) per second refers to the threshold quantity of dns server domain name mapping, if The domain name mapping request that synchronization dns server is received exceedes domain name mapping and protects QPS, then domain name occurs in dns server Parse the situation of time-out so that user equipment can not normally carry out domain name access.If that is, QPS is protected in domain name mapping Relatively low, then criminal attacks having higher success rate for dns server by sending a large amount of domain name analysis requests so that DNS takes Business device normally can not provide having higher success rate for service for user equipment, and this obviously affects the Web vector graphic experience of user.Cause This, QPS is a particularly important index of dns server.
And improve the QPS of dns server typically by the hardware processing capability of lifting dns server at present.For example, By setting multiple dns servers, wherein, different dns servers provide domain name mapping for the user equipment in different range Service, and then make it that the pressure of the domain name mapping of each dns server is smaller, it is able to just with the domain name access for ensureing user equipment Often carry out;Or, using bigger internal memory or higher performance central processing unit (Central Processing Unit, CPU) Dns server.But both approaches either need to transform dns server or need to set more DNS services Device, workload is big, it is necessary to expend more manpower.
The content of the invention
The embodiment of the present invention provides a kind of message processing method and equipment, the domain name mapping speed for lifting dns server Degree, and then lift the QPS of dns server.
First aspect includes there is provided a kind of message processing method, this method:
Message processor intercepts the message that packet sending and receiving process is received by the first process in kernel state;
The message processor receives the first message that user equipment is sent by the packet sending and receiving process, and will First packet storage is to shared drive;Wherein, the shared drive can be in the first process access of User space;
When the message processor by first process in kernel state listens to the packet sending and receiving process When having been received by first message, then first process is switched to User space by the message processor by kernel state, And first message is read from the shared drive by first process;
The message processor handles first message by first process, and response is generated according to result Message, and response message storage is arrived by the shared drive by first process.
Optionally, described is had been received by when first process in kernel state listens to the packet sending and receiving process During one message, then first process is switched to User space by the message processor by kernel state, including:
The message processor receives the packet sending and receiving process by first process in kernel state The instruction message of transmission, the instruction message is used to indicate first process, and the packet sending and receiving process has received described the One message;
First process is switched to User space by the message processor by kernel state.
Optionally, response message storage is shared to described by first process in the message processor After internal memory, in addition to:
The response message is sent to the user equipment by the message processor by the packet sending and receiving process.
Optionally, response message storage is shared to described by first process in the message processor After internal memory, in addition to:
The message processor is determined in the shared drive with the presence or absence of pending the by first process Two messages;
If it is determined that there is the second pending message in the shared drive, then the message processor passes through described One process reads from the shared drive and handles second message;Otherwise, the message processor is by described first Process switches to kernel state by User space, to continue to intercept message by first process in kernel state.
Optionally, the message stored in the shared drive is using without lock data structure.
Second aspect includes there is provided a kind of message processor, the equipment:
Unit is intercepted, is used to intercept the message that packet sending and receiving process is received for the first process by kernel state;
Transmit-Receive Unit, for receiving the first message that user equipment is sent by the packet sending and receiving process, and by institute The first packet storage is stated to shared drive;Wherein, the shared drive can be in the first process access of User space;
Reading unit, for intercept unit when described by first process in kernel state and listen to the message When transmitting-receiving process has been received by first message, then first process is switched into User space by kernel state, and pass through institute State the first process and first message is read from the shared drive;
Processing unit, for handling first message by first process, response report is generated according to result Text, and response message storage is arrived by the shared drive by first process.
Optionally, described is had been received by when first process in kernel state listens to the packet sending and receiving process During one message, first process is then switched to User space by the reading unit by kernel state, including:
When first process in kernel state receives the instruction message that the packet sending and receiving process is sent, institute Stating instruction message is used to indicate first process, and the packet sending and receiving process has received first message;It is described to read list First process is switched to User space by member by kernel state.
Optionally, the Transmit-Receive Unit is additionally operable to:Response message storage is arrived described by first process After shared drive, the response message is sent to by the user equipment by the packet sending and receiving process.
Optionally, the equipment also includes determining unit,
The determining unit is used for:Response message storage is arrived by institute by first process in the processing unit State after shared drive, determine to whether there is the second pending message in the shared drive by first process;
The processing unit is additionally operable to:If it is determined that unit determines there is the second pending message in the shared drive, Read by first process from the shared drive and handle second message;
The unit of intercepting is additionally operable to:If it is determined that unit determines that the second pending report is not present in the shared drive Text, kernel state is switched to by first process by User space, to continue to intercept by first process in kernel state Message.
Optionally, the message stored in the shared drive is using without lock data structure.
The third aspect is there is provided a kind of computer installation, and described device includes processor, and the processor is used to perform storage The step of method any one of the message processing method provided such as first aspect is provided during the computer program stored in device.
Fourth aspect is stored thereon with computer program there is provided a kind of computer-readable recording medium, it is characterised in that: Method any one of the message processing method provided such as first aspect is provided when the computer program is executed by processor The step of.
In embodiments of the present invention, can be by the first packet storage everywhere after message processor receives the first message In the shared drive that the first process of User space is able to access that, such first process can then be read directly from shared drive First message simultaneously carries out Message processing, without the first message is copied into the internal memory that the first process can be accessed by the first process In space, and then improve treatment effeciency.Also, after the first process has handled the first message, response message storage can also be arrived In shared drive, so also avoiding the need for the first process, switching state, to replicate response message, is equally improved to handle and imitated again Rate.In this way, it is possible in the case where not changing the hardware resource of dns server, by the speed for lifting Message processing each time Degree, and then the message amount that synchronization is handled is more, that is, correspondingly improve the QPS of dns server.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, will make below to required in the embodiment of the present invention Accompanying drawing is briefly described, it should be apparent that, accompanying drawing described below is only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1 carries out the schematic diagram of domain name mapping for dns server in the prior art;
Fig. 2 is the schematic flow sheet of message processing method provided in an embodiment of the present invention;
Fig. 3 is a kind of structural representation of message processor provided in an embodiment of the present invention;
Fig. 4 is a kind of structural representation of computer installation provided in an embodiment of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described.
The technical background of the embodiment of the present invention is described below.
Fig. 1 is referred to, is the schematic diagram that dns server carries out domain name mapping in the prior art.First, in dns server DNS processes need to switch to kernel state by User space, and the SOCKET interfaces provided by system in dns server intercept report Text;When dns server receives the query message for requesting query IP address, DNS processes are waken up, and are switched by kernel state For User space;Because the query message that dns server is received is stored in the internal memory for only allowing the process in kernel state to access Space, and query message can only be in the DNS processes processing of User space, therefore DNS processes are also needed to by SOCKET interfaces Query message is copied to the memory headroom for allowing the process in User space to access, query message could be handled. DNS processes have been handled after the query message and generated according to result after response message, in addition it is also necessary to will by SOCKET interfaces Response message copies to the memory headroom for allowing the process in kernel state to access, and then can just be sent to corresponding user and set It is standby.Wherein, DNS processes often handle one query message and are required for switching state at least twice, relatively complicated, and it also requires entering The duplication of row query message and response message, very elapsed time.Wherein, this is the process for handling a DNS query message, It is contemplated that, when DNS query message is more, then it is likely to many pending DNS query messages of accumulation so that user domain Name access speed is slower, influences the usage experience of user.And it is obvious, the speed for handling a DNS query message is slower, then DNS The QPS of server is also lower, and the possibility of domain name resolution service can not normally be provided by also increasing dns server.
In consideration of it, the embodiment of the present invention provides a kind of message processing method, in the method, message processor receives the After one message, in the shared drive that can be able to access that the first packet storage to the first process in User space, such One process then can directly read the first message from shared drive and carry out Message processing, without again by the first process by One message is copied in the memory headroom that the first process can be accessed, and then improves treatment effeciency.Also, in the processing of the first process After complete first message, also it so can also avoid the need for the first process by response message storage into shared drive and switch shape again State replicates response message, equally improves treatment effeciency, so as to lift the speed of domain name mapping, improves dns server QPS.
Technical scheme provided in an embodiment of the present invention is introduced below in conjunction with the accompanying drawings.
Fig. 2 is referred to, one embodiment of the invention provides a kind of message processing method, and the flow of this method is described as follows:
In embodiments of the present invention, message processor can receive and dispatch and handle any equipment of message, for example Message processor can be dns server etc..The message processor can include first thread, packet sending and receiving thread and be total to Internal memory is enjoyed, certainly, first thread, packet sending and receiving thread and shared drive can also be not arranged within message processor.Under Face is illustrated so that message processor can include first thread, packet sending and receiving thread and shared drive as an example.
Step S201:Message processor intercepts the report that packet sending and receiving process is received by the first process in kernel state Text.
In embodiments of the present invention, when message processor is not received by message, message processor can then pass through First process intercepts message in message processor.Wherein, because message processor receive message be stored in The memory headroom that the process of core state could be accessed, if therefore the first process can not listen to message, then in User space First process then by User space can be switched to kernel state by message processor when not having outstanding message.Specifically, report The application programming interface that literary processing equipment can be provided by the first process through the operating system in message processor (Application Programming Interface, API) calls kernel, to switch to kernel state.Wherein, API is for example Can be NETLINK interfaces.
In embodiments of the present invention, when message processor is dns server, the first process can be then DNS service DNS processes in device.
Step S202:User equipment sends the first message to message processor, and message processor passes through packet sending and receiving Process receives the first message.
When user equipment needs the first message of processing, user equipment then can send the first message to message processor, For example when user equipment needs to carry out domain name access, DNS query message can be then sent to dns server by user equipment, with The corresponding IP address of the DNS query domain name is asked, and then user equipment could conduct interviews according to the IP address.Correspondingly, report Literary processing equipment can receive the first message that user equipment is sent by packet sending and receiving process.
Step S203:Message processor is by packet sending and receiving process by the first packet storage to shared drive.
After message processor receives the first message by packet sending and receiving process, then message processor can pass through Packet sending and receiving process is by the first packet storage received to shared drive.Wherein, packet sending and receiving process is one and is in all the time The process of kernel state, that is to say, that packet sending and receiving process is the kernel spacing operated in message processor, therefore message Transmitting-receiving process can directly receive the first message, and can be by the first packet storage in shared drive.Shared drive is this A part of memory headroom that inventive embodiments are marked in the internal memory of message processor, and the partial memory space is arranged to The memory headroom that the process of User space can also be accessed.
In embodiments of the present invention, when message processor is dns server, packet sending and receiving process can be then DNS Fast-turn construction DNS processes in server.Wherein, fast-turn construction DNS processes are used to collect message and will handle the response message forwarding completed To corresponding user equipment.
Step S204:Message processor is sent to the first process by packet sending and receiving process and indicates message, Message processing Equipment is received by the first process and indicates message.
When message processor by packet sending and receiving process by the first packet storage to shared drive after, packet sending and receiving is entered Cheng Ze can send to the first process and indicate message, to inform that the first process packet sending and receiving process has received the first message and deposited Storage.Wherein, the message that packet sending and receiving equipment is received may have multiple, therefore, and packet sending and receiving process can be with one message of every storage All sent afterwards to the first process and indicate message.Certainly, in order to reduce the interactive quantity of packet sending and receiving process and the first process, message Transmitting-receiving process can just send to the first process after first message that storage is received and indicate message, and continuously receive afterwards Message do not send instruction message then.Accordingly, message processor can receive the instruction message by the first process.
Specifically, the API that packet sending and receiving process can be provided by operating system sends to the first process and indicates message, example NETLINK interfaces described above.
Step S205:Message processor reads the first message by the first process from shared drive.
Specifically, because the first process in kernel state can not be handled the first message, therefore in message Processing equipment is received by the first process after instruction message, and message processor first can be cut the first process by kernel state It is changed to User space.
Message processor by the first process after kernel state switches to User space, message processor can then lead to Cross the first process and the first message is read from shared drive.Because the data stored in shared drive are can be by the of User space What one process was accessed, therefore the first process can directly read the first message from shared drive, without again by first Message, which is copied to, could continue follow-up processing in the memory headroom that the first process can be accessed, it is clear that compare duplication first and report Text, the embodiment of the present invention directly reads the first message from the communal space and obviously more saves the time.
In embodiments of the present invention, in order to ensure that the message stored in shared drive can be processed successively in sequence, Therefore the data structure that stored messages are used in shared drive is without lock data structure.It is of course also possible to use can realize Other the possible data structures for the function that message can be processed successively in sequence, the embodiment of the present invention is not limited this System.Wherein, message can be processed successively in sequence refers to that the first process, when reading message, can be stored from shared drive First start of heading of message queue read, after the completion of first message is processed, next message then becomes first Individual message, the like, that is to say, that the message that the first process is read is first message being in message queue all the time.And In packet sending and receiving process stored messages, can by the packet storage newly received in message queue backmost.Wherein, received in message It is also similar during hair process transmission response message, i.e., packet sending and receiving process can read first response message in response message queue And corresponding user equipment is sent to, response message can be also stored in response message by the first process when storing response message Queue it is last.
Specifically, the embodiment of the present invention without lock data structure in addition to it can realize above-mentioned functions, it is also possible that read Take message and storage response message can be while carrying out, it is not necessary to which addend carries out data protection according to lock, then can prevent from reading Thread is suspended when message or storage response message, and then can not continue reading message or storage response report next time Text, therefore the speed for reading message by using may also speed up without lock data structure or storing response message.
Step S206:Message processor handles the first message by the first process, and response report is generated according to result Text.
In embodiments of the present invention, after message processor reads the first message by the first process, Message processing Equipment handles the first message by the first process, and generates response message according to result.For example, when message processor is During dns server, the DNS processes in dns server are read after the first message, then the information inquiry that can be included according to the first message Corresponding IP address, and response message is generated according to Query Result.
Step S207:Response message storage is arrived shared drive by message processor by the first process.
In embodiments of the present invention, message processor by the first process by response message storage to shared drive it Afterwards, message processor can also determine to whether there is the second pending message in shared drive by the first process.If Message processor determines there is the second pending message in shared drive by the first process, then message processor then can The first process is continued through to read from shared drive and handle the second message;And if message processor passes through the first process Determine that message processor is switched the first process by User space without any the second pending message in shared drive For kernel state, to continue to intercept message by the first process in kernel state.Wherein, because the first process has handled the first report After text, response message is sent without switching to kernel state, but shared drive is arrived into response message storage, such first enters Cheng Ze can handle other messages stored in shared drive, without frequently switching state, it is clear that more save the time.Example Such as, when message processor is dns server, then the DNS processes in dns server can continue processing DNS query message, Without frequently switching DNS states of a process, then the lifting that the speed of domain name mapping obviously can be bigger, accordingly, DNS clothes The QPS of business device can also get a promotion accordingly.Meanwhile, also carried not necessarily like needing to put into more hardware resources in the prior art The QPS of dns server is risen, it is more cost-effective, save manpower.
Step S208:Message processor sends response to packet sending and receiving process by the first process and indicates message, message Processing equipment receives response by packet sending and receiving process and indicates message.
Response message storage is arrived by shared drive by the first process in message processor, entered in order that obtaining packet sending and receiving Response message is transmitted to user equipment by journey in time, then message processor can be provided by the first process through operating system API sends response to packet sending and receiving process and indicates message, and the message of process first is received and dispatched by the first process with notice message Reason is completed, and has been stored on shared drive.Wherein, API for example can be above-mentioned NETLINK interfaces.
Step S209:Message processor reads response message by packet sending and receiving process from shared drive.
Step S210:Response message is sent to user equipment by message processor by packet sending and receiving process.
In the embodiment of the present invention, because message processor directly can be read by packet sending and receiving process from shared drive Response message is simultaneously sent to corresponding user equipment, without as also need in the prior art by the first process also need to by with Family state switches to kernel state, then the response message that response message is sent in corresponding user equipment, the embodiment of the present application is sent out The process sent more saves the time.
In embodiments of the present invention, in order to realize further beneficial effect, step 208~step S210 is increased, although Shown in the lump in figure, but the beneficial effect of the application can just be realized by going to s207, i.e., carried while workload is reduced Rise the QPS of dns server.
In summary, in embodiments of the present invention, can be by the first message after message processor receives the first message Store in the shared drive that the first process in User space is able to access that, such first process then can be directly from shared interior Deposit the first message of middle reading and carry out Message processing, can be with without the first message is copied into the first process by the first process again In the memory headroom of access, and then improve treatment effeciency.Also, can also be by response after the first process has handled the first message Packet storage also avoids the need for into shared drive, so the first process, and switching state replicates response message again, equally carries High treatment effeciency, so as to lift the speed of domain name mapping, improves the QPS of dns server.
Equipment provided in an embodiment of the present invention is introduced below in conjunction with the accompanying drawings.
Fig. 3 is referred to, based on same inventive concept, one embodiment of the invention provides a kind of message processor 30, and this sets It is standby to include:
Unit 301 is intercepted, is used to intercept the message that transmitting-receiving process is received for the first process by kernel state;
Transmit-Receive Unit 302, for receiving the first message that user equipment is sent by packet sending and receiving process, and will be described First packet storage is to shared drive;Wherein, the shared drive can be in the first process access of User space;
Reading unit 303, for listening to packet sending and receiving process when intercepting unit by the first process in kernel state When having been received by the first message, then first process is switched into User space by kernel state, and by first process from First message is read in the shared drive;
Processing unit 304, for handling first message by first process, response is generated according to result Message, and response message storage is arrived by the shared drive by first process.
Optionally, when the first process in kernel state, which listens to packet sending and receiving process, has been received by the first message, read Take unit that the first process then is switched into User space by kernel state, including:
When the first process in kernel state receives the instruction message that packet sending and receiving process is sent, indicate that message is used to refer to Show the first process, packet sending and receiving process has received the first message;First process is switched to User space by reading unit by kernel state.
Optionally, the Transmit-Receive Unit 302 is additionally operable to:Response message storage is arrived by institute by first process State after shared drive, the response message is sent to by the user equipment by the packet sending and receiving process.
Optionally, the equipment also includes determining unit 305,
The determining unit 305 is used for:The response message is deposited by first process in the processing unit 304 Store up after the shared drive, determined by first process in the shared drive with the presence or absence of the second pending report Text;
The processing unit 304 is additionally operable to:If it is determined that unit 305 determines there is pending second in the shared drive Message, is read from the shared drive by first process and handles second message;
The unit 301 of intercepting is additionally operable to:If it is determined that unit 305 determines to be not present pending the in the shared drive Two messages, kernel state is switched to by first process by User space, to be continued by first process in kernel state Intercept message.
Optionally, the message stored in the shared drive is using without lock data structure.
The equipment can be used for performing the method that the embodiment shown in Fig. 2 is provided.Therefore, for each function of the equipment Function that module can be realized etc. refers to the description of the embodiment shown in Fig. 2, seldom repeats.Wherein it is determined that unit 305 is not It is essential functional module, thus it is shown in broken lines in figure 3.
Fig. 4 is referred to, one embodiment of the invention also provides a kind of computer installation, the computer installation includes processor 401, processor 401 is used to realize calculating audio provided in an embodiment of the present invention when performing the computer program stored in memory The step of with the method for the video asynchronous time difference.
Optionally, processor 401 can be specifically central processing unit, ASIC (English: Application Specific Integrated Circuit, referred to as:ASIC), can be it is one or more be used for control journey The integrated circuit that sequence is performed, can be using field programmable gate array (English:Field Programmable Gate Array, referred to as:FPGA) hardware circuit of exploitation, can be BBP.
Optionally, processor 401 can include at least one processing core.
Optionally, the computer installation also includes memory 402, and memory 402 can include read-only storage (English: Read Only Memory, referred to as:ROM), random access memory (English:Random Access Memory, referred to as:RAM) And magnetic disk storage.Memory 402 is used to store data required when processor 401 is run.The quantity of memory 402 is one Or it is multiple.Wherein, memory 402 is shown in the lump in Fig. 4, but it is understood that memory 402 is not essential function mould Block, thus it is shown in broken lines in Fig. 4.
In embodiments of the present invention, it should be understood that disclosed apparatus and method, can be real by another way It is existing.For example, apparatus embodiments described above are only schematical, for example, the division of the unit or unit, is only A kind of division of logic function, can there is other dividing mode when actually realizing, such as multiple units or component can combine or Person is desirably integrated into another system, or some features can be ignored, or does not perform.Another, shown or discussed is mutual Between coupling or direct-coupling or communication connection can be the INDIRECT COUPLING or communication link of equipment or unit by some interfaces Connect, can be electrical or other forms.
Each functional unit in embodiments of the present invention can be integrated in a processing unit, or unit also may be used To be independent physical module.
If the integrated unit is realized using in the form of SFU software functional unit and as independent production marketing or used When, it can be stored in a computer read/write memory medium.Understood based on such, the technical scheme of the embodiment of the present invention All or part can be embodied in the form of software product, the computer software product is stored in a storage medium In, including some instructions can be personal computer to cause a computer equipment, such as, server, or network are set It is standby etc., or processor (processor) performs all or part of step of each embodiment methods described of the invention.And it is foregoing Storage medium includes:General serial bus USB (Universal Serial Bus flash drive), mobile hard disk, only Read memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disc Or CD etc. is various can be with the medium of store program codes.
Described above, above example is only described in detail to the technical scheme to the application, but implements above The explanation of example is only intended to help the method for understanding the embodiment of the present invention, should not be construed as the limitation to the embodiment of the present invention.This The change or replacement that those skilled in the art can readily occur in, should all cover the embodiment of the present invention protection domain it It is interior.

Claims (12)

1. a kind of message processing method, it is characterised in that including:
Message processor intercepts the message that packet sending and receiving process is received by the first process in kernel state;
The message processor receives the first message that user equipment is sent by the packet sending and receiving process, and will be described First packet storage is to shared drive;Wherein, the shared drive can be in the first process access of User space;
When first process in kernel state, which listens to the packet sending and receiving process, has been received by first message, then First process is switched to User space by the message processor by kernel state, and by first process from described common Enjoy and first message is read in internal memory;
The message processor handles first message by first process, and response report is generated according to result Text, and response message storage is arrived by the shared drive by first process.
2. the method as described in claim 1, it is characterised in that when first process in kernel state listens to the report When literary transmitting-receiving process has been received by first message, then the message processor is switched first process by kernel state For User space, including:
The message processor receives the packet sending and receiving process by first process in kernel state and sent Instruction message, the instruction message is used to indicate first process, and the packet sending and receiving process has received first report Text;
First process is switched to User space by the message processor by kernel state.
3. the method as described in claim 1, it is characterised in that in the message processor by first process by institute Response message storage is stated to arrive after the shared drive, in addition to:
The response message is sent to the user equipment by the message processor by the packet sending and receiving process.
4. the method as described in claim 1-3 is any, it is characterised in that enter in the message processor by described first Journey arrives response message storage after the shared drive, in addition to:
The message processor is determined in the shared drive with the presence or absence of the second pending report by first process Text;
If it is determined that there is the second pending message in the shared drive, then the message processor enters by described first Journey reads from the shared drive and handles second message;Otherwise, the message processor is by first process Kernel state is switched to by User space, to continue to intercept message by first process in kernel state.
5. method as claimed in claim 4, it is characterised in that the message stored in the shared drive is using without lock data Structure.
6. a kind of message processor, it is characterised in that including:
Unit is intercepted, for being used to intercept the message that packet sending and receiving process is received by the first process in kernel state;
Transmit-Receive Unit, for receiving the first message that user equipment is sent by the packet sending and receiving process, and by described the One packet storage is to shared drive;Wherein, the shared drive can be in the first process access of User space;
Reading unit, for when first process in kernel state listen to the packet sending and receiving process have been received by it is described During the first message, then first process is switched into User space by kernel state, and shared from described by first process First message is read in internal memory;
Processing unit, for handling first message by first process, response message is generated according to result, and And response message storage is arrived by the shared drive by first process.
7. equipment as claimed in claim 6, it is characterised in that when first process in kernel state listens to the report When literary transmitting-receiving process has been received by first message, first process is then switched to use by the reading unit by kernel state Family state, including:
When first process in kernel state receives the instruction message that the packet sending and receiving process is sent, the finger Show that message is used to indicate first process, the packet sending and receiving process has received first message;The reading unit will First process switches to User space by kernel state.
8. equipment as claimed in claim 6, it is characterised in that
The Transmit-Receive Unit is additionally operable to:By first process by the response message storage to the shared drive it Afterwards, the response message is sent to by the user equipment by the packet sending and receiving process.
9. the equipment as described in claim 6-8 is any, it is characterised in that the equipment also includes determining unit,
The determining unit is used for:Response message storage is arrived described common by first process in the processing unit Enjoy after internal memory, determine to whether there is the second pending message in the shared drive by first process;
The processing unit is additionally operable to:If it is determined that unit determines there is the second pending message in the shared drive, pass through First process reads from the shared drive and handles second message;
The unit of intercepting is additionally operable to:If it is determined that unit determines that the second pending message is not present in the shared drive, will First process switches to kernel state by User space, to continue to intercept message by first process in kernel state.
10. equipment as claimed in claim 9, it is characterised in that the message stored in the shared drive is using without lock number According to structure.
11. a kind of computer installation, it is characterised in that described device includes processor, the processor is used to perform memory Realized during the computer program of middle storage as any one of claim 1-5 the step of method.
12. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that:The computer program Realized when being executed by processor as any one of claim 1-5 the step of method.
CN201710509548.2A 2017-06-28 2017-06-28 Message processing method and device Active CN107193673B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710509548.2A CN107193673B (en) 2017-06-28 2017-06-28 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710509548.2A CN107193673B (en) 2017-06-28 2017-06-28 Message processing method and device

Publications (2)

Publication Number Publication Date
CN107193673A true CN107193673A (en) 2017-09-22
CN107193673B CN107193673B (en) 2020-05-26

Family

ID=59881499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710509548.2A Active CN107193673B (en) 2017-06-28 2017-06-28 Message processing method and device

Country Status (1)

Country Link
CN (1) CN107193673B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234481A (en) * 2017-12-29 2018-06-29 上海品顺信息科技有限公司 A kind of method and distributed system that multiple machine distributing is controlled to access external system
CN110149262A (en) * 2019-04-02 2019-08-20 视联动力信息技术股份有限公司 A kind for the treatment of method and apparatus and storage medium of signaling message
CN110635569A (en) * 2019-09-24 2019-12-31 南京智联达科技有限公司 Power distribution terminal design architecture and method based on Linux
CN112104572A (en) * 2020-09-11 2020-12-18 北京天融信网络安全技术有限公司 Data processing method and device, electronic equipment and storage medium
WO2021121123A1 (en) * 2019-12-16 2021-06-24 中兴通讯股份有限公司 Media stream distribution method, cdn node server, cdn system, and readable storage medium
CN113612773A (en) * 2021-08-03 2021-11-05 厦门至恒融兴信息技术股份有限公司 Intelligent message identification and analysis system and method realized by artificial intelligence
WO2021244155A1 (en) * 2020-06-05 2021-12-09 华为技术有限公司 Inter-process communication method and inter-process communication apparatus
WO2023125430A1 (en) * 2021-12-29 2023-07-06 华为技术有限公司 Traffic management apparatus, packet caching method, chip, and network device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942149A (en) * 2014-03-27 2014-07-23 汉柏科技有限公司 User mode application and kernel message interaction method and system
CN104796337A (en) * 2015-04-10 2015-07-22 京信通信系统(广州)有限公司 Method and device for forwarding message
CN105656808A (en) * 2015-12-29 2016-06-08 京信通信技术(广州)有限公司 Message processing method and system thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942149A (en) * 2014-03-27 2014-07-23 汉柏科技有限公司 User mode application and kernel message interaction method and system
CN104796337A (en) * 2015-04-10 2015-07-22 京信通信系统(广州)有限公司 Method and device for forwarding message
CN105656808A (en) * 2015-12-29 2016-06-08 京信通信技术(广州)有限公司 Message processing method and system thereof

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234481A (en) * 2017-12-29 2018-06-29 上海品顺信息科技有限公司 A kind of method and distributed system that multiple machine distributing is controlled to access external system
CN108234481B (en) * 2017-12-29 2020-10-30 上海品顺信息科技有限公司 Method for controlling multi-machine distributed access to external system and distributed system
CN110149262A (en) * 2019-04-02 2019-08-20 视联动力信息技术股份有限公司 A kind for the treatment of method and apparatus and storage medium of signaling message
CN110149262B (en) * 2019-04-02 2021-03-12 视联动力信息技术股份有限公司 Method and device for processing signaling message and storage medium
CN110635569A (en) * 2019-09-24 2019-12-31 南京智联达科技有限公司 Power distribution terminal design architecture and method based on Linux
WO2021121123A1 (en) * 2019-12-16 2021-06-24 中兴通讯股份有限公司 Media stream distribution method, cdn node server, cdn system, and readable storage medium
WO2021244155A1 (en) * 2020-06-05 2021-12-09 华为技术有限公司 Inter-process communication method and inter-process communication apparatus
CN112104572A (en) * 2020-09-11 2020-12-18 北京天融信网络安全技术有限公司 Data processing method and device, electronic equipment and storage medium
CN112104572B (en) * 2020-09-11 2023-02-07 北京天融信网络安全技术有限公司 Data processing method and device, electronic equipment and storage medium
CN113612773A (en) * 2021-08-03 2021-11-05 厦门至恒融兴信息技术股份有限公司 Intelligent message identification and analysis system and method realized by artificial intelligence
CN113612773B (en) * 2021-08-03 2023-06-16 厦门至恒融兴信息技术股份有限公司 Intelligent message identification and analysis system and method realized by artificial intelligence
WO2023125430A1 (en) * 2021-12-29 2023-07-06 华为技术有限公司 Traffic management apparatus, packet caching method, chip, and network device

Also Published As

Publication number Publication date
CN107193673B (en) 2020-05-26

Similar Documents

Publication Publication Date Title
CN107193673A (en) A kind of message processing method and equipment
US10901638B2 (en) Cascading board and SSD shared remote access system and method
US10313247B2 (en) System, method, and device for network load balance processing
WO2006019512B1 (en) Apparatus and method for supporting connection establishment in an offload of network protocol processing
CN110505319A (en) A kind of RS485 is from device address auto-allocation method and system
CN106301859B (en) Method, device and system for managing network card
CN112333298B (en) Message transmission method and device, computer equipment and storage medium
CN109076024A (en) data control method and terminal device
CN106936739B (en) Message forwarding method and device
CN107743137B (en) File uploading method and device
CN105335309B (en) A kind of data transmission method and computer
CN114265800B (en) Interrupt message processing method and device, electronic equipment and readable storage medium
CN103634364A (en) Remote desktop realizing system, method, client-side and service center
CN102917052A (en) Method for distributing resources in cloud computing system
WO2017185615A1 (en) Method for determining service status of service processing device and scheduling device
CN106101171A (en) Server method of attachment and device
CN110798412A (en) Multicast service processing method, device, cloud platform, equipment and readable storage medium
CN114095567A (en) Data access request processing method and device, computer equipment and medium
CN114697391B (en) Data processing method, device, equipment and storage medium
CN107896196B (en) Method and device for distributing messages
WO2022032990A1 (en) Command information transmission method, system, and apparatus, and readable storage medium
CN109257806B (en) Carrier aggregation mode setting method for communication terminal, communication terminal and medium
CN112491794A (en) Port forwarding method, device and related equipment
CN103491141A (en) Application server and request processing method
CN107229424B (en) Data writing method for distributed storage system and distributed storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant