CN108512820A - The method and apparatus of server response request message in a kind of communication system - Google Patents

The method and apparatus of server response request message in a kind of communication system Download PDF

Info

Publication number
CN108512820A
CN108512820A CN201710114800.XA CN201710114800A CN108512820A CN 108512820 A CN108512820 A CN 108512820A CN 201710114800 A CN201710114800 A CN 201710114800A CN 108512820 A CN108512820 A CN 108512820A
Authority
CN
China
Prior art keywords
request message
time
server
effective
response
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
CN201710114800.XA
Other languages
Chinese (zh)
Other versions
CN108512820B (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.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710114800.XA priority Critical patent/CN108512820B/en
Priority to CN202010657850.4A priority patent/CN111953655B/en
Publication of CN108512820A publication Critical patent/CN108512820A/en
Application granted granted Critical
Publication of CN108512820B publication Critical patent/CN108512820B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/62Establishing a time schedule for servicing the requests

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

The method and apparatus of server response request message in a kind of communication system, the technical issues of leading to security risk to the message of settlement server response failure.This method includes:Server receives the request message that client is sent;The server obtains the first effective time information for the request message;The first effective time information is used to indicate first effective initial time and first effective end time, first effective initial time is the time that server begins to respond to the request message, and first effective end time is that server terminates to respond the time of the request message;The server determines the response policy to the request message;The server is according to request message described in the response policy and the first effective time information processing.

Description

The method and apparatus of server response request message in a kind of communication system
Technical field
The present embodiments relate to server response request messages in field of communication technology more particularly to a kind of communication system Method and apparatus.
Background technology
Internet of Things relies on the supporting bodies such as internet and conventional telecommunications net, allows all common objects that can exercise standalone feature Realize the network to interconnect.The internets the ITU report of International Telecommunication Union (ITU) publication, has done as given a definition Internet of Things: Pass through the letters such as two dimension code reading equipment, radio frequency identification (RFID) device, infrared inductor, global positioning system and laser scanner Sensing equipment is ceased, by the agreement of agreement, any article is connected with internet, information exchange and communication are carried out, to realize intelligence A kind of network of energyization identification, positioning, tracking, monitoring and management.It is, utilizing the communication technologys such as localized network or internet Sensor, controller, machine, personnel and object etc. are linked togather by new mode, people is formed and object, object is connected with object, it is real Existing information-based, remote management and control and intelligentized network.
The internet of things application layer agreement of current main-stream is limited applications agreement (Constrained Application Protocol, CoAP), for CoAP using the pattern of client (Client)/server (Server), there are message may It is delayed by or congestion situations, is described below.
For example, user end to server sends PUT message, which may intercepted by intermediate equipment malicious intercepted The PUT message is sent to server by the intermediate equipment again after delay a period of time afterwards, then server reception is exactly by Between equipment delay after PUT message.But whether server None- identified PUT message is delayed by, then server can response should as usual PUT message., may be no longer valid but since the PUT message has been delayed by, then server responds disappearing for this potential failure Breath, will have security risk.For example, which is door-lock opening request, which asks by intermediate equipment Server is sent to after delay, server opens door after receiving the PUT message.However, because client does not wait until slowly Server responds the PUT message, is had been moved off in the people waited in front of the door, potential to other if server opens door again at this time Malice people have into the chance in introduction, there are security risks.
Invention content
The embodiment of the present invention provides a kind of method and apparatus of server response request message in communication system, to solve The technical issues of server responds the request message of failure and leads to security risk.
In a first aspect, the method for providing server response request message in a kind of communication system, this method are held by server Row.Here server refers to the server in user terminal/server framework, is the clothes in logical concept rather than physical significance Business device, as long as having the function of that the equipment of the server in user terminal/server framework all can serve as the embodiment of the present invention Server.In addition this method further relates to client, and client here refers to the server in user terminal/server framework, It is logical concept, as long as it is of the invention real to have the function of that the equipment of the client in user terminal/server framework all can serve as Apply the client of example.This method includes:Server receives the request message that client is sent, and obtains first for request message Effective time information.Wherein, the first effective time information is used to indicate first effective initial time and first effective end time, First effective initial time is the time that server begins to respond to request message, and first effective end time was that server terminates to ring Answer the time of request message.Server determines to the response policy of request message, and according to response strategy and first it is effective when Between information process request message.
In the embodiment of the present invention, after server receives the request message that client is sent, the request message pair can be obtained The the first effective time information answered, server are assured that the first of response request message has according to the first effective time information Imitate initial time and first effective end time, that is, it is determined that when response request message.So, if it is current Time is not the time of the first effective time information defined, then server obviously will not response request message, that is to say, that this Server in inventive embodiments can identify whether the message of reception is effective, to respond the message of failure, reduce Security risk improves the safety of whole system.
With reference to first aspect, in the first possible realization method of first aspect, server is determined to request message Response policy, including:Server determines response policy for response policy on time.So, server according to response strategy and First effective time information process request message, including:Server is according to response policy on time, if the current time is positioned at first Before effective end time, then response request message.
One of which response policy is response policy on time, and response policy refers to being had according to current time and first on time Imitate the strategy of the precedence relationship processing request message between temporal information.So, it is effectively tied if the current time is located at first Before the beam time, show that the request message also in the term of validity, has not expired, then server meeting response request message, ensures Request message timely responds to.
The possible realization method of with reference to first aspect the first, in second of possible realization method of first aspect In, server is according to response policy on time, if the current time was located at before first effective end time, respond request disappears Breath, including:If the current time was located at before first effective end time, server is according to the waiting in response policy on time Response mode or directly in response to mode response request message.
The case where being located at before first effective end time for the current time, server has different responders again Formula, such as server can be according to wait-for-response modes or directly in response to mode come response request message.To according to different feelings Condition has different response modes, more flexibly, but also request message can obtain most suitable response.
Second of possible realization method with reference to first aspect, in the third possible realization method of first aspect In, if the current time was located at before first effective end time, server is according to the wait-for-response in response policy on time Mode response request message, including:If the current time is located at before first effective initial time, startup of server first is fixed When device, wherein the timing duration of first timer be greater than or equal to first effective initial time and the difference between the current time Value, and less than or equal to the difference between first effective end time and current time.In the timing duration of first timer When arrival, server response request message.
First effective initial time is the time that defined server begins to respond to request message, and server is according to the rules To carry out response request message naturally be best time.Therefore, if the current time be also located at first effective initial time it Before, then server can be waited for first, that is, start first timer, and the time of the timing duration arrival of first timer is set It is also located in the term of validity of the request message, then when the timing duration of first timer reaches, server begins to respond to this Request message so that the request message is responded in the time of the first effective time information defined as possible.
The possible realization method of with reference to first aspect the first, in the 4th kind of possible realization method of first aspect In, if the current time be located at before first effective end time, server according in response policy on time directly in response to Mode response request message, including:If time consistent or current with first effective initial time current time is located at first After effective initial time and before first effective end time, then server response request message.
If the current time is consistent with first effective initial time, i.e., when the current time is exactly first effective starting Between or the current time be located at after first effective initial time and before first effective end time, show to have arrived The defined time for responding the request message, then server can be directly in response to request message, to ensure that request message can It is responded in time.
The possible realization method of with reference to first aspect the first, in the 5th kind of possible realization method of first aspect In, server according to response strategy and the first effective time information process request message, further include:Server is according to ringing on time Strategy is answered, if the current time was located at after first effective end time, abandons request message.
If the current time was located at after first effective end time, show to have had been subjected to the effective of the request message Phase, the request message may be no longer valid, and there may be security risks if being also responsive to the request message at this time.Therefore server The request message can be abandoned, is no longer responded, the safety and reliability of system is improved.
The possible realization method of with reference to first aspect the first to any one of the 5th kind of possible realization method can The realization of energy, in the 6th kind of possible realization method of first aspect, this method further includes:Server is sent to client to be rung Answer message, response message, which is used to indicate request message and has responded, to be finished, or is used to indicate request message and has been added and wait for response queue, Or it is used to indicate request message and has been dropped.Wherein, if response message is used to indicate request message and has responded completion or for referring to Show that request message has been dropped, then response message also carries time offset value, time offset value be first effective initial time with Difference between the time of server processing requests message.
After server handles request message, response message can be sent to client, so that client energy Enough dispositions for knowing server in time.Wherein, if response message is used to indicate request message and has responded completion or be used for Instruction request message has been dropped, then server can also carry time offset value in the response message, and client can basis The time offset value that the response message of reception carries is arranged the effective time information that subsequent request message carries.For example, such as Fruit request message is always delayed by, then illustrates that system has delay situation, the time that client can will receive in some cycles Deviant is averaged, and the effective time information of subsequent request message carrying is arranged according to the average value acquired.Wherein, It is recommended that the effective time of the response request message of the effective time information instruction of client setting is less than the average value.By this Mode so that client is that the effective time information set by request message is more reasonable.
With reference to first aspect, in the 7th kind of possible realization method of first aspect, which also carries sequence Number.So, server determines the response policy to request message, including:If sequence number and server that request message carries are most The sequence number that the request message that the nearly client once received is sent carries is discontinuous, and the sequence number that request message carries is more than Server the last time receive client send request message carry sequence number, then server determine response policy be rob It accounts for response policy, ordinal response strategy or sequence and abandons response policy.
If request message carries sequence number, server can determine asking for client transmission according to sequence number Seek the sequencing of message.The sequence number carried according to the request message of reception is sent out with the client that server the last time receives Relationship between the sequence number that the request message sent carries, server can select different response policies, more flexibly.Its In, the discontinuous situation of sequence number is as above described only, if the sequence number that request message carries connects with server the last time The sequence number that the request message that the client of receipts is sent carries is continuous, and the sequence number that request message carries is nearest less than server The sequence number that the request message that the client once received is sent carries, then server can respond the request message, clothes The response policy on time such as preceding introduction may be used to be responded when responding the request message in business device, seldom repeats.
The 7th kind of possible realization method with reference to first aspect, in the 8th kind of possible realization method of first aspect In, if server determines that response policy is to seize response policy, server according to response believe by strategy and the first effective time Breath processing request message, including:Server is according to seizing response policy and first effective time information response's request message.Separately Outside, after response request message, further include:If the sequence number that the subsequent request message that server receives carries is less than request Message carry sequence number, then server abandon subsequent request message.
It is so-called to seize response policy, it is exactly first to receive the strategy first responded, that is, even if what the request message first received carried The sequence number that the request message that sequence number is sent with the client that server the last time receives carries is discontinuous, and request message The sequence number of carrying is more than the sequence number that the request message that the client that server the last time receives is sent carries, but because should Request message first receives, so server also can first handle the request message.Specifically, server can be according to such as preceding introduction Response policy on time handle the request message, seldom repeat.Under this response policy, server does not take into account that request disappears Sequencing between breath more is suitable for not requiring the application scenarios of sequence.In addition, if server connects before first having responded The request message of receipts, then, if server subsequently has received request message, referred to herein as subsequent request message again, subsequently ask The sequence number that request message before asking the sequence number that message carries to be less than carries, then in order to avoid out of order, server can be lost Subsequent request message is abandoned, to avoid causing confusion.
The 7th kind of possible realization method with reference to first aspect, in the 9th kind of possible realization method of first aspect In, if server determines that response policy is ordinal response strategy or sequence and abandons response policy, server plan according to response Summary and the first effective time information process request message, including:Server is according to ordinal response strategy or sequence and abandons sound Strategy is answered, request message is not responding to, and waits subsequent request message to be received.Wherein, subsequent request message carry sequence number with The sequence number that the request message that the client that server the last time receives is sent carries is continuous.
So-called ordinal response strategy, be exactly server have to the sequencing of the sequence number carried according to request message into The strategy of row response, so-called sequence simultaneously abandon response policy, the sequence number that exactly server is carried according to request message as possible The strategy that sequencing is responded.So, if the server determine that response policy is ordinal response strategy or sequence and abandons Response policy, and the current time was located at before first effective end time, then server can all select temporarily to be not responding to ask Message is sought, and waits subsequent request message to be received, ensures to send the sequence of request message according to client as possible to be responded.
The 9th kind of possible realization method with reference to first aspect, in the tenth kind of possible realization method of first aspect In, this method further includes:Server receives subsequent request message, and subsequent request message carries the second effective time information.Second Effective time information is used to indicate second effective initial time and second effective end time, and second effective initial time is regulation The time for beginning to respond to subsequent request message, second effective end time be it is defined terminate respond subsequent request message when Between.If the current time was located at before second effective end time, server responds subsequent request message.
If server has received subsequent request message, and the current time was located at before second effective end time, table Bright subsequent request message, then server can respond subsequent request message, ensures as possible according to suitable also in the term of validity The request message that sequence response receives, and the message that response is failed can also be avoided by the second effective time information.Wherein, it services Device can respond subsequent request message according to the response policy on time of such as preceding introduction.
The tenth kind of possible realization method with reference to first aspect, in a kind of the tenth possible realization method of first aspect In, after server responds subsequent request message, further include:If the current time was located at before first effective end time, Then server response request message;Or, if the current time was located at after first effective end time, server abandons request and disappears Breath.
After server responds subsequent request message, if the current time was located at before first effective end time, table Bright request message has not expired, then server response request message, and if the current time be located at for first effective end time Later, show that request message has failed, then server abandons request message.In this way, server will not respond failure Request message, improve the safety of system.
The tenth kind of possible realization method with reference to first aspect, in the 12nd kind of possible realization method of first aspect In, this method further includes:If the current time was located at after second effective end time, server abandons subsequent request and disappears Breath.
When server receives subsequent request message, if the current time had been positioned at after the second effective time, show Subsequent request message has failed, and security risk is might have if proceeding to respond to subsequent request message.Therefore server abandons Subsequent request message, to protect system safe.
The 12nd kind of possible realization method with reference to first aspect, in the 13rd kind of possible realization side of first aspect In formula, if server determines response policy as ordinal response strategy, and the current time was located at after second effective end time, Then server abandons request message;Or, if server determines that response policy is sequence and abandons response policy, and current time After second effective end time, then, if the current time was located at before first effective end time, server response is asked Seek message.
If the server determine that response policy is ordinal response strategy, and the current time was located at for second effective end time Later, then server can abandon subsequent request message, and because being ordinal response strategy, it is asked if the sequence number carried is smaller Message, i.e. subsequent request message are asked, has all been dropped, then server also no longer executes the larger request message of sequence number, therefore Server can also abandon request message, avoid in this way out of order.And in sequence and under abandoning response policy, server meeting The first subsequent request message to be received such as selection if not receiving subsequent request message, or receives follow-up when subsequent request message Request message has failed, then the request message that server can also receive before Response to selection.Therefore, if the server determine that response Strategy is sequence and abandons response policy, and the current time was located at after second effective end time, then server can abandon Subsequent request message, at this time server also can determine whether the current time whether be located at first effective end time before, if worked as The preceding time was located at before first effective end time, and server meeting response request message ensures disappearing for client transmission as possible Breath can be responded.Wherein, server can be according to the response policy response request message on time of such as preceding introduction.Certainly, if worked as The preceding time was located at after first effective end time, showed that request message has failed, then server can abandon request message, protected Protecting system safety.
The 9th kind of possible realization method with reference to first aspect, in the 14th kind of possible realization method of first aspect In, this method further includes:If server determines that response policy is ordinal response strategy, and when reaching first effective end time Server does not receive subsequent request message, then server abandons request message;Or, if server determines that response policy is sequentially simultaneously Response policy is abandoned, and server does not receive subsequent request message when reaching first effective end time, then, if when current Between be located at first effective end time before, server response request message.
What it is such as preceding introduction is the case where server has received subsequent request message, and under ordinal response strategy, if Server does not receive subsequent request message when first effective end time reached, then server can abandon request message, that is, i.e. Make the message for being not responding to client transmission, out of order response will not be carried out.And in sequence and under abandoning response policy, server meeting The first subsequent request message to be received such as selection, if not receiving subsequent request message, server can also connect before Response to selection The request message of receipts ensures that the message that client is sent can be responded as possible.Wherein, server can pressing according to such as preceding introduction When response policy response request message.Certainly, if the current time was located at after first effective end time, show that request disappears Breath has failed, then server can abandon request message, protection system safety.
The 9th kind of possible realization method with reference to first aspect, in the 15th kind of possible realization method of first aspect In, after server response request message, further include:Server receives subsequent request message, and server abandons subsequent request Message.
In sequence and under abandoning response modes, if server has first responded request message, even when server connects again Subsequent request message is received, then server also can directly abandon subsequent request message, avoid out of order response in this way.
With reference to first aspect or the first possible realization method of first aspect is to the 14th kind of possible realization method Any one of possible realization method, in the 16th kind of possible realization method of first aspect, server is directed to First effective time information of request message, including:Server obtains the first effective time information that request message carries;Or, Server is determined according at least one of the mark of the type of request message, the content of request message and client factor First effective time information.
That is, the first effective time information can be arranged by client, client can be configured according to the demand of user, This setup is relatively simple easy, also more meets the demand of user.Or first effective time information can also be by taking Device be engaged in be arranged, such as the type of request message, the content of request message and client can be rule of thumb arranged in server in advance Mapping relations between at least one of the mark at end factor and effective time information, then after receipt of subsequent request message directly The effective time information that the mapping relations are assured that request message is inquired, this mode alleviates the burden of client, special It is not that this mode is just more suitable for for the incomplete client of function.By providing different effective time information Set-up mode, but also the application range of the embodiment of the present invention is more extensive.
Second aspect provides a kind of method for sending request message to server in communication system, and this method is by client It executes, client here refers to the server in user terminal/server framework, is logical concept, as long as having client/clothes The equipment of the function of client in business device framework all can serve as the client of the embodiment of the present invention.In addition this method further relates to Server, server here refer to the server in user terminal/server framework, are in logical concept rather than physical significance Server, as long as having the function of that the equipment of the server in user terminal/server framework all can serve as implementation of the present invention The server of example.This method includes:User end to server sends request message, and request message carries the first effective time letter Breath.Wherein, the first effective time information is used to indicate first effective initial time and first effective end time, and first effectively rises Time beginning is the time that server begins to respond to request message, and first effective end time was that server terminates response request message Time.Client receives the response message that server is sent, and response message, which is used to indicate request message and has responded, to be finished, or is used It has been added in instruction request message and has waited for response queue, or be used to indicate request message and be dropped.
In the embodiment of the present invention, the request message that client is sent to server can carry the first effective time information, from And server can obtain the first effective time information, server is assured that response is asked according to the first effective time information Ask first effective initial time and the first effective end time of message, that is, it is determined that when response request message. So, if the current time is not the time of the first effective time information defined, server obviously will not respond request Message, that is to say, that the server in the embodiment of the present invention can identify whether the message of reception is effective, to respond mistake The message of effect, reduces security risk, improves the safety of whole system.
In conjunction with second aspect, in the first possible realization method of second aspect, which also carries sequence Number.This method further includes:User end to server sends subsequent request message, and subsequent request message carries sequence number.
In embodiments of the present invention, the request message that client is sent can also carry sequence number, so that server energy It enough identifies the sequence between request message, is determined whether in sequence convenient for server to execute.
In conjunction with the first possible realization method of second aspect, in second of possible realization method of second aspect In, subsequent request message also carries the second effective time information.When second effective time information is used to indicate second effective starting Between and second effective end time, second effective initial time be the defined time for beginning to respond to subsequent request message, second Effective end time is the defined time for terminating to respond subsequent request message.
That is, the request message that client is sent can carry effective temporal information, such server Determine whether the request message received is also effective, and server is avoided to respond failed message.
In conjunction with the possible realization method of the first of second aspect or second aspect or second of possible realization method, In the third possible realization method of second aspect, if response message is used to indicate request message and has responded completion or for referring to Show that request message has been dropped, then response message also carries time offset value, time offset value be first effective initial time with Difference between the time of server processing requests message.
If response message is used to indicate request message and has responded completion or be used to indicate request message and be dropped, take Business device can also carry time offset value in the response message, and the time that client can be carried according to the response message of reception is inclined Shifting value is arranged the effective time information that subsequent request message carries.For example, if request message is always delayed by, illustrate There is delay situation in system, client can average the time offset value received in some cycles, and according to acquiring Average value is arranged the effective time information that subsequent request message carries.Wherein, it is proposed that the effective time letter of client setting The effective time for ceasing the response request message of instruction is less than the average value.In this way so that client is request message Set effective time information is more reasonable.
In conjunction with the third possible realization method of second aspect, in the 4th kind of possible realization method of second aspect In, this method further includes:The effective time information that client is carried according to the request message that time offset value adjustment is sent later.
The third aspect provides a kind of server, which includes receiver and processor.Wherein, receiver is for connecing Receive the request message that client is sent.Processor is used to obtain the first effective time information for request message, determines to asking The response policy of message is sought, according to response strategy and the first effective time information process request message.Wherein, first it is effective when Between information be used to indicate first effective initial time and first effective end time, first effective initial time starts for server The time of response request message, first effective end time are the time that server terminates response request message.
In conjunction with the third aspect, in the first possible realization method of the third aspect, processor is for determining to request The response policy of message, including:Determine response policy for response policy on time.Processor is for strategy and first according to response Effective time information process request message, including:According to response policy on time, if at the end of the current time is located at first effectively Between before, then response request message.
In conjunction with the first possible realization method of the third aspect, in second of possible realization method of the third aspect In, processor is used for according to response policy on time, if the current time was located at before first effective end time, respond request Message, including:If the current time was located at before first effective end time, according to the wait-for-response in response policy on time Mode or directly in response to mode response request message.
In conjunction with second of possible realization method of the third aspect, in the third possible realization method of the third aspect In, if processor is located at for the current time before first effective end time, according to the waiting in response policy on time Response mode response request message, including:If the current time is located at before first effective initial time, start the first timing Device, when the timing duration of first timer reaches, response request message.The timing duration of first timer is greater than or equal to the One effective initial time and the difference between the current time, and less than or equal to first effective end time and current time Between difference.
In conjunction with the first possible realization method of the third aspect, in the 4th kind of possible realization method of the third aspect In, if processor is located at for the current time before first effective end time, according to direct in response policy on time Response mode response request message, including:If time consistent or current with first effective initial time current time is located at After first effective initial time and before first effective end time, then response request message.
In conjunction with the first possible realization method of the third aspect, in the 5th kind of possible realization method of the third aspect In, processor further includes for strategy and the first effective time information process request message according to response:According to responding on time Strategy abandons request message if the current time was located at after first effective end time.
The first possible realization method in conjunction with the third aspect is possible to any one of the 5th kind of possible mode Realization method, in the 6th kind of possible realization method of the third aspect, which further includes transmitter.Transmitter is used for: Response message is sent to client, response message, which is used to indicate request message and has responded, to be finished, or is used to indicate request message Addition waits for response queue, or is used to indicate request message and has been dropped.Wherein, if response message is used to indicate request message and has rung It should complete or be used to indicate request message to be dropped, then response message also carries time offset value, time offset value first Difference effectively between initial time and the time of server processing requests message.
In conjunction with the third aspect, in the 7th kind of possible realization method of the third aspect, which also carries sequence Number.So, processor is used to determine the response policy to request message, including:If sequence number and service that request message carries The sequence number that the request message that the client that device the last time receives is sent carries is discontinuous, and the sequence number that request message carries The sequence number carried more than the request message that the client that server the last time receives is sent, it is determined that response policy is to seize Response policy, ordinal response strategy or sequence simultaneously abandon response policy.
In conjunction with the 7th kind of possible realization method of the third aspect, in the 8th kind of possible realization method of the third aspect In, if processor determines that response policy is to seize response policy, processor according to response believe by strategy and the first effective time Breath processing request message, including:According to seizing response policy and first effective time information response's request message.In addition, place Reason device is additionally operable to:After response request message, asked if the sequence number that the subsequent request message that receiver receives carries is less than The sequence number for asking message to carry, then abandon subsequent request message.
In conjunction with the 7th kind of possible realization method of the third aspect, in the 9th kind of possible realization method of the third aspect In, processor is used for if it is determined that response policy is ordinal response strategy or sequence and abandons response policy, then tactful according to response And the first effective time information process request message, including:According to ordinal response strategy or sequence and response policy is abandoned, no Response request message, and wait subsequent request message to be received.The sequence number that subsequent request message carries is the last with server The sequence number that the request message that the client of reception is sent carries is continuous.
In conjunction with the 9th kind of possible realization method of the third aspect, in the tenth kind of possible realization method of the third aspect In, receiver is additionally operable to:Subsequent request message is received, subsequent request message carries the second effective time information.Second it is effective when Between information be used to indicate second effective initial time and second effective end time, second effective initial time starts for server The time of subsequent request message is responded, second effective end time was that server terminates to respond the time of subsequent request message.Place Reason device is additionally operable to:If the current time was located at before second effective end time, subsequent request message is responded.
In conjunction with the tenth kind of possible realization method of the third aspect, in a kind of the tenth possible realization method of the third aspect In, processor is additionally operable to:After responding subsequent request message, if the current time was located at before first effective end time, Then response request message;Or, if the current time was located at after first effective end time, request message is abandoned.
In conjunction with the tenth kind of possible realization method of the third aspect, in the 12nd kind of possible realization method of the third aspect In, this method further includes:If the current time was located at after second effective end time, subsequent request message is abandoned.
In conjunction with the 12nd kind of possible realization method of the third aspect, in the 13rd kind of possible realization side of the third aspect In formula, processor is additionally operable to:If it is determined that at the end of response policy is ordinal response strategy, and the current time is located at second effectively Between after, then abandon request message;Or, if it is determined that response policy is sequence and abandons response policy, and the current time is located at After second effective end time, then, if the current time was located at before first effective end time, response request message.
In conjunction with the 9th kind of possible realization method of the third aspect, in the 14th kind of possible realization method of the third aspect In, processor is additionally operable to:If it is determined that response policy is ordinal response strategy, and the server when reaching first effective end time Subsequent request message is not received, then abandons request message;Or, if it is determined that response policy is sequence and abandons response policy, and Server does not receive subsequent request message when first effective end time reached, then, is effectively tied if the current time is located at first Before the beam time, response request message.
In conjunction with the 14th kind of possible realization method of the third aspect, in the 15th kind of possible realization side of the third aspect In formula, receiver is additionally operable to:After processor response request message, subsequent request message is received.Processor is additionally operable to:It abandons Subsequent request message.
In conjunction with the possible realization method of the first of the third aspect or the third aspect to the 15th kind of possible realization method Any one of possible realization method, in the 16th kind of possible realization method of the third aspect, processor is for obtaining For the first effective time information of request message, including:Obtain the first effective time information that request message carries;Or, root At least one of mark according to the type of request message, the content of request message and client factor determines first effectively Temporal information.
Fourth aspect provides a kind of client, which includes transmitters and receivers.Wherein, transmitter be used for Server sends request message, and request message carries the first effective time information.Wherein, the first effective time information is used to indicate First effective initial time and first effective end time, first effective initial time are that server begins to respond to request message Time, first effective end time are the time that server terminates response request message.Receiver is used for:Server is received to send Response message, response message, which is used to indicate request message and has responded, to be finished, or is used to indicate request message and has been added and wait responding Queue, or be used to indicate request message and be dropped.
In conjunction with fourth aspect, in the first possible realization method of fourth aspect, which also carries sequence Number.Transmitter is additionally operable to:Subsequent request message is sent to server, subsequent request message carries sequence number.
In conjunction with the first possible realization method of fourth aspect, in second of possible realization method of fourth aspect In, subsequent request message also carries the second effective time information.When second effective time information is used to indicate second effective starting Between and second effective end time, second effective initial time be the defined time for beginning to respond to subsequent request message, second Effective end time is the defined time for terminating to respond subsequent request message.
In conjunction with the possible realization method of the first of fourth aspect or fourth aspect or second of possible realization method, In the third possible realization method of fourth aspect, if response message is used to indicate request message and has responded completion or for referring to Show that request message has been dropped, then response message also carries time offset value, time offset value be first effective initial time with Difference between the time of server processing requests message.
In conjunction with the third possible realization method of fourth aspect, in the 4th kind of possible realization method of fourth aspect In, which further includes processor.Processor is used for:What the request message sent later according to time offset value adjustment carried Effective time information.
5th aspect, provides a kind of server, which includes any for executing first aspect or first aspect The functional unit for the method that the possible realization method of kind is provided.
6th aspect, provides a kind of client, which includes any for executing first aspect or first aspect The functional unit for the method that the possible realization method of kind is provided.
7th aspect, provides a kind of computer storage media, the computer software for being stored as used in above-mentioned server Instruction is the journey designed by server it includes any possible realization method for executing first aspect or first aspect Sequence.
Eighth aspect provides a kind of computer storage media, the computer software for being stored as used in above-mentioned client Instruction is the journey designed by client it includes any possible realization method for executing first aspect or first aspect Sequence.
Server in the embodiment of the present invention can identify whether the message of reception is effective, to respond disappearing for failure Breath, reduces security risk, improves the safety of whole system.
Description of the drawings
Fig. 1 is a kind of application scenarios schematic diagram of the embodiment of the present invention;
Fig. 2 provides the flow chart of a kind of method of server response request message in communication system for the embodiment of the present invention;
Fig. 3 for the method provided in an embodiment of the present invention according to response policy on time come response request message flow chart;
Fig. 4 is to be provided in an embodiment of the present invention according to the flow chart for seizing method of the response policy come response request message;
Fig. 5 for the method provided in an embodiment of the present invention according to ordinal response strategy come response request message flow chart;
Fig. 6 according to sequence and abandons the stream of method of the response policy come response request message to be provided in an embodiment of the present invention Cheng Tu;
Fig. 7-Fig. 8 is two kinds of structural schematic diagrams of server provided in an embodiment of the present invention;
Fig. 9-Figure 10 is two kinds of structural schematic diagrams of client provided in an embodiment of the present invention.
Specific implementation mode
In order to keep the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with attached drawing to this hair Bright embodiment is described in further detail.
Hereinafter, the part term in the embodiment of the present invention is explained, in order to those skilled in the art understand that.
(1) client, i.e. client in user terminal/server framework in Internet of things system, for into the framework Server send request message.
(2) server, i.e. server in user terminal/server framework in Internet of things system, for receiving the framework In the request message that sends of client, and respond received request message.
It is to be appreciated that user terminal/server framework refers to a kind of logical architecture, as long as client can be completed The equipment of function all can serve as the client in the framework, as long as the equipment that can complete the function of server can be made It,, both can be under different scenes, or at different times even the same equipment for the server in the framework Server is can also be used as client.Such as in practical applications, terminal device can be used as client, can also be used as Server, the server apparatus in physical significance is also that both can also be used as the framework as the client in the framework In server.
(3) terminal device refers to the equipment for providing a user voice and/or data connectivity, and particularly, the present invention is implemented Terminal device involved in example can be constrained devices, such as the lower equipment of power consumption or the limited equipment of storage capacity, or meter Limited equipment of calculation ability etc..Specifically, bar code, radio frequency identification (RFID), sensor, global positioning system (GPS), laser are swept It retouches the information sensing devices such as device and all can serve as terminal device in the embodiment of the present invention.In addition, some terminal devices may be with Gateway device communicates, such as accesses network by gateway device, and in such a scenario, gateway device can also be used as of the invention real Apply the terminal device that example is introduced.
(4) server apparatus, the server being different from the logical meaning introduced such as preceding (2) article, clothes here Business device equipment refers to the server in physical significance, also referred to as servomechanism, is to provide the equipment of the service of calculating.Since server needs Service request is responded, and is handled, therefore in general server should have the service of undertaking and ensure the ability of service.Clothes The composition of business device includes that processor, hard disk, memory and system bus etc. are similar with general computer architecture.
(5) in the embodiment of the present invention, " multiple " refer to two or more, in consideration of it, also may be used in the embodiment of the present invention " multiple " to be interpreted as " at least two ".
The application scenarios of the embodiment of the present invention are introduced below in conjunction with the accompanying drawings.
Fig. 1 is referred to, is a kind of application scenarios schematic diagram of the embodiment of the present invention.Fig. 1 includes that cloud platform, terminal are set Standby, sub- equipment (Child Device) and gateway device (Gateway Device).Wherein, terminal device or sub- equipment can Directly to be connect with server, or can also be connect with server by gateway device nearby.Wherein, for cloud platform and For terminal device, cloud platform can serve as the role of server, and terminal device serves as the role of client or cloud platform is filled As the role of client, terminal device serves as the role of server.For cloud platform and gateway device, cloud platform can fill As the role of server, gateway device serves as the role of client or cloud platform serves as the role of client, and gateway device fills As the role of server.For gateway device and sub- equipment, gateway device can serve as the role of server, and sub- equipment is filled When the role of client or gateway device serve as the role of client, sub- equipment serves as the role of server.Meeting in cloud platform A variety of applications (APP) are run, these applications can correspond to different vertical industries, such as smart home, intelligent grid or vehicle connection Net etc., to form small-sized Internet of things system.
In Fig. 1, the line between cloud platform and application, which shows to apply, to be mounted in cloud platform, or is mounted on other equipment On application can be communicated with cloud platform.The line between equipment in Fig. 1 refers to that can communicate between equipment, as communication party Formula can be that wired mode can also be wireless mode.
Certainly, Fig. 1 is a kind of example, and the application scenarios of the embodiment of the present invention are without being limited thereto, such as terminal device and net It closes equipment etc. and is not necessarily and is connected to cloud platform, can also be connected to other equipment, such as the server in physical significance is set It is standby etc..
Technical solution provided in an embodiment of the present invention is introduced below in conjunction with the accompanying drawings.During following introduction, with this hair The scheme that bright embodiment provides is applied to for application scenarios shown in FIG. 1, then, the client described in following Examples The terminal device in Fig. 1 is can be regarded as, server can be regarded as the cloud platform in Fig. 1, or, client can be regarded as in Fig. 1 Cloud platform, server can be regarded as the terminal device in Fig. 1, or, client can be regarded as the cloud platform in Fig. 1, server can The gateway device being interpreted as in Fig. 1, or, client can be regarded as the gateway device in Fig. 1, server can be regarded as in Fig. 1 Cloud platform, or, client can be regarded as the gateway device in Fig. 1, server can be regarded as the sub- equipment in Fig. 1, or, client The sub- equipment in Fig. 1 is can be regarded as, server can be regarded as the gateway device in Fig. 1.
Refer to Fig. 2, the method that one embodiment of the invention provides server response request message in a kind of communication system should The process description of method is as follows.
S21, user end to server send request message, and server receives request message.
S22, server obtain the first effective time information for request message.
Wherein, the first effective time information is used to indicate first effective initial time and first effective end time, and first Effective initial time is the time that defined server begins to respond to request message, and first effective end time was defined service Device terminates the time of response request message.That is, the first effective time information define response request message it is effective when Between, server needs to carry out response request message according to the effective time, just can guarantee that request message is to respond according to the rules in this way, So that request message plays due effect, the message of server response failure is also avoided.
The content that the embodiment of the present invention includes for the first effective time information is not restricted.Such as first effective time letter Breath includes first effective initial time and first effective end time, i.e. the first effective time information includes just believing at two moment Breath, is first effective initial time and first effective end time respectively, then server obtains the first effective time information and is exactly First effective initial time and first effective end time are obtained.Alternatively, the first effective time information includes first effective Begin time and the first effective time, and the first effective time is the duration of defined response request message.So, server obtains First effective initial time can be directly obtained after one effective time information, then by first effective initial time and the first effective time Summation, just obtained for first effective end time.Alternatively, the first effective time information includes first effective end time and first Effective time, the first effective time are the duration of defined response request message.So, server obtains the first effective time letter It can directly obtain for first effective end time after breath, then the first effective time is subtracted with first effective end time, just obtain First effective initial time.
In embodiments of the present invention, server can obtain the first effective time information by different modes, carry out below It introduces.
First way carries the first effective time information in request message, then server passes through analysis request message It is obtained with the first effective time information.
In this fashion, it can voluntarily determine that the first effective time information, that is, client are being sent by client The effective time information of request message is voluntarily determined when request message.In general, client is all purposefully to send request Message, then client also just will be apparent that when request message should start to execute and when should execute It finishes, therefore voluntarily determines that effective time information more tallies with the actual situation, and realizes more convenient by client.
The second way, in mark of the server according to the type of request message, the content of request message and client At least one factor determine the first effective time information.Wherein, the mark of client may include the identification of client At least one of the address of number (ID) and client is also possible that other letters for the unique mark client certainly Breath.
In this fashion, server can prestore the type of request message, the content of request message and client Mapping relations between at least one of the mark at end factor and effective time information, to according to request message and this reflect The relationship of penetrating is assured that the first effective time information.Such as server has prestored content and the effective time of request message Mapping relations between information directly inquire the request in the mapping relations and disappear then after server receives the request message The content of breath corresponds to effective temporal information, the content corresponding effective time of the request message stored in the mapping relations Information is exactly the first effective time information.
In addition in this fashion, effective time information is also required to effective initial time of instruction request message, and services Device is actually not know when receive the request message, then can be used such as under type:First effective time information includes First interval and the second interval, the first interval are used to indicate that server receives the time of the request message and server starts to execute The difference of the time of the request message, the second interval are used to indicate that server receives the time of the request message and server terminates to hold The difference of the time of the row request message or the second interval are used to indicate the effective time of the request message, that is, respond the request and disappear The duration of breath, then server just can determine that first effective initial time according to the first interval, according to the second interval and/or first Interval just can determine that for first effective end time.
For example, for the higher client of some priority, then these clients corresponding effective time in mapping relations Effective initial time of information and these clients corresponding during the time difference between effective end time is smaller or mapping relations One interval can be shorter, to ensure that the request message that these clients are sent can be rapidly performed in time.Or for one The type of message or message content more demanding to time delay a bit, then these type of messages or message content are corresponding in mapping relations Effective initial time of effective time information and these message classes during the time difference between effective end time is smaller or mapping relations Type or corresponding first interval of message content can be shorter, to ensure that these request messages can be rapidly performed in time.
In this way, effective time information is determined by server, alleviates the burden of client, especially for For the incomplete client of some functions, request message only need to be sent, reduces the requirement to client so that this The application of inventive embodiments is more extensive.
But the if request message that the time delay of system is bigger or client is sent quilt before reaching server Malicious intercepted, then server may have been subjected to the time that the request message should be responded after receiving request message, and ask Message itself has time limit requirement again, it is clear that such case is just no longer desirable for the second way.Therefore the second way is more The higher situation of reliability of the situation or system smaller suitable for Time Delay of Systems.As it can be seen that the effect of the second way is more It is to be embodied in server to take different request messages different time responses, is equivalent to and different request messages is adopted Different processing modes is taken, the hierarchy for embodying different request messages, the message that more gives top priority to what is the most important or key customer end are contributed to Advantage.
In short, for both the above mode, system may be selected to use, and the embodiment of the present invention is not restricted.
S23, server determine the response policy to request message.
S24, server are according to the response policy and the first effective time information process request message.
In the embodiment of the present invention, the first effective time letter is carried in the request message that client is sent to server Breath, server are assured that first effective initial time and first of response request message has according to the first effective time information Imitate the end time, that is, it is determined that when response request message.So, if the current time is not first effective Between information defined time, then server obviously will not response request message, that is to say, that the service in the embodiment of the present invention Device can identify whether the message of reception is effective, to respond the message of failure, reduce security risk, improve entire The safety of system.
As for having which response policy and server actually for request message, how according to response strategy is asked to handle Message is sought, will be introduced in next embodiment.
Refer to Fig. 3, the method that one embodiment of the invention provides server response request message in a kind of communication system should The process description of method is as follows.
S31, server determine the response policy to request message for response policy on time.
Wherein, S31 can be understood as the thinning process to S22.Wherein, on time response policy can be regarded as server need to be by The strategy responded according to the effective time information that request message carries.
S32, server are according to response policy on time and the first effective time information process request message.
Server identifies the current time after receiving request message, then according to response policy on time, effectively believes first Then the processing mode of request message would also vary from when ceasing different.
In possible embodiment, server is according to response policy on time and the first effective time information process request Message, a kind of processing mode are:
S3201, it is serviced according to response policy on time if the current time was located at after first effective end time Device abandons request message.
Wherein, if the current time was located at after first effective end time, show response request message it is effective when Between have been subjected to, request message is exactly failed request message at this time, if server response request message will exist peace Full hidden danger, therefore in the embodiment of the present invention, server can abandon request message, to improve safety.
After server abandons request message, server can send response message to client, which uses It has been dropped in instruction request message.Time offset value is also carried in the response message, which is first effective Difference between initial time and the time of server processing requests message, that is, first effective initial time are lost with server Difference between the time for abandoning request message.Client can be arranged according to the time offset value that the response message of reception carries The effective time information that subsequent request message carries.For example, if request message is always delayed by, illustrates that system exists and prolong Slow situation, client can average the time offset value received in some cycles, and be set according to the average value acquired Set the effective time information that subsequent request message carries.Wherein, it is proposed that the sound of the effective time information instruction of client setting The effective time of request message is answered to be less than the average value.
In possible embodiment, server is according to response policy on time and the first effective time information process request Message, another processing mode are:If the current time was located at before first effective end time, server respond request Message.And according to response policy on time, several response modes of server in this case are described below.
A, wait-for-response mode.
Under this mode, S32 is refined as follows:
S3202, startup of server first timer, when the timing duration of first timer reaches, server response is asked Seek message.
Wherein, server identifies the current time after receiving request message, is effectively risen if the current time is located at first Begin before the time, show as defined in begin to respond to request message it's not time yet, then according to response policy on time, server is also It is unable to response request message.So server just starts timer, which is known as first timer, in terms of in timer When the time reach when response request message.
In embodiments of the present invention, the timing duration of first timer be greater than or equal to first effective initial time with it is current Time between difference, and less than or equal to difference between first effective end time and current time, such ability Ensure server can in the time range indicated by the first effective time information response request message.Preferably, first is fixed When device timing duration be equal to first effective initial time and the difference between the current time so that server can be first Effective initial time begins to respond to request message.
In addition, request message addition other than starting timer, is also waited for response queue by server, wait for that response queue uses In the message of storage waiting for server response.In this case, server can also send response message, the sound to client It answers message to be used to indicate request message and be added and waits for response queue.
After server response request message, server can also send response message, the response message to client It is just used to indicate request message and has responded and finish.Time offset value is also carried in the response message, which is the One effective initial time and the difference between the time of server processing requests message, that is, first effective initial time and clothes Difference between the time for device response request message of being engaged in.The time offset value that client can be carried according to the response message of reception The effective time information that subsequent request message carries is arranged.
For example, if time offset value is smaller, show that the effective time information of client setting is relatively reasonable, then it is subsequent The effective time information that request message carries can continue to be arranged according to effective time information before.If time offset value compared with Greatly, show that system has delay situation, then client can reset the effective time model that subsequent request message carries It encloses, such as the effective time of response request message can be extended, or effective initial time of response request message can be delayed, To ensure that request message can be by normal response.
B, directly in response to mode.
Under this mode, S32 is refined as follows:
If S3203, current time time consistent or current with first effective initial time are located at the first effectively starting After time and before first effective end time, then server response request message.
That is, if the current time have been positioned at as defined in response request message effective time within the scope of, that Server is just directly in response to request message.
Likewise, after server response request message, server can send response message, the response to client Message, which is used to indicate request message and has responded, to be finished.Time offset value is also carried in the response message, which is First effective initial time and the difference between the time of server processing requests message, that is, first effective initial time with Difference between the time of server response request message.The time that client can equally be carried according to the response message of reception Deviant is arranged the effective time information that subsequent request message carries, and seldom repeats.
It describes in front, in the prior art, message may be delayed by or block, and server may respond disappearing for failure Breath, leads to security risk.Therefore in the embodiment of the present invention server can with it is determined that when response request message, if worked as The preceding time is not the time of the first effective time information defined, then server will not response request message, that is to say, that this Server in inventive embodiments can identify whether the message of reception is effective, to respond the message of failure, reduce Security risk improves the safety of whole system.
In addition to this, in the prior art, it is also possible to there is a situation where that message is out of order.For example, client first backward service Device sends two PUT message, and all by intermediate equipment malicious intercepted, which disappears the two PUT message in two PUT of interception After breath, second PUT message is first sent to server, server can be sent out after responding second PUT message to client It send response message, intermediate equipment to continue to intercept the response message, first PUT message is sent to server again later, then is taken Business device responds first PUT message again, that is to say, that server is not responded according to the sequence of PUT message.So, If the two PUT message, which are the execution sequences to server, strict demand, such as it is system that the two PUT message are corresponding First latter two action of dynamic device, cannot be out of order, then server first carries out second PUT message executes first PUT message again, It has resulted in out of order, has equally existed security risk.
In order to solve the technical problem, the embodiment of the present invention proposes, request message can carry sequence number, server according to Sequence number can identify that the sequence of request message, i.e. request message can carry sequence number.So, S22 can be refined as:If ask The sequence number that the request message that the sequence number that message carries is sent with the client that server the last time receives carries is asked not connect It is continuous, and the sequence number that request message carries is more than the sequence that the request message that the client that server the last time receives is sent carries Row number, then server determines response policy as " seizing response policy ", " ordinal response strategy " or " sequence simultaneously abandons response plan Slightly ".
Wherein, so-called to seize response policy, it is exactly request message of the server directly in response to reception, if follow-up connect again Request message of the serial number bit before the sequence number that the request message responded carries is received, then server is abandoned follow-up and connect The request message of receipts avoids out of order.So-called ordinal response strategy is exactly that server must be according to the sequence indicated by sequence number Response request message.So-called sequence simultaneously abandons response policy, if being exactly that server first has received the larger request of sequence number Message, then server wouldn't respond, continue waiting for receiving the smaller request message of sequence number.Server is described in detail below how Request message is handled according to different response policies.
Fig. 4 is referred to, server determines that response policy is to seize response policy..
S41, server are according to seizing response policy and first effective time information response's request message.
Wherein, S41 can be regarded as the refinement to S23.
In the case where seizing response policy, after server receives request message, even if the sequence number of request message carrying and service The sequence number that the request message that the client that device the last time receives is sent carries is discontinuous, and the sequence that request message carries Number be more than server the last time receive the client send request message carry sequence number, server also directly in response to Request message.The request message of reception can more be responded in time in this way.
Certainly, request message carries the first effective time information, server also need according to the first effective time information come Response request message.Specific server how according to the first effective time information come response request message, can refer to shown in Fig. 2 Embodiment and embodiment shown in Fig. 3 introduction, seldom repeat.
After response request message, server is also possible to receive subsequent request message, that is, should be in request message The processing mode of server is described below in the request message responded before.
S42, user end to server send subsequent request message, then server receives subsequent request message.Wherein, subsequently Request message also carries sequence number, at this point, the sequence number that carries of sequence number and request message that subsequent request message carries can be with It continuously, can not also be continuous.
If the sequence number that S43, subsequent request message carry is less than the sequence number that request message carries, after server abandons Continuous request message.
That is, server has first responded the larger request message of sequence number, if it is smaller to have received sequence number again Message, in order to avoid out of order, then the smaller request message of server no longer response sequence number.
Certainly, server can send response message after abandoning subsequent request message to client, to inform client, after Continuous request message has been dropped, and time offset value can be also carried in the response message, can refer to as preceding about this partial content Related introduction seldom repeats.
Wherein, S42 and S43 can not necessarily be executed, that is to say, that can not necessarily be connect after server response request message Receive subsequent request message.Here it only says, if server has received, so that it may in such a way that S42 and S43 are provided Reason.
Fig. 5 is referred to, server determines that response policy is ordinal response strategy.Wherein, understand to be more convenient for, by Fig. 5 It is depicted as common flowchart schema.
S51, server are not responding to request message, and wait subsequent request message to be received according to ordinal response strategy.Its In, sequence number and the request message carrying of the client transmission of server the last time reception that subsequent request message carries Sequence number is continuous.
Wherein, S51 can be regarded as the refinement to S23.
Ordinal response policy definition server will carry out response request message according to the sequence indicated by sequence number, therefore service If device receives the sequence number of identification request message after request message, determine that the sequence number of request message carrying and server are nearest The sequence number that the request message that the client once received is sent carries is discontinuous, and the sequence number that request message carries is more than Server the last time receive the client send request message carry sequence number, then server be first not responding to request disappear Breath.Such as request message addition is waited for response queue by server, and wait subsequent request message to be received.In this case, it takes Device of being engaged in can also send response message to client, which, which be used to indicate request message and be added, waits for response queue.
S52, server receive the subsequent request message of client transmission.Wherein, subsequent request message carries second and has Temporal information is imitated, the second effective time information is used to indicate second effective initial time and second effective end time, and second has Effect initial time is the defined time for beginning to respond to subsequent request message, and second effective end time responded for defined end The time of subsequent request message.
This is the case where server has received subsequent request message before first effective end time reached.
It is noted that in general server is for the response of different messages sequence is to be directed to the same client , that is, whether sequence number is continuous, is therefore the embodiment of the present invention for the request message that the same client is sent In a plurality of request message be all that same client is sent.
If S53, current time were located at before second effective end time, server responds subsequent request message.
Wherein, if the current time was located at before second effective end time, server is directly in response to subsequently asking It asks message that subsequent request message addition is first still waited for response queue, whether is located at second effective initial time with the current time Before related, the description about as described in can refer to preceding for server response request message this partial content seldom repeats.
Further include following step after server responds subsequent request message:
If S54, current time were located at before first effective end time, server response request message.
Certainly, request message carries the first effective time information, server also need according to the first effective time information come Response request message.Specific server how according to the first effective time information come response request message, can refer to shown in Fig. 2 Embodiment and embodiment shown in Fig. 3 introduction, seldom repeat.
S55 or, if the current time be located at after first effective end time, server abandon request message.
If the current time was located at after first effective end time, show that request message has failed, then server is straight Connect discarding request message.
The case where previously described is before being located at for second effective end time the current time, is described below S56:If working as The preceding time was located at after second effective end time, then server abandons subsequent request message.
If the current time was located at after second effective end time, shows that subsequent request message has failed, then service Device directly abandons subsequent request message.
S57, server abandon request message.
S57 is to connect S56, that is to say, that under ordinal response strategy, if server has abandoned subsequent request and disappeared Breath, then server must also abandon request message, otherwise will result in the out of order of response.
What S52-S57 was introduced is all that server has received subsequent request message before first effective end time reached S58 is described below in situation:If server does not receive subsequent request message, server when reaching first effective end time Abandon request message.
S58 is to connect S51, that is to say, that under ordinal response pattern, it is necessary to be rung according to the sequence of sequence number instruction It answers, if server is not received by the subsequent request message that first respond, server just abandons request message, that is, It would rather be not responding to, out of order response will not be carried out.
Fig. 6 is referred to, server determines that response policy is sequence and abandons response policy.Wherein, understand to be more convenient for, Fig. 6 is depicted as to common flowchart schema.
S61, server according to sequence and abandon response policy, are not responding to request message, and subsequent request to be received is waited to disappear Breath.Wherein, the request message that the sequence number that subsequent request message carries is sent with the client that server the last time receives The sequence number of carrying is continuous.
Wherein, S61 can be regarded as the refinement to S23.
Sequence simultaneously abandons response policy predetermined server preferentially selection according to the sequence indicated by sequence number carrys out respond request Message, if therefore server receive request message after identify request message sequence number, determine request message carry sequence Number sequence number carried with the request message that the client that server the last time receives is sent is discontinuous, and request message is taken The sequence number of band is more than the sequence number that the request message that the client that server the last time receives is sent carries, then server First it is not responding to request message.Such as request message addition is waited for response queue by server, and wait subsequent request message to be received. In this case, server can also send response message to client, which is used to indicate request message and has been added Wait for response queue.
S62, server receive subsequent request message.Wherein, the second effective time information of subsequent request message carrying, second Effective time information is used to indicate second effective initial time and second effective end time, and second effective initial time is regulation The time for beginning to respond to subsequent request message, second effective end time be it is defined terminate respond subsequent request message when Between.
This is the case where server has received subsequent request message before first effective end time reached.
If S63, current time were located at before second effective end time, server responds subsequent request message.
Wherein, if the current time was located at before second effective end time, server is directly in response to subsequently asking It asks message that subsequent request message addition is first still waited for response queue, whether is located at second effective initial time with the current time Before related, the description about as described in can refer to preceding for server response request message this partial content seldom repeats.
Further include following step after server responds subsequent request message:
If S64, current time were located at before first effective end time, server response request message.
Certainly, request message carries the first effective time information, server also need according to the first effective time information come Response request message.Specific server how according to the first effective time information come response request message, can refer to shown in Fig. 2 Embodiment and embodiment shown in Fig. 3 introduction, seldom repeat.
S65 or, if the current time be located at after first effective end time, server abandon request message.
If the current time was located at after first effective end time, show that request message has failed, then server is straight Connect discarding request message.
The case where previously described is before being located at for second effective end time the current time, is described below S66:If working as The preceding time was located at after second effective end time, then server abandons subsequent request message.
If the current time was located at after second effective end time, shows that subsequent request message has failed, then service Device directly abandons subsequent request message.
If S67, current time were located at before first effective end time, server response request message.
S67 is to connect S66, that is to say, that in sequence and under abandoning response policy, server is preferentially according to sequence number Indicated sequence is responded, but in the case where that can not be responded according to the sequence indicated by sequence number, server meeting Selection is responded according to the sequencing for receiving message.So, if server has abandoned subsequent request message, being exactly can not be again It is responded according to the sequence of sequence number instruction, then server can select to respond according to the sequencing for receiving message, also It is that server can Response to selection request message.
Certainly, request message carries the first effective time information, server also need according to the first effective time information come Response request message.Specific server how according to the first effective time information come response request message, can refer to shown in Fig. 2 Embodiment and embodiment shown in Fig. 3 introduction, seldom repeat.
What S62-S67 was introduced is all that server has received subsequent request message before first effective end time reached S68 is described below in situation:If server does not receive subsequent request message when reaching first effective end time, if currently Time be located at before first effective end time, server response request message.
S68 is to connect S61, that is, likewise, the case where can not be responded according to the sequence indicated by sequence number Under, server can select to respond according to the sequencing for receiving message.Disappear if server can not receive subsequent request Breath, then server can select processing request message.When handling request message, be naturally according to the first effective time information into Row processing, seldom repeats.
After S68, that is, after server response request message, it is also possible to including following step:
S69, server receive subsequent request message.
S70, server abandon subsequent request message.
That is, after server elder generation response request message, server has received subsequent request message again.This In the case of, in order to avoid out of order, then server just abandons subsequent request message, is no longer responded.
According to introduction as above it is found that if requiring the execution for having comparison stringent suitable the request message that client is sent Sequence must be executed according to the sequence indicated by sequence number, or if will not according to the sequence execution indicated by sequence number Certain adverse consequences are caused, then server may be selected by ordinal response strategy, can avoid Out-of-order execution in this way Caused adverse consequences.And if the request message sent to client does not require the stringent sequence that executes, server It may be selected by seizing response policy or sequence and abandon response policy, received request message can be responded as possible.Its In, sequence and to abandon response policy again more stronger than seizing the succession of response policy, server can also root when selecting It is selected according to different actual conditions.
The scheme provided through the embodiment of the present invention, the sequence number that server is carried according to request message just can recognize that and ask The sequence for seeking message avoids out of order sound in the case where that out of order response should not occur as possible to select suitable response policy It answers, reduces the security problems being likely to occur, improve the reliability of system.
Fig. 7 is referred to, is based on same inventive concept, one embodiment of the invention provides a kind of server, which can be with Including processor 701 and receiver 702.
Wherein, processor 701 may include central processing unit (CPU) or application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), may include one or more integrated electricity for controlling program execution Road may include the hardware of use site programmable gate array (Field Programmable Gate Array, FPGA) exploitation Circuit may include baseband chip.
In possible embodiment, which can also include memory 703, show together in the figure 7, because depositing Reservoir 703 is not essential device, therefore is depicted as the form of dotted line frame in the figure 7, to be distinguished with essential device.Memory 703 quantity can be one or more.Memory 703 may include read-only memory (Read Only Memory, ROM), Random access memory (Random Access Memory, RAM) and magnetic disk storage, etc..Memory 703 can be used for depositing The program code that processor 701 executes required by task is stored up, storage data are can be also used for.
Wherein, receiver 702 is used to receive the request message of client transmission.Processor 701 is used for:Acquisition is asked for this The first effective time information of message, the first effective time information is asked to be used to indicate first effective initial time and first effective knot Beam time, first effective initial time are the defined time for beginning to respond to request message, and first effective end time was regulation End response request message time;It determines the response policy to request message, and is had according to the response policy and first It imitates temporal information and handles request message.
In possible embodiment, processor 701 is used to determine the response policy to request message, including:Determining pair The response policy of request message is response policy on time.Processor 701 was used for according to the response policy and the first effective time Information process request message, including:According to response policy on time, if the current time was located at before first effective end time, Then response request message.
In possible embodiment, processor 701 is used for according to response policy on time, if the current time is located at first Before effective end time, then response request message, including:If the current time was located at before first effective end time, According in response policy on time wait-for-response mode or directly in response to mode response request message.
In possible embodiment, if processor 701 is located at for the current time before first effective end time, Then according to the wait-for-response mode response request message in response policy on time, including:If the current time is located at first effectively Before initial time, then start first timer, when the timing duration of first timer reaches, response request message.First The timing duration of timer is greater than or equal to first effective initial time and the difference between the current time, and is less than or equal to Difference between first effective end time and current time.
In possible embodiment, if processor 701 is located at for the current time before first effective end time, Then according in response policy on time directly in response to mode response request message, including:If the current time effectively rises with first Beginning time consistency or current time are located at after first effective initial time and before first effective end time, then ring Answer request message.
In possible embodiment, processor 701 is used at according to the response policy and the first effective time information Request message is managed, further includes:It is lost according to response policy on time if the current time was located at after first effective end time Abandon request message.
In possible embodiment, which can also include transmitter 704, show together in the figure 7, because Transmitter 704 is not essential device, therefore is depicted as the form of dotted line frame in the figure 7, to be distinguished with essential device.Transmitter 704 may belong to radio frequency system, for external equipment carry out network communication, such as can by Ethernet, wireless access network, The networks such as WLAN are communicated with external equipment.
In the embodiment of the present invention, transmitter 704 is used to send response message to client, and response message is used to indicate request Message, which has responded, to be finished, or is used to indicate request message and has been added and wait for response queue, or is stated request message for referring to and be dropped. Wherein, if response message is used to indicate request message and has responded completion or be used to indicate request message and be dropped, response disappears Breath also carries time offset value, and time offset value is for first effective initial time and between the time of server processing requests message Difference.
In possible embodiment, request message also carries sequence number.So, processor 701 is for determining to request The response policy of message, including:If the sequence number that request message carries is sent with the client that server the last time receives Request message carry sequence number it is discontinuous, and request message carry sequence number be more than server the last time receive should Client send request message carry sequence number, it is determined that response policy be seize response policy, ordinal response strategy or Sequence simultaneously abandons response policy.
In possible embodiment, if processor 701 determines that response policy is to seize response policy, processor 701 For according to the response policy and the first effective time information process request message, including:According to seize response policy and First effective time information response's request message.Processor 701 is additionally operable to:After response request message, if passing through receiver The sequence number that 702 subsequent request messages received carry is less than the sequence number that request message carries, then abandons the subsequent request Message.
In possible embodiment, if processor 701 determines that response policy is ordinal response strategy or sequence and abandons Response policy, then processor 701 be used for according to the response policy and the first effective time information process request message, including: According to ordinal response strategy or sequence and response policy is abandoned, is not responding to request message, and waits subsequent request message to be received.Afterwards The sequence that the request message that the sequence number that continuous request message carries is sent with the client that server the last time receives carries It is number continuous.
In possible embodiment, receiver 702 is additionally operable to receive subsequent request message, and subsequent request message carries the Two effective time information.Second effective time information is used to indicate second effective initial time and second effective end time, the Two effective initial times are the defined time for beginning to respond to subsequent request message, and second effective end time was defined end Respond the time of subsequent request message.If processor 701 is additionally operable to the current time and is located at before second effective end time, Respond subsequent request message.
In possible embodiment, processor 701 is additionally operable to:After responding subsequent request message, if when current Between be located at before first effective end time, then response request message;Or, after responding subsequent request message, if current Time was located at after first effective end time, then abandoned request message.
In possible embodiment, processor 701 is additionally operable to:If the current time be located at second effective end time it Afterwards, then subsequent request message is abandoned.
In possible embodiment, processor 701 is additionally operable to:If it is determined that response policy is ordinal response strategy, and work as The preceding time was located at after second effective end time, then abandoned request message;Or, if it is determined that response policy is sequence and abandons Response policy, and the current time be located at after second effective end time, then, if the current time effectively terminates positioned at first Before time, response request message.
In possible embodiment, processor 701 is additionally operable to:If it is determined that response policy is ordinal response strategy, and Server does not receive subsequent request message when first effective end time reached, then abandons the request message;Or, if it is determined that response Strategy is sequence and abandons response policy, and server does not receive subsequent request message when reaching first effective end time, Then, if the current time was located at before first effective end time, the request message is responded.
In possible embodiment, receiver 702 is additionally operable to:After 701 response request message of processor, receiving should Subsequent request message.Processor 701 is additionally operable to:Abandon the subsequent request message.
In possible embodiment, processor 701 is used to obtain the first effective time information for request message, packet It includes:Obtain the first effective time information that request message carries;Or, according to the type of request message, the content of request message, with And at least one of mark of client factor determines the first effective time information.
Wherein, receiver 702, memory 703 and transmitter 704 can be connected by bus 700 with processor 701 (Fig. 7 is as example), or can also be connect with processor 701 by special connecting line.
By being designed programming to processor 701, will be aforementioned shown in code corresponding to method be cured in chip, To make chip be able to carry out at runtime in previous embodiment shown in method.How volume is designed to processor 701 Journey technology known to those skilled in the art, which is not described herein again.
The server can be used for executing any one reality in above-mentioned embodiment-shown in Fig. 2 embodiment shown in fig. 6 Apply the method that example is provided, e.g. foregoing server.Therefore, each functional unit in the server is realized Function etc., can refer to the description such as front method part, seldom repeat.
Fig. 8 is referred to, is based on same inventive concept, one embodiment of the invention provides a kind of server, which can be with Including processing unit 801 and receiving unit 802.
Wherein, receiving unit 802 is used to receive the request message of client transmission.Processing unit 801 is used for:It is directed to First effective time information of the request message, the first effective time information are used to indicate first effective initial time and first have It imitates the end time, first effective initial time is the defined time for beginning to respond to the request message, first effective end time For the defined time for terminating to respond the request message;Determine to the response policy of request message, and according to the response policy with And the first effective time information processing request message.
In possible embodiment, processing unit 801 is used to determine the response policy to request message, including:It determines The response policy is response policy on time.Processing unit 801 is for strategy and the information processing of the first effective time according to response Request message, including:According to response policy on time, if the current time was located at before first effective end time, response should Request message.
In possible embodiment, processing unit 801 is used for according to response policy on time, if the current time is located at the Before one effective end time, then response request message, including:If the current time was located at before first effective end time, Then according in response policy on time wait-for-response mode or respond the request message directly in response to mode.
In possible embodiment, if processing unit 801 for the current time be located at first effective end time it Before, then the request message is responded according to the wait-for-response mode in response policy on time, including:If the current time is located at first Before effective initial time, then start first timer, when the timing duration of first timer reaches, responds the request and disappear Breath.The timing duration of first timer is greater than or equal to first effective initial time and the difference between the current time, and small In or equal to difference between first effective end time and current time.
In possible embodiment, if processing unit 801 for the current time be located at first effective end time it Before, then the request message is responded directly in response to mode according in response policy on time, including:If the current time has with first The effect initial time consistent or current time is located at after first effective initial time and before first effective end time, Then respond the request message.
In possible embodiment, processing unit 801 is used at strategy according to response and the first effective time information Request message is managed, further includes:It is lost according to response policy on time if the current time was located at after first effective end time Abandon request message.
In possible embodiment, which can also include transmission unit 803, show together in fig. 8, because It is not essential device for transmission unit 803, therefore is depicted as the form of dotted line frame in fig. 8, is distinguished with essential device.
In the embodiment of the present invention, transmission unit 803 is used to send response message to client, and response message, which is used to indicate, asks It asks message to respond to finish, or is used to indicate request message and has been added and wait for response queue, or state request message for referring to and lost It abandons.Wherein, it if response message is used to indicate request message and has responded completion or be used to indicate request message and be dropped, responds Message also carries time offset value, time offset value be first effective initial time with the time of server processing requests message it Between difference.
In possible embodiment, request message also carries sequence number.So, processing unit 801 is for determining to asking The response policy of message is sought, including:If the sequence number that request message carries is sent out with the client that server the last time receives The sequence number that the request message sent carries is discontinuous, and the sequence number that request message carries is more than what server the last time received The client send request message carry sequence number, it is determined that response policy be seize response policy, ordinal response strategy, Or sequence and abandon response policy.
In possible embodiment, if processing unit 801 determines that response policy is to seize response policy, processing is single Member 801 is used for strategy and the first effective time information process request message according to response, including:According to seize response policy with And the first effective time information response's request message.Processing unit 801 is additionally operable to:After responding the request message, if connecing It receives the sequence number that the subsequent request message that unit 802 receives carries and is less than the sequence number that the request message carries, then abandoning should Subsequent request message.
In possible embodiment, if processing unit 801 determines that response policy is ordinal response strategy or sequence and loses Response policy is abandoned, then processing unit 801 is for strategy and the first effective time information process request message according to response, packet It includes:According to ordinal response strategy or sequence and response policy is abandoned, is not responding to request message, and subsequent request to be received is waited to disappear Breath.What the request message that the sequence number that subsequent request message carries is sent with the client that server the last time receives carried Sequence number is continuous.
In possible embodiment, receiving unit 802 is additionally operable to receive subsequent request message, and subsequent request message carries Second effective time information.Second effective time information is used to indicate second effective initial time and second effective end time, Second effective initial time is the defined time for beginning to respond to subsequent request message, and second effective end time was defined knot Beam responds the time of subsequent request message.If processing unit 801 be additionally operable to the current time be located at second effective end time it Before, then respond subsequent request message.
In possible embodiment, processing unit 801 is additionally operable to:After responding subsequent request message, if current Time was located at before first effective end time, then response request message;Or, after responding subsequent request message, if currently Time be located at after first effective end time, then abandon request message.
In possible embodiment, processing unit 801 is additionally operable to:If the current time was located at for second effective end time Later, then subsequent request message is abandoned.
In possible embodiment, processing unit 801 is additionally operable to:If it is determined that response policy is ordinal response strategy, and The current time was located at after second effective end time, then abandoned request message;Or, if it is determined that response policy is sequence and loses Response policy is abandoned, and the current time was located at after second effective end time, then, is effectively tied if the current time is located at first Before the beam time, response request message.
In possible embodiment, processing unit 801 is additionally operable to:If it is determined that response policy is ordinal response strategy, and When reaching first effective end time, server does not receive subsequent request message, then abandons request message;Or, if it is determined that response Strategy is sequence and abandons response policy, and server does not receive subsequent request message when reaching first effective end time, Then, if the current time was located at before first effective end time, response request message.
In possible embodiment, receiving unit 802 is additionally operable to:After 801 response request message of processing unit, connect Receive subsequent request message.Processing unit 801 is additionally operable to:Abandon subsequent request message.
In possible embodiment, processing unit 801 is used to obtain the first effective time information for request message, Including:Obtain the first effective time information that request message carries;Or, according to the type of request message, the content of request message, And at least one of mark of client factor determines the first effective time information.
In practical applications, 802 corresponding entity device of receiving unit can be the receiver 702 in Fig. 7, processing unit 801 corresponding entity devices can be the processor 701 in Fig. 7, and 803 corresponding entity device of transmission unit can be in Fig. 7 Transmitter 704.
The server can be used for executing any one reality in above-mentioned embodiment-shown in Fig. 2 embodiment shown in fig. 6 Apply the method that example is provided, e.g. foregoing server.Therefore, each functional unit in the server is realized Function etc., can refer to the description such as front method part, seldom repeat.
Fig. 9 is referred to, is based on same inventive concept, one embodiment of the invention provides a kind of client, which can be with Including transmitter 901 and receiver 902.
Wherein, transmitter 901 is used to send request message to server, which carries the first effective time letter Breath.Wherein, the first effective time information is used to indicate first effective initial time and first effective end time, and first effectively rises Time beginning is the time that server begins to respond to request message, and first effective end time was that server terminates response request message Time.Receiver 902 is used to receive the response message of server transmission, and response message is used to indicate the request message and has responded It finishes, or is used to indicate the request message and has been added and wait for response queue, or be used to indicate the request message and be dropped.
In possible embodiment, which also carries sequence number.So, transmitter 901 is additionally operable to:To service Device sends subsequent request message, which carries sequence number.
In possible embodiment, which also carries the second effective time information.Second effective time Information is used to indicate second effective initial time and second effective end time, and second effective initial time starts to ring to be defined It answers the time of subsequent request message, second effective end time was the defined time for terminating to respond subsequent request message.
In possible embodiment, if response message is used to indicate the request message and has responded completion or be used to indicate this Request message has been dropped, then the response message also carries time offset value, time offset value be first effective initial time with Difference between the time of the server process request message.
In possible embodiment, which further includes processor 903.Processor 903 may include CPU or ASIC may include one or more integrated circuits for controlling program execution, may include the hardware using FPGA exploitations Circuit may include baseband chip.
In possible embodiment, which can also include memory 904, show together in fig.9, memory 904 quantity can be one or more.Memory 904 may include ROM, RAM and magnetic disk storage, etc..Memory 904 It can be used for storing the program code that processor 903 executes required by task, can be also used for storage data.
Wherein, because processor 903 and memory 904 are not essential devices, therefore it is depicted as the shape of dotted line frame in fig.9 Formula, to be distinguished with essential device.
The effective time information that processor 903 is used to be carried according to the request message that time offset value adjustment is sent later.
Wherein, receiver 902, memory 904 and transmitter 901 can be connected by bus 900 with processor 903 (Fig. 9 is as example), or can also be connect with processor 903 by special connecting line.
By being designed programming to processor 903, will be aforementioned shown in code corresponding to method be cured in chip, To make chip be able to carry out at runtime in previous embodiment shown in method.How volume is designed to processor 903 Journey technology known to those skilled in the art, which is not described herein again.
The client can be used for executing any one reality in above-mentioned embodiment-shown in Fig. 2 embodiment shown in fig. 6 Apply the method that example is provided, e.g. foregoing client.Therefore, each functional unit in the client is realized Function etc., can refer to the description such as front method part, seldom repeat.
Figure 10 is referred to, is based on same inventive concept, one embodiment of the invention provides a kind of client, which can be with Including transmission unit 1001 and receiving unit 1002.
Wherein, transmission unit 1001 is used to send request message to server, which carried for the first effective time Information.Wherein, the first effective time information is used to indicate first effective initial time and first effective end time, and first effectively Initial time is the time that server begins to respond to request message, and first effective end time terminated respond request for server and disappears The time of breath.Receiving unit 1002 is used to receive the response message of server transmission, and response message is used to indicate the request message It has responded and has finished, or be used to indicate the request message and be added and wait for response queue, or be used to indicate the request message and be dropped.
In possible embodiment, which also carries sequence number.So, transmission unit 1001 is additionally operable to clothes Business device sends subsequent request message, which carries sequence number.
In possible embodiment, subsequent request message also carries the second effective time information.Second effective time believed Breath is used to indicate second effective initial time and second effective end time, and second effective initial time is defined begins to respond to The time of subsequent request message, second effective end time are the defined time for terminating to respond subsequent request message.
In possible embodiment, if response message is used to indicate request message and has responded completion or be used to indicate request Message has been dropped, then response message also carries time offset value, and time offset value is first effective initial time and server Handle the difference between the time of request message.
In possible embodiment, which can also include processing unit 1003, show together in Fig. 10, Because processing unit 1003 is not essential device, therefore is depicted as the form of dotted line frame in Fig. 10, to carry out area with essential device Point.
Wherein, processing unit 1003 be used for according to the request message that sends later of time offset value adjustment carry it is effective when Between information.
In practical applications, 1002 corresponding entity device of receiving unit can be the receiver 902 in Fig. 9, and processing is single First 1003 corresponding entity devices can be the processor 903 in Fig. 9, and 1001 corresponding entity device of transmission unit can be figure Transmitter 901 in 9.
The client can be used for executing any one reality in above-mentioned embodiment-shown in Fig. 2 embodiment shown in fig. 6 Apply the method that example is provided, e.g. foregoing client.Therefore, each functional unit in the client is realized Function etc., can refer to the description such as front method part, seldom repeat.
In the embodiment of the present invention, after server receives the request message that client is sent, the request message pair can be obtained The the first effective time information answered, server are assured that the first of response request message has according to the first effective time information Imitate initial time and first effective end time, that is, it is determined that when response request message.So, if it is current Time is not the time of the first effective time information defined, then server obviously will not response request message, that is to say, that this Server in inventive embodiments can identify whether the message of reception is effective, to respond the message of failure, reduce Security risk improves the safety of whole system.
The embodiment of the present invention also provides a kind of computer storage media, wherein the computer storage media can be stored with journey Sequence, the program include the Overall Steps as performed by the server described in any one preceding embodiment of the method when executing.
The embodiment of the present invention also provides a kind of computer storage media, wherein the computer storage media can be stored with journey Sequence, the program include the Overall Steps as performed by the client described in any one preceding embodiment of the method when executing.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program production Product.Therefore, in terms of the embodiment of the present invention can be used complete hardware embodiment, complete software embodiment or combine software and hardware Embodiment form.Moreover, it wherein includes computer available programs generation that the embodiment of the present invention, which can be used in one or more, The meter implemented in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of code The form of calculation machine program product.
The embodiment of the present invention be with reference to according to the method for the embodiment of the present invention, equipment (system) and computer program product Flowchart and/or the block diagram describe.It should be understood that can be realized by computer program instructions in flowchart and/or the block diagram The combination of flow and/or box in each flow and/or block and flowchart and/or the block diagram.These calculating can be provided Processing of the machine program instruction to all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices Device is to generate a machine so that the instruction executed by computer or the processor of other programmable data processing devices generates For realizing the function of being specified in one flow of flow chart or multiple flows and/or one box of block diagram or multiple boxes Device.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a box or multiple boxes.
Obviously, those skilled in the art can carry out the embodiment of the present invention various modification and variations without departing from this Shen Spirit and scope please.In this way, if these modifications and variations of the embodiment of the present invention belong to the application claim and its wait Within the scope of technology, then the application is also intended to include these modifications and variations.

Claims (31)

1. a kind of method of server response request message in communication system, which is characterized in that including:
Server receives the request message that client is sent;
The server obtains the first effective time information for the request message;The first effective time information is used for Indicate that first effective initial time and first effective end time, first effective initial time begin to respond to institute for server The time of request message is stated, first effective end time is that server terminates to respond the time of the request message;
The server determines the response policy to the request message;
The server is according to request message described in the response policy and the first effective time information processing.
2. the method as described in claim 1, which is characterized in that
The server determines the response policy to the request message, including:
The server determines the response policy for response policy on time;
The server according to request message described in the response policy and the first effective time information processing, including:
The server is according to the response policy on time, if the current time was located at before described first effective end time, Then respond the request message.
3. method as claimed in claim 2, which is characterized in that the server is according to the response policy on time, if currently Time be located at before described first effective end time, then respond the request message, including:
If the current time was located at before described first effective end time, the server is according to the response policy on time In wait-for-response mode or respond the request message directly in response to mode.
4. method as claimed in claim 3, which is characterized in that if the current time be located at described first effective end time it Before, then the server responds the request message according to the wait-for-response mode in the response policy on time, including:
If the current time is located at before described first effective initial time, the startup of server first timer; The timing duration of the first timer was greater than or equal between described first effective initial time and the current time Difference, and less than or equal to the difference between described first effective end time and the current time;
When the timing duration of the first timer reaches, the server responds the request message.
5. method as claimed in claim 2, which is characterized in that if the current time be located at described first effective end time it Before, then the server responds the request message according in the response policy on time directly in response to mode, including:
If the current time is consistent with described first effective initial time or current time is located at described first has Initial time is imitated later and before first effective end time, then the server responds the request message.
6. method as claimed in claim 2, which is characterized in that the server is according to the response policy and described first Request message described in effective time information processing further includes:
The server is according to the response policy on time, if the current time was located at after described first effective end time, Then abandon the request message.
7. the method as described in claim 2-6 is any, which is characterized in that the method further includes:
The server sends response message to the client, and the response message is used to indicate the request message and has responded It finishes, or is used to indicate the request message and has been added and wait for response queue, or be used to indicate the request message and be dropped;Its In, it is lost if the response message is used to indicate the request message and has responded completion or be used to indicate the request message Abandon, then the response message also carries time offset value, the time offset value be described first effective initial time with it is described Difference between the time of request message described in server process.
8. the method as described in claim 1, which is characterized in that the request message also carries sequence number;The server is true The fixed response policy to the request message, including:
If the request that the sequence number that the request message carries is sent with the client that described server the last time receives The sequence number that message carries is discontinuous, and the sequence number that the request message carries is more than what described server the last time received The sequence number that the request message that the client is sent carries, then the server determine that the response policy is to seize response plan Summary, ordinal response strategy or sequence simultaneously abandon response policy.
9. method as claimed in claim 8, which is characterized in that if the server determines that the response policy is described seizes Response policy, then,
The server according to request message described in the response policy and the first effective time information processing, including:
The server seizes request message described in response policy and the first effective time information response according to;
After responding the request message, further include:
If the sequence number that the subsequent request message that the server receives carries is less than the sequence number that the request message carries, Then the server abandons the subsequent request message.
10. method as claimed in claim 8, which is characterized in that if the server determines that the response policy is described suitable Sequence response policy or the sequence simultaneously abandon response policy, then the server has according to the response policy and described first It imitates temporal information and handles the request message, including:
The server is according to the ordinal response strategy or the sequence and abandons response policy, is not responding to the request and disappears Breath, and wait subsequent request message to be received;The sequence number that the subsequent request message carries connects with described server the last time The sequence number that the request message that the client received is sent carries is continuous.
11. method as claimed in claim 10, which is characterized in that the method further includes:
The server receives the subsequent request message;The subsequent request message carries the second effective time information;It is described Second effective time information is used to indicate second effective initial time and second effective end time, described second effectively starting when Between for server begin to respond to time of the subsequent request message, second effective end time is that server terminates to respond The time of the subsequent request message;
If the current time was located at before described second effective end time, the server responds the subsequent request and disappears Breath.
12. method as claimed in claim 11, which is characterized in that the server respond the subsequent request message it Afterwards, further include:
If the current time was located at before described first effective end time, the server responds the request message;Or, If the current time was located at after described first effective end time, the server abandons the request message.
13. method as claimed in claim 11, which is characterized in that the method further includes:
If the current time was located at after described second effective end time, the server abandons the subsequent request and disappears Breath.
14. method as claimed in claim 13, which is characterized in that the method further includes:
If the server determines the response policy as the ordinal response strategy, and the current time is located at described second and has After imitating the end time, then the server abandons the request message;Or
If the server determines that the response policy is the sequence and abandons response policy, and the current time is positioned at described After second effective end time, then, if the current time was located at before described first effective end time, the server is rung Answer the request message.
15. method as claimed in claim 10, which is characterized in that the method further includes:
If the server determines that the response policy is the ordinal response strategy, and is arrived in described first effective end time Up to when the server do not receive the subsequent request message, then the server abandons the request message;Or
If the server determines that the response policy is the sequence and abandons response policy, and effectively terminates described first The server does not receive the subsequent request message when time arrival, then, is effectively tied if the current time is located at described first Before the beam time, the server responds the request message.
16. method as claimed in claim 15, which is characterized in that after the server responds the request message, also Including:
The server receives the subsequent request message;
The server abandons the subsequent request message.
17. the method as described in claim 1-16 is any, which is characterized in that the server, which obtains, is directed to the request message The first effective time information, including:
The server obtains the first effective time information that the request message carries;Or
The server is according to the type of the request message, the mark of the content of the request message and the client At least one of factor determine the first effective time information.
18. a kind of method for sending request message to server in communication system, which is characterized in that including:
User end to server sends request message, and the request message carries the first effective time information;Wherein, described first Effective time information is used to indicate first effective initial time and first effective end time, and first effective initial time is Server begins to respond to the time of the request message, and first effective end time is that server terminates to respond the request The time of message;
The client receives the response message that the server is sent, and the response message has been used to indicate the request message Response finishes, or is used to indicate the request message and has been added and wait for response queue, or is used to indicate the request message and is lost It abandons.
19. method as claimed in claim 18, which is characterized in that the request message also carries sequence number;The method is also Including:
The client sends subsequent request message to the server, and the subsequent request message carries sequence number.
20. method as claimed in claim 19, which is characterized in that the subsequent request message also carries the second effective time letter Breath;The second effective time information is used to indicate second effective initial time and second effective end time, and described second has Effect initial time is the defined time for beginning to respond to the subsequent request message, and second effective end time is defined Terminate the time of the response subsequent request message.
21. the method as described in claim 18-20 is any, which is characterized in that if the response message is used to indicate described ask It asks message to respond completion or be used to indicate the request message to be dropped, then the response message also carries time migration Value, the time offset value is between the time of request message described in described first effective initial time and the server process Difference.
22. method as claimed in claim 21, which is characterized in that the method further includes:
The effective time information that the client is carried according to the request message that time offset value adjustment is sent later.
23. a kind of server, which is characterized in that including:
Receiving unit, the request message for receiving client transmission;
Processing unit, for obtaining the first effective time information for the request message;The first effective time information It is used to indicate first effective initial time and first effective end time, first effective initial time is that server starts to ring It answers the time of the request message, first effective end time is that server terminates to respond the time of the request message; Determine the response policy to the request message;According to the response policy and the first effective time information processing Request message.
24. server as claimed in claim 23, which is characterized in that
The processing unit is used to determine the response policy to the request message, including:
Determine the response policy for response policy on time;
The processing unit is used for according to request message described in the response policy and the first effective time information processing, Including:
According to the response policy on time, if the current time was located at before described first effective end time, described in response Request message.
25. server as claimed in claim 24, which is characterized in that the processing unit is used to respond plan on time according to Slightly, if the current time was located at before described first effective end time, the request message is responded, including:
If the current time was located at before described first effective end time, according to the waiting sound in the response policy on time It answers mode or responds the request message directly in response to mode.
26. server as claimed in claim 25, which is characterized in that if the processing unit is located at institute for the current time Before stating for first effective end time, is then responded according to the wait-for-response mode in the response policy on time and described ask to disappear Breath, including:
If the current time is located at before described first effective initial time, start first timer;Described first is fixed When device timing duration be greater than or equal to difference between described first effective initial time and the current time, and be less than Or equal to the difference between described first effective end time and the current time;
When the timing duration of the first timer reaches, the request message is responded.
27. server as claimed in claim 24, which is characterized in that if the processing unit is located at institute for the current time Before stating for first effective end time, then described ask to disappear according to responding directly in response to mode in the response policy on time Breath, including:
If the current time is consistent with described first effective initial time or current time is located at described first has Initial time is imitated later and before first effective end time, then responds the request message.
28. server as claimed in claim 24, which is characterized in that the processing unit be used for according to the response policy with And request message described in the first effective time information processing, further include:
According to the response policy on time, if the current time was located at after described first effective end time, abandon described in Request message.
29. the server as described in claim 24-28 is any, which is characterized in that the server further includes transmission unit;
The transmission unit is used for:Response message is sent to the client, the response message is used to indicate the request and disappears Breath has been responded and has been finished, or is used to indicate the request message and has been added and wait for response queue, or is used to indicate the request message It is dropped;Wherein, disappear if the response message is used to indicate the request message and has responded completion or be used to indicate the request Breath has been dropped, then the response message also carries time offset value, when the time offset value is described first effective starting Between difference between the time of request message described in the server process.
30. server as claimed in claim 23, which is characterized in that the request message also carries sequence number;The processing Unit is used to determine the response policy to the request message, including:
If the request that the sequence number that the request message carries is sent with the client that described server the last time receives The sequence number that message carries is discontinuous, and the sequence number that the request message carries is more than what described server the last time received The sequence number that the request message that the client is sent carries, it is determined that the response policy is to seize response policy, sequence sound It answers strategy or sequence and abandons response policy.
31. a kind of client, which is characterized in that including:
Transmission unit, for sending request message to server, the request message carries the first effective time information;Wherein, The first effective time information is used to indicate first effective initial time and first effective end time, and described first effectively rises Time beginning is the time that server begins to respond to the request message, and first effective end time is that server terminates to respond The time of the request message;
Receiving unit, the response message sent for receiving the server, the response message are used to indicate the request and disappear Breath has been responded and has been finished, or is used to indicate the request message and has been added and wait for response queue, or is used to indicate the request message It is dropped.
CN201710114800.XA 2017-02-28 2017-02-28 Method and equipment for server to respond to request message in communication system Active CN108512820B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710114800.XA CN108512820B (en) 2017-02-28 2017-02-28 Method and equipment for server to respond to request message in communication system
CN202010657850.4A CN111953655B (en) 2017-02-28 2017-02-28 Method and equipment for server to respond to request message in communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710114800.XA CN108512820B (en) 2017-02-28 2017-02-28 Method and equipment for server to respond to request message in communication system

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202010657850.4A Division CN111953655B (en) 2017-02-28 2017-02-28 Method and equipment for server to respond to request message in communication system

Publications (2)

Publication Number Publication Date
CN108512820A true CN108512820A (en) 2018-09-07
CN108512820B CN108512820B (en) 2020-07-24

Family

ID=63374202

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202010657850.4A Active CN111953655B (en) 2017-02-28 2017-02-28 Method and equipment for server to respond to request message in communication system
CN201710114800.XA Active CN108512820B (en) 2017-02-28 2017-02-28 Method and equipment for server to respond to request message in communication system

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202010657850.4A Active CN111953655B (en) 2017-02-28 2017-02-28 Method and equipment for server to respond to request message in communication system

Country Status (1)

Country Link
CN (2) CN111953655B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110351334A (en) * 2019-05-31 2019-10-18 口碑(上海)信息技术有限公司 Service request processing and payment transaction request processing method and device
CN113032307A (en) * 2021-03-26 2021-06-25 山东英信计算机技术有限公司 Integrated device access request processing method and related assembly
CN113596002A (en) * 2021-07-20 2021-11-02 中国联合网络通信集团有限公司 Service providing method and device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612621A (en) * 2020-12-16 2021-04-06 京东数字科技控股股份有限公司 Data processing method and related equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1443424A (en) * 2000-07-21 2003-09-17 艾利森电话股份有限公司 Method and apparatus for enhanced short message service
CN101083582A (en) * 2007-06-22 2007-12-05 华中科技大学 Heterogeneous medical information integrated system based on HL7 agent server
CN101697504A (en) * 2009-09-08 2010-04-21 杭州华三通信技术有限公司 Method and device for improving data transmission quality
CN102833257A (en) * 2012-08-31 2012-12-19 北京小米科技有限责任公司 Operation request queuing method, associated equipment and system
CN103298064A (en) * 2012-03-02 2013-09-11 华为终端有限公司 Downlink data transmission method, related device and communication system
CN104580409A (en) * 2014-12-24 2015-04-29 广州酷狗计算机科技有限公司 Service request processing method, server and terminal
CN105430161A (en) * 2015-10-29 2016-03-23 小米科技有限责任公司 Message processing method and device
CN105611540A (en) * 2015-12-17 2016-05-25 深圳市金立通信设备有限公司 Channel detection control method and related equipment
CN106330665A (en) * 2015-06-30 2017-01-11 深圳市星电商科技有限公司 Information interaction processing method, terminal and system
CN106327200A (en) * 2015-06-30 2017-01-11 深圳市星电商科技有限公司 Information interaction processing method and terminal and system
CN106330664A (en) * 2015-06-30 2017-01-11 深圳市星电商科技有限公司 Information interaction processing method, system and terminal
CN106330835A (en) * 2015-06-30 2017-01-11 深圳市星电商科技有限公司 Information interaction processing method, system and terminal

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2363990B1 (en) * 2003-08-13 2018-03-07 Qualcomm Incorporated A signal interface for higher data rates
CA2731265A1 (en) * 2003-12-08 2005-06-23 Qualcomm Incorporated High data rate interface with improved link synchronization
CN101237331B (en) * 2007-12-27 2011-11-02 华为技术有限公司 CDR file generation method, transmission method, system and device
CN103368703B (en) * 2012-04-10 2016-08-17 华为技术有限公司 Data package retransmission method, data packet receiving method and device
CN102724207B (en) * 2012-06-28 2015-07-15 上海西本网络科技有限公司 Method and device for transmitting/processing service request, client end and service end
CN104301294B (en) * 2013-07-19 2017-11-21 中国移动通信集团广东有限公司 A kind of response method, device and the network side equipment of DNS query request
US9474069B2 (en) * 2013-10-09 2016-10-18 Qualcomm Incorporated Enabling a communication feasibility determination time to complete communication exchanges between an M2M server and one or more M2M devices
CN104917733A (en) * 2014-03-13 2015-09-16 张永杰 Time interval attribute recognition method and system
CN104065465B (en) * 2014-06-06 2018-03-16 华为技术有限公司 A kind of method of message retransmission, request end, responder and system
CN106034141B (en) * 2015-03-12 2019-07-23 华为技术有限公司 Message treatment method, resource acquiring method, server and terminal device
CN106330833A (en) * 2015-06-29 2017-01-11 中兴通讯股份有限公司 Communication method based on ICAP (Internet Content Adaptation Protocol), client and server

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1443424A (en) * 2000-07-21 2003-09-17 艾利森电话股份有限公司 Method and apparatus for enhanced short message service
CN101083582A (en) * 2007-06-22 2007-12-05 华中科技大学 Heterogeneous medical information integrated system based on HL7 agent server
CN101697504A (en) * 2009-09-08 2010-04-21 杭州华三通信技术有限公司 Method and device for improving data transmission quality
CN103298064A (en) * 2012-03-02 2013-09-11 华为终端有限公司 Downlink data transmission method, related device and communication system
CN102833257A (en) * 2012-08-31 2012-12-19 北京小米科技有限责任公司 Operation request queuing method, associated equipment and system
CN104580409A (en) * 2014-12-24 2015-04-29 广州酷狗计算机科技有限公司 Service request processing method, server and terminal
CN106330665A (en) * 2015-06-30 2017-01-11 深圳市星电商科技有限公司 Information interaction processing method, terminal and system
CN106327200A (en) * 2015-06-30 2017-01-11 深圳市星电商科技有限公司 Information interaction processing method and terminal and system
CN106330664A (en) * 2015-06-30 2017-01-11 深圳市星电商科技有限公司 Information interaction processing method, system and terminal
CN106330835A (en) * 2015-06-30 2017-01-11 深圳市星电商科技有限公司 Information interaction processing method, system and terminal
CN105430161A (en) * 2015-10-29 2016-03-23 小米科技有限责任公司 Message processing method and device
CN105611540A (en) * 2015-12-17 2016-05-25 深圳市金立通信设备有限公司 Channel detection control method and related equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110351334A (en) * 2019-05-31 2019-10-18 口碑(上海)信息技术有限公司 Service request processing and payment transaction request processing method and device
CN110351334B (en) * 2019-05-31 2021-12-24 口碑(上海)信息技术有限公司 Service request processing method and device and payment service request processing method and device
CN113032307A (en) * 2021-03-26 2021-06-25 山东英信计算机技术有限公司 Integrated device access request processing method and related assembly
CN113596002A (en) * 2021-07-20 2021-11-02 中国联合网络通信集团有限公司 Service providing method and device

Also Published As

Publication number Publication date
CN111953655A (en) 2020-11-17
CN108512820B (en) 2020-07-24
CN111953655B (en) 2023-03-10

Similar Documents

Publication Publication Date Title
CN108512820A (en) The method and apparatus of server response request message in a kind of communication system
CN100508489C (en) System and method for dynamic interface management
CN106060459B (en) A kind of protocol conversion system and its conversion method of video camera
TWI332330B (en) Quality of service differentiation in wireless networks
CN108989372A (en) Method, registration center and the equipment of service discovery
CN109617731A (en) Adaptive gateway role configuration method and device under a kind of multi-gateway environment
WO2017215614A1 (en) Method, device and system for realising heart beat keepalive
CN104158684B (en) Gateway device status tracking based on open type intelligent Networking Platform
CN105228126B (en) A kind of method and system of network access point trustship
CN106656911B (en) A kind of portal authentication method, access device and management server
CN106537841A (en) Resource and attribute management in machine to machine networks
EP2636182B1 (en) Method and network nodes that establish sessions using existing connections identified in a central database
CN103428666A (en) Charging method and device
CN104320272B (en) A kind of method and the network equipment of transmission equipment information
CN108667699A (en) Interconnected method and device between a kind of terminal device and gateway device
CN107615791A (en) Apparatus and method for adding M2M services
CN106302230B (en) A kind of data transmission method and device
CN109561054A (en) A kind of data transmission method, controller and access device
RU2668083C2 (en) Method for real-time charging, gateway and device for real-time charging
CN109743722A (en) It is connected to the network treating method and apparatus
CN107770754A (en) A kind of notice sending method, device and system
CN103442328A (en) Method and system for controlling quality of service of terminal of Internet of Things
CN103327490B (en) Outlet the Internet WIFI accesses system and method
CN105959292B (en) Recognition methods, management server and the system of equipment access right
CN107786680A (en) Method and apparatus for being managed to IP address resources

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220216

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technologies Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.