WO2021057808A1 - Method and apparatus for traffic control - Google Patents
Method and apparatus for traffic control Download PDFInfo
- Publication number
- WO2021057808A1 WO2021057808A1 PCT/CN2020/117212 CN2020117212W WO2021057808A1 WO 2021057808 A1 WO2021057808 A1 WO 2021057808A1 CN 2020117212 W CN2020117212 W CN 2020117212W WO 2021057808 A1 WO2021057808 A1 WO 2021057808A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- flow control
- message
- control strategy
- client
- server
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 121
- 238000004891 communication Methods 0.000 claims abstract description 48
- 238000011217 control strategy Methods 0.000 claims description 291
- 238000012545 processing Methods 0.000 claims description 69
- 238000005111 flow chemistry technique Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 description 45
- 230000015654 memory Effects 0.000 description 45
- 230000006870 function Effects 0.000 description 39
- 230000004044 response Effects 0.000 description 38
- 230000008569 process Effects 0.000 description 31
- 238000003860 storage Methods 0.000 description 18
- 238000010586 diagram Methods 0.000 description 16
- 238000007726 management method Methods 0.000 description 8
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000001360 synchronised effect Effects 0.000 description 5
- 238000013461 design Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000012795 verification Methods 0.000 description 3
- 230000003190 augmentative effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000001356 surgical procedure Methods 0.000 description 2
- 101150119040 Nsmf gene Proteins 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012508 change request Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
- H04L63/123—Applying verification of the received information received data contents, e.g. message integrity
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Definitions
- the embodiments of the present application relate to the field of communication technologies, and in particular, to a method and device for flow control.
- the client sends a service request message to the server to request service. Due to the limited traffic processing capability of the server (the number of service request messages that can be processed in a period of time), if the client sends a large number of service request messages to the server, which exceeds the traffic processing capability of the server, the server will be congested. In order to avoid congestion, the server can return a service unavailable response to the client for some service request messages.
- the client can use the following schemes for flow control to avoid congestion on the server: the client can receive the number of non-service unavailable responses (service request messages successfully processed by the server), and get it based on experience A scaling factor for discarding service request messages.
- the current flow control scheme it is easy to drop too many service request messages or insufficient service request messages.
- the embodiments of the present application provide a flow control method and device to solve the problem of unreasonable and inflexible current flow control methods.
- a method and device for flow control are provided.
- the execution subject of the method may be a server, and the server may receive a first message sent by a client, and the first message may be used to instruct the client Support flow control.
- the server may also send a second message for the first message to the client, the second message may include a first flow control policy, and the first flow control policy may be used to determine to allow the The first number of server request messages sent by the client to the server, where the first number is an integer greater than or equal to zero.
- the server can issue a flow control policy to the client to indicate the number of service request messages reported by the client. In this way, the client can reasonably discard the service request messages according to the instructions of the server, that is, send a reasonable number of service request messages to the server.
- the business data can be processed flexibly and reasonably between the client and the server.
- the first message sent by the client to the server may include the second flow control strategy being executed by the client, and the second flow control strategy may be used to determine the first flow control Strategy.
- the second flow control policy is used to determine a second number of service request messages that the client is allowed to send to the server, and the second number is an integer greater than or equal to 0.
- the client not only reports that it supports flow control, but also reports the second flow control strategy being executed, so that the server can determine the first flow control strategy in combination with the second flow control strategy, making the first flow control strategy formulated for the client more consistent
- the traffic processing capability of the server and the business requirements of the client are also reported.
- the server when the server receives the first message, if the server is in a congested state, the server may determine the first flow control strategy according to its own flow processing capability.
- the server can formulate the first flow control strategy for the client when it is not in a congested state, or when it is in a congested state, determine the first flow control strategy according to the current flow processing capability. Further, if the first message includes the second flow control strategy being executed by the client, the server can determine the first flow control strategy according to its own flow processing capability and the second flow control strategy.
- the server may also receive a fifth message from an upper-level server, the fifth message may include a third flow control strategy, and the third flow control strategy may be used to determine permission to The third number of service request messages sent by the server to the superior server, where the third number is an integer greater than or equal to 0. Further, the server may determine the first flow control strategy according to the local strategy of the server and the third flow control strategy. Furthermore, if the first message includes the second flow control strategy being executed by the client, the server may determine the current flow control strategy according to the local strategy of the server, the second flow control strategy, and the third flow control strategy. Describe the first flow control strategy.
- the first flow control strategy can also include but not It is limited to one or more of the effective time of the first flow control strategy, the flow control method, the type of service request message, the generation time of the first flow control strategy, and the increment counter.
- the flow control method includes: sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number; the increment counter is used to determine the first flow Whether the control strategy is the latest flow control strategy.
- the second flow control strategy can not only be used to determine the second number of server request messages that the client is allowed to send to the server, but can also include but is not limited to: a second flow control strategy One or more of the effective time, the flow control mode, the type of service request message, the generation time of the second flow control strategy, and the increment counter.
- the flow control method includes: sending service request messages exceeding the second number to other servers for processing or discarding service request messages exceeding the second number; the incremented counter is used to determine the second flow Whether the control strategy is the latest flow control strategy.
- the third flow control strategy can not only be used to determine the second number of server request messages that the server is allowed to send to the superior server, but also include but not limited to: the third flow control strategy One or more of valid time, flow control mode, type of service request message, generation time of the third flow control strategy, and increment counter.
- the flow control method includes: sending service request messages exceeding the third number to other higher-level servers for processing or discarding service request messages exceeding the third number; the increment counter is used to determine the third Whether the flow control strategy is the latest flow control strategy.
- the first message may be a service request message based on a hypertext transport protocol (HTTP), and the second message may be a service response message based on HTTP.
- HTTP hypertext transport protocol
- the server may also receive a third message sent by the client, and the third message may include the first flow control policy being executed by the client and/or the client support Indication of flow control; the server may send a fourth message for the third message to the client in the case that the congestion state of the server is determined to be released, and the fourth message may be used to indicate the service The congestion state of the end is lifted.
- the fourth message may include a first field for indicating the congestion state
- the server may indicate that the congestion state of the server is released through the value of the first field. For example, when the value is "00", it indicates that the congestion state is released, and when the value is "01", it indicates that it is in the congestion state.
- the server informs the client in time whether it is in a congested state, so that the client can reasonably execute the flow control strategy.
- the third message may be an HTTP-based service request message
- the fourth message may be an HTTP-based service response message.
- the message that the server interacts with the client has integrity protection.
- the first message has integrity protection
- the server sends the second message to the client The integrity of the first message may also be verified.
- the second message is sent.
- the second message may also have integrity protection.
- the third message has integrity protection
- the server may also perform an integrity check on the third message before sending the fourth message to the client. After the verification is passed, the fourth message is sent.
- the fourth message may also have integrity protection.
- the messages exchanged between the server and the client can be integrity protected to avoid attacks by attackers.
- the server may also receive a sixth message sent by an upper-level server, and the sixth message may include a first field for indicating the congestion state, and the upper-level server may use the first field The value of indicates that the congestion state of the upper-level server is removed.
- the server may also determine that its own congestion state is released upon receiving the congestion state release of the superior server, and then send a fourth message to the client. The fourth message may be used to indicate that the congestion state of the server is released. .
- the fifth message is an HTTP-based service request message
- the sixth message is an HTTP-based service request message
- a flow control method in a second aspect, may be a client, and the client may send a first message to the server, and the first message may be used to indicate that the client supports flow control. .
- the client may also receive a second message from the server for the first message, the second message may include a first flow control policy, and the first flow control policy may be used to determine that the client is allowed.
- the first number of service request messages sent to the server where the first number is an integer greater than or equal to 0.
- the client performs flow control according to the first flow control strategy.
- the client informs the server of its ability to support flow control, and performs flow control according to the first flow control strategy indicated by the server. In this way, the client can reasonably discard the service request message, that is, send a reasonable number of service request messages to the server to ensure the reasonable progress of the business.
- the first message received by the server may include a second flow control strategy being executed by the client, and the second flow control strategy may be used to determine the first flow control Strategy.
- the second flow control policy is used to determine a second number of service request messages that the client is allowed to send to the server, and the second number is an integer greater than or equal to 0.
- the client can not only report that it supports flow control, but it can also inform the server of the second flow control strategy it is currently executing, so that the server can formulate the first flow control strategy for the client according to the second flow control strategy, so that The first flow control strategy is more in line with the flow processing capabilities of the server and more in line with the business needs of the client.
- the first flow control strategy can also include but not It is limited to at least one of the following: effective time of the first flow control strategy, flow control mode, type of service request message, generation time of the first flow control strategy, and increment counter; wherein, the flow control mode includes: Sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number, and the incrementing counter is used to determine whether the first flow control strategy is the latest flow control strategy .
- the second flow control strategy can not only be used to determine the second number of server request messages that the client is allowed to send to the server, but can also include but is not limited to: a second flow control strategy One or more of the effective time, the flow control mode, the type of service request message, the generation time of the second flow control strategy, and the increment counter.
- the flow control method includes: sending service request messages exceeding the second number to other servers for processing or discarding service request messages exceeding the second number; the incremented counter is used to determine the second flow Whether the control strategy is the latest flow control strategy.
- the client before the client performs flow control according to the first flow control policy, the client The terminal can also determine whether the generation time of the second flow control strategy being executed is earlier than the generation time of the first flow control strategy; if so, it can perform flow control according to the first flow control strategy; if not, then The flow control can be performed according to the second flow control strategy.
- the client can determine the latest generation time according to the generation time of each flow control strategy, that is, the latest flow control strategy.
- the client performs flow control according to the latest flow control strategy to achieve a more reasonable processing of business data.
- the client may also compare the first The increment counter in the flow control strategy and the increment counter of the second flow control strategy being executed determine to use the first flow control strategy.
- the client can determine the latest flow control strategy according to the counter of each flow control strategy.
- the client performs flow control according to the latest flow control strategy to achieve a more reasonable processing of business data.
- the first message may be an HTTP-based service request message
- the second message may be an HTTP-based service response message
- the client may also send a third message to the server, and the third message may include the second traffic control strategy being executed by the client and/or the client supporting traffic
- the client may also receive a fourth message sent by the server for the third message, and the fourth message may be used to indicate that the congestion state of the server is released. The client no longer executes the first flow control strategy.
- the fourth message is sent by the server after receiving the first flow control policy after it is determined that the congestion state is removed.
- the fourth message may include a first field for indicating the congestion state
- the server may indicate that the congestion state of the server is released through the value of the first field. For example, when the value is "00", it indicates that the congestion state is released, and when the value is "01", it indicates that it is in the congestion state.
- the server informs the client in time whether it is in a congested state, and the client can reasonably execute the flow control strategy.
- the third message may be a service request message based on HTTP
- the fourth message may be a service response message based on HTTP
- the message exchanged between the server and the client may have integrity protection.
- the second message has integrity protection
- the client may perform flow control according to the first flow control policy.
- flow control is performed according to the first flow control strategy, and the first message may also have integrity protection.
- the fourth message may have integrity protection
- the client may also perform an integrity check on the fourth message before determining that the first flow control policy is no longer executed. After passing the integrity check of the fourth message, it is determined that the first flow control strategy is no longer executed.
- the third message may also have integrity protection.
- the messages exchanged between the server and the client can be integrity protected to avoid attacks by attackers.
- a communication device in a third aspect, has the function of realizing the server in the foregoing method embodiment.
- These functions can be realized by hardware, or by hardware executing corresponding software.
- the hardware or software includes one or more functional modules corresponding to the above-mentioned functions.
- a communication device in a fourth aspect, has the function of realizing the client in the foregoing method embodiment.
- These functions can be realized by hardware, or by hardware executing corresponding software.
- the hardware or software includes one or more functional modules corresponding to the above-mentioned functions.
- a communication device may be the server in the foregoing method embodiment, or a chip set in the server.
- the communication device includes a transceiver and a processor, and optionally, a memory, where the memory is used to store a computer program or instruction, and the processor is respectively coupled with the memory and the transceiver.
- the communication device executes the computer program or instruction
- the communication device is caused to execute the method executed by the server in the foregoing method embodiment.
- a communication device may be the client in the foregoing method embodiment, or a chip set in the client.
- the communication device includes a transceiver and a processor, and optionally, a memory, where the memory is used to store a computer program or instruction, and the processor is respectively coupled with the memory and the transceiver.
- the processor executes the computer program or instruction
- the communication device is caused to execute the method executed by the client in the foregoing method embodiment.
- a computer program product includes: computer program code, which when the computer program code runs on a computer, causes the computer to execute any of the above-mentioned first aspect and any possible aspect of the first aspect The method executed by the server in the implementation.
- a computer program product comprising: computer program code, when the computer program code runs on a computer, the computer can execute any of the above-mentioned second aspect and any of the possible aspects of the second aspect Implementation of the method executed by the client.
- the present application provides a chip system including a processor and a memory, the processor and the memory are electrically coupled; the memory is used to store computer program instructions; the processor , Used to execute part or all of the computer program instructions in the memory. When the part or all of the computer program instructions are executed, they are used to implement the first aspect and any one of the possible implementation methods of the first aspect.
- the chip system further includes a transceiver, and the transceiver is configured to send a signal processed by the processor or receive a signal input to the processor.
- the chip system can be composed of chips, and can also include chips and other discrete devices.
- a chip system in a tenth aspect, includes a processor and a memory, the processor and the memory are electrically coupled; the memory is used for storing computer program instructions; the processor is used for In executing part or all of the computer program instructions in the memory, when the part or all of the computer program instructions are executed, they are used to implement the functions of the client in the foregoing second aspect and any possible implementation method of the second aspect.
- the chip system further includes a transceiver, and the transceiver is configured to send a signal processed by the processor or receive a signal input to the processor.
- the chip system can be composed of chips, and can also include chips and other discrete devices.
- a computer-readable storage medium stores a computer program.
- the computer program When the computer program is executed, the first aspect and any possible implementation of the first aspect are implemented by The method executed by the server.
- this application provides a computer-readable storage medium that stores a computer program, and when the computer program is executed, the second aspect and any possible implementation of the second aspect are realized In the method executed by the client.
- a communication system may include a server that executes the method described in any possible implementation of the first aspect and the first aspect, and executes the second aspect and the second aspect. Any possible implementation of the method described in the client.
- FIG. 1 is a schematic diagram of an architecture provided in an embodiment of the application
- Figure 2 is a flow control flow chart provided in an embodiment of the application.
- Figure 3 is a flow control flow chart provided in an embodiment of the application.
- Figure 4 is a flow control flow chart provided in an embodiment of the application.
- FIG. 5 is a schematic diagram of a communication device provided in an embodiment of this application.
- FIG. 6 is a schematic diagram of a communication device provided in an embodiment of this application.
- FIG. 7 is a schematic diagram of a communication device provided in an embodiment of this application.
- FIG. 8 is a schematic diagram of a communication device provided in an embodiment of this application.
- Terminal also called user equipment (UE), mobile station (MS), mobile terminal (MT), etc.
- terminal devices include handheld devices with wireless connection functions, vehicle-mounted devices, and Internet of Things devices.
- terminal devices can be: mobile phones (mobile phones), tablets, notebook computers, handheld computers, mobile Internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (augmented reality (AR) equipment, industrial control (industrial control) wireless terminals, unmanned driving (self-driving) wireless terminals, remote medical surgery (remote medical surgery) wireless terminals, smart grid (smart grid) Wireless terminals, wireless terminals in transportation safety, wireless terminals in smart cities, or wireless terminals in smart homes, etc.
- UE user equipment
- MS mobile station
- MT mobile terminal
- terminal devices include handheld devices with wireless connection functions, vehicle-mounted devices, and Internet of Things devices.
- terminal devices can be: mobile phones (mobile phones), tablets, notebook computers, handheld computers, mobile Internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality ( augmented reality (AR)
- the server after receiving the service request message sent by the client, and the end that responds to the client, or the end that provides services to the client.
- Integrity protection refers to the process of transmitting and storing information or data to ensure that the information or data is not changed without authorization or can be quickly discovered after the change.
- messages with integrity protection generally include message authentication code (MAC) information.
- MAC message authentication code
- Hash the information in the information calculate the MAC information, compare the calculated MAC information with the MAC information in the integrity-protected message, to determine whether the two MAC information is the same, if the MAC information is the same, then the integrity check by.
- integrity-protected messages in this application may also have confidentiality protection and/or anti-replay protection, where confidentiality protection means that the information cannot be accessed by unauthorized individuals, entities, or processes. Disclosure of characteristics. Anti-replay protection means that the receiver receives repeated packets from the attacker.
- Traffic processing capacity refers to the number of service request messages that can be processed in a period of time.
- Congestion means that the number of service request messages received in a period of time exceeds the number of service request messages that can be processed.
- the "and/or” in this application describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone. This situation.
- the character "/” generally indicates that the associated objects before and after are in an "or” relationship.
- the multiple involved in this application refers to two or more.
- the word "exemplary” is used to mean serving as an example, illustration, or illustration. Any embodiment or implementation described as an “example” in this application should not be construed as being more preferable or advantageous than other embodiments or implementations. To be precise, the term example is used to present the concept in a concrete way.
- the embodiments of the present application provide a method and device for flow control.
- the method and device are based on the same technical idea. Since the principles of the method and device to solve the problem are similar, the implementation of the device and the method can be referred to each other. No longer.
- LTE long term evolution
- WiMAX worldwide interoperability for microwave access
- 5G fifth generation of the future
- NR new radio access technology
- Figure 1 is a schematic diagram of a possible communication system architecture applicable to this application, including: UE, (radio access network, (R)AN), UPF network element, DN network element, AUSF network element, AMF network elements, SMF network elements, NESSF network elements, NEF network elements, NRF network elements, PCF network elements, UDM network elements, and AF network elements, among which network elements can also be called functional entity equipment, UPF network elements, DN network elements, AUSF network elements, AMF network elements, SMF network elements, NESSF network elements, NEF network elements, NRF network elements, PCF network elements, UDM network elements, and AF networks may be core network network elements.
- R radio access network
- Nnssf is the service-based interface displayed by NESSF
- Nausf is the service-based interface displayed by AUSF
- Namf is the service-based interface displayed by AMF
- Nsmf is the service-based interface displayed by SMF
- Nnef is displayed by NEF.
- Nnrf is a service-based interface displayed by NRF
- Npcf is a service-based interface displayed by PCF
- Nudm is a service-based interface displayed by UDM
- Naf is a service-based interface displayed by AF.
- Service-based interfaces can also be called service-oriented interfaces.
- Each network element can provide one or more service-oriented interface services, which are called by other network elements, and at the same time, the service-oriented interface services of other network elements will also be called.
- N1 is the reference point between UE and AMF
- N2 is the reference point between (R)AN and AMF, used for sending non-access stratum messages, etc.
- N3 is the reference point between (R)AN and UPF, used for Transmit user plane data, etc.
- N4 is the reference point between SMF and UPF, used to transmit information such as N3 connection tunnel identification information, data buffer indication information, and downlink data notification messages
- N6 interface is between UPF and DN The reference point is used to transmit user plane data, etc.
- the access and mobility management function has the core network control plane function, providing user mobility management and access management functions, and SEAF has security authentication, management, and deduction security. Functions such as keys.
- Network repository function (NRF) network element: used to store information about the network functions deployed in the core network, and provide discovery of network functions and services.
- UPF User plane function
- QoS quality of service
- DN network element a network used to provide data transmission.
- Authentication server function authentication server function, AUSF
- AUSF authentication server function
- Session Management Function Network element: Mainly used for session management, terminal device Internet protocol (IP) address allocation and management, selection of manageable user plane functions, policy control and charging function interfaces The end point and downlink data notification, etc.
- IP Internet protocol
- Network exposure function (NEF) network element used to safely open the services and capabilities provided by the 3GPP network function network element to the outside.
- PCF Policy control function
- Application function (AF) network element a device used to manage a terminal, and store attribute information of the managed terminal, such as location information and type of the terminal.
- Unified data management (UDM) network elements used to process user identification, access authentication, registration, and mobility management.
- SSF Network slice selection function
- the above-mentioned network architecture applied to the embodiment of the present application is only an example of a network architecture described from the perspective of a service-oriented architecture, and the network architecture applicable to the embodiment of the present application is not limited to this, and any network element that can implement the above-mentioned various network elements
- the network architectures of all functions are applicable to the embodiments of this application.
- the UE side or the R(AN) side may request a service from the network element on the core network side, and the lower-level network element on the core network side may also send a service request message to the upper-level network element to request the service.
- the AMF network element subordinate network element
- the UDM network element upper network element
- the element processes the service request message and feeds back the service response message to the AMF.
- the AMF network element receives the service response message for the service request message, it feeds back the response to the UE side or the R(AN) side.
- the client the end that actively sends the service request message or the end that calls the service of the server.
- the end that receives the service request message sent by the client and feeds back the response to the client, or the end that provides services to the client is called the server. If the AMF network element directly sends a service request message to the UDM network element, the AMF network element is the client and the UDM network element is the server.
- the AMF network element communicates with the UDM network element through the AUSF network element, the AMF network element sends a service request message to the AUSF network element, and the AUSF network element sends a service request message to the UDM network element.
- the AMF network element receives the service request message of the AMF network element
- the AMF network element is the client and the AUSF network element is the server.
- the AUSF network element sends a service request message to the UDM network element
- the AUSF network element is the client and the UDM network element is the server. It can be seen that the role of the AUSF network element may change when it communicates with different network elements. It can be concluded that a network element can be either a client or a server.
- the traffic processing capability of the server is limited. If the client sends a large number of service request messages to the server in a period of time, which exceeds the traffic processing capability of the server, the server will be congested. In order to avoid congestion, the server can return a service unavailable response to the client for some service request messages.
- the client can use the following schemes for flow control to avoid congestion on the server: the client can receive the number of non-service unavailable responses (service request messages successfully processed by the server), and the experience obtained The proportional coefficient is used to estimate the traffic processing capacity of the server for the client. The client discards the service request message that exceeds the traffic processing capability of the server for the client according to the estimated traffic processing capability of the server for the client.
- the client cannot accurately estimate the real situation of the server, and it is prone to discard too many service request messages or insufficient service request messages.
- the server does not know whether the reason for the decrease in client service request messages is that the client performs flow control or the service request messages sent by the client itself decrease.
- the server responds to each client with a response that the service is unavailable according to a unified strategy (for example, the proportion of service request messages received), which will cause more and more request messages to be discarded by clients that actively perform flow control. There are fewer and fewer service request messages that are normally processed.
- C1, c2, and c3 respectively connect to the server.
- C1, c2, and c3 respectively send 200 service request messages to the server.
- the server determines that it cannot be successfully processed (such as discarding or discarding) according to its own traffic processing capabilities.
- the server can process 100 service request messages for c1, c2, and c3, respectively, and the other 100 can be discarded or reply with unavailable services. If c3 is performing flow control at this time, c3 will think that the server can only handle 100 service request messages, and even if c3 has 150, 200 or more service request messages in the next cycle, c3 will only send to the server About 100 service request messages, redundant service request messages are discarded.
- the server does not know that c3 is reporting 100 service request messages because of flow control.
- the server thinks that c3 only has 100 service request messages.
- the server only processes 60 service messages for the 100 service messages reported by c3.
- the client thinks that the server can only process 60 service request messages, and then only about 60 service request messages will be reported in the next cycle, and so on, will cause more and more request messages discarded by clients that actively perform flow control. If more, there are fewer and fewer service request messages that are normally processed.
- the embodiment of the present application provides a flow control method.
- the client informs the server that it has flow control capabilities.
- the server can issue a flow control policy to the client.
- the flow control policy is used to determine the server.
- the client can send a reasonable number of service request messages to the server according to the flow control strategy issued by the server, so that both parties can process business data more flexibly and reasonably.
- the client shown in FIG. 2 may be the AMF network element shown in FIG. 1, and the corresponding server may be the UDM network element shown in FIG. 1.
- the client shown in FIG. 2 may be the AMF network element shown in FIG. 1, and the corresponding server may be the AUSF network element shown in FIG. 1.
- the client shown in FIG. 2 may be the AUSF network element shown in FIG. 1, and the corresponding server may be the UDM network element shown in FIG. 1.
- the client and server It is believed that those skilled in the art can reasonably think of other examples of the client and server according to the business requirements in actual applications.
- Step 201 The client sends a first message to the server.
- the server receives the first message sent by the client.
- the first message is used to indicate that the client supports flow control.
- the client can send a service request message to an upper network element (that is, the server) when receiving a service request message sent by a lower network element.
- the client can inform the server that it supports flow control when sending a service request message to the server.
- the first message may be a service request message, and further, the first message may be a service request message based on HTTP.
- the first message may carry an indication that the client supports flow control to indicate that the client supports flow control.
- the indication that the client supports flow control can be carried in the header of the HTTP message, and can also be carried in the body of the HTTP message.
- the first message may also be other messages independent of the service request message, for example, define a new message.
- the first message is not limited in this application.
- the client can not only report its ability to support flow control to the server, but the client can also report the flow control method it supports to the server, so that the server can formulate a more reasonable flow control strategy for the client, then the first message It may also include a flow control method supported by the client, where the flow control method supported by the client may be sending the service request message to other servers for processing, or discarding the service request message, or both.
- the client can also inform the server of the second flow control strategy being executed, so that the server can formulate a more reasonable flow control strategy for the client, and the first message can also include The second flow control strategy.
- Step 202 The server sends a second message for the first message to the client.
- the client receives the second message sent by the server, where the second message includes the first flow control policy.
- the server may formulate a first flow control strategy for the client, and send the formulated first flow control strategy to the client.
- the first flow control policy may be used to determine a first number of service request messages that the client is allowed to send to the server, and the first number is an integer greater than or equal to zero.
- the first number may refer to the number of service request messages allowed to be sent in a fixed time length, or the number of service request messages allowed to be sent in an unfixed time length.
- the fixed time length is, for example, one cycle
- the variable time length is, for example, the time interval for the server to feed back two service response messages to the client, or the time interval for two specific types of service response messages.
- the first quantity may be a relative quantity, for example, the first quantity may be a proportion of service request messages that the server instructs the client to reduce.
- the first quantity may also be an absolute quantity.
- the first quantity may be a value at which the server indicates the number of service request messages sent by the client.
- the first flow control strategy may also include but is not limited to at least one of the following items:
- the effective time of the first flow control strategy, the flow control mode, the type of service request message, and the generation time of the first flow control strategy increment the counter.
- the valid time may be a duration value, such as 3s, 10s, etc., or a time point, such as 23:20 on May 1, 2019. If the effective time is a duration value, it can be reflected by a specific time value, such as 10s, or by the number of cycles. For example, the server and the client can pre-appoint a period of 2s, and the effective time can be 5 cycle. The client can execute the first flow control strategy within the effective time of the first flow control strategy.
- the flow control method includes: the client sends the service request messages exceeding the first number to other servers for processing or discards the service request messages exceeding the first number.
- the client can pre-configure the identifiers of other servers, and the client can also query the identifiers of other servers through the network repository function (NRF), or the traffic control policy can carry the identifiers of other servers.
- NRF network repository function
- the type of the service request message may be that the server instructs the client to perform flow control for those types of messages, and may not perform flow control for other types of messages.
- the type of the service request message may be, for example, a registration request message, a read subscription data request message, a subscription data change request message, etc.
- a registration request message a read subscription data request message
- a subscription data change request message etc.
- the generation time of the first flow control strategy may be used to determine whether the first flow control strategy is the latest flow control strategy.
- the increment counter of the first flow control strategy can also be used to determine whether the first flow control strategy is the latest flow control strategy.
- the client can inform the server of the second flow control policy it is executing.
- the second flow control policy can not only be used to determine the second number of server request messages that the client is allowed to send to the server, but also include But not limited to: one or more of the effective time of the second flow control strategy, the flow control mode, the type of service request message, the generation time of the second flow control strategy, and the increment counter.
- the flow control method includes: the client sends the service request messages exceeding the second number to other servers for processing or discards the service request messages exceeding the second number; the increment counter is used to determine the first 2. Whether the flow control strategy is the latest flow control strategy.
- the first flow control strategy issued by the server to the client may include the effective time, flow control method, and service of the first flow control strategy described above.
- One or more of the type of the request message, the generation time, and the incremented counter may also be that the server informs the client of the difference between the first flow control strategy and the second flow control strategy. The client can then adjust the second flow control strategy being executed according to the difference notified by the server, and the adjusted flow control strategy will be the first flow control strategy.
- the server can be in any state, as long as it receives an instruction from the client to support flow control, it will formulate the first flow control strategy for the client.
- the server can also formulate the first flow control strategy for the client only when it is in a congested state. After the server receives the indication from the client that the client supports flow control, if the server is currently in a congested state, the server can formulate a first flow control strategy for the client according to the server's flow processing capability. If the server is not currently in a congested state, the server can ignore the instructions sent by the client to support flow control.
- the following specifically introduces the process of making the first flow control strategy for the client based on the flow processing capacity when the server is in a congested state:
- the server can estimate its own load level in this cycle according to its multiple resource usage (such as CPU usage, message processing time, etc.). For example, if the CPU usage rate is greater than 98%, it is estimated that the current cycle is extremely high; the CPU usage rate is between 90% and 98%, and the current cycle is estimated to be a high load; the CPU usage rate is between 80% and 90%, and the cost is estimated The cycle is high load; the CPU usage rate is less than 80%, and it is estimated that this cycle is light load.
- multiple resource usage such as CPU usage, message processing time, etc.
- the current cycle is estimated to be high load, and the message processing delay is less than 1 second, then the current cycle is estimated to be a high load.
- the cycle is light load.
- the load level of the server can be the highest level of the load corresponding to multiple resources, or it can be calculated comprehensively according to the load level of multiple resources.
- the server can first estimate that it can be processed in this cycle (may be processed successfully, or may be processed)
- the number of service request messages that failed) is the estimated traffic processing capacity.
- the server can also estimate the number of service request messages that will be received in this cycle based on the number of service request messages received in the previous cycle.
- the load of the system can be kept as high as possible. For example, processing 1000 messages in the previous cycle, the system load is extremely high. The estimated load this week is also extremely high, and the load situation has not changed, and it is considered that 900 messages can be processed in this cycle (the load is extremely high, and the number of messages to be processed needs to be reduced). For another example, if 1000 messages were processed in the previous cycle, the system load is high, and the estimated load in this cycle is also extremely high, and the load level has not changed, then it is considered that 1000 messages can be processed in this cycle (the system is stable under high load, and it is not necessary. Need to adjust the message).
- the server can estimate the number of service request messages that cannot be processed based on the estimated number of service request messages that can be processed in this cycle and the number of service request messages that will be received in this cycle.
- the server can directly discard the service request message that cannot be processed, or return a failure to the client (for example, the service is unavailable).
- the server can make the number of service request messages sent by all clients connected to it close to the estimated traffic processing capacity (the number of service request messages that can be processed). For example, the estimated traffic processing capacity of the server in this cycle is to process 1000 service request messages, and it is estimated that 2000 service request messages are received in this cycle, and it is estimated that 1000 service request messages cannot be processed.
- the server can instruct all clients connected to it to send a total of 1000 service request messages.
- the server can make the number of service request messages sent by all clients connected to it greater than the estimated traffic processing capacity. For example, the server multiplies the number of service request messages that it can process by a ratio value to indicate the total number of service request messages sent by all clients.
- the ratio value is generally greater than 1, for example, 1.1, 1.2, and so on.
- the estimated traffic processing capacity of the server in this cycle is to process 1000 service request messages, and it is estimated that 2000 service request messages are received in this cycle, and it is estimated that 1000 service request messages cannot be processed.
- the server can instruct all clients connected to it to send a total of 1200 service request messages, and the ratio is 1.2.
- the server can instruct the client to discard 800 service request messages for 1000 service request messages that are estimated to be unable to be processed.
- the server can return 200 failures according to its own traffic processing capability, or the server can send the 200 service request messages to other servers for processing after receiving the 200 service request messages, or the server can indicate all connected to it.
- the client sends a total of 1200 service request messages, and can also instruct the client to send service request messages to other servers to disperse the pressure on the current server.
- the load on the server in this cycle is higher than the load in the previous cycle, it means that the number of service request messages that the server has caused the client to discard is not large enough, and the client can discard more service request messages in the next cycle. For example, in this cycle, the client is allowed to discard 60% of service request messages, and the client can be allowed to discard 80% of service request messages in the next cycle.
- the server can instruct the client to discard a smaller number of service request messages in the next cycle, or even not to discard service request messages.
- the server develops a flow control strategy for the client, it can not only consider the current load level, but also the changing trend of the load level.
- the second message delivered by the server to the client may be a service response message, and further, the second message may be a service response message based on HTTP.
- the first flow control policy can be carried in the header of the HTTP message, for example, the extended Retry-After header, or non-standard headers such as X-headers, can also be in the body of the HTTP message carry.
- the second message may also be another message independent of the service response message, for example, a new message is defined.
- the first message is not limited in this application.
- the client can protect the integrity of the first message.
- the server can perform an integrity check on the first message. After the integrity check passes, Then formulate the first flow control strategy for the client. If the integrity check of the first message fails, the server can ignore the first message, or inform the client that there is an attacker.
- Step 203 The client performs flow control according to the first flow control strategy.
- the client After the client determines the first number of service request messages allowed to be sent to the server according to the first flow control policy, it can send about the first number of service request messages to the server. In order to achieve the purpose of reasonably discarding service request messages. It should be noted that the first number may be larger than the number of service request messages that the client needs to send, and the client does not need to discard the service request messages.
- the client can also have some traffic control strategies locally, for example, some types of service request messages have higher priority.
- the server instructs the client to limit the flow of this type of service request message. If the client sets the priority of this type of message to a higher priority When it is high, the client may not discard this type of service request message. Or a certain session is in progress, even if the server instructs the client to restrict the flow of the service request message of the session, in order to ensure the normal progress of the session, the client may not discard the subsequent service request message of the session.
- the generation time of the first flow control strategy may be used to determine whether the first flow control strategy is the latest flow control strategy. If the first flow control strategy includes the generation time of the first flow control strategy, before the client performs flow control according to the first flow control strategy, the client may also determine the first flow control strategy being executed. 2. Whether the generation time of the flow control strategy is earlier than the generation time of the first flow control strategy, and if so, perform flow control according to the first flow control strategy. If not, flow control can be performed according to the second flow control strategy.
- the client can determine the latest flow control strategy according to the generation time of each flow control strategy.
- the client performs flow control according to the latest flow control strategy to achieve a more reasonable processing of business data.
- the increment counter of the first flow control strategy can also be used to determine whether the first flow control strategy is the latest flow control strategy. If the first flow control policy includes the increment counter, before the client performs flow control according to the first flow control policy, the client may also compare the increment in the first flow control policy The counter and the incremental counter of the second flow control strategy being executed determine which flow control strategy is used. For example, the larger the value of the increment counter, the later the flow control strategy, that is, the latest flow control strategy. Then, when the counter of the first flow control strategy is greater than the counter of the second flow control strategy, the first flow control strategy can be used.
- the flow control strategy can carry the identifiers of other servers.
- the client can also pre-configure the identifiers of other servers, and the client can also query the identifiers of other servers through the network repository function (NRF).
- NEF network repository function
- the server can protect the integrity of the second message. If the second message has integrity protection, after receiving the second message, the client may first perform an integrity check on the second message, and after passing the integrity check, perform flow control according to the first flow control policy. If the integrity check of the first message fails, the client can ignore the first flow control policy in the second message, or inform the server that there is an attacker.
- the integrity protection key used can be a symmetric key preset between the server and the client, or an asymmetric key mechanism, such as using the server’s
- the certificate signs the first flow control policy.
- the above has introduced the process of issuing the first flow control policy to the client when the server is in a congested state.
- the congestion state of the server may be lifted, and the server may also issue an instruction to clear the congestion state to the client, and the client may reasonably report a service request message to the server.
- Step 301 to step 303 are the same as step 201 to step 203, and the repetition will not be repeated.
- Step 304 the client sends a third message to the server.
- the server receives the third message sent by the client.
- the third message may include the first flow control policy being executed by the client. And/or the client supports the instruction of the flow control strategy.
- Step 305 The server determines that the congestion state is released, and sends a fourth message to the client. Accordingly, the client receives a fourth message, which is used to indicate that the congestion state of the server is released.
- Step 306 The client determines that the first flow control strategy is no longer executed.
- the server when the server determines that the congestion state is released, it may issue an indication of the congestion state release to all clients connected to the server.
- the server may send the congestion to the client after receiving the flow control policy sent by the client or the indication that the client supports the flow control policy, and when it determines that its congestion state is lifted Indication of status release. For example, step 304 and step 305 in FIG. 3.
- the server may also save the flow control policy issued to the client for the client's identification.
- the server can monitor in real time whether the flow control strategy for each client is effective. If the congestion state of the server is released and it is monitored that certain flow control policies are still valid, the server can issue an indication of the congestion release to the clients whose flow control policies are still valid. For clients whose flow control policy is invalid, since the client no longer executes the flow control policy, the server may not issue an indication of the congestion state release to these clients.
- the fourth message includes a first field for indicating the congestion state, and the value of the first field indicates that the congestion state of the server is released.
- the server can indicate that the congestion state of the server is lifted by setting the effective time of the flow control policy to 0.
- the fourth message may include a fourth flow control strategy, and the effective time of the fourth flow control strategy is zero.
- the third message may be a service request message, and further, the third message may be a service request message based on HTTP.
- the first flow control policy and/or the indication that the client supports flow control may be carried in the header of the HTTP message, and may also be carried in the body of the HTTP message.
- the third message may also be another message independent of the service request message, for example, define a new message.
- the third message is not limited in this application.
- the client can perform integrity protection on the third message. If the third message has integrity protection, after receiving the third message, the server can perform an integrity check on the third message first, and after the integrity check is passed, the server can issue a congestion release for the client. Instructions. If the integrity check of the third message fails, the server can ignore the third message or inform the client that there is an attacker.
- the fourth message may be a service response message, and further, the fourth message may be a service response message based on HTTP.
- the fourth message may carry a fourth flow control policy, and the fourth flow control policy may be carried in the header of the HTTP message, such as an extended Retry-After header field, or a non-standard header field such as X -headers, can also be carried in the body of the HTTP message.
- the fourth message may also carry an identifier of the server's uncongested state, such as the value of a field.
- the fourth message may also be another message independent of the service response message, for example, a new message is defined.
- the fourth message is not limited in this application.
- the server can perform integrity protection on the fourth message. If the fourth message has integrity protection, after receiving the fourth message, the client may first perform an integrity check on the fourth message, and after the integrity check passes, it is determined that the first flow control strategy is no longer executed. If the integrity check of the first message fails, the client can ignore the indication of the server to release the congestion state in the fourth message, or inform the server that there is an attacker.
- the flow control strategy may include a generation time and/or an increment counter.
- the aforementioned third message After receiving the second message, if the client determines to execute the first flow control strategy according to the generation time and/or incrementing counter of the first flow control side, the aforementioned third message includes the first flow control strategy; Time and/or increment the counter to determine not to execute the first flow control strategy, but to execute the second flow control strategy, then the aforementioned third message may include the second flow control strategy instead of the first flow control strategy.
- the third message may also include the second flow control strategy and the first flow control strategy.
- the server can also act as a client to receive a third flow control policy sent by an upper-level server, where the third flow control policy is used to determine the service that the server is allowed to send to the upper-level server
- the third quantity of the request message where the third quantity is an integer greater than or equal to zero.
- the server may formulate a first flow control policy for the client according to the local policy of the server and the third flow control policy.
- the client shown in FIG. 4 may be the AMF network element shown in FIG. 1, and the corresponding server may be the AUSF network element shown in FIG. 1.
- the upper-level server may be the UDM network element shown in Figure 1.
- the AUSF network element is the server for the AMF network element
- the AUSF network element is the client for the UDM network element.
- client, server, and upper-level server it is believed that those skilled in the art can reasonably think of other examples of the client, server, and upper-level server according to the business requirements in actual applications.
- Step 401 The client (AMF network element) sends a service request message to the server (AUSF network element).
- the server (AUSF network element) receives the service request message sent by the client.
- the service request message includes Instruct the client (AMF network element) to support flow control.
- the service request message may also include a flow control mode supported by the AMF network element.
- Step 402 The server (AUSF network element) acts as a client and sends a service request message to an upper server (UDM network element).
- the service request message includes instructions for instructing the client (AUSF network element) to support flow control. Instructions.
- the service request message may also include a flow control mode supported by the AUSF network element.
- Step 403 The UDM network element formulates a third flow control strategy for the AUSF network element.
- the third flow control strategy is formulated for the AUSF network element according to the system capability.
- Step 404 The UDM network element sends a service response message to the AUSF network element.
- the AUSF network element receives the service response message sent by the UDM network element.
- the service response message includes the third flow control policy.
- Step 405 The AUSF network element determines the first flow control strategy according to the third flow control strategy and the local strategy.
- the AMF network element reports the second flow control strategy being executed by the AMF network element to the AUSF network element, and the AUSF network element determines the first flow control strategy according to the third flow control strategy and the local strategy, and the second flow control side. .
- the third flow control strategy is that the UDM network element instructs the AUSF network element to send 1000 service request messages. For example, it may send 1000 messages in one cycle, and one cycle may be, for example, 1s.
- the AUSF network element expects to receive 1500 service request messages in this cycle, of which 500 are high-priority non-discardable messages, and 1000 are low-priority messages that can be discarded. Then the AUSF network element can send 500 messages to the UDM network element. High priority messages and 500 low priority messages.
- the AUSF network element needs to discard 500 low-priority messages.
- the local policy of the AUSF network element can be, for example, that it discards the number of service request messages sent to the UDM network element and requires lower-level clients to reduce the number of messages sent to the AUSF network element.
- the ratio of the number of service request messages may be 1:1, 1:2, 1.5, etc., for example. If the AUSF network element itself discards and requires AMF to reduce the number of messages sent is 1:1, the AUSF network element can instruct all AMF network elements connected to the AUSF network element to send a total of 750 low-priority messages and all 500 messages in the next period. High priority message.
- Step 406 The AUSF network element sends a service response message to the AMF network element.
- the AMF network element receives the service response message sent by the AUSF network element.
- the service response message includes the first flow control policy.
- Step 407 The AMF network element may perform flow control according to the first flow control strategy.
- step 408 the AMF network element may also send a service request message to the AUSF network element.
- the AUSF network element receives the service request message sent by the AMF network element, and the service request message includes the AMF An indication that the network element supports flow control and/or the first flow control strategy being executed by the AMF network element.
- step 409 the AUSF network element sends a service request message to the UDM network element, and correspondingly, the UDM network element receives the service request message sent by the AUSF network element, and the service request message includes that the AUSF network element supports flow control The instructions and/or the third flow control strategy.
- the AUSF network element plays the role of an intermediate node between the AMF network element and the UDM network element.
- the process of determining the third flow control strategy by the AUSF network element according to the first flow control strategy may be the reverse process of the above step 405.
- Step 410 The UDM network element may send a service response message to the AUSF network element when it is determined that the congestion is removed.
- the AUSF network element receives the service response message sent by the UDM network element, and the service response message is used to instruct the UDM network The meta-congestion state is removed.
- Step 411 After the AUSF network element receives the indication that the congestion state of the UDM network element is released, it can no longer execute the third flow control strategy. Under normal circumstances, the AUSF network element does not need to perform flow control on the AMF anymore, then the AUSF network element industry A service response message can be sent to the AMF network element to indicate that the congestion state of the AUSF network element is released. AMF may no longer execute the first flow control strategy.
- each network element can exchange information through a service request message and a service response message.
- the service request message can be a service request message based on HTTP
- the service response message can be a service response message based on HTTP.
- the service request message and service response message exchanged between the various network elements in FIG. 4 may have integrity protection, and the end receiving the message may perform integrity verification on it first, and then perform the corresponding process after the integrity verification is passed.
- HTTP-based service request messages and service response messages in the various embodiments provided above may be HTTP2.0-based service request messages and service response messages.
- a communication device 500 is provided, and the communication device 500 can perform each step performed by the server in the methods of FIG. 2, FIG. 3, and FIG. 4, In order to avoid repetition, it will not be detailed here.
- the communication device 500 may be a server or a chip applied to the server.
- the communication device 500 includes: a transceiver module 510, optionally, a processing module 520 and a storage module 530; the processing module 520 can be connected to the storage module 530 and the transceiver module 510 respectively, and the storage module 530 can also be connected to the transceiver module 510 :
- the storage module 530 is used to store computer programs
- the transceiver module 510 is configured to receive a first message sent by a client, where the first message is used to indicate that the client supports flow control; and send a message specific to the first message to the client
- the second message the second message includes a first flow control strategy, the first flow control strategy is used to determine a first number of service request messages that the client is allowed to send to the device, and the first number is greater than Or an integer equal to 0.
- the processing module 520 is configured to determine the first flow control strategy according to the flow processing capability of the device when the device is in a congested state.
- the transceiver module 510 is further configured to receive a fifth message from an upper-level server, where the fifth message includes a third flow control strategy, and the third flow control strategy is used to determine permission to The third number of service request messages sent by the device to the upper-level server, where the third number is an integer greater than or equal to 0.
- the processing module 520 is configured to determine the first flow control strategy according to the local strategy of the device and the third flow control strategy.
- the transceiver module 510 is further configured to receive a third message sent by the client, where the third message includes the first flow control policy being executed by the client; and When the congestion state is released, a fourth message for the third message is sent to the client, where the fourth message is used to indicate that the congestion state of the device is released.
- a communication device 600 is provided, and the communication device 600 can perform the steps performed by the client in the methods of FIG. 2, FIG. 3, and FIG. 4, In order to avoid repetition, it will not be detailed here.
- the communication device 600 may be a client or a chip applied in the client.
- the communication device 600 includes: a transceiver module 610, optionally, a processing module 620 and a storage module 630; the processing module 620 can be connected to the storage module 630 and the transceiver module 610 respectively, and the storage module 630 can also be connected to the transceiver module 610 :
- the storage module 630 is used to store computer programs
- the transceiver module 610 is configured to send a first message to a server, the first message is used to indicate that the device supports flow control; and to receive a second message from the server for the first message Message, the second message includes a first flow control strategy, the first flow control strategy is used to determine a first number of service request messages that the device is allowed to send to the server, and the first number is greater than or equal to An integer of 0;
- the processing module 620 is configured to perform flow control according to the first flow control strategy.
- the first flow control strategy includes at least one of the following items:
- the flow control method includes: sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number, and the increment counter is used to determine the first flow Whether the control strategy is the latest flow control strategy.
- the processing module 620 is configured to perform flow control according to the first flow control strategy. Before, it is also used to determine that the generation time of the second flow control strategy being executed is earlier than the generation time of the first flow control strategy.
- the processing module 620 is further used to: compare before performing flow control according to the first flow control strategy.
- the increment counter in the first flow control strategy and the increment counter in the second flow control strategy being executed determine to use the first flow control strategy.
- the transceiver module 610 is further configured to send a third message to the server, where the third message includes the first flow control strategy being executed by the device; and to receive the service A fourth message for the third message of the terminal, where the fourth message is used to indicate that the congestion state of the server is released;
- the processing module 620 is further configured to determine that the first flow control strategy is no longer executed.
- FIG. 7 is a schematic block diagram of a communication device 700 according to an embodiment of the present application. It should be understood that the communication device 700 can execute each step performed by the server in the methods shown in FIG. 2, FIG. 3, and FIG. 4. In order to avoid repetition, the details are not described herein again.
- the communication device 700 includes: a processor 701 and a memory 703, and the processor 701 and the memory 703 are electrically coupled;
- the memory 703 is used to store computer program instructions
- the processor 701 is configured to execute part or all of the computer program instructions in the memory.
- the device receives a first message sent by a client, and the first message A message is used to indicate that the client supports flow control; and a second message for the first message is sent to the client, the second message includes a first flow control strategy, and the first flow control strategy is used to determine The first number of service request messages that the client is allowed to send to the device, where the first number is an integer greater than or equal to 0.
- the processor 701 is configured to determine the first flow control strategy according to the flow processing capability of the device when the device is in a congested state.
- the processor 701 is further configured to receive a fifth message from an upper-level server, where the fifth message includes a third flow control strategy, and the third flow control strategy is used to determine permission to The third number of service request messages sent by the device to the upper-level server, where the third number is an integer greater than or equal to 0.
- the processor 701 is configured to determine the first flow control strategy according to the local strategy of the apparatus and the third flow control strategy.
- the processor 701 is further configured to receive a third message sent by the client, where the third message includes the first flow control policy being executed by the client; and When the congestion state is released, a fourth message for the third message is sent to the client, where the fourth message is used to indicate that the congestion state of the device is released.
- a transceiver 702 for communicating with other devices; for example, sending a second message and a fourth message to the client, and receiving a first message and a third message sent by the client.
- the communication device 700 shown in FIG. 7 may be a chip or a circuit.
- a chip or circuit can be installed in the server.
- the aforementioned transceiver 702 may also be a communication interface.
- the transceiver includes a receiver and a transmitter.
- the communication device 700 may also include a bus system.
- the processor 701, the memory 703, and the transceiver 702 are connected by a bus system.
- the processor 701 is used to execute the instructions stored in the memory 703 to control the transceiver to receive and send signals, and to complete the flow control method of the present application. step.
- the memory 703 may be integrated in the processor 701, or may be provided separately from the processor 701.
- the function of the transceiver 702 may be implemented by a transceiver circuit or a dedicated chip for transceiver.
- the processor 701 may be implemented by a dedicated processing chip, a processing circuit, a processor, or a general-purpose chip.
- FIG. 8 is a schematic block diagram of a communication device 800 according to an embodiment of the present application. It should be understood that the communication device 800 can execute each step executed by the client in the methods of FIG. 2, FIG. 3, and FIG. 4. In order to avoid repetition, details are not described herein again.
- the communication device 800 includes: a processor 801 and a memory 803, and the processor 801 and the memory 803 are electrically coupled;
- the memory 803 is used to store computer program instructions
- the processor 801 is configured to execute part or all of the computer program instructions in the memory.
- the device sends a first message to the server, and the first message For indicating that the device supports flow control; and receiving a second message from the server for the first message, where the second message includes a first flow control strategy, and the first flow control strategy is used to determine permission
- the first number of service request messages sent by the device to the server where the first number is an integer greater than or equal to 0; and performing flow control according to the first flow control strategy.
- the first flow control strategy includes at least one of the following items:
- the flow control method includes: sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number, and the increment counter is used to determine the first flow Whether the control strategy is the latest flow control strategy.
- the processor 801 is configured to perform flow control according to the first flow control strategy. Before, it is also used to determine that the generation time of the second flow control strategy being executed is earlier than the generation time of the first flow control strategy.
- the processor 801 is further configured to: compare before performing flow control according to the first flow control strategy.
- the increment counter in the first flow control strategy and the increment counter in the second flow control strategy being executed determine to use the first flow control strategy.
- the processor 801 is further configured to send a third message to the server, where the third message includes the first flow control strategy being executed by the device; and to receive the service A fourth message for the third message at the end, where the fourth message is used to indicate that the congestion state of the server is released; and it is determined that the first flow control strategy is no longer executed.
- a transceiver 802 for communicating with other devices; for example, receiving the second message and the fourth message sent by the server, and sending the first message and the second message to the server.
- the communication device 800 shown in FIG. 8 may be a chip or a circuit.
- a chip or circuit can be installed in the client.
- the above-mentioned transceiver 802 may also be a communication interface.
- the transceiver includes a receiver and a transmitter.
- the communication device 800 may also include a bus system.
- the processor 801, the memory 803, and the transceiver 802 are connected by a bus system.
- the processor 801 is used to execute the instructions stored in the memory 803 to control the transceiver to receive and send signals, and complete the flow control method of the present application. step.
- the memory 803 may be integrated in the processor 801, or may be provided separately from the processor 801.
- the function of the transceiver 802 may be implemented by a transceiver circuit or a dedicated transceiver chip.
- the processor 801 may be implemented by a dedicated processing chip, a processing circuit, a processor, or a general-purpose chip.
- the processor may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.
- CPU central processing unit
- NP network processor
- the processor may further include a hardware chip or other general-purpose processors.
- the aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof.
- ASIC application-specific integrated circuit
- PLD programmable logic device
- the above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (generic array logic, GAL) and other programmable logic devices , Discrete gates or transistor logic devices, discrete hardware components, etc. or any combination thereof.
- the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
- the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
- the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
- the volatile memory may be random access memory (Random Access Memory, RAM), which is used as an external cache.
- RAM random access memory
- SRAM static random access memory
- DRAM dynamic random access memory
- DRAM synchronous dynamic random access memory
- DDR SDRAM Double Data Rate Synchronous Dynamic Random Access Memory
- Enhanced SDRAM, ESDRAM Enhanced Synchronous Dynamic Random Access Memory
- Synchronous Link Dynamic Random Access Memory Synchronous Link Dynamic Random Access Memory
- DR RAM Direct Rambus RAM
- the embodiment of the present application provides a computer storage medium storing a computer program, and the computer program includes a method for performing the above-mentioned flow control.
- the embodiment of the present application provides a computer program product containing instructions, which when running on a computer, causes the computer to execute the method for flow control provided above.
- the device embodiments described above are merely illustrative.
- the division of the units is only a logical function division, and there may be Other division methods, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not implemented.
- the displayed or discussed mutual communication connections may be indirect couplings or communication connections through some interfaces, devices or units, and may be in electrical, mechanical, or other forms.
- the units in the device embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the processor in the embodiment of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (digital signal processors, DSP), and application specific integrated circuits. (application specific integrated circuit, ASIC), field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
- the general-purpose processor may be a microprocessor or any conventional processor.
- the methods in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
- software When implemented by software, it can be implemented in the form of a computer program product in whole or in part.
- the computer program product includes one or more computer programs or instructions.
- the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
- the computer program or instruction may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium.
- the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server integrating one or more available media.
- the usable medium may be a magnetic medium, such as a floppy disk, a hard disk, and a magnetic tape; it may also be an optical medium, such as a CD-ROM, a DVD; and it may also be a semiconductor medium, such as a solid state disk (SSD), random Access memory (random access memory, RAM), read-only memory (ROM), registers, etc.
- this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
- the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Mobile Radio Communication Systems (AREA)
- Telephonic Communication Services (AREA)
- Computer And Data Communications (AREA)
Abstract
The present application relates to the technical field of communications, and disclosed therein are a method and apparatus for traffic control, which are used to solve the problem wherein current traffic control means are unreasonable and inflexible. The method comprises: a service end receives a first message sent by a client, the first message being used to indicate that the client supports traffic control; and the service end sends to the client a second message for the first message, the second message comprising a first traffic control policy, the first traffic control policy being used to determine a first number of service request messages that the client is allowed to send to the service end, and the first number being an integer greater than or equal to 0. When determined that the client supports traffic control, the service end may issue to the client a traffic control policy, which is used to indicate the number of service request messages reported by the client. As such, the client may send a reasonable number of service request messages to the service end according to the indication of the service end.
Description
相关申请的交叉引用Cross-references to related applications
本申请要求在2019年09月27日提交中国专利局、申请号为201910924070.9、申请名称为“一种流量控制的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910924070.9, and the application name is "a method and device for flow control" on September 27, 2019, the entire content of which is incorporated into this application by reference in.
本申请实施例涉及通信技术领域,尤其涉及一种流量控制的方法及装置。The embodiments of the present application relate to the field of communication technologies, and in particular, to a method and device for flow control.
客户端向服务端发送服务请求消息,用于请求服务。由于服务端的流量处理能力(一段时间中能够处理的服务请求消息的数量)有限,如果客户端向服务端发送大量的服务请求消息,超过服务端的流量处理能力,服务端则会发生拥塞。服务端为了避免拥塞,可以针对部分服务请求消息向客户端返回服务不可用(service unavailable)的响应。The client sends a service request message to the server to request service. Due to the limited traffic processing capability of the server (the number of service request messages that can be processed in a period of time), if the client sends a large number of service request messages to the server, which exceeds the traffic processing capability of the server, the server will be congested. In order to avoid congestion, the server can return a service unavailable response to the client for some service request messages.
目前,客户端可以采用以下方案进行流量控制,以避免服务端发生拥塞:客户端可以根据收到的非服务不可用的响应(被服务端成功处理的服务请求消息)的数量,以及根据经验得到的一个比例系数,丢弃服务请求消息。在目前的流量控制方案中,容易出现服务请求消息丢弃太多或者服务请求消息丢弃不足的情况。At present, the client can use the following schemes for flow control to avoid congestion on the server: the client can receive the number of non-service unavailable responses (service request messages successfully processed by the server), and get it based on experience A scaling factor for discarding service request messages. In the current flow control scheme, it is easy to drop too many service request messages or insufficient service request messages.
发明内容Summary of the invention
本申请实施例提供一种流量控制的方法及装置,用以解决目前的流量控制方式不合理、不灵活的问题。The embodiments of the present application provide a flow control method and device to solve the problem of unreasonable and inflexible current flow control methods.
第一方面,提供了一种流量控制的方法及装置,该方法的执行主体可以是服务端,服务端可以接收客户端发送的第一消息,所述第一消息可以用于指示所述客户端支持流量控制。所述服务端还可以向所述客户端发送针对所述第一消息的第二消息,所述第二消息可以包括第一流量控制策略,所述第一流量控制策略可以用于确定允许所述客户端向所述服务端发送的服务器请求消息的第一数量,第一数量为大于或等于0的整数。In the first aspect, a method and device for flow control are provided. The execution subject of the method may be a server, and the server may receive a first message sent by a client, and the first message may be used to instruct the client Support flow control. The server may also send a second message for the first message to the client, the second message may include a first flow control policy, and the first flow control policy may be used to determine to allow the The first number of server request messages sent by the client to the server, where the first number is an integer greater than or equal to zero.
服务端在确定客户端支持流量控制时,可以向客户端下发流量控制策略,用于指示客户端上报的服务请求消息的数量。这样,客户端就可以根据服务端的指示,合理地丢弃服务请求消息,即向服务端发送合理数量的服务请求消息。客户端与服务端间就可以灵活合理地处理业务数据。When determining that the client supports flow control, the server can issue a flow control policy to the client to indicate the number of service request messages reported by the client. In this way, the client can reasonably discard the service request messages according to the instructions of the server, that is, send a reasonable number of service request messages to the server. The business data can be processed flexibly and reasonably between the client and the server.
在一种可能的实现中,客户端向服务端发送的第一消息可以包括所述客户端正在执行的第二流量控制策略,所述第二流量控制策略可以用于确定所述第一流量控制策略。第二流量控制策略用于确定允许所述客户端向所述服务端发送的服务请求消息的第二数量,所述第二数量为大于或等于0的整数。In a possible implementation, the first message sent by the client to the server may include the second flow control strategy being executed by the client, and the second flow control strategy may be used to determine the first flow control Strategy. The second flow control policy is used to determine a second number of service request messages that the client is allowed to send to the server, and the second number is an integer greater than or equal to 0.
客户端不仅上报自身支持流量控制,还上报正在执行的第二流量控制策略,这样服务端可以结合第二流量控制策略确定第一流量控制策略,使得为客户端制定的第一流量控制 策略更加符合服务端的流量处理能力以及客户端的业务需求。The client not only reports that it supports flow control, but also reports the second flow control strategy being executed, so that the server can determine the first flow control strategy in combination with the second flow control strategy, making the first flow control strategy formulated for the client more consistent The traffic processing capability of the server and the business requirements of the client.
在一种可能的实现中,所述服务端在接收到第一消息时,如果服务端处于拥塞状态,服务端可以根据自身的流量处理能力,确定第一流量控制策略。服务端可以在不处于拥塞状态时为客户端制定第一流量控制策略,也可以是在处于拥塞状态,根据当前的流量处理能力,确定第一流量控制策略。进一步地,如果第一消息中包括客户端正在执行的第二流量控制策略,则服务端可以根据自身的流量处理能力以及所述第二流量控制策略,确定第一流量控制策略。In a possible implementation, when the server receives the first message, if the server is in a congested state, the server may determine the first flow control strategy according to its own flow processing capability. The server can formulate the first flow control strategy for the client when it is not in a congested state, or when it is in a congested state, determine the first flow control strategy according to the current flow processing capability. Further, if the first message includes the second flow control strategy being executed by the client, the server can determine the first flow control strategy according to its own flow processing capability and the second flow control strategy.
在一种可能的实现中,所述服务端还可以接收到来自上级服务端的第五消息,所述第五消息可以包括第三流量控制策略,所述第三流量控制策略可以用于确定允许所述服务端向所述上级服务端发送的服务请求消息的第三数量,所述第三数量为大于或等于0的整数。进一步地,所述服务端可以根据所述服务端的本地策略和所述第三流量控制策略,确定所述第一流量控制策略。更进一步地,如果第一消息中包括客户端正在执行的第二流量控制策略,所述服务端可以根据所述服务端的本地策略、第二流量控制策略和所述第三流量控制策略,确定所述第一流量控制策略。In a possible implementation, the server may also receive a fifth message from an upper-level server, the fifth message may include a third flow control strategy, and the third flow control strategy may be used to determine permission to The third number of service request messages sent by the server to the superior server, where the third number is an integer greater than or equal to 0. Further, the server may determine the first flow control strategy according to the local strategy of the server and the third flow control strategy. Furthermore, if the first message includes the second flow control strategy being executed by the client, the server may determine the current flow control strategy according to the local strategy of the server, the second flow control strategy, and the third flow control strategy. Describe the first flow control strategy.
在一种可能的实现中,第一流量控制策略不但可以用于确定允许所述客户端向所述服务端发送的服务器请求消息的第一数量,所述第一流量控制策略还可以包括但不限于:第一流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第一流量控制策略的生成时间、递增计数器中的一项或多项。其中,所述流量控制方式包括:将超出所述第一数量的服务请求消息发送给其他服务端处理或将超出第一数量的服务请求消息丢弃;所述递增计数器用于判断所述第一流量控制策略是否为最新的流量控制策略。In a possible implementation, not only can the first flow control strategy be used to determine the first number of server request messages that the client is allowed to send to the server, the first flow control strategy can also include but not It is limited to one or more of the effective time of the first flow control strategy, the flow control method, the type of service request message, the generation time of the first flow control strategy, and the increment counter. Wherein, the flow control method includes: sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number; the increment counter is used to determine the first flow Whether the control strategy is the latest flow control strategy.
在一种可能的实现中,第二流量控制策略不但可以用于确定允许所述客户端向所述服务端发送的服务器请求消息的第二数量,还可以包括但不限于:第二流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第二流量控制策略的生成时间、递增计数器中的一项或多项。其中,所述流量控制方式包括:将超出所述第二数量的服务请求消息发送给其他服务端处理或将超出第二数量的服务请求消息丢弃;所述递增计数器用于判断所述第二流量控制策略是否为最新的流量控制策略。In a possible implementation, the second flow control strategy can not only be used to determine the second number of server request messages that the client is allowed to send to the server, but can also include but is not limited to: a second flow control strategy One or more of the effective time, the flow control mode, the type of service request message, the generation time of the second flow control strategy, and the increment counter. Wherein, the flow control method includes: sending service request messages exceeding the second number to other servers for processing or discarding service request messages exceeding the second number; the incremented counter is used to determine the second flow Whether the control strategy is the latest flow control strategy.
在一种可能的实现中,第三流量控制策略不但可以用于确定允许所述服务端向上级服务端发送的服务器请求消息的第二数量,还可以包括但不限于:第三流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第三流量控制策略的生成时间、递增计数器中的一项或多项。其中,所述流量控制方式包括:将超出所述第三数量的服务请求消息发送给其他上级服务端处理或将超出第三数量的服务请求消息丢弃;所述递增计数器用于判断所述第三流量控制策略是否为最新的流量控制策略。In a possible implementation, the third flow control strategy can not only be used to determine the second number of server request messages that the server is allowed to send to the superior server, but also include but not limited to: the third flow control strategy One or more of valid time, flow control mode, type of service request message, generation time of the third flow control strategy, and increment counter. Wherein, the flow control method includes: sending service request messages exceeding the third number to other higher-level servers for processing or discarding service request messages exceeding the third number; the increment counter is used to determine the third Whether the flow control strategy is the latest flow control strategy.
在一种可能的实现中,所述第一消息可以为基于超文本传输协议(hyper text transport protocol,HTTP)的服务请求消息,所述第二消息可以为基于HTTP的服务响应消息。In a possible implementation, the first message may be a service request message based on a hypertext transport protocol (HTTP), and the second message may be a service response message based on HTTP.
在一种可能的实现中,所述服务端还可以接收所述客户端发送的第三消息,所述第三消息可以包括所述客户端正在执行的第一流量控制策略和/或客户端支持流量控制的指示;所述服务端在确定服务端的拥塞状态解除的情况下,可以向所述客户端发送针对所述第三消息的第四消息,所述第四消息可以用于指示所述服务端的拥塞状态解除。In a possible implementation, the server may also receive a third message sent by the client, and the third message may include the first flow control policy being executed by the client and/or the client support Indication of flow control; the server may send a fourth message for the third message to the client in the case that the congestion state of the server is determined to be released, and the fourth message may be used to indicate the service The congestion state of the end is lifted.
在一种可能的实现中,所述第四消息中可以包括用于指示拥塞状态的第一字段,服务端可以通过第一字段的值指示所述服务端的拥塞状态解除。例如当值为“00”时指示拥塞 状态解除,当值为“01”时指示处于拥塞状态。In a possible implementation, the fourth message may include a first field for indicating the congestion state, and the server may indicate that the congestion state of the server is released through the value of the first field. For example, when the value is "00", it indicates that the congestion state is released, and when the value is "01", it indicates that it is in the congestion state.
服务端将自身是否处于拥塞状态的信息及时告知客户端,以使客户端可以合理地执行流量控制策略。The server informs the client in time whether it is in a congested state, so that the client can reasonably execute the flow control strategy.
在一种可能的实现中,所述第三消息可以是为基于HTTP的服务请求消息,所述第四消息可以为基于HTTP的服务响应消息。In a possible implementation, the third message may be an HTTP-based service request message, and the fourth message may be an HTTP-based service response message.
在一种可能的实现中,服务端与客户端交互的消息具有完整性保护,示例的,所述第一消息具有完整性保护,所述服务端在向所述客户端发送第二消息之前,还可以对第一消息的完整性进行校验,在对第一消息完整性校验通过后,再发送第二消息,第二消息也可以具有完整性保护。In a possible implementation, the message that the server interacts with the client has integrity protection. For example, the first message has integrity protection, and before the server sends the second message to the client, The integrity of the first message may also be verified. After the integrity check of the first message is passed, the second message is sent. The second message may also have integrity protection.
在另一示例中,所述第三消息具有完整性保护,所述服务端在向客户端发送第四消息之前,还可以对第三消息进行完整性校验,在对第三消息完整性校验通过后,再发送第四消息。所述第四消息也可以具有完整性保护。In another example, the third message has integrity protection, and the server may also perform an integrity check on the third message before sending the fourth message to the client. After the verification is passed, the fourth message is sent. The fourth message may also have integrity protection.
服务端与客户端交互的消息可以进行完整性保护,以避免攻击者的攻击。The messages exchanged between the server and the client can be integrity protected to avoid attacks by attackers.
在一种可能的实现中,所述服务端还可以接收上级服务端发送的第六消息,所述第六消息中可以包括用于指示拥塞状态的第一字段,上级服务端可以通过第一字段的值指示所述上级服务端的拥塞状态解除。所述服务端也可以在接收到上级服务端的拥塞状态解除的情况下,确定自身拥塞状态解除,进而向客户端发送第四消息,所述第四消息可以用于指示所述服务端的拥塞状态解除。In a possible implementation, the server may also receive a sixth message sent by an upper-level server, and the sixth message may include a first field for indicating the congestion state, and the upper-level server may use the first field The value of indicates that the congestion state of the upper-level server is removed. The server may also determine that its own congestion state is released upon receiving the congestion state release of the superior server, and then send a fourth message to the client. The fourth message may be used to indicate that the congestion state of the server is released. .
在一种可能的实现中,所述第五消息为基于HTTP的服务请求消息,所述第六消息为基于HTTP的服务请求消息。In a possible implementation, the fifth message is an HTTP-based service request message, and the sixth message is an HTTP-based service request message.
第二方面,提供了一种流量控制的方法,该方法的执行主体可以是客户端,客户端可以向服务端发送第一消息,所述第一消息可以用于指示所述客户端支持流量控制。所述客户端还可以接收来自所述服务端的针对所述第一消息的第二消息,所述第二消息可以包括第一流量控制策略,第一流量控制策略可以用于确定允许所述客户端向所述服务端发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数。所述客户端根据所述第一流量控制策略进行流量控制。In a second aspect, a flow control method is provided. The execution subject of the method may be a client, and the client may send a first message to the server, and the first message may be used to indicate that the client supports flow control. . The client may also receive a second message from the server for the first message, the second message may include a first flow control policy, and the first flow control policy may be used to determine that the client is allowed The first number of service request messages sent to the server, where the first number is an integer greater than or equal to 0. The client performs flow control according to the first flow control strategy.
客户端将自身支持流量控制的能力告知服务端,并根据服务端指示的第一流量控制策略进行流量控制。这样,客户端就可以合理地丢弃服务请求消息,即向服务端发送合理数量的服务请求消息,以保证业务的合理进行。The client informs the server of its ability to support flow control, and performs flow control according to the first flow control strategy indicated by the server. In this way, the client can reasonably discard the service request message, that is, send a reasonable number of service request messages to the server to ensure the reasonable progress of the business.
在一种可能的实现中,服务端接收到的所述第一消息可以包括所述客户端正在执行的第二流量控制策略,所述第二流量控制策略可以用于确定所述第一流量控制策略。第二流量控制策略用于确定允许所述客户端向所述服务端发送的服务请求消息的第二数量,所述第二数量为大于或等于0的整数。In a possible implementation, the first message received by the server may include a second flow control strategy being executed by the client, and the second flow control strategy may be used to determine the first flow control Strategy. The second flow control policy is used to determine a second number of service request messages that the client is allowed to send to the server, and the second number is an integer greater than or equal to 0.
客户端不仅可以上报自身支持流量控制,还可以将自身当前正在执行的第二流量控制策略告知服务端,以使服务端可以根据第二流量控制策略为客户端制定第一流量控制策略,使得制定的第一流量控制策略更加符合服务端的流量处理能力,也更加符合客户端的业务需求。The client can not only report that it supports flow control, but it can also inform the server of the second flow control strategy it is currently executing, so that the server can formulate the first flow control strategy for the client according to the second flow control strategy, so that The first flow control strategy is more in line with the flow processing capabilities of the server and more in line with the business needs of the client.
在一种可能的实现中,第一流量控制策略不但可以用于确定允许所述客户端向所述服务端发送的服务器请求消息的第一数量,所述第一流量控制策略还可以包括但不限于以下 多项中的至少一项:第一流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第一流量控制策略的生成时间、递增计数器;其中,所述流量控制方式包括:将超出所述第一数量的服务请求消息发送给其他服务端处理或将超出第一数量的服务请求消息丢弃,所述递增计数器用于判断所述第一流量控制策略是否为最新的流量控制策略。In a possible implementation, not only can the first flow control strategy be used to determine the first number of server request messages that the client is allowed to send to the server, the first flow control strategy can also include but not It is limited to at least one of the following: effective time of the first flow control strategy, flow control mode, type of service request message, generation time of the first flow control strategy, and increment counter; wherein, the flow control mode includes: Sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number, and the incrementing counter is used to determine whether the first flow control strategy is the latest flow control strategy .
在一种可能的实现中,第二流量控制策略不但可以用于确定允许所述客户端向所述服务端发送的服务器请求消息的第二数量,还可以包括但不限于:第二流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第二流量控制策略的生成时间、递增计数器中的一项或多项。其中,所述流量控制方式包括:将超出所述第二数量的服务请求消息发送给其他服务端处理或将超出第二数量的服务请求消息丢弃;所述递增计数器用于判断所述第二流量控制策略是否为最新的流量控制策略。In a possible implementation, the second flow control strategy can not only be used to determine the second number of server request messages that the client is allowed to send to the server, but can also include but is not limited to: a second flow control strategy One or more of the effective time, the flow control mode, the type of service request message, the generation time of the second flow control strategy, and the increment counter. Wherein, the flow control method includes: sending service request messages exceeding the second number to other servers for processing or discarding service request messages exceeding the second number; the incremented counter is used to determine the second flow Whether the control strategy is the latest flow control strategy.
在一种可能的实现中,如果所述第一流量控制策略中包括所述第一流量控制策略的生成时间,所述客户端在根据所述第一流量控制策略进行流量控制之前,所述客户端还可以确定正在执行的第二流量控制策略的生成时间是否早于所述第一流量控制策略的生成时间;如果是,则可以根据所述第一流量控制策略进行流量控制;如果否,则可以根据第二流量控制策略进行流量控制。In a possible implementation, if the first flow control policy includes the generation time of the first flow control policy, before the client performs flow control according to the first flow control policy, the client The terminal can also determine whether the generation time of the second flow control strategy being executed is earlier than the generation time of the first flow control strategy; if so, it can perform flow control according to the first flow control strategy; if not, then The flow control can be performed according to the second flow control strategy.
客户端可以根据每个流量控制策略的生成时间,确定生成时间最晚的,即最新的流量控制策略。客户端根据最新的流量控制策略进行流量控制,以实现更合理地处理业务数据。The client can determine the latest generation time according to the generation time of each flow control strategy, that is, the latest flow control strategy. The client performs flow control according to the latest flow control strategy to achieve a more reasonable processing of business data.
在一种可能的实现中,如果所述第一流量控制策略中包括递增计数器,所述客户端在根据所述第一流量控制策略进行流量控制之前,所述客户端还可以比较所述第一流量控制策略中的递增计数器和正在执行的第二流量控制策略的递增计数器,确定使用所述第一流量控制策略。In a possible implementation, if the first flow control policy includes an incrementing counter, before the client performs flow control according to the first flow control policy, the client may also compare the first The increment counter in the flow control strategy and the increment counter of the second flow control strategy being executed determine to use the first flow control strategy.
客户端可以根据每个流量控制策略的计数器,确定出最新的流量控制策略。客户端根据最新的流量控制策略进行流量控制,以实现更合理地处理业务数据。The client can determine the latest flow control strategy according to the counter of each flow control strategy. The client performs flow control according to the latest flow control strategy to achieve a more reasonable processing of business data.
在一种可能的实现中,所述第一消息可以为基于HTTP的服务请求消息,所述第二消息可以为基于HTTP的服务响应消息。In a possible implementation, the first message may be an HTTP-based service request message, and the second message may be an HTTP-based service response message.
在一种可能的实现中,所述客户端还可以向所述服务端发送第三消息,所述第三消息可以包括所述客户端正在执行的第二流量控制策略和/或客户端支持流量控制的指示,所述客户端还可以接收所述服务端发送的针对所述第三消息的第四消息,所述第四消息可以用于指示所述服务端的拥塞状态解除。所述客户端不再执行所述第一流量控制策略。所述第四消息是所述服务端在接收到所述第一流量控制策略后,在确定拥塞状态解除的情况下后发送的。In a possible implementation, the client may also send a third message to the server, and the third message may include the second traffic control strategy being executed by the client and/or the client supporting traffic For an indication of control, the client may also receive a fourth message sent by the server for the third message, and the fourth message may be used to indicate that the congestion state of the server is released. The client no longer executes the first flow control strategy. The fourth message is sent by the server after receiving the first flow control policy after it is determined that the congestion state is removed.
在一种可能的实现中,所述第四消息中可以包括用于指示拥塞状态的第一字段,服务端可以通过第一字段的值指示所述服务端的拥塞状态解除。例如当值为“00”时指示拥塞状态解除,当值为“01”时指示处于拥塞状态。In a possible implementation, the fourth message may include a first field for indicating the congestion state, and the server may indicate that the congestion state of the server is released through the value of the first field. For example, when the value is "00", it indicates that the congestion state is released, and when the value is "01", it indicates that it is in the congestion state.
服务端将自身是否处于拥塞状态的信息及时告知客户端,客户端可以合理地执行流量控制策略。The server informs the client in time whether it is in a congested state, and the client can reasonably execute the flow control strategy.
在一种可能的实现中,所述第三消息可以是为HTTP的服务请求消息,所述第四消息可以为基于HTTP的服务响应消息。In a possible implementation, the third message may be a service request message based on HTTP, and the fourth message may be a service response message based on HTTP.
在一种可能的实现中,服务端与客户端交互的消息可以具有完整性保护,示例的,所述第二消息具有完整性保护,所述客户端在根据第一流量控制策略进行流量控制之前,还 可以对第二消息的完整性进行校验。在对第二消息完整性校验通过后,再根据第一流量控制策略进行流量控制,第一消息也可以具有完整性保护。In a possible implementation, the message exchanged between the server and the client may have integrity protection. For example, the second message has integrity protection, and the client may perform flow control according to the first flow control policy. , You can also verify the integrity of the second message. After passing the integrity check of the second message, flow control is performed according to the first flow control strategy, and the first message may also have integrity protection.
在另一示例中,所述第四消息可以具有完整性保护,所述客户端在确定不再执行第一流量控制策略之前,还可以对第四消息进行完整性校验。在对第四消息完整性校验通过后,再确定不再执行第一流量控制策略。所述第三消息也可以具有完整性保护。In another example, the fourth message may have integrity protection, and the client may also perform an integrity check on the fourth message before determining that the first flow control policy is no longer executed. After passing the integrity check of the fourth message, it is determined that the first flow control strategy is no longer executed. The third message may also have integrity protection.
服务端与客户端交互的消息可以进行完整性保护,以避免攻击者的攻击。The messages exchanged between the server and the client can be integrity protected to avoid attacks by attackers.
第三方面,提供了一种通信装置,所述通信装置具有实现上述方法实施例中的服务端的功能。这些功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的功能模块。In a third aspect, a communication device is provided, and the communication device has the function of realizing the server in the foregoing method embodiment. These functions can be realized by hardware, or by hardware executing corresponding software. The hardware or software includes one or more functional modules corresponding to the above-mentioned functions.
第四方面,提供了一种通信装置,所述通信装置具有实现上述方法实施例中的客户端的功能。这些功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的功能模块。In a fourth aspect, a communication device is provided, and the communication device has the function of realizing the client in the foregoing method embodiment. These functions can be realized by hardware, or by hardware executing corresponding software. The hardware or software includes one or more functional modules corresponding to the above-mentioned functions.
第五方面,提供了一种通信装置,该通信装置可以为上述方法实施例中的服务端,或者为设置在服务端中的芯片。该通信装置包括收发器以及处理器,可选的,还包括存储器,其中,该存储器用于存储计算机程序或指令,处理器分别与存储器、收发器耦合,当处理器执行所述计算机程序或指令时,使通信装置执行上述方法实施例中由服务端所执行的方法。In a fifth aspect, a communication device is provided. The communication device may be the server in the foregoing method embodiment, or a chip set in the server. The communication device includes a transceiver and a processor, and optionally, a memory, where the memory is used to store a computer program or instruction, and the processor is respectively coupled with the memory and the transceiver. When the processor executes the computer program or instruction At this time, the communication device is caused to execute the method executed by the server in the foregoing method embodiment.
第六方面,提供了一种通信装置,该通信装置可以为上述方法实施例中的客户端,或者为设置在客户端中的芯片。该通信装置包括收发器以及处理器,可选的,还包括存储器,其中,该存储器用于存储计算机程序或指令,处理器分别与存储器、收发器耦合,当处理器执行所述计算机程序或指令时,使通信装置执行上述方法实施例中由客户端所执行的方法。In a sixth aspect, a communication device is provided. The communication device may be the client in the foregoing method embodiment, or a chip set in the client. The communication device includes a transceiver and a processor, and optionally, a memory, where the memory is used to store a computer program or instruction, and the processor is respectively coupled with the memory and the transceiver. When the processor executes the computer program or instruction At this time, the communication device is caused to execute the method executed by the client in the foregoing method embodiment.
第七方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码在计算机上运行时,使得计算机执行上述第一方面及第一方面任一可能的实现中由服务端执行的方法。In a seventh aspect, a computer program product is provided. The computer program product includes: computer program code, which when the computer program code runs on a computer, causes the computer to execute any of the above-mentioned first aspect and any possible aspect of the first aspect The method executed by the server in the implementation.
第八方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码在计算机上运行时,使得计算机执行上述第二方面及第二方面任一可能的实现中由客户端执行的方法。In an eighth aspect, a computer program product is provided, the computer program product comprising: computer program code, when the computer program code runs on a computer, the computer can execute any of the above-mentioned second aspect and any of the possible aspects of the second aspect Implementation of the method executed by the client.
第九方面,本申请提供了一种芯片系统,该芯片系统包括处理器和存储器,所述处理器、所述存储器之间电偶合;所述存储器,用于存储计算机程序指令;所述处理器,用于执行所述存储器中的部分或者全部计算机程序指令,当所述部分或者全部计算机程序指令被执行时,用于实现上述第一方面及第一方面任一可能的实现的方法中服务端的功能。In a ninth aspect, the present application provides a chip system including a processor and a memory, the processor and the memory are electrically coupled; the memory is used to store computer program instructions; the processor , Used to execute part or all of the computer program instructions in the memory. When the part or all of the computer program instructions are executed, they are used to implement the first aspect and any one of the possible implementation methods of the first aspect. Features.
在一种可能的设计中,所述芯片系统还包括收发器,所述收发器,用于发送所述处理器处理后的信号,或者接收信号输入给所述处理器。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。In a possible design, the chip system further includes a transceiver, and the transceiver is configured to send a signal processed by the processor or receive a signal input to the processor. The chip system can be composed of chips, and can also include chips and other discrete devices.
第十方面,提供了一种芯片系统,该芯片系统包括处理器和存储器,所述处理器、所述存储器之间电偶合;所述存储器,用于存储计算机程序指令;所述处理器,用于执行所述存储器中的部分或者全部计算机程序指令,当所述部分或者全部计算机程序指令被执行时,用于实现上述第二方面及第二方面任一可能的实现的方法中客户端的功能。In a tenth aspect, a chip system is provided. The chip system includes a processor and a memory, the processor and the memory are electrically coupled; the memory is used for storing computer program instructions; the processor is used for In executing part or all of the computer program instructions in the memory, when the part or all of the computer program instructions are executed, they are used to implement the functions of the client in the foregoing second aspect and any possible implementation method of the second aspect.
在一种可能的设计中,所述芯片系统还包括收发器,所述收发器,用于发送所述处理器处理后的信号,或者接收信号输入给所述处理器。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。In a possible design, the chip system further includes a transceiver, and the transceiver is configured to send a signal processed by the processor or receive a signal input to the processor. The chip system can be composed of chips, and can also include chips and other discrete devices.
第十一方面,提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,当该计算机程序被运行时,实现上述第一方面及第一方面任一可能的实现中由服务端执行的方法。In an eleventh aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. When the computer program is executed, the first aspect and any possible implementation of the first aspect are implemented by The method executed by the server.
第十二方面,本申请提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,当该计算机程序被运行时,实现上述第二方面及第二方面任一可能的实现中由客户端执行的方法。In a twelfth aspect, this application provides a computer-readable storage medium that stores a computer program, and when the computer program is executed, the second aspect and any possible implementation of the second aspect are realized In the method executed by the client.
第十三方面,提供了一种通信系统,该系统可以包括执行上述第一方面和第一方面的任一可能的实现中所述的方法的服务端、以及执行上述第二方面和第二方面的任一可能的实现中所述的方法的客户端。In a thirteenth aspect, a communication system is provided. The system may include a server that executes the method described in any possible implementation of the first aspect and the first aspect, and executes the second aspect and the second aspect. Any possible implementation of the method described in the client.
图1为本申请实施例中提供的一种架构示意图;FIG. 1 is a schematic diagram of an architecture provided in an embodiment of the application;
图2为本申请实施例中提供的一种流量控制流程图;Figure 2 is a flow control flow chart provided in an embodiment of the application;
图3为本申请实施例中提供的一种流量控制流程图;Figure 3 is a flow control flow chart provided in an embodiment of the application;
图4为本申请实施例中提供的一种流量控制流程图;Figure 4 is a flow control flow chart provided in an embodiment of the application;
图5为本申请实施例中提供的一种通信装置示意图;FIG. 5 is a schematic diagram of a communication device provided in an embodiment of this application;
图6为本申请实施例中提供的一种通信装置示意图;FIG. 6 is a schematic diagram of a communication device provided in an embodiment of this application;
图7为本申请实施例中提供的一种通信装置示意图;FIG. 7 is a schematic diagram of a communication device provided in an embodiment of this application;
图8为本申请实施例中提供的一种通信装置示意图。FIG. 8 is a schematic diagram of a communication device provided in an embodiment of this application.
下面将结合附图,对本申请实施例进行详细描述。The embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.
为便于理解本申请实施例,以下对本申请实施例的部分用语进行解释说明,以便于本领域技术人员理解。In order to facilitate the understanding of the embodiments of the present application, some terms of the embodiments of the present application are explained below to facilitate the understanding of those skilled in the art.
1)、终端,又称之为用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)等,是一种向用户提供语音和/或数据连通性的设备。例如,终端设备包括具有无线连接功能的手持式设备、车载设备、物联网设备等。目前,终端设备可以是:手机(mobile phone)、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(mobile internet device,MID)、可穿戴设备,虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端,或智慧家庭(smart home)中的无线终端等。1) Terminal, also called user equipment (UE), mobile station (MS), mobile terminal (MT), etc., is a way to provide users with voice and/or data connectivity device of. For example, terminal devices include handheld devices with wireless connection functions, vehicle-mounted devices, and Internet of Things devices. At present, terminal devices can be: mobile phones (mobile phones), tablets, notebook computers, handheld computers, mobile Internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality ( augmented reality (AR) equipment, industrial control (industrial control) wireless terminals, unmanned driving (self-driving) wireless terminals, remote medical surgery (remote medical surgery) wireless terminals, smart grid (smart grid) Wireless terminals, wireless terminals in transportation safety, wireless terminals in smart cities, or wireless terminals in smart homes, etc.
2)、客户端,主动向服务端发送服务请求消息的一端,或者调用服务端的服务的一端。2) The client, the end that actively sends a service request message to the server, or the end that calls the service of the server.
3)、服务端,接收客户端发送的服务请求消息后,并向客户端反馈响应的一端,或者为客户端提供服务的一端。3), the server, after receiving the service request message sent by the client, and the end that responds to the client, or the end that provides services to the client.
4)完整性保护,指在传输、存储信息或数据的过程中,确保信息或数据不被未授权的更改或在更改后能够被迅速发现。需要说明的是,具有完整性保护的消息中一般会包括消息认证码(MAC)信息,在对具有完整性保护的消息进行校验时,可以使用相同的哈希算法对具有完整性保护的消息中的信息进行哈希运算,计算MAC信息,将计算出的MAC信息与具有完整性保护的消息中的MAC信息进行比较,确定两个MAC信息是否相同,如果MAC信息相同,则完整性校验通过。4) Integrity protection refers to the process of transmitting and storing information or data to ensure that the information or data is not changed without authorization or can be quickly discovered after the change. It should be noted that messages with integrity protection generally include message authentication code (MAC) information. When verifying messages with integrity protection, the same hash algorithm can be used for integrity-protected messages. Hash the information in the information, calculate the MAC information, compare the calculated MAC information with the MAC information in the integrity-protected message, to determine whether the two MAC information is the same, if the MAC information is the same, then the integrity check by.
另外,需要说明的是本申请中的具有完整性保护的消息,还可以具有机密性保护和/或防重放保护,其中机密性保护指信息无法被未经授权的个人、实体、流程访问或披露的特性。防重放保护指接收方接收攻击者重复的报文。In addition, it should be noted that the integrity-protected messages in this application may also have confidentiality protection and/or anti-replay protection, where confidentiality protection means that the information cannot be accessed by unauthorized individuals, entities, or processes. Disclosure of characteristics. Anti-replay protection means that the receiver receives repeated packets from the attacker.
5)流量处理能力,是指一段时间内能够处理的服务请求消息的数量。5) Traffic processing capacity refers to the number of service request messages that can be processed in a period of time.
6)拥塞,是指在一段时间内接收到的服务请求消息的数量超过了能够处理的服务请求消息的数量。6) Congestion means that the number of service request messages received in a period of time exceeds the number of service request messages that can be processed.
本申请中的“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。The "and/or" in this application describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone. This situation. The character "/" generally indicates that the associated objects before and after are in an "or" relationship.
本申请中所涉及的多个,是指两个或两个以上。The multiple involved in this application refers to two or more.
在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。In the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing description, and cannot be understood as indicating or implying relative importance, nor as indicating or implying order.
另外,在本申请实施例中,“示例的”一词用于表示作例子、例证或说明。本申请中被描述为“示例”的任何实施例或实现方案不应被解释为比其它实施例或实现方案更优选或更具优势。确切而言,使用示例的一词旨在以具体方式呈现概念。In addition, in the embodiments of the present application, the word "exemplary" is used to mean serving as an example, illustration, or illustration. Any embodiment or implementation described as an "example" in this application should not be construed as being more preferable or advantageous than other embodiments or implementations. To be precise, the term example is used to present the concept in a concrete way.
本申请实施例提供了一种流量控制的方法及装置,其中,方法、装置是基于同一技术构思的,由于方法、装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。The embodiments of the present application provide a method and device for flow control. The method and device are based on the same technical idea. Since the principles of the method and device to solve the problem are similar, the implementation of the device and the method can be referred to each other. No longer.
本申请实施例的技术方案可以应用于各种通信系统,例如:长期演进(long term evolution,LTE)系统,全球互联微波接入(worldwide interoperability for microwave access,WiMAX)通信系统,未来的第五代(5th Generation,5G)系统,如新一代无线接入技术(new radio access technology,NR),及未来的通信系统等。The technical solutions of the embodiments of this application can be applied to various communication systems, such as long term evolution (LTE) systems, worldwide interoperability for microwave access (WiMAX) communication systems, and the fifth generation of the future (5th Generation, 5G) systems, such as new radio access technology (NR), and future communication systems.
图1为本申请适用的一种可能的通信系统架构示意图,包括:UE、(无线)接入网设备(radio access network,(R)AN)、UPF网元、DN网元、AUSF网元、AMF网元、SMF网元、NESSF网元NEF网元、NRF网元、PCF网元、UDM网元和AF网元,其中网元也可以称为功能实体设备,UPF网元、DN网元、AUSF网元、AMF网元、SMF网元、NESSF网元NEF网元、NRF网元、PCF网元、UDM网元和AF网可以为核心网网元。在该网络架构中,Nnssf为NESSF展现的基于服务的接口、Nausf为AUSF展现的基于服务的接口,Namf为AMF展现的基于服务的接口,Nsmf为SMF展现的基于服务的接口,Nnef为NEF展现的基于服务的接口,Nnrf为NRF展现的基于服务的接口,Npcf为PCF展现的基于服务的接口,Nudm为UDM展现的基于服务的接口,Naf为AF展现的基于服务的接口。基于服务的接口也可称为服务化接口。各个网元可以提供一个或多个服务化接口的服务,由其他网元调用,同时也会调用其他网元的服务化接口的服务。Figure 1 is a schematic diagram of a possible communication system architecture applicable to this application, including: UE, (radio access network, (R)AN), UPF network element, DN network element, AUSF network element, AMF network elements, SMF network elements, NESSF network elements, NEF network elements, NRF network elements, PCF network elements, UDM network elements, and AF network elements, among which network elements can also be called functional entity equipment, UPF network elements, DN network elements, AUSF network elements, AMF network elements, SMF network elements, NESSF network elements, NEF network elements, NRF network elements, PCF network elements, UDM network elements, and AF networks may be core network network elements. In this network architecture, Nnssf is the service-based interface displayed by NESSF, Nausf is the service-based interface displayed by AUSF, Namf is the service-based interface displayed by AMF, Nsmf is the service-based interface displayed by SMF, and Nnef is displayed by NEF. Nnrf is a service-based interface displayed by NRF, Npcf is a service-based interface displayed by PCF, Nudm is a service-based interface displayed by UDM, and Naf is a service-based interface displayed by AF. Service-based interfaces can also be called service-oriented interfaces. Each network element can provide one or more service-oriented interface services, which are called by other network elements, and at the same time, the service-oriented interface services of other network elements will also be called.
N1为UE和AMF之间的参考点,N2为(R)AN和AMF的参考点,用于非接入层消息 的发送等;N3为(R)AN和UPF之间的参考点,用于传输用户面的数据等;N4为SMF和UPF之间的参考点,用于传输例如N3连接的隧道标识信息,数据缓存指示信息,以及下行数据通知消息等信息;N6接口为UPF和DN之间的参考点,用于传输用户面的数据等。N1 is the reference point between UE and AMF, N2 is the reference point between (R)AN and AMF, used for sending non-access stratum messages, etc.; N3 is the reference point between (R)AN and UPF, used for Transmit user plane data, etc.; N4 is the reference point between SMF and UPF, used to transmit information such as N3 connection tunnel identification information, data buffer indication information, and downlink data notification messages; N6 interface is between UPF and DN The reference point is used to transmit user plane data, etc.
其中,接入以及移动性管理功能网元(access and mobility management function,AMF),具有核心网控制面功能,提供用户的移动性管理以及接入管理的功能,SEAF具有安全认证、管理和推演安全密钥等功能。Among them, the access and mobility management function (AMF) has the core network control plane function, providing user mobility management and access management functions, and SEAF has security authentication, management, and deduction security. Functions such as keys.
网络存储功能(network repository function,NRF)网元:用于存储核心网中部署的网络功能的信息,提供网络功能和服务的发现等。Network repository function (NRF) network element: used to store information about the network functions deployed in the core network, and provide discovery of network functions and services.
用户面功能(user plane function,UPF)网元:用于分组路由和转发以及用户面数据的服务质量(quality of service,QoS)处理等。User plane function (UPF) network element: used for packet routing and forwarding, and quality of service (QoS) processing of user plane data, etc.
数据网络(data network,DN)网元:用于提供传输数据的网络。Data network (DN) network element: a network used to provide data transmission.
认证服务器功能(authentication server function,AUSF)网元:用于实现对用户的鉴权和认证等。Authentication server function (authentication server function, AUSF) network element: used to implement user authentication and authentication.
会话管理功能(Session Management Function,SMF)网元:主要用于会话管理、终端设备的网络互连协议(internet protocol,IP)地址分配和管理、选择可管理用户平面功能、策略控制和收费功能接口的终结点以及下行数据通知等。Session Management Function (SMF) network element: Mainly used for session management, terminal device Internet protocol (IP) address allocation and management, selection of manageable user plane functions, policy control and charging function interfaces The end point and downlink data notification, etc.
网络开放功能(network exposure function,NEF)网元:用于安全地向外部开放由3GPP网络功能网元提供的业务和能力等。Network exposure function (NEF) network element: used to safely open the services and capabilities provided by the 3GPP network function network element to the outside.
策略控制功能(policy control function,PCF)网元:用于指导网络行为的统一策略框架,为控制面功能网元(例如AMF,SMF网元等)提供策略规则信息等。Policy control function (PCF) network element: a unified policy framework used to guide network behavior, and provide policy rule information for control plane function network elements (such as AMF, SMF network elements, etc.).
应用功能(application function,AF)网元:用于管理终端的设备,存储所管理的终端的属性信息,例如终端的位置信息、类型等。Application function (AF) network element: a device used to manage a terminal, and store attribute information of the managed terminal, such as location information and type of the terminal.
统一数据管理(unified data management,UDM)网元:用于处理用户标识,接入鉴权,注册以及移动性管理等。Unified data management (UDM) network elements: used to process user identification, access authentication, registration, and mobility management.
网络切片选择功能(network slice selection function,SSF):用于选择服务UE的一组网络切片实例。Network slice selection function (SSF): used to select a group of network slice instances to serve the UE.
应理解,上述应用于本申请实施例的网络架构仅是举例说明的从服务化架构的角度描述的网络架构,适用本申请实施例的网络架构并不局限于此,任何能够实现上述各个网元的功能的网络架构都适用于本申请实施例。It should be understood that the above-mentioned network architecture applied to the embodiment of the present application is only an example of a network architecture described from the perspective of a service-oriented architecture, and the network architecture applicable to the embodiment of the present application is not limited to this, and any network element that can implement the above-mentioned various network elements The network architectures of all functions are applicable to the embodiments of this application.
为便于理解本申请实施例,接下来对本请的应用场景进行介绍,本申请实施例描述的业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。In order to facilitate the understanding of the embodiments of this application, the application scenarios of this application will be introduced next. The business scenarios described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application, and do not constitute the provision of the embodiments of this application. As for the limitation of technical solutions, those of ordinary skill in the art will know that with the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
UE侧或R(AN)侧可以向核心网侧的网元请求服务,核心网侧的下级网元也可以向上级网元发送服务请求消息,用以请求服务。结合图1所示,在一个示例中,AMF网元(下级网元)接收到UE侧或R(AN)侧的请求后,可以向UDM网元(上级网元)发送服务请求消息,UDM网元对所述服务请求消息进行处理,并向AMF反馈服务响应消息。AMF网元接收到针对服务请求消息的服务响应消息后,再向UE侧或R(AN)侧反馈响应。在本申请中,将主动发送服务请求消息的一端,或者调用服务端的服务的一端称为客户端。将接收客户端发送的服务请求消息后,并向客户端反馈响应的一端,或者为客户端提供服 务的一端称为服务端。如果AMF网元直接向UDM网元发送服务请求消息,则AMF网元为客户端,UDM网元为服务端。The UE side or the R(AN) side may request a service from the network element on the core network side, and the lower-level network element on the core network side may also send a service request message to the upper-level network element to request the service. As shown in Figure 1, in an example, after the AMF network element (subordinate network element) receives the request from the UE side or the R(AN) side, it can send a service request message to the UDM network element (upper network element). The element processes the service request message and feeds back the service response message to the AMF. After the AMF network element receives the service response message for the service request message, it feeds back the response to the UE side or the R(AN) side. In this application, the end that actively sends the service request message or the end that calls the service of the server is called the client. The end that receives the service request message sent by the client and feeds back the response to the client, or the end that provides services to the client is called the server. If the AMF network element directly sends a service request message to the UDM network element, the AMF network element is the client and the UDM network element is the server.
在另一示例中,AMF网元通过AUSF网元与UDM网元进行通信,AMF网元向AUSF网元发送服务请求消息,AUSF网元再向UDM网元发送服务请求消息。AUSF网元在接收AMF网元的服务请求消息时,AMF网元为客户端,AUSF网元为服务端。AUSF网元在向UDM网元发送服务请求消息时,AUSF网元为客户端,UDM网元为服务端。由此可以看出,AUSF网元在与不同的网元进行通信时,角色可能会发生变化。由此可以得出,一个网元既可以是客户端,也可以是服务端。In another example, the AMF network element communicates with the UDM network element through the AUSF network element, the AMF network element sends a service request message to the AUSF network element, and the AUSF network element sends a service request message to the UDM network element. When the AUSF network element receives the service request message of the AMF network element, the AMF network element is the client and the AUSF network element is the server. When the AUSF network element sends a service request message to the UDM network element, the AUSF network element is the client and the UDM network element is the server. It can be seen that the role of the AUSF network element may change when it communicates with different network elements. It can be concluded that a network element can be either a client or a server.
服务端的流量处理能力有限,如果在一段时间中,客户端向服务端发送大量的服务请求消息,超过服务端的流量处理能力,服务端则会发生拥塞。服务端为了避免拥塞,可以针对部分服务请求消息向客户端返回服务不可用(service unavailable)的响应。The traffic processing capability of the server is limited. If the client sends a large number of service request messages to the server in a period of time, which exceeds the traffic processing capability of the server, the server will be congested. In order to avoid congestion, the server can return a service unavailable response to the client for some service request messages.
目前,客户端可以采用以下方案进行流量控制,以避免服务端的拥塞:客户端可以根据收到的非服务不可用的响应(被服务端成功处理的服务请求消息)的数量,以及根据经验得到的比例系数,估算服务端针对该客户端的流量处理能力。客户端根据估算出的服务端针对该客户端的流量处理能力,丢弃超过服务端针对该客户端的流量处理能力的服务请求消息。At present, the client can use the following schemes for flow control to avoid congestion on the server: the client can receive the number of non-service unavailable responses (service request messages successfully processed by the server), and the experience obtained The proportional coefficient is used to estimate the traffic processing capacity of the server for the client. The client discards the service request message that exceeds the traffic processing capability of the server for the client according to the estimated traffic processing capability of the server for the client.
在目前的流量控制方案中,客户端无法准确估算出服务端的真实情况,容易出现服务请求消息丢弃太多或者服务请求消息丢弃不足的情况。并且服务端不清楚客户端服务请求消息减少的原因是客户端进行了流量控制,还是客户端本身发送的服务请求消息减少。一般会有多个客户端向同一个服务端请求服务,如果某一个客户端进行流量控制,而其他客户端不进行流量控制。服务端按照统一的策略(例如收到服务请求消息的比例值)向每个客户端回复服务不可用的响应,则会导致主动进行流量控制的客户端丢弃的请求消息越来越多,则被正常处理的服务请求消息越来越少。In the current flow control scheme, the client cannot accurately estimate the real situation of the server, and it is prone to discard too many service request messages or insufficient service request messages. And the server does not know whether the reason for the decrease in client service request messages is that the client performs flow control or the service request messages sent by the client itself decrease. Generally, there are multiple clients requesting services from the same server. If one client performs flow control, other clients do not perform flow control. The server responds to each client with a response that the service is unavailable according to a unified strategy (for example, the proportion of service request messages received), which will cause more and more request messages to be discarded by clients that actively perform flow control. There are fewer and fewer service request messages that are normally processed.
例如,有三个客户端c1、c2、c3分别与服务端连接,c1、c2、c3分别向服务端发送200条服务请求消息,服务端根据自身的流量处理能力,确定不能成功处理(例如丢弃或者回复服务不可用)的请求消息为60*50=300条。服务端可以针对c1、c2、c3分别处理100条服务请求消息,另外的100条可以丢弃或回复服务不可用的响应。如果此时c3进行流量控制,c3会认为服务端仅能处理100条服务请求消息,则下个周期中即使c3有150、200条甚至更多条服务请求消息,c3也仅会向服务端发送100条左右的服务请求消息,多余的服务请求消息进行丢弃。服务端不知道c3是因为进行流量控制才上报100条服务请求消息的,服务端以为c3仅有100条服务请求消息。服务端针对c3上报的100条服务消息仅处理60条。则客户端认为服务端仅能处理60条服务请求消息,则下个周期仅会上报60条左右的服务请求消息,以此类推,会导致主动进行流量控制的客户端丢弃的请求消息越来越多,则被正常处理的服务请求消息越来越少。For example, there are three clients c1, c2, and c3 respectively connected to the server. C1, c2, and c3 respectively send 200 service request messages to the server. The server determines that it cannot be successfully processed (such as discarding or discarding) according to its own traffic processing capabilities. The number of request messages for reply service unavailable is 60*50=300. The server can process 100 service request messages for c1, c2, and c3, respectively, and the other 100 can be discarded or reply with unavailable services. If c3 is performing flow control at this time, c3 will think that the server can only handle 100 service request messages, and even if c3 has 150, 200 or more service request messages in the next cycle, c3 will only send to the server About 100 service request messages, redundant service request messages are discarded. The server does not know that c3 is reporting 100 service request messages because of flow control. The server thinks that c3 only has 100 service request messages. The server only processes 60 service messages for the 100 service messages reported by c3. Then the client thinks that the server can only process 60 service request messages, and then only about 60 service request messages will be reported in the next cycle, and so on, will cause more and more request messages discarded by clients that actively perform flow control. If more, there are fewer and fewer service request messages that are normally processed.
基于此,本申请实施例提供了一种流量控制的方法,客户端将自身具有流量控制的能力告知服务端,服务端可以向客户端下发流量控制策略,该流量控制策略用于确定服务端期望客户端向服务端发送的服务请求消息的数量,或者期望客户端丢弃的服务请求消息的数量。则客户端可以根据服务端下发的流量控制策略,向服务端发送合理数量的服务请求消息,以实现双方更灵活、合理地处理业务数据。Based on this, the embodiment of the present application provides a flow control method. The client informs the server that it has flow control capabilities. The server can issue a flow control policy to the client. The flow control policy is used to determine the server. The number of service request messages that the client is expected to send to the server, or the number of service request messages that the client is expected to discard. Then the client can send a reasonable number of service request messages to the server according to the flow control strategy issued by the server, so that both parties can process business data more flexibly and reasonably.
如图2所示,提供了一种流量控制的流程示意图。图2所示的客户端可以是图1所示 的AMF网元,对应的服务端可以是图1所示的UDM网元。图2所示的客户端可以是图1所示的AMF网元,对应的服务端可以是图1所示的AUSF网元。图2所示的客户端可以是图1所示的AUSF网元,对应的服务端可以是图1所示的UDM网元。此处仅是给出了客户端和服务端几个示例,相信本领域技术人员可以根据实际应用中的业务需求,合理地想出其他的客户端和服务端的示例。As shown in Figure 2, a schematic flow diagram of flow control is provided. The client shown in FIG. 2 may be the AMF network element shown in FIG. 1, and the corresponding server may be the UDM network element shown in FIG. 1. The client shown in FIG. 2 may be the AMF network element shown in FIG. 1, and the corresponding server may be the AUSF network element shown in FIG. 1. The client shown in FIG. 2 may be the AUSF network element shown in FIG. 1, and the corresponding server may be the UDM network element shown in FIG. 1. Here are just a few examples of the client and server. It is believed that those skilled in the art can reasonably think of other examples of the client and server according to the business requirements in actual applications.
步骤201:客户端向服务端发送第一消息,相应的,服务端接收客户端发送的第一消息,所述第一消息用于指示所述客户端支持流量控制。Step 201: The client sends a first message to the server. Correspondingly, the server receives the first message sent by the client. The first message is used to indicate that the client supports flow control.
由于,下层网元可以向上层网元发送服务请求消息,用以请求服务,上层网元可以向下层网元回复服务响应消息,用以提供服务。因此,客户端作为一个网元,可以在接收到下层网元发送的服务请求消息时,向上层网元(即服务端)发送服务请求消息。客户端可以在向服务端发送服务请求消息时,告知服务端自身支持流量控制。示例的,第一消息可以是服务请求消息,进一步地,第一消息可以是基于HTTP的服务请求消息。第一消息中可以携带客户端支持流量控制的指示,来用于指示客户端支持流量控制。该客户端支持流量控制的指示可以在HTTP消息的头域(header)中携带,也可以在HTTP消息的消息体(body)中携带。第一消息也可以是独立于服务请求消息外的其他消息,例如定义一条新的消息。第一消息在本申请中不进行限定。Because the lower-layer network element can send a service request message to the upper-layer network element to request services, the upper-layer network element can reply to the lower-layer network element with a service response message to provide services. Therefore, as a network element, the client can send a service request message to an upper network element (that is, the server) when receiving a service request message sent by a lower network element. The client can inform the server that it supports flow control when sending a service request message to the server. For example, the first message may be a service request message, and further, the first message may be a service request message based on HTTP. The first message may carry an indication that the client supports flow control to indicate that the client supports flow control. The indication that the client supports flow control can be carried in the header of the HTTP message, and can also be carried in the body of the HTTP message. The first message may also be other messages independent of the service request message, for example, define a new message. The first message is not limited in this application.
客户端不仅可以向服务端上报自身支持流量控制的能力,客户端还可以将自身支持的流量控制方式上报给服务端,以便服务端为客户端制定更加合理的流量控制策略,则第一消息中还可以包括客户端支持的流量控制方式,其中客户端支持的流量控制方式可以是将服务请求消息发送给其他服务端处理,或者将服务请求消息丢弃,也可以是两者都支持。The client can not only report its ability to support flow control to the server, but the client can also report the flow control method it supports to the server, so that the server can formulate a more reasonable flow control strategy for the client, then the first message It may also include a flow control method supported by the client, where the flow control method supported by the client may be sending the service request message to other servers for processing, or discarding the service request message, or both.
如果客户端当前正在执行第二流量控制策略,客户端也可以将正在执行的第二流量控制策略告知服务端,以便服务端为客户端制定更加合理的流量控制策略,则第一消息还可以包括第二流量控制策略。If the client is currently executing the second flow control strategy, the client can also inform the server of the second flow control strategy being executed, so that the server can formulate a more reasonable flow control strategy for the client, and the first message can also include The second flow control strategy.
步骤202:服务端向客户端发送针对所述第一消息的第二消息,相应的,客户端接收服务端发送的第二消息,所述第二消息包括第一流量控制策略。Step 202: The server sends a second message for the first message to the client. Correspondingly, the client receives the second message sent by the server, where the second message includes the first flow control policy.
服务端在接收到客户端发送的客户端支持流量控制的指示后,可以为客户端制定第一流量控制策略,并将制定的第一流量控制策略发送给客户端。第一流量控制策略可以用于确定允许所述客户端向所述服务端发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数。该第一数量可以是指在一个固定时间长度中允许发送服务请求消息的数量,也可以是一个不固定时间长度中允许发送服务请求消息的数量。固定时间长度例如一个周期,不固定时间长度例如服务端向客户端反馈两次服务响应消息的时间间隔,或者反馈两次特定类型的服务响应消息的时间间隔。第一数量可以是相对数量,例如第一数量可以是服务端指示客户端减少的服务请求消息的比例。第一数量也可以是绝对数量,例如第一数量可以是服务端指示客户端发送的服务请求消息的数量的值。After receiving the indication from the client that the client supports flow control, the server may formulate a first flow control strategy for the client, and send the formulated first flow control strategy to the client. The first flow control policy may be used to determine a first number of service request messages that the client is allowed to send to the server, and the first number is an integer greater than or equal to zero. The first number may refer to the number of service request messages allowed to be sent in a fixed time length, or the number of service request messages allowed to be sent in an unfixed time length. The fixed time length is, for example, one cycle, and the variable time length is, for example, the time interval for the server to feed back two service response messages to the client, or the time interval for two specific types of service response messages. The first quantity may be a relative quantity, for example, the first quantity may be a proportion of service request messages that the server instructs the client to reduce. The first quantity may also be an absolute quantity. For example, the first quantity may be a value at which the server indicates the number of service request messages sent by the client.
进一步地,所述第一流量控制策略还可以包括但不限于以下多项中的至少一项:Further, the first flow control strategy may also include but is not limited to at least one of the following items:
第一流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第一流量控制策略的生成时间,递增计数器。The effective time of the first flow control strategy, the flow control mode, the type of service request message, and the generation time of the first flow control strategy, increment the counter.
所述有效时间可以为一个时长值,例如3s、10s等,也可以是一个时间点,例如2019年5月1日23点20分。如果有效时间为一个时长值,可以通过具体的时间数值体现,例如10s,也可以通过周期的数量体现,例如服务端可以与客户端预先约定一个周期的时长 为2s,该有效时间可以是5个周期。客户端可以在第一流量控制策略的有效时间内执行第一流量控制策略。The valid time may be a duration value, such as 3s, 10s, etc., or a time point, such as 23:20 on May 1, 2019. If the effective time is a duration value, it can be reflected by a specific time value, such as 10s, or by the number of cycles. For example, the server and the client can pre-appoint a period of 2s, and the effective time can be 5 cycle. The client can execute the first flow control strategy within the effective time of the first flow control strategy.
所述流量控制方式包括:客户端将超出所述第一数量的服务请求消息发送给其他服务端处理或将超出第一数量的服务请求消息丢弃。客户端中可以预先配置其它服务端的标识,客户端也可以通过网络存储功能(network repository function,NRF)查询其它服务端的标识,或者流量控制策略中可以携带其它服务端的标识。The flow control method includes: the client sends the service request messages exceeding the first number to other servers for processing or discards the service request messages exceeding the first number. The client can pre-configure the identifiers of other servers, and the client can also query the identifiers of other servers through the network repository function (NRF), or the traffic control policy can carry the identifiers of other servers.
服务请求消息的类型可以是服务端指示客户端针对那些类型的消息进行流量控制,针对其它类型的消息可以不进行流量控制。服务请求消息的类型例如可以是:注册请求消息,读取签约数据请求消息,订阅数据变更请问消息等等,具体可以参考3GPP规范中的定义。The type of the service request message may be that the server instructs the client to perform flow control for those types of messages, and may not perform flow control for other types of messages. The type of the service request message may be, for example, a registration request message, a read subscription data request message, a subscription data change request message, etc. For details, please refer to the definition in the 3GPP specification.
第一流量控制策略的生成时间可以用于确定第一流量控制策略是否为最新的流量控制策略。The generation time of the first flow control strategy may be used to determine whether the first flow control strategy is the latest flow control strategy.
第一流量控制策略的递增计数器也可以用于确定第一流量控制策略是否为最新的流量控制策略。The increment counter of the first flow control strategy can also be used to determine whether the first flow control strategy is the latest flow control strategy.
客户端可以将自身正在执行的第二流量控制策略告知服务端,第二流量控制策略不但可以用于确定允许所述客户端向所述服务端发送的服务器请求消息的第二数量,还可以包括但不限于:第二流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第二流量控制策略的生成时间、递增计数器中的一项或多项。其中,所述流量控制方式包括:客户端将超出所述第二数量的服务请求消息发送给其他服务端处理或将超出第二数量的服务请求消息丢弃;所述递增计数器用于判断所述第二流量控制策略是否为最新的流量控制策略。The client can inform the server of the second flow control policy it is executing. The second flow control policy can not only be used to determine the second number of server request messages that the client is allowed to send to the server, but also include But not limited to: one or more of the effective time of the second flow control strategy, the flow control mode, the type of service request message, the generation time of the second flow control strategy, and the increment counter. Wherein, the flow control method includes: the client sends the service request messages exceeding the second number to other servers for processing or discards the service request messages exceeding the second number; the increment counter is used to determine the first 2. Whether the flow control strategy is the latest flow control strategy.
如果客户端在第一消息中上报了第二流量控制策略,服务端向客户端下发的第一流量控制策略,可以是包括上述介绍的第一流量控制策略的有效时间、流量控制方式、服务请求消息的类型、生成时间、递增计数器中的一项或多项,还可以是服务端向客户端告知第一流量控制策略与第二流量控制策略的不同之处即可。客户端就可以根据服务端告知的不同之处,对正在执行的第二流量控制策略进行调整,则调整后的流量控制策略则为第一流量控制策略。If the client reports the second flow control strategy in the first message, the first flow control strategy issued by the server to the client may include the effective time, flow control method, and service of the first flow control strategy described above. One or more of the type of the request message, the generation time, and the incremented counter may also be that the server informs the client of the difference between the first flow control strategy and the second flow control strategy. The client can then adjust the second flow control strategy being executed according to the difference notified by the server, and the adjusted flow control strategy will be the first flow control strategy.
服务端可以在任何状态下,只要接收到客户端发送的支持流量控制的指示,就为客户端制定第一流量控制策略。在一个具体的示例中,服务端也可以只在处于拥塞状态的情况下,为客户端制定第一流量控制策略。服务端在接收到客户端发送的客户端支持流量控制的指示后,如果服务端当前处于拥塞状态,服务端可以根据服务器端的流量处理能力为客户端制定第一流量控制策略。如果服务端当前未处于拥塞状态,服务端可以忽略客户端发送的支持流量控制的指示。The server can be in any state, as long as it receives an instruction from the client to support flow control, it will formulate the first flow control strategy for the client. In a specific example, the server can also formulate the first flow control strategy for the client only when it is in a congested state. After the server receives the indication from the client that the client supports flow control, if the server is currently in a congested state, the server can formulate a first flow control strategy for the client according to the server's flow processing capability. If the server is not currently in a congested state, the server can ignore the instructions sent by the client to support flow control.
以下具体介绍服务端处于拥塞状态,根据流量处理能力,为客户端制定第一流量控制策略的过程:The following specifically introduces the process of making the first flow control strategy for the client based on the flow processing capacity when the server is in a congested state:
服务端可以根据自己的多个资源使用情况,(如CPU的使用率,消息处理的时间等)估算出本周期自身的负载程度。例如CPU使用率大于98%,则估算本周期为极高负载;CPU使用率在90%到98%之间,估算本周期为高负载;CPU使用率在80%到90%之间,估算本周期为较高负载;CPU使用率低于80%,估算本周期为轻负载。再例如,消息处理时延大于3秒,则估算本周期为极高负载,消息处理时延1秒到3秒,则估算本周期为高负载,消息处理时延低于1秒,则估算本周期为轻负载。服务端的负载程度可以是多个资 源对应的负载中的最高程度,也可以根据多个资源对应的负载的程度进行综合计算得到。The server can estimate its own load level in this cycle according to its multiple resource usage (such as CPU usage, message processing time, etc.). For example, if the CPU usage rate is greater than 98%, it is estimated that the current cycle is extremely high; the CPU usage rate is between 90% and 98%, and the current cycle is estimated to be a high load; the CPU usage rate is between 80% and 90%, and the cost is estimated The cycle is high load; the CPU usage rate is less than 80%, and it is estimated that this cycle is light load. For another example, if the message processing delay is greater than 3 seconds, it is estimated that the current cycle is extremely high load, and the message processing delay is 1 to 3 seconds, then the current cycle is estimated to be high load, and the message processing delay is less than 1 second, then the current cycle is estimated to be a high load. The cycle is light load. The load level of the server can be the highest level of the load corresponding to multiple resources, or it can be calculated comprehensively according to the load level of multiple resources.
服务端可以先根据上一周期处理的服务请求消息的数量,本周期的负载程度,上一周期的负载程度,以及负载的变化趋势,估算本周期能够处理(可能会处理成功,也可能会处理失败)的服务请求消息的数量,即估算流量处理能力。服务端还可以根据上一周期接收的服务请求消息的数量,估算本周期即将收到的服务请求消息的数量。Based on the number of service request messages processed in the previous cycle, the load level of the current cycle, the load level of the previous cycle, and the trend of load changes, the server can first estimate that it can be processed in this cycle (may be processed successfully, or may be processed) The number of service request messages that failed) is the estimated traffic processing capacity. The server can also estimate the number of service request messages that will be received in this cycle based on the number of service request messages received in the previous cycle.
在进行流量控制时,可以将系统的负载尽量保持在高负载上。例如,上一周期处理1000条消息,系统负载为极高。本周期估算出的负载也为极高,则负载情况未变化,则认为本周期可以处理900条消息(负载为极高,需要减少处理的消息数)。再例如,上一周期处理1000条消息,系统负载为高,本周期估算出的负载也为极高,负载程度未变化,则认为本周期可以处理1000条消息(系统稳定在高负载,可以不需要调整消息)。再例如,如上一周期处理1000条消息,系统负载为高,本周期估算出的负载为中等负载,负载程度从高变化为中,则认为本周期可以处理1100条消息(系统负载在降低,可以多处理一些消息)。When carrying out flow control, the load of the system can be kept as high as possible. For example, processing 1000 messages in the previous cycle, the system load is extremely high. The estimated load this week is also extremely high, and the load situation has not changed, and it is considered that 900 messages can be processed in this cycle (the load is extremely high, and the number of messages to be processed needs to be reduced). For another example, if 1000 messages were processed in the previous cycle, the system load is high, and the estimated load in this cycle is also extremely high, and the load level has not changed, then it is considered that 1000 messages can be processed in this cycle (the system is stable under high load, and it is not necessary. Need to adjust the message). For another example, if 1000 messages were processed in the previous cycle, the system load is high, the estimated load in this cycle is medium load, and the load level changes from high to medium, then it is considered that 1100 messages can be processed in this cycle (the system load is decreasing, you can Process some more messages).
进而,服务端可以根据估算出的本周期能够处理的服务请求消息的数量和本周期即将收到的服务请求消息的数量,估算出不能处理的服务请求消息的数量。服务端针对不能处理的服务请求消息可以是直接丢弃,或者向客户端返回失败(例如服务不可用)。Furthermore, the server can estimate the number of service request messages that cannot be processed based on the estimated number of service request messages that can be processed in this cycle and the number of service request messages that will be received in this cycle. The server can directly discard the service request message that cannot be processed, or return a failure to the client (for example, the service is unavailable).
服务端可以让与其连接的所有的客户端发送的服务请求消息的数量接近于估算出的流量处理能力(能够处理的服务请求消息的数量)。例如服务端在估算出的本周期的流量处理能力为处理1000条服务请求消息,估算出本周期接收2000条服务请求消息,则估算1000条服务请求消息不能被处理。服务端可以指示与其连接的所有的客户端总共发送1000条服务请求消息。The server can make the number of service request messages sent by all clients connected to it close to the estimated traffic processing capacity (the number of service request messages that can be processed). For example, the estimated traffic processing capacity of the server in this cycle is to process 1000 service request messages, and it is estimated that 2000 service request messages are received in this cycle, and it is estimated that 1000 service request messages cannot be processed. The server can instruct all clients connected to it to send a total of 1000 service request messages.
为了处理较多的服务请求消息,服务端可以让与其连接的所有的客户端发送的服务请求消息的数量大于估算的流量处理能力。例如服务端将自身能够处理的服务请求消息的数量乘以一个比例值,作为指示所有的客户端总共发送的服务请求消息的数量,该比例值一般大于1,例如可以是1.1,1.2等等。例如服务端在估算出的本周期的流量处理能力为处理1000条服务请求消息,估算出本周期接收2000条服务请求消息,则估算1000条服务请求消息不能被处理。服务端可以指示与其连接的所有的客户端总共发送1200条服务请求消息,则比例值为1.2。也就是服务端可以针对估算出不能处理的1000条服务请求消息,指示客户端丢弃800条。客户端发送的1200条中服务端可以根据自身的流量处理能力返回失败200条,或者服务端在接收到这200条服务请求消息后发给其他服务端处理,或者服务端可以指示与其连接的所有的客户端总共发送1200条服务请求消息,还可以指示客户端向其他服务端发送服务请求消息,以分散当前服务端的压力。In order to process more service request messages, the server can make the number of service request messages sent by all clients connected to it greater than the estimated traffic processing capacity. For example, the server multiplies the number of service request messages that it can process by a ratio value to indicate the total number of service request messages sent by all clients. The ratio value is generally greater than 1, for example, 1.1, 1.2, and so on. For example, the estimated traffic processing capacity of the server in this cycle is to process 1000 service request messages, and it is estimated that 2000 service request messages are received in this cycle, and it is estimated that 1000 service request messages cannot be processed. The server can instruct all clients connected to it to send a total of 1200 service request messages, and the ratio is 1.2. That is, the server can instruct the client to discard 800 service request messages for 1000 service request messages that are estimated to be unable to be processed. Among the 1200 messages sent by the client, the server can return 200 failures according to its own traffic processing capability, or the server can send the 200 service request messages to other servers for processing after receiving the 200 service request messages, or the server can indicate all connected to it. The client sends a total of 1200 service request messages, and can also instruct the client to send service request messages to other servers to disperse the pressure on the current server.
服务端如果在本周期的负载相比上一周期的负载更高,说明服务端让客户端丢弃的服务请求消息的数量不够多,在下一周期可以让客户端丢弃更多的服务请求消息。例如本周期让客户端丢弃60%服务请求消息,则下一周期可以让客户端丢弃80%的服务请求消息。If the load on the server in this cycle is higher than the load in the previous cycle, it means that the number of service request messages that the server has caused the client to discard is not large enough, and the client can discard more service request messages in the next cycle. For example, in this cycle, the client is allowed to discard 60% of service request messages, and the client can be allowed to discard 80% of service request messages in the next cycle.
如果本周期的负载相对上一周期的负载有明显的减轻,例如由高负载变为低负载,服务端可以在下一周期指示客户端丢弃更少数量的服务请求消息,甚至不丢弃服务请求消息。服务端在为客户端制定流量控制策略时,不仅可以考虑当前的负载程度,还可以考虑负载程度的变化趋势。If the load of the current cycle is significantly reduced compared to the load of the previous cycle, for example, the load changes from a high load to a low load, the server can instruct the client to discard a smaller number of service request messages in the next cycle, or even not to discard service request messages. When the server develops a flow control strategy for the client, it can not only consider the current load level, but also the changing trend of the load level.
服务端向客户端下发的第二消息可以是服务响应消息,进一步地,第二消息可以是基 于HTTP的服务响应消息。该第一流量控制策略可以在HTTP消息的头域(header)中携带,例如扩展Retry-After头域,或者非标准的头域如X-headers,也可以在HTTP消息的消息体(body)中携带。第二消息也可以是独立于服务响应消息外的其他消息,例如定义一条新的消息,第一消息在本申请中不进行限定。The second message delivered by the server to the client may be a service response message, and further, the second message may be a service response message based on HTTP. The first flow control policy can be carried in the header of the HTTP message, for example, the extended Retry-After header, or non-standard headers such as X-headers, can also be in the body of the HTTP message carry. The second message may also be another message independent of the service response message, for example, a new message is defined. The first message is not limited in this application.
为了避免攻击者的攻击,客户端可以对第一消息进行完整性保护,则服务端在接收到第一消息后,可以先对第一消息进行完整性校验,在完整性校验通过后,再为客户端制定第一流量控制策略。如果对第一消息完整性校验不通过,服务端可以忽略第一消息,或者告知客户端存在攻击者。In order to avoid an attacker’s attack, the client can protect the integrity of the first message. After receiving the first message, the server can perform an integrity check on the first message. After the integrity check passes, Then formulate the first flow control strategy for the client. If the integrity check of the first message fails, the server can ignore the first message, or inform the client that there is an attacker.
步骤203:客户端根据所述第一流量控制策略进行流量控制。Step 203: The client performs flow control according to the first flow control strategy.
客户端在根据第一流量控制策略确定出允许向服务端发送的服务请求消息的第一数量后,就可以向服务端发送第一数量左右的服务请求消息。以实现合理丢弃服务请求消息的目的。需要注意的是,第一数量可能比客户端需要发送的服务请求消息的数量还大,则客户端无需丢弃服务请求消息。After the client determines the first number of service request messages allowed to be sent to the server according to the first flow control policy, it can send about the first number of service request messages to the server. In order to achieve the purpose of reasonably discarding service request messages. It should be noted that the first number may be larger than the number of service request messages that the client needs to send, and the client does not need to discard the service request messages.
客户端本地也可以有一些流量控制策略,例如有些类型的服务请求消息的优先级较高。The client can also have some traffic control strategies locally, for example, some types of service request messages have higher priority.
如果服务端下发的第一流量控制策略中包含服务请求消息的类型,即服务端指示客户端对该类型的服务请求消息进行流量限制,如果客户端将该类型的消息的优先级设置为较高时,客户端也可以不对该类型的服务请求消息进行丢弃。或者某一会话正在进行中,即使服务端指示客户端对该会话的服务请求消息进行流量限制,为了保证会话的正常进行,客户端也可以不对后续出现的该会话的服务请求消息进行丢弃。If the first flow control policy issued by the server includes the type of service request message, that is, the server instructs the client to limit the flow of this type of service request message. If the client sets the priority of this type of message to a higher priority When it is high, the client may not discard this type of service request message. Or a certain session is in progress, even if the server instructs the client to restrict the flow of the service request message of the session, in order to ensure the normal progress of the session, the client may not discard the subsequent service request message of the session.
第一流量控制策略的生成时间可以用于确定第一流量控制策略是否为最新的流量控制策略。如果所述第一流量控制策略中包括所述第一流量控制策略的生成时间,所述客户端在根据所述第一流量控制策略进行流量控制之前,所述客户端还可以确定正在执行的第二流量控制策略的生成时间是否早于所述第一流量控制策略的生成时间,如果是,则根据所述第一流量控制策略进行流量控制。如果否,可以根据第二流量控制策略进行流量控制。The generation time of the first flow control strategy may be used to determine whether the first flow control strategy is the latest flow control strategy. If the first flow control strategy includes the generation time of the first flow control strategy, before the client performs flow control according to the first flow control strategy, the client may also determine the first flow control strategy being executed. 2. Whether the generation time of the flow control strategy is earlier than the generation time of the first flow control strategy, and if so, perform flow control according to the first flow control strategy. If not, flow control can be performed according to the second flow control strategy.
客户端可以根据每个流量控制策略的生成时间,确定出最新的流量控制策略。客户端根据最新的流量控制策略进行流量控制,以实现更合理地处理业务数据。The client can determine the latest flow control strategy according to the generation time of each flow control strategy. The client performs flow control according to the latest flow control strategy to achieve a more reasonable processing of business data.
第一流量控制策略的递增计数器也可以用于确定第一流量控制策略是否为最新的流量控制策略。如果所述第一流量控制策略中包括所述递增计数器,所述客户端在根据所述第一流量控制策略进行流量控制之前,所述客户端还可以比较所述第一流量控制策略中的递增计数器和正在执行的第二流量控制策略的递增计数器,确定使用哪个流量控制策略。例如,递增计数器的数值越大,说明流量控制策略越晚,即是最新的流量控制策略。则在第一流量控制策略的计数器大于第二流量控制策略的计数器时,可以使用所述第一流量控制策略。The increment counter of the first flow control strategy can also be used to determine whether the first flow control strategy is the latest flow control strategy. If the first flow control policy includes the increment counter, before the client performs flow control according to the first flow control policy, the client may also compare the increment in the first flow control policy The counter and the incremental counter of the second flow control strategy being executed determine which flow control strategy is used. For example, the larger the value of the increment counter, the later the flow control strategy, that is, the latest flow control strategy. Then, when the counter of the first flow control strategy is greater than the counter of the second flow control strategy, the first flow control strategy can be used.
如果服务端下发的流量控制方式为客户端将超出所述第一数量的服务请求消息发送给其他服务端处理。流量控制策略中可以携带其它服务端的标识。客户端中也可以预先配置其它服务端的标识,客户端也可以通过网络存储功能(network repository function,NRF)查询其它服务端的标识。If the flow control mode issued by the server is that the client sends service request messages exceeding the first number to other servers for processing. The flow control strategy can carry the identifiers of other servers. The client can also pre-configure the identifiers of other servers, and the client can also query the identifiers of other servers through the network repository function (NRF).
为了避免攻击者的攻击,篡改第一流量控制策略,服务端可以对第二消息进行完整性保护。如果第二消息具有完整性保护,客户端在接收到第二消息后,可以先对第二消息进行完整性校验,在完整性校验通过后,再根据第一流量控制策略执行流量控制。如果对第 一消息完整性校验不通过,客户端可以忽略第二消息中第一流量控制策略,或者告知服务端存在攻击者。In order to avoid an attacker's attack and tampering with the first flow control strategy, the server can protect the integrity of the second message. If the second message has integrity protection, after receiving the second message, the client may first perform an integrity check on the second message, and after passing the integrity check, perform flow control according to the first flow control policy. If the integrity check of the first message fails, the client can ignore the first flow control policy in the second message, or inform the server that there is an attacker.
在对第一消息和第二消息进行完整性保护时,使用的完整性保护密钥可以是服务端和客户端之间预设的对称密钥,或者使用非对称密钥机制,例如使用服务端的证书对第一流量控制策略进行签名。When performing integrity protection on the first message and the second message, the integrity protection key used can be a symmetric key preset between the server and the client, or an asymmetric key mechanism, such as using the server’s The certificate signs the first flow control policy.
以上介绍了服务端在处于拥塞状态时,为客户端下发第一流量控制策略的过程。随着时间的推移,服务端的拥塞状态可能会解除,服务端还可以向客户端下发拥塞状态解除的指示,客户端可以合理地向服务端上报服务请求消息。The above has introduced the process of issuing the first flow control policy to the client when the server is in a congested state. With the passage of time, the congestion state of the server may be lifted, and the server may also issue an instruction to clear the congestion state to the client, and the client may reasonably report a service request message to the server.
参见图3所示,进一步介绍流量控制的流程:Refer to Figure 3 to further introduce the flow control process:
步骤301-步骤303,与步骤201-步骤203相同,重复之处不再进行赘述。Step 301 to step 303 are the same as step 201 to step 203, and the repetition will not be repeated.
步骤304:可选的,客户端向服务端发送第三消息,相应的,服务端接收客户端发送的第三消息,所述第三消息可以包括所述客户端正在执行的第一流量控制策略和/或客户端支持流量控制策略的指示。Step 304: Optionally, the client sends a third message to the server. Correspondingly, the server receives the third message sent by the client. The third message may include the first flow control policy being executed by the client. And/or the client supports the instruction of the flow control strategy.
步骤305:所述服务端确定拥塞状态解除,则向客户端发送第四消息,相应的,客户端接收第四消息,所述第四消息用于指示所述服务端的拥塞状态解除。Step 305: The server determines that the congestion state is released, and sends a fourth message to the client. Accordingly, the client receives a fourth message, which is used to indicate that the congestion state of the server is released.
步骤306:客户端确定不再执行第一流量控制策略。Step 306: The client determines that the first flow control strategy is no longer executed.
在一个示例中,服务端在确定拥塞状态解除时,可以向与自身连接的所有的客户端下发拥塞状态解除的指示。In an example, when the server determines that the congestion state is released, it may issue an indication of the congestion state release to all clients connected to the server.
在另一示例中,为了节省信令开销,服务端可以在接收到客户端发送的流量控制策略或者客户端支持流量控制策略的指示后,在确定自身拥塞状态解除时,向客户端下发拥塞状态解除的指示。例如,图3中的步骤304和步骤305。In another example, in order to save signaling overhead, the server may send the congestion to the client after receiving the flow control policy sent by the client or the indication that the client supports the flow control policy, and when it determines that its congestion state is lifted Indication of status release. For example, step 304 and step 305 in FIG. 3.
在另一示例中,服务端中也可以针对客户端的标识,保存向客户端下发的流量控制策略。服务端可以实时监控针对每个客户端的流量控制策略是否有效。如果服务端的拥塞状态解除时,监控到某些流量控制策略仍然有效,则服务端可以向这些流量控制策略仍然有效的客户端下发拥塞状态解除的指示。针对流量控制策略无效的客户端,由于客户端不再执行流量控制策略,则服务端可以不向这些客户端下发拥塞状态解除的指示。In another example, the server may also save the flow control policy issued to the client for the client's identification. The server can monitor in real time whether the flow control strategy for each client is effective. If the congestion state of the server is released and it is monitored that certain flow control policies are still valid, the server can issue an indication of the congestion release to the clients whose flow control policies are still valid. For clients whose flow control policy is invalid, since the client no longer executes the flow control policy, the server may not issue an indication of the congestion state release to these clients.
在一个示例中,所述第四消息中包括用于指示拥塞状态的第一字段,通过第一字段的值指示所述服务端的拥塞状态解除。In an example, the fourth message includes a first field for indicating the congestion state, and the value of the first field indicates that the congestion state of the server is released.
在另一示例中,服务端可以通过将流量控制策略的有效时间设置为0,来指示服务端的拥塞状态解除。示例的,第四消息中可以包括第四流量控制策略,第四流量控制策略的有效时间为0。In another example, the server can indicate that the congestion state of the server is lifted by setting the effective time of the flow control policy to 0. For example, the fourth message may include a fourth flow control strategy, and the effective time of the fourth flow control strategy is zero.
第三消息可以是服务请求消息,进一步地,第三消息可以是基于HTTP的服务请求消息。该第一流量控制策略和/或客户端支持流量控制的指示可以在HTTP消息的头域(header)中携带,也可以在HTTP消息的消息体(body)中携带。第三消息也可以是独立于服务请求消息外的其他消息,例如定义一条新的消息。第三消息在本申请中不进行限定。The third message may be a service request message, and further, the third message may be a service request message based on HTTP. The first flow control policy and/or the indication that the client supports flow control may be carried in the header of the HTTP message, and may also be carried in the body of the HTTP message. The third message may also be another message independent of the service request message, for example, define a new message. The third message is not limited in this application.
为了避免攻击者的攻击,客户端可以对第三消息进行完整性保护。如果第三消息具有完整性保护,服务端在接收到第三消息后,可以先对第三消息进行完整性校验,在完整性校验通过后,再为客户端下发服务端拥塞状态解除的指示。如果对第三消息完整性校验不通过,服务端可以忽略第三消息,或者告知客户端存在攻击者。In order to avoid an attack by an attacker, the client can perform integrity protection on the third message. If the third message has integrity protection, after receiving the third message, the server can perform an integrity check on the third message first, and after the integrity check is passed, the server can issue a congestion release for the client. Instructions. If the integrity check of the third message fails, the server can ignore the third message or inform the client that there is an attacker.
第四消息可以是服务响应消息,进一步地,第四消息可以是基于HTTP的服务响应消 息。示例的,第四消息中可以携带第四流量控制策略,该第四流量控制策略可以在HTTP消息的头域(header)中携带,例如扩展Retry-After头域,或者非标准的头域如X-headers,也可以在HTTP消息的消息体body中携带。另一示例中,第四消息中也可以携带服务端解除拥塞状态的标识,例如字段的值。第四消息也可以是独立于服务响应消息外的其他消息,例如定义一条新的消息,第四消息在本申请中不进行限定。The fourth message may be a service response message, and further, the fourth message may be a service response message based on HTTP. For example, the fourth message may carry a fourth flow control policy, and the fourth flow control policy may be carried in the header of the HTTP message, such as an extended Retry-After header field, or a non-standard header field such as X -headers, can also be carried in the body of the HTTP message. In another example, the fourth message may also carry an identifier of the server's uncongested state, such as the value of a field. The fourth message may also be another message independent of the service response message, for example, a new message is defined. The fourth message is not limited in this application.
为了避免攻击者的攻击,服务端可以对第四消息进行完整性保护。如果第四消息具有完整性保护,客户端在接收到第四消息后,可以先对第四消息进行完整性校验,在完整性校验通过后,再确定不再执行第一流量控制策略。如果对第一消息完整性校验不通过,客户端可以忽略第四消息中服务端解除拥塞状态的指示,或者告知服务端存在攻击者。In order to avoid an attack by an attacker, the server can perform integrity protection on the fourth message. If the fourth message has integrity protection, after receiving the fourth message, the client may first perform an integrity check on the fourth message, and after the integrity check passes, it is determined that the first flow control strategy is no longer executed. If the integrity check of the first message fails, the client can ignore the indication of the server to release the congestion state in the fourth message, or inform the server that there is an attacker.
需要注意的是,根据前述描述,流量控制策略中可以包括生成时间和/或递增计数器。客户端在接收到第二消息后,如果根据第一流量控制侧的生成时间和/或递增计数器,确定执行第一流量控制策略,则前述的第三消息包括第一流量控制策略;如果根据生成时间和/或递增计数器,确定不执行第一流量控制策略,而是执行第二流量控制策略,则前述的第三消息可以包括第二流量控制策略,而非第一流量控制策略。当然第三消息也可以包括第二流量控制策略和第一流量控制策略。It should be noted that, according to the foregoing description, the flow control strategy may include a generation time and/or an increment counter. After receiving the second message, if the client determines to execute the first flow control strategy according to the generation time and/or incrementing counter of the first flow control side, the aforementioned third message includes the first flow control strategy; Time and/or increment the counter to determine not to execute the first flow control strategy, but to execute the second flow control strategy, then the aforementioned third message may include the second flow control strategy instead of the first flow control strategy. Of course, the third message may also include the second flow control strategy and the first flow control strategy.
在另一示例中,服务端还可以作为客户端,接收上级服务端发送的第三流量控制策略,所述第三流量控制策略用于确定允许所述服务端向所述上级服务端发送的服务请求消息的第三数量,所述第三数量为大于或等于0的整数。服务端可以根据所述服务端的本地策略和所述第三流量控制策略,为客户端制定第一流量控制策略。In another example, the server can also act as a client to receive a third flow control policy sent by an upper-level server, where the third flow control policy is used to determine the service that the server is allowed to send to the upper-level server The third quantity of the request message, where the third quantity is an integer greater than or equal to zero. The server may formulate a first flow control policy for the client according to the local policy of the server and the third flow control policy.
如图4所示,提供了一种流量控制的流程示意图。图4所示的客户端可以是图1所示的AMF网元,对应的服务端可以是图1所示的AUSF网元。上级服务端可以是图1所示的UDM网元。则AUSF网元对于AMF网元来说是服务端,AUSF网元对于UDM网元来说是客户端。此处仅是给出了客户端、服务端和上级服务端的一个示例,相信本领域技术人员可以根据实际应用中的业务需求,合理地想出其他的客户端、服务端和上级服务端的示例。As shown in Figure 4, a flow control flow diagram is provided. The client shown in FIG. 4 may be the AMF network element shown in FIG. 1, and the corresponding server may be the AUSF network element shown in FIG. 1. The upper-level server may be the UDM network element shown in Figure 1. Then the AUSF network element is the server for the AMF network element, and the AUSF network element is the client for the UDM network element. Here is only an example of the client, server, and upper-level server. It is believed that those skilled in the art can reasonably think of other examples of the client, server, and upper-level server according to the business requirements in actual applications.
步骤401:客户端(AMF网元)向服务端(AUSF网元)发送服务请求消息,相应的,服务端(AUSF网元)接收客户端发送的服务请求消息,所述服务请求消息包括用于指示所述客户端(AMF网元)支持流量控制的指示。Step 401: The client (AMF network element) sends a service request message to the server (AUSF network element). Correspondingly, the server (AUSF network element) receives the service request message sent by the client. The service request message includes Instruct the client (AMF network element) to support flow control.
可选的,所述服务请求消息还可以包括AMF网元支持的流量控制方式。Optionally, the service request message may also include a flow control mode supported by the AMF network element.
步骤402:所述服务端(AUSF网元)作为客户端向上级服务端(UDM网元)发送服务请求消息,所述服务请求消息包括用于指示所述客户端(AUSF网元)支持流量控制的指示。可选的,所述服务请求消息还可以包括AUSF网元支持的流量控制方式。Step 402: The server (AUSF network element) acts as a client and sends a service request message to an upper server (UDM network element). The service request message includes instructions for instructing the client (AUSF network element) to support flow control. Instructions. Optionally, the service request message may also include a flow control mode supported by the AUSF network element.
步骤403:UDM网元为AUSF网元制定第三流量控制策略。Step 403: The UDM network element formulates a third flow control strategy for the AUSF network element.
示例的,UDM网元在确定处于拥塞状态时,根据系统能力,为AUSF网元制定第三流量控制策略。For example, when the UDM network element is determined to be in a congested state, the third flow control strategy is formulated for the AUSF network element according to the system capability.
步骤404:UDM网元向AUSF网元发送服务响应消息,相应的,AUSF网元接收UDM网元发送的服务响应消息,所述服务响应消息包括第三流量控制策略。Step 404: The UDM network element sends a service response message to the AUSF network element. Correspondingly, the AUSF network element receives the service response message sent by the UDM network element. The service response message includes the third flow control policy.
步骤405:AUSF网元根据第三流量控制策略和本地策略,确定第一流量控制策略。Step 405: The AUSF network element determines the first flow control strategy according to the third flow control strategy and the local strategy.
具体的,AMF网元向AUSF网元上报AMF网元正在执行的第二流量控制策略,则AUSF网元根据第三流量控制策略和本地策略,以及第二流量控制侧,确定第一流量控制 策略。Specifically, the AMF network element reports the second flow control strategy being executed by the AMF network element to the AUSF network element, and the AUSF network element determines the first flow control strategy according to the third flow control strategy and the local strategy, and the second flow control side. .
以下具体介绍AUSF网元根据第三流量控制策略和本地策略,确定第一流量控制策略的过程:The following specifically introduces the process of determining the first flow control strategy by the AUSF network element according to the third flow control strategy and the local strategy:
例如,第三流量控制策略为UDM网元指示AUSF网元发送1000条服务请求消息,例如可以是一个周期中发送1000条消息,一个周期例如可以是1s。AUSF网元预计本周期会接受1500条服务请求消息,其中,500条为高优先级不可丢弃的消息,1000条为低优先级可以丢弃的消息,则AUSF网元可以给UDM网元发送500条高优先级消息和500条低优先级消息。For example, the third flow control strategy is that the UDM network element instructs the AUSF network element to send 1000 service request messages. For example, it may send 1000 messages in one cycle, and one cycle may be, for example, 1s. The AUSF network element expects to receive 1500 service request messages in this cycle, of which 500 are high-priority non-discardable messages, and 1000 are low-priority messages that can be discarded. Then the AUSF network element can send 500 messages to the UDM network element. High priority messages and 500 low priority messages.
这种场景下AUSF网元需要丢弃500条低优先级消息,AUSF网元的本地策略例如可以是自身丢弃向UDM网元发送的服务请求消息的数量和要求下级客户端减少向AUSF网元发的服务请求消息的数量的比例,例如可以是1:1,1:2,1.5等。假如AUSF网元自身丢弃和要求AMF减少发送的消息为1:1,则AUSF网元可以指示下周期内,与AUSF网元连接的所有的AMF网元总共发送750条低优先级消息和全部500条高优先级消息。In this scenario, the AUSF network element needs to discard 500 low-priority messages. The local policy of the AUSF network element can be, for example, that it discards the number of service request messages sent to the UDM network element and requires lower-level clients to reduce the number of messages sent to the AUSF network element. The ratio of the number of service request messages may be 1:1, 1:2, 1.5, etc., for example. If the AUSF network element itself discards and requires AMF to reduce the number of messages sent is 1:1, the AUSF network element can instruct all AMF network elements connected to the AUSF network element to send a total of 750 low-priority messages and all 500 messages in the next period. High priority message.
步骤406:AUSF网元向AMF网元发送服务响应消息,相应的,AMF网元接收AUSF网元发送的服务响应消息,所述服务响应消息中包括第一流量控制策略。Step 406: The AUSF network element sends a service response message to the AMF network element. Correspondingly, the AMF network element receives the service response message sent by the AUSF network element. The service response message includes the first flow control policy.
步骤407:AMF网元可以根据第一流量控制策略进行流量控制。Step 407: The AMF network element may perform flow control according to the first flow control strategy.
进一步地,可选的,步骤408:AMF网元还可以向AUSF网元发送服务请求消息,相应的,所述AUSF网元接收AMF网元发送的服务请求消息,所述服务请求消息中包括AMF网元支持流量控制的指示和/或AMF网元正在执行的第一流量控制策略。Further, optionally, step 408: the AMF network element may also send a service request message to the AUSF network element. Correspondingly, the AUSF network element receives the service request message sent by the AMF network element, and the service request message includes the AMF An indication that the network element supports flow control and/or the first flow control strategy being executed by the AMF network element.
可选的,步骤409:AUSF网元向UDM网元发送服务请求消息,相应的,所述UDM网元接收AUSF网元发送的服务请求消息,所述服务请求消息中包括AUSF网元支持流量控制的指示和/或第三流量控制策略。Optionally, step 409: the AUSF network element sends a service request message to the UDM network element, and correspondingly, the UDM network element receives the service request message sent by the AUSF network element, and the service request message includes that the AUSF network element supports flow control The instructions and/or the third flow control strategy.
AUSF网元在AMF网元与UDM网元间扮演中间节点的角色,AUSF网元根据第一流量控制策略确定第三流量控制策略的过程可以是上述步骤405的逆过程。The AUSF network element plays the role of an intermediate node between the AMF network element and the UDM network element. The process of determining the third flow control strategy by the AUSF network element according to the first flow control strategy may be the reverse process of the above step 405.
步骤410:UDM网元在确定拥塞解除的情况下,可以向AUSF网元发送服务响应消息,相应的,AUSF网元接收UDM网元发送的服务响应消息,所述服务响应消息用于指示UDM网元拥塞状态解除。Step 410: The UDM network element may send a service response message to the AUSF network element when it is determined that the congestion is removed. Correspondingly, the AUSF network element receives the service response message sent by the UDM network element, and the service response message is used to instruct the UDM network The meta-congestion state is removed.
步骤411:AUSF网元在接收到UDM网元拥塞状态解除的指示后,可以不再执行第三流量控制策略,一般情况下,AUSF网元也无需再对AMF进行流量控制,则AUSF网元业可以向AMF网元发送服务响应消息,用于指示AUSF网元拥塞状态解除。AMF可以不再执行第一流量控制策略。Step 411: After the AUSF network element receives the indication that the congestion state of the UDM network element is released, it can no longer execute the third flow control strategy. Under normal circumstances, the AUSF network element does not need to perform flow control on the AMF anymore, then the AUSF network element industry A service response message can be sent to the AMF network element to indicate that the congestion state of the AUSF network element is released. AMF may no longer execute the first flow control strategy.
图4中各个网元间可以通过服务请求消息和服务响应消息进行信息交互,服务请求消息可以是基于HTTP的服务请求消息,服务响应消息可以是基于HTTP的服务响应消息。图4中各个网元间交互的服务请求消息和服务响应消息可以具有完整性保护,接收消息的一端可以先对其进行完整性校验,在完整性校验通过后,再执行对应的过程。In FIG. 4, each network element can exchange information through a service request message and a service response message. The service request message can be a service request message based on HTTP, and the service response message can be a service response message based on HTTP. The service request message and service response message exchanged between the various network elements in FIG. 4 may have integrity protection, and the end receiving the message may perform integrity verification on it first, and then perform the corresponding process after the integrity verification is passed.
上述提供的各个实施例中基于HTTP的服务请求消息和服务响应消息可以是基于HTTP2.0的服务请求消息和服务响应消息。The HTTP-based service request messages and service response messages in the various embodiments provided above may be HTTP2.0-based service request messages and service response messages.
基于与上述流量控制的方法的同一技术构思,如图5所示,提供了一种通信装置500,通信装置500能够执行图2、图3和图4的方法中由服务端执行的各个步骤,为了避免重 复,此处不再详述。通信装置500可以为服务端,也可以为应用于服务端中的芯片。通信装置500包括:收发模块510,可选的,还包括处理模块520,存储模块530;处理模块520可以分别与存储模块530和收发模块510相连,所述存储模块530也可以与收发模块510相连:Based on the same technical concept as the above-mentioned flow control method, as shown in FIG. 5, a communication device 500 is provided, and the communication device 500 can perform each step performed by the server in the methods of FIG. 2, FIG. 3, and FIG. 4, In order to avoid repetition, it will not be detailed here. The communication device 500 may be a server or a chip applied to the server. The communication device 500 includes: a transceiver module 510, optionally, a processing module 520 and a storage module 530; the processing module 520 can be connected to the storage module 530 and the transceiver module 510 respectively, and the storage module 530 can also be connected to the transceiver module 510 :
所述存储模块530,用于存储计算机程序;The storage module 530 is used to store computer programs;
示例的,所述收发模块510,用于接收客户端发送的第一消息,所述第一消息用于指示所述客户端支持流量控制;以及向所述客户端发送针对所述第一消息的第二消息,所述第二消息包括第一流量控制策略,第一流量控制策略用于确定允许所述客户端向所述装置发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数。For example, the transceiver module 510 is configured to receive a first message sent by a client, where the first message is used to indicate that the client supports flow control; and send a message specific to the first message to the client The second message, the second message includes a first flow control strategy, the first flow control strategy is used to determine a first number of service request messages that the client is allowed to send to the device, and the first number is greater than Or an integer equal to 0.
在一种可能的实现中,处理模块520,用于所述装置在处于拥塞状态时,根据所述装置的流量处理能力,确定所述第一流量控制策略。In a possible implementation, the processing module 520 is configured to determine the first flow control strategy according to the flow processing capability of the device when the device is in a congested state.
在一种可能的实现中,所述收发模块510,还用于接收来自上级服务端的第五消息,所述第五消息包括第三流量控制策略,所述第三流量控制策略用于确定允许所述装置向所述上级服务端发送的服务请求消息的第三数量,所述第三数量为大于或等于0的整数。In a possible implementation, the transceiver module 510 is further configured to receive a fifth message from an upper-level server, where the fifth message includes a third flow control strategy, and the third flow control strategy is used to determine permission to The third number of service request messages sent by the device to the upper-level server, where the third number is an integer greater than or equal to 0.
在一种可能的实现中,处理模块520,用于根据所述装置的本地策略和所述第三流量控制策略,确定所述第一流量控制策略。In a possible implementation, the processing module 520 is configured to determine the first flow control strategy according to the local strategy of the device and the third flow control strategy.
在一种可能的实现中,所述收发模块510,还用于接收所述客户端发送的第三消息,所述第三消息包括所述客户端正在执行的第一流量控制策略;以及在确定拥塞状态解除的情况下,向所述客户端发送针对所述第三消息的第四消息,所述第四消息用于指示所述装置的拥塞状态解除。In a possible implementation, the transceiver module 510 is further configured to receive a third message sent by the client, where the third message includes the first flow control policy being executed by the client; and When the congestion state is released, a fourth message for the third message is sent to the client, where the fourth message is used to indicate that the congestion state of the device is released.
基于与上述流量控制的方法的同一技术构思,如图6所示,提供了一种通信装置600,通信装置600能够执行图2、图3和图4的方法中由客户端执行的各个步骤,为了避免重复,此处不再详述。通信装置600可以为客户端,也可以为应用于客户端中的芯片。通信装置600包括:收发模块610,可选的,还包括处理模块620,存储模块630;处理模块620可以分别与存储模块630和收发模块610相连,所述存储模块630也可以与收发模块610相连:Based on the same technical concept as the above-mentioned flow control method, as shown in FIG. 6, a communication device 600 is provided, and the communication device 600 can perform the steps performed by the client in the methods of FIG. 2, FIG. 3, and FIG. 4, In order to avoid repetition, it will not be detailed here. The communication device 600 may be a client or a chip applied in the client. The communication device 600 includes: a transceiver module 610, optionally, a processing module 620 and a storage module 630; the processing module 620 can be connected to the storage module 630 and the transceiver module 610 respectively, and the storage module 630 can also be connected to the transceiver module 610 :
所述存储模块630,用于存储计算机程序;The storage module 630 is used to store computer programs;
示例的,所述收发模块610,用于向服务端发送第一消息,所述第一消息用于指示所述装置支持流量控制;以及接收来自所述服务端的针对所述第一消息的第二消息,所述第二消息包括第一流量控制策略,第一流量控制策略用于确定允许所述装置向所述服务端发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数;For example, the transceiver module 610 is configured to send a first message to a server, the first message is used to indicate that the device supports flow control; and to receive a second message from the server for the first message Message, the second message includes a first flow control strategy, the first flow control strategy is used to determine a first number of service request messages that the device is allowed to send to the server, and the first number is greater than or equal to An integer of 0;
处理模块620,用于根据所述第一流量控制策略进行流量控制。The processing module 620 is configured to perform flow control according to the first flow control strategy.
在一种可能的实现中,所述第一流量控制策略包括以下多项中的至少一项:In a possible implementation, the first flow control strategy includes at least one of the following items:
第一流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第一流量控制策略的生成时间、递增计数器;The effective time of the first flow control strategy, the flow control method, the type of service request message, the generation time of the first flow control strategy, and the increment counter;
其中,所述流量控制方式包括:将超出所述第一数量的服务请求消息发送给其他服务端处理或将超出第一数量的服务请求消息丢弃,所述递增计数器用于判断所述第一流量控制策略是否为最新的流量控制策略。Wherein, the flow control method includes: sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number, and the increment counter is used to determine the first flow Whether the control strategy is the latest flow control strategy.
在一种可能的是实现中,如果所述第一流量控制策略中包括所述第一流量控制策略的 生成时间,所述处理模块620,在用于根据所述第一流量控制策略进行流量控制之前,还用于:确定正在执行的第二流量控制策略的生成时间早于所述第一流量控制策略的生成时间。In a possible implementation, if the first flow control strategy includes the generation time of the first flow control strategy, the processing module 620 is configured to perform flow control according to the first flow control strategy. Before, it is also used to determine that the generation time of the second flow control strategy being executed is earlier than the generation time of the first flow control strategy.
在一种可能的实现中,如果所述第一流量控制策略中包括所述递增计数器,所述处理模块620,在用于根据所述第一流量控制策略进行流量控制之前,还用于:比较所述第一流量控制策略中的递增计数器和正在执行的第二流量控制策略的递增计数器,确定使用所述第一流量控制策略。In a possible implementation, if the first flow control strategy includes the increment counter, the processing module 620 is further used to: compare before performing flow control according to the first flow control strategy. The increment counter in the first flow control strategy and the increment counter in the second flow control strategy being executed determine to use the first flow control strategy.
在一种可能的实现中,所述收发模块610,还用于向所述服务端发送第三消息,所述第三消息包括所述装置正在执行的第一流量控制策略;以及接收所述服务端的针对所述第三消息的第四消息,所述第四消息用于指示所述服务端的拥塞状态解除;In a possible implementation, the transceiver module 610 is further configured to send a third message to the server, where the third message includes the first flow control strategy being executed by the device; and to receive the service A fourth message for the third message of the terminal, where the fourth message is used to indicate that the congestion state of the server is released;
所述处理模块620,还用于确定不再执行第一流量控制策略。The processing module 620 is further configured to determine that the first flow control strategy is no longer executed.
图7是本申请实施例的通信装置700的示意性框图。应理解,所述通信装置700能够执行图2、图3和图4所示的方法中由服务端执行的各个步骤,为了避免重复,此处不再详述。通信装置700包括:处理器701和存储器703,所述处理器701和所述存储器703之间电偶合;FIG. 7 is a schematic block diagram of a communication device 700 according to an embodiment of the present application. It should be understood that the communication device 700 can execute each step performed by the server in the methods shown in FIG. 2, FIG. 3, and FIG. 4. In order to avoid repetition, the details are not described herein again. The communication device 700 includes: a processor 701 and a memory 703, and the processor 701 and the memory 703 are electrically coupled;
所述存储器703,用于存储计算机程序指令;The memory 703 is used to store computer program instructions;
所述处理器701,用于执行所述存储器中的部分或者全部计算机程序指令,当所述部分或者全部计算机程序指令被执行时,所述装置接收客户端发送的第一消息,所述第一消息用于指示所述客户端支持流量控制;以及向所述客户端发送针对所述第一消息的第二消息,所述第二消息包括第一流量控制策略,第一流量控制策略用于确定允许所述客户端向所述装置发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数。The processor 701 is configured to execute part or all of the computer program instructions in the memory. When the part or all of the computer program instructions are executed, the device receives a first message sent by a client, and the first message A message is used to indicate that the client supports flow control; and a second message for the first message is sent to the client, the second message includes a first flow control strategy, and the first flow control strategy is used to determine The first number of service request messages that the client is allowed to send to the device, where the first number is an integer greater than or equal to 0.
在一种可能的实现中,处理器701,用于所述装置在处于拥塞状态时,根据所述装置的流量处理能力,确定所述第一流量控制策略。In a possible implementation, the processor 701 is configured to determine the first flow control strategy according to the flow processing capability of the device when the device is in a congested state.
在一种可能的实现中,所述处理器701,还用于接收来自上级服务端的第五消息,所述第五消息包括第三流量控制策略,所述第三流量控制策略用于确定允许所述装置向所述上级服务端发送的服务请求消息的第三数量,所述第三数量为大于或等于0的整数。In a possible implementation, the processor 701 is further configured to receive a fifth message from an upper-level server, where the fifth message includes a third flow control strategy, and the third flow control strategy is used to determine permission to The third number of service request messages sent by the device to the upper-level server, where the third number is an integer greater than or equal to 0.
在一种可能的实现中,处理器701,用于根据所述装置的本地策略和所述第三流量控制策略,确定所述第一流量控制策略。In a possible implementation, the processor 701 is configured to determine the first flow control strategy according to the local strategy of the apparatus and the third flow control strategy.
在一种可能的实现中,所述处理器701,还用于接收所述客户端发送的第三消息,所述第三消息包括所述客户端正在执行的第一流量控制策略;以及在确定拥塞状态解除的情况下,向所述客户端发送针对所述第三消息的第四消息,所述第四消息用于指示所述装置的拥塞状态解除。In a possible implementation, the processor 701 is further configured to receive a third message sent by the client, where the third message includes the first flow control policy being executed by the client; and When the congestion state is released, a fourth message for the third message is sent to the client, where the fourth message is used to indicate that the congestion state of the device is released.
可选的,还包括:收发器702,用于和其他设备进行通信;例如向客户端发送第二消息、第四消息,以及接收客户端发送的第一消息,第三消息。Optionally, it further includes: a transceiver 702 for communicating with other devices; for example, sending a second message and a fourth message to the client, and receiving a first message and a third message sent by the client.
应理解,图7所示的通信装置700可以是芯片或电路。例如可设置在服务端内的芯片或电路。上述收发器702也可以是通信接口。收发器包括接收器和发送器。进一步地,该通信装置700还可以包括总线系统。It should be understood that the communication device 700 shown in FIG. 7 may be a chip or a circuit. For example, a chip or circuit can be installed in the server. The aforementioned transceiver 702 may also be a communication interface. The transceiver includes a receiver and a transmitter. Further, the communication device 700 may also include a bus system.
其中,处理器701、存储器703、收发器702通过总线系统相连,处理器701用于执行该存储器703存储的指令,以控制收发器接收信号和发送信号,完成本申请流量控制的 方法中服务端的步骤。所述存储器703可以集成在所述处理器701中,也可以与所述处理器701分开设置。Among them, the processor 701, the memory 703, and the transceiver 702 are connected by a bus system. The processor 701 is used to execute the instructions stored in the memory 703 to control the transceiver to receive and send signals, and to complete the flow control method of the present application. step. The memory 703 may be integrated in the processor 701, or may be provided separately from the processor 701.
作为一种实现方式,收发器702的功能可以考虑通过收发电路或者收发专用芯片实现。处理器701可以考虑通过专用处理芯片、处理电路、处理器或者通用芯片实现。As an implementation manner, the function of the transceiver 702 may be implemented by a transceiver circuit or a dedicated chip for transceiver. The processor 701 may be implemented by a dedicated processing chip, a processing circuit, a processor, or a general-purpose chip.
图8是本申请实施例的通信装置800的示意性框图。应理解,所述通信装置800能够执行图2、图3、图4方法中由客户端执行的各个步骤,为了避免重复,此处不再详述。通信装置800包括:处理器801和存储器803,所述处理器801和所述存储器803之间电偶合;FIG. 8 is a schematic block diagram of a communication device 800 according to an embodiment of the present application. It should be understood that the communication device 800 can execute each step executed by the client in the methods of FIG. 2, FIG. 3, and FIG. 4. In order to avoid repetition, details are not described herein again. The communication device 800 includes: a processor 801 and a memory 803, and the processor 801 and the memory 803 are electrically coupled;
所述存储器803,用于存储计算机程序指令;The memory 803 is used to store computer program instructions;
所述处理器801,用于执行所述存储器中的部分或者全部计算机程序指令,当所述部分或者全部计算机程序指令被执行时,所述装置向服务端发送第一消息,所述第一消息用于指示所述装置支持流量控制;以及接收来自所述服务端的针对所述第一消息的第二消息,所述第二消息包括第一流量控制策略,第一流量控制策略用于确定允许所述装置向所述服务端发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数;以及根据所述第一流量控制策略进行流量控制。The processor 801 is configured to execute part or all of the computer program instructions in the memory. When the part or all of the computer program instructions are executed, the device sends a first message to the server, and the first message For indicating that the device supports flow control; and receiving a second message from the server for the first message, where the second message includes a first flow control strategy, and the first flow control strategy is used to determine permission The first number of service request messages sent by the device to the server, where the first number is an integer greater than or equal to 0; and performing flow control according to the first flow control strategy.
在一种可能的实现中,所述第一流量控制策略包括以下多项中的至少一项:In a possible implementation, the first flow control strategy includes at least one of the following items:
第一流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第一流量控制策略的生成时间、递增计数器;The effective time of the first flow control strategy, the flow control method, the type of service request message, the generation time of the first flow control strategy, and the increment counter;
其中,所述流量控制方式包括:将超出所述第一数量的服务请求消息发送给其他服务端处理或将超出第一数量的服务请求消息丢弃,所述递增计数器用于判断所述第一流量控制策略是否为最新的流量控制策略。Wherein, the flow control method includes: sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number, and the increment counter is used to determine the first flow Whether the control strategy is the latest flow control strategy.
在一种可能的是实现中,如果所述第一流量控制策略中包括所述第一流量控制策略的生成时间,所述处理器801,在用于根据所述第一流量控制策略进行流量控制之前,还用于:确定正在执行的第二流量控制策略的生成时间早于所述第一流量控制策略的生成时间。In a possible implementation, if the first flow control strategy includes the generation time of the first flow control strategy, the processor 801 is configured to perform flow control according to the first flow control strategy. Before, it is also used to determine that the generation time of the second flow control strategy being executed is earlier than the generation time of the first flow control strategy.
在一种可能的实现中,如果所述第一流量控制策略中包括所述递增计数器,所述处理器801,在用于根据所述第一流量控制策略进行流量控制之前,还用于:比较所述第一流量控制策略中的递增计数器和正在执行的第二流量控制策略的递增计数器,确定使用所述第一流量控制策略。In a possible implementation, if the first flow control strategy includes the increment counter, the processor 801 is further configured to: compare before performing flow control according to the first flow control strategy. The increment counter in the first flow control strategy and the increment counter in the second flow control strategy being executed determine to use the first flow control strategy.
在一种可能的实现中,所述处理器801,还用于向所述服务端发送第三消息,所述第三消息包括所述装置正在执行的第一流量控制策略;以及接收所述服务端的针对所述第三消息的第四消息,所述第四消息用于指示所述服务端的拥塞状态解除;以及确定不再执行第一流量控制策略。In a possible implementation, the processor 801 is further configured to send a third message to the server, where the third message includes the first flow control strategy being executed by the device; and to receive the service A fourth message for the third message at the end, where the fourth message is used to indicate that the congestion state of the server is released; and it is determined that the first flow control strategy is no longer executed.
可选的,还包括:收发器802,用于和其他设备进行通信;例如接收服务端发送的第二消息、第四消息,向服务端发送第一消息、第二消息等。Optionally, it further includes: a transceiver 802 for communicating with other devices; for example, receiving the second message and the fourth message sent by the server, and sending the first message and the second message to the server.
应理解,图8所示的通信装置800可以是芯片或电路。例如可设置在客户端内的芯片或电路。上述收发器802也可以是通信接口。收发器包括接收器和发送器。进一步地,该通信装置800还可以包括总线系统。It should be understood that the communication device 800 shown in FIG. 8 may be a chip or a circuit. For example, a chip or circuit can be installed in the client. The above-mentioned transceiver 802 may also be a communication interface. The transceiver includes a receiver and a transmitter. Further, the communication device 800 may also include a bus system.
其中,处理器801、存储器803、收发器802通过总线系统相连,处理器801用于执行该存储器803存储的指令,以控制收发器接收信号和发送信号,完成本申请流量控制的 方法中客户端的步骤。所述存储器803可以集成在所述处理器801中,也可以与所述处理器801分开设置。Among them, the processor 801, the memory 803, and the transceiver 802 are connected by a bus system. The processor 801 is used to execute the instructions stored in the memory 803 to control the transceiver to receive and send signals, and complete the flow control method of the present application. step. The memory 803 may be integrated in the processor 801, or may be provided separately from the processor 801.
作为一种实现方式,收发器802的功能可以考虑通过收发电路或者收发专用芯片实现。处理器801可以考虑通过专用处理芯片、处理电路、处理器或者通用芯片实现。As an implementation manner, the function of the transceiver 802 may be implemented by a transceiver circuit or a dedicated transceiver chip. The processor 801 may be implemented by a dedicated processing chip, a processing circuit, a processor, or a general-purpose chip.
处理器可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。The processor may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.
处理器还可以进一步包括硬件芯片或其他通用处理器。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)及其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等或其任意组合。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor may further include a hardware chip or other general-purpose processors. The aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (generic array logic, GAL) and other programmable logic devices , Discrete gates or transistor logic devices, discrete hardware components, etc. or any combination thereof. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
还应理解,本申请实施例中提及的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本申请描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. The volatile memory may be random access memory (Random Access Memory, RAM), which is used as an external cache. By way of exemplary but not restrictive description, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, DDR SDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), Synchronous Link Dynamic Random Access Memory (Synchlink DRAM, SLDRAM) ) And Direct Rambus RAM (DR RAM). It should be noted that the memories described in this application are intended to include, but are not limited to, these and any other suitable types of memories.
本申请实施例提供了一种计算机存储介质,存储有计算机程序,该计算机程序包括用于执行上述流量控制的方法。The embodiment of the present application provides a computer storage medium storing a computer program, and the computer program includes a method for performing the above-mentioned flow control.
本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述提供的流量控制的方法。The embodiment of the present application provides a computer program product containing instructions, which when running on a computer, causes the computer to execute the method for flow control provided above.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略, 或不执行。另一点,所显示或讨论的相互之间的通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be Other division methods, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual communication connections may be indirect couplings or communication connections through some interfaces, devices or units, and may be in electrical, mechanical, or other forms.
另外,在本申请装置实施例中的各单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, the units in the device embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
可以理解的是,本申请的实施例中的处理器可以是中央处理单元(central processing unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件,硬件部件或者其任意组合。通用处理器可以是微处理器,也可以是任何常规的处理器。It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (digital signal processors, DSP), and application specific integrated circuits. (application specific integrated circuit, ASIC), field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
本申请的实施例中的方法可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机程序或指令。在计算机上加载和执行所述计算机程序或指令时,全部或部分地执行本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机程序或指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是集成一个或多个可用介质的服务器等数据存储设备。所述可用介质可以是磁性介质,例如,软盘、硬盘、磁带;也可以是光介质,例如,CD-ROM,DVD;还可以是半导体介质,例如,固态硬盘(solid state disk,SSD),随机存取存储器(random access memory,RAM)、只读存储器(read-only memory,ROM)和寄存器等。The methods in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on the computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer program or instruction may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server integrating one or more available media. The usable medium may be a magnetic medium, such as a floppy disk, a hard disk, and a magnetic tape; it may also be an optical medium, such as a CD-ROM, a DVD; and it may also be a semiconductor medium, such as a solid state disk (SSD), random Access memory (random access memory, RAM), read-only memory (ROM), registers, etc.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包括有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of this application. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包括这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. In this way, if these modifications and variations of the embodiments of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.
Claims (30)
- 一种流量控制的方法,其特征在于,所述方法包括:A flow control method, characterized in that the method includes:服务端接收客户端发送的第一消息,所述第一消息用于指示所述客户端支持流量控制;The server receives a first message sent by the client, where the first message is used to indicate that the client supports flow control;所述服务端向所述客户端发送针对所述第一消息的第二消息,所述第二消息包括第一流量控制策略,第一流量控制策略用于确定允许所述客户端向所述服务端发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数。The server sends a second message for the first message to the client, the second message includes a first flow control policy, and the first flow control policy is used to determine that the client is allowed to send the service to the service The first number of service request messages sent by the terminal, where the first number is an integer greater than or equal to 0.
- 如权利要求1所述的方法,其特征在于,所述第一消息包括:所述客户端正在执行的第二流量控制策略。The method according to claim 1, wherein the first message comprises: a second flow control strategy being executed by the client.
- 如权利要求1或2所述的方法,其特征在于,还包括:The method of claim 1 or 2, further comprising:所述服务端在处于拥塞状态时,根据所述服务端的流量处理能力,确定所述第一流量控制策略。When the server is in a congested state, the first flow control strategy is determined according to the flow processing capability of the server.
- 如权利要求1或2所述的方法,其特征在于,还包括:The method of claim 1 or 2, further comprising:所述服务端接收来自上级服务端的第五消息,所述第五消息包括第三流量控制策略,所述第三流量控制策略用于确定允许所述服务端向所述上级服务端发送的服务请求消息的第三数量,所述第三数量为大于或等于0的整数。The server receives a fifth message from an upper-level server, the fifth message includes a third flow control policy, and the third flow control policy is used to determine the service request that the server is allowed to send to the upper-level server The third number of messages, where the third number is an integer greater than or equal to zero.
- 如权利要求4所述的方法,其特征在于,还包括:The method of claim 4, further comprising:所述服务端根据所述服务端的本地策略和所述第三流量控制策略,确定所述第一流量控制策略。The server determines the first flow control strategy according to the local strategy of the server and the third flow control strategy.
- 如权利要求1-5任一项所述的方法,其特征在于,所述第一流量控制策略包括以下多项中的至少一项:The method according to any one of claims 1 to 5, wherein the first flow control strategy comprises at least one of the following items:第一流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第一流量控制策略的生成时间、递增计数器;The effective time of the first flow control strategy, the flow control method, the type of service request message, the generation time of the first flow control strategy, and the increment counter;其中,所述流量控制方式包括:将超出所述第一数量的服务请求消息发送给其他服务端处理或将超出第一数量的服务请求消息丢弃;所述递增计数器用于判断所述第一流量控制策略是否为最新的流量控制策略。Wherein, the flow control method includes: sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number; the increment counter is used to determine the first flow Whether the control strategy is the latest flow control strategy.
- 如权利要求1所述的方法,其特征在于,其特征在于,还包括:The method according to claim 1, characterized in that it further comprises:所述服务端接收所述客户端发送的第三消息,所述第三消息包括所述客户端正在执行的第一流量控制策略;Receiving, by the server, a third message sent by the client, where the third message includes the first flow control policy being executed by the client;所述服务端在确定拥塞状态解除的情况下,向所述客户端发送针对所述第三消息的第四消息,所述第四消息用于指示所述服务端的拥塞状态解除。When determining that the congestion state is released, the server sends a fourth message for the third message to the client, where the fourth message is used to indicate that the congestion state of the server is released.
- 如权利要求7所述的方法,其特征在于,所述第四消息中包括用于指示拥塞状态的第一字段,通过第一字段的值指示所述服务端的拥塞状态解除。The method according to claim 7, wherein the fourth message includes a first field for indicating a congestion state, and the value of the first field indicates that the congestion state of the server is released.
- 一种流量控制的方法,其特征在于,所述方法包括:A flow control method, characterized in that the method includes:客户端向服务端发送第一消息,所述第一消息用于指示所述客户端支持流量控制;The client sends a first message to the server, where the first message is used to indicate that the client supports flow control;所述客户端接收来自所述服务端的针对所述第一消息的第二消息,所述第二消息包括第一流量控制策略,第一流量控制策略用于确定允许所述客户端向所述服务端发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数;The client receives a second message from the server for the first message, the second message includes a first flow control policy, and the first flow control policy is used to determine that the client is allowed to send the service to the service A first number of service request messages sent by the terminal, where the first number is an integer greater than or equal to 0;所述客户端根据所述第一流量控制策略进行流量控制。The client performs flow control according to the first flow control strategy.
- 如权利要求9所述的方法,其特征在于,所述第一消息包括:所述客户端正在执 行的第二流量控制策略,所述第二流量控制策略用于确定所述第一流量控制策略。The method according to claim 9, wherein the first message comprises: a second flow control strategy being executed by the client, and the second flow control strategy is used to determine the first flow control strategy .
- 如权利要求9或10所述的方法,其特征在于,所述第一流量控制策略包括以下多项中的至少一项:The method according to claim 9 or 10, wherein the first flow control strategy includes at least one of the following items:第一流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第一流量控制策略的生成时间、递增计数器;The effective time of the first flow control strategy, the flow control method, the type of service request message, the generation time of the first flow control strategy, and the increment counter;其中,所述流量控制方式包括:将超出所述第一数量的服务请求消息发送给其他服务端处理或将超出第一数量的服务请求消息丢弃,所述递增计数器用于判断所述第一流量控制策略是否为最新的流量控制策略。Wherein, the flow control method includes: sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number, and the increment counter is used to determine the first flow Whether the control strategy is the latest flow control strategy.
- 如权利要求11所述的方法,其特征在于,如果所述第一流量控制策略中包括所述第一流量控制策略的生成时间,所述客户端在根据所述第一流量控制策略进行流量控制之前,还包括:The method of claim 11, wherein if the first flow control strategy includes the generation time of the first flow control strategy, the client is performing flow control according to the first flow control strategy. Before, it also included:所述客户端确定正在执行的第二流量控制策略的生成时间早于所述第一流量控制策略的生成时间。The client determines that the generation time of the second flow control strategy being executed is earlier than the generation time of the first flow control strategy.
- 如权利要求11所述的方法,其特征在于,如果所述第一流量控制策略中包括所述递增计数器,所述客户端在根据所述第一流量控制策略进行流量控制之前,还包括:The method of claim 11, wherein if the first flow control strategy includes the increment counter, before the client performs flow control according to the first flow control strategy, the method further comprises:所述客户端比较所述第一流量控制策略中的递增计数器和正在执行的第二流量控制策略的递增计数器,确定使用所述第一流量控制策略。The client compares the increment counter in the first flow control strategy with the increment counter of the second flow control strategy being executed, and determines to use the first flow control strategy.
- 如权利要求9所述的方法,其特征在于,还包括:The method of claim 9, further comprising:所述客户端向所述服务端发送第三消息,所述第三消息包括所述客户端正在执行的第一流量控制策略;Sending, by the client, a third message to the server, where the third message includes the first flow control policy being executed by the client;所述客户端接收所述服务端的针对所述第三消息的第四消息,所述第四消息用于指示所述服务端的拥塞状态解除;Receiving, by the client, a fourth message from the server for the third message, where the fourth message is used to indicate that the congestion state of the server is released;所述客户端不再执行第一流量控制策略。The client no longer executes the first flow control strategy.
- 如权利要求14所述的方法,其特征在于,所述第四消息包括用于指示拥塞状态的第一字段,通过第一字段的值指示所述服务端的拥塞状态解除。The method according to claim 14, wherein the fourth message includes a first field for indicating a congestion state, and the value of the first field indicates that the congestion state of the server is released.
- 一种通信装置,其特征在于,所述装置包括:A communication device, characterized in that the device comprises:收发模块,用于接收客户端发送的第一消息,所述第一消息用于指示所述客户端支持流量控制;以及向所述客户端发送针对所述第一消息的第二消息,所述第二消息包括第一流量控制策略,第一流量控制策略用于确定允许所述客户端向所述装置发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数。The transceiver module is configured to receive a first message sent by a client, the first message is used to indicate that the client supports flow control; and a second message for the first message is sent to the client, the The second message includes a first flow control policy, and the first flow control policy is used to determine a first number of service request messages that the client is allowed to send to the device, and the first number is an integer greater than or equal to 0.
- 如权利要求16所述的装置,其特征在于,所述第一消息包括:所述客户端正在执行的第二流量控制策略。The apparatus according to claim 16, wherein the first message comprises: a second flow control strategy being executed by the client.
- 如权利要求16或17所述的装置,其特征在于,还包括:The device according to claim 16 or 17, further comprising:处理模块,用于所述装置在处于拥塞状态时,根据所述装置的流量处理能力,确定所述第一流量控制策略。The processing module is configured to determine the first flow control strategy according to the flow processing capability of the device when the device is in a congested state.
- 如权利要求16或17所述的装置,其特征在于,所述收发模块,还用于接收来自上级服务端的第五消息,所述第五消息包括第三流量控制策略,所述第三流量控制策略用于确定允许所述装置向所述上级服务端发送的服务请求消息的第三数量,所述第三数量为大于或等于0的整数。The device according to claim 16 or 17, wherein the transceiver module is further configured to receive a fifth message from an upper-level server, the fifth message including a third flow control strategy, and the third flow control The policy is used to determine a third number of service request messages that the device is allowed to send to the upper-level server, and the third number is an integer greater than or equal to 0.
- 如权利要求19所述的装置,其特征在于,还包括:The device of claim 19, further comprising:处理模块,用于根据所述装置的本地策略和所述第三流量控制策略,确定所述第一流量控制策略。The processing module is configured to determine the first flow control strategy according to the local strategy of the device and the third flow control strategy.
- 如权利要求16-20任一项所述的装置,其特征在于,所述第一流量控制策略包括以下多项中的至少一项:The device according to any one of claims 16-20, wherein the first flow control strategy comprises at least one of the following items:第一流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第一流量控制策略的生成时间、递增计数器;The effective time of the first flow control strategy, the flow control method, the type of service request message, the generation time of the first flow control strategy, and the increment counter;其中,所述流量控制方式包括:将超出所述第一数量的服务请求消息发送给其他装置处理或将超出第一数量的服务请求消息丢弃;所述递增计数器用于判断所述第一流量控制策略是否为最新的流量控制策略。Wherein, the flow control method includes: sending service request messages exceeding the first number to other devices for processing or discarding service request messages exceeding the first number; the increment counter is used to determine the first flow control Whether the strategy is the latest flow control strategy.
- 如权利要求16所述的装置,其特征在于,其特征在于,所述收发模块,还用于接收所述客户端发送的第三消息,所述第三消息包括所述客户端正在执行的第一流量控制策略;以及在确定拥塞状态解除的情况下,向所述客户端发送针对所述第三消息的第四消息,所述第四消息用于指示所述装置的拥塞状态解除。The apparatus according to claim 16, wherein the transceiver module is further configured to receive a third message sent by the client, and the third message includes the first message being executed by the client A flow control strategy; and in a case where it is determined that the congestion state is released, a fourth message for the third message is sent to the client, the fourth message is used to indicate that the congestion state of the device is released.
- 如权利要求22所述的装置,其特征在于,所述第四消息中包括用于指示拥塞状态的第一字段,通过第一字段的值指示所述装置的拥塞状态解除。The device according to claim 22, wherein the fourth message includes a first field for indicating a congestion state, and the value of the first field indicates that the congestion state of the device is released.
- 一种通信装置,其特征在于,所述装置包括:A communication device, characterized in that the device comprises:收发模块,用于向服务端发送第一消息,所述第一消息用于指示所述装置支持流量控制;以及接收来自所述服务端的针对所述第一消息的第二消息,所述第二消息包括第一流量控制策略,第一流量控制策略用于确定允许所述装置向所述服务端发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数;The transceiver module is configured to send a first message to the server, where the first message is used to indicate that the device supports flow control; and to receive a second message from the server for the first message, the second message The message includes a first flow control strategy, the first flow control strategy is used to determine a first number of service request messages that the device is allowed to send to the server, and the first number is an integer greater than or equal to 0;处理模块,用于根据所述第一流量控制策略进行流量控制。The processing module is configured to perform flow control according to the first flow control strategy.
- 如权利要求24所述的装置,其特征在于,所述第一消息包括:所述装置正在执行的第二流量控制策略,所述第二流量控制策略用于确定所述第一流量控制策略。The device of claim 24, wherein the first message comprises: a second flow control strategy being executed by the device, and the second flow control strategy is used to determine the first flow control strategy.
- 如权利要求24或25所述的装置,其特征在于,所述第一流量控制策略包括以下多项中的至少一项:The device according to claim 24 or 25, wherein the first flow control strategy comprises at least one of the following items:第一流量控制策略的有效时间、流量控制方式、服务请求消息的类型、第一流量控制策略的生成时间、递增计数器;The effective time of the first flow control strategy, the flow control method, the type of service request message, the generation time of the first flow control strategy, and the increment counter;其中,所述流量控制方式包括:将超出所述第一数量的服务请求消息发送给其他服务端处理或将超出第一数量的服务请求消息丢弃,所述递增计数器用于判断所述第一流量控制策略是否为最新的流量控制策略。Wherein, the flow control method includes: sending service request messages exceeding the first number to other servers for processing or discarding service request messages exceeding the first number, and the increment counter is used to determine the first flow Whether the control strategy is the latest flow control strategy.
- 如权利要求26所述的装置,其特征在于,如果所述第一流量控制策略中包括所述第一流量控制策略的生成时间,所述处理模块,在用于根据所述第一流量控制策略进行流量控制之前,还用于:确定正在执行的第二流量控制策略的生成时间早于所述第一流量控制策略的生成时间。The apparatus according to claim 26, wherein, if the first flow control strategy includes the generation time of the first flow control strategy, the processing module is configured to perform according to the first flow control strategy Before performing flow control, it is also used to determine that the generation time of the second flow control strategy being executed is earlier than the generation time of the first flow control strategy.
- 如权利要求26所述的装置,其特征在于,如果所述第一流量控制策略中包括所述递增计数器,所述处理模块,在用于根据所述第一流量控制策略进行流量控制之前,还用于:比较所述第一流量控制策略中的递增计数器和正在执行的第二流量控制策略的递增计数器,确定使用所述第一流量控制策略。The device according to claim 26, wherein if the first flow control strategy includes the increment counter, the processing module, before being used to perform flow control according to the first flow control strategy, further It is used to compare the increment counter in the first flow control strategy with the increment counter in the second flow control strategy being executed, and determine to use the first flow control strategy.
- 如权利要求24所述的装置,其特征在于,还包括:The device of claim 24, further comprising:所述收发模块,还用于向所述服务端发送第三消息,所述第三消息包括所述装置正在 执行的第一流量控制策略;以及接收所述服务端的针对所述第三消息的第四消息,所述第四消息用于指示所述服务端的拥塞状态解除;The transceiver module is further configured to send a third message to the server, the third message including the first flow control strategy being executed by the device; and to receive the first message from the server for the third message Four messages, the fourth message is used to indicate that the congestion state of the server is released;所述处理模块,还用于确定不再执行第一流量控制策略。The processing module is also used to determine that the first flow control strategy is no longer executed.
- 一种通信系统,其特征在于,包括:服务端和客户端;A communication system, characterized by comprising: a server and a client;所述客户端,用于:The client is used for:向所述服务端发送第一消息,所述第一消息用于指示所述客户端支持流量控制;Sending a first message to the server, where the first message is used to indicate that the client supports flow control;接收来自所述服务端的针对所述第一消息的第二消息,所述第二消息包括第一流量控制策略,第一流量控制策略用于确定允许所述装置向所述服务端发送的服务请求消息的第一数量,所述第一数量为大于或等于0的整数;Receive a second message from the server for the first message, where the second message includes a first flow control policy, and the first flow control policy is used to determine the service request that the device is allowed to send to the server A first number of messages, where the first number is an integer greater than or equal to 0;根据所述第一流量控制策略进行流量控制Perform flow control according to the first flow control strategy所述服务端,用于:The server is used to:接收所述客户端发送的所述第一消息Receiving the first message sent by the client向所述客户端发送针对所述第一消息的所述第二消息。Sending the second message for the first message to the client.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910924070.9 | 2019-09-27 | ||
CN201910924070.9A CN112583726B (en) | 2019-09-27 | 2019-09-27 | Flow control method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021057808A1 true WO2021057808A1 (en) | 2021-04-01 |
Family
ID=75109944
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/117212 WO2021057808A1 (en) | 2019-09-27 | 2020-09-23 | Method and apparatus for traffic control |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112583726B (en) |
WO (1) | WO2021057808A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114143377A (en) * | 2021-11-29 | 2022-03-04 | 杭州逗酷软件科技有限公司 | Resource request configuration method, server, client, equipment and storage medium |
CN114531374A (en) * | 2022-02-25 | 2022-05-24 | 平安国际智慧城市科技股份有限公司 | Network monitoring method, device, equipment and storage medium |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113489572B (en) * | 2021-08-23 | 2022-12-20 | 杭州安恒信息技术股份有限公司 | Request sending method, device, equipment and storage medium |
CN115396375B (en) * | 2022-08-17 | 2024-02-27 | 支付宝(杭州)信息技术有限公司 | Service processing method, device and equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6982956B2 (en) * | 2000-04-26 | 2006-01-03 | International Business Machines Corporation | System and method for controlling communications network traffic through phased discard strategy selection |
CN101917431A (en) * | 2010-08-13 | 2010-12-15 | 中兴通讯股份有限公司 | Method and device for preventing illegal invasion of internal network of intelligent home |
CN102164384A (en) * | 2010-06-17 | 2011-08-24 | 华为技术有限公司 | Method, device and system for improving service success rate |
CN107508860A (en) * | 2017-07-21 | 2017-12-22 | 深圳市金立通信设备有限公司 | One kind service current-limiting method, server and terminal |
CN107707488A (en) * | 2017-10-25 | 2018-02-16 | 北京数码视讯支付技术有限公司 | Payment online transaction flow control method, flow limiting server and client |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102137091B (en) * | 2010-11-15 | 2013-11-06 | 华为技术有限公司 | Overload control method, device and system as well as client-side |
CN103369601B (en) * | 2013-07-15 | 2016-01-20 | 厦门卓讯信息技术有限公司 | For cell-phone customer terminal provides the method for large concurrent processing and flow control |
CN105024933B (en) * | 2014-04-22 | 2019-01-29 | 腾讯科技(深圳)有限公司 | The control method and device of request packet transmission frequency |
EP3057290A1 (en) * | 2015-02-10 | 2016-08-17 | Telefonica Digital España, S.L.U. | Method, system and device for managing congestion in network services |
JP6997090B2 (en) * | 2016-02-18 | 2022-01-17 | テレフオンアクチーボラゲット エルエム エリクソン(パブル) | Systems, methods, and equipment for managing data rates for control plane optimization |
CN106161219B (en) * | 2016-09-29 | 2019-04-09 | 广州华多网络科技有限公司 | Message treatment method and device |
CN108134808B (en) * | 2016-12-01 | 2021-06-11 | 阿里巴巴集团控股有限公司 | Network request method and device |
CN109088828B (en) * | 2018-08-03 | 2022-07-26 | 网宿科技股份有限公司 | Server overload control method and system |
-
2019
- 2019-09-27 CN CN201910924070.9A patent/CN112583726B/en active Active
-
2020
- 2020-09-23 WO PCT/CN2020/117212 patent/WO2021057808A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6982956B2 (en) * | 2000-04-26 | 2006-01-03 | International Business Machines Corporation | System and method for controlling communications network traffic through phased discard strategy selection |
CN102164384A (en) * | 2010-06-17 | 2011-08-24 | 华为技术有限公司 | Method, device and system for improving service success rate |
CN101917431A (en) * | 2010-08-13 | 2010-12-15 | 中兴通讯股份有限公司 | Method and device for preventing illegal invasion of internal network of intelligent home |
CN107508860A (en) * | 2017-07-21 | 2017-12-22 | 深圳市金立通信设备有限公司 | One kind service current-limiting method, server and terminal |
CN107707488A (en) * | 2017-10-25 | 2018-02-16 | 北京数码视讯支付技术有限公司 | Payment online transaction flow control method, flow limiting server and client |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114143377A (en) * | 2021-11-29 | 2022-03-04 | 杭州逗酷软件科技有限公司 | Resource request configuration method, server, client, equipment and storage medium |
CN114143377B (en) * | 2021-11-29 | 2024-04-02 | 杭州逗酷软件科技有限公司 | Resource request configuration method, server, client, device and storage medium |
CN114531374A (en) * | 2022-02-25 | 2022-05-24 | 平安国际智慧城市科技股份有限公司 | Network monitoring method, device, equipment and storage medium |
CN114531374B (en) * | 2022-02-25 | 2023-08-25 | 深圳平安智慧医健科技有限公司 | Network monitoring method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112583726B (en) | 2022-11-11 |
CN112583726A (en) | 2021-03-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021057808A1 (en) | Method and apparatus for traffic control | |
WO2020001572A1 (en) | Communication method and apparatus | |
EP3806524B1 (en) | Quality of service monitoring methods, devices, system and computer-readable storage medium | |
EP3981190B1 (en) | Method and apparatus for enforcement of maximum number of protocol data unit sessions per network slice in a communication system | |
WO2021037175A1 (en) | Network slice management method and related device | |
WO2020052416A1 (en) | Security protection method, device, and system | |
CN112913212A (en) | Control of user plane functions with control plane-user plane separation | |
EP3499949B1 (en) | Method, device and system for processing control signalling | |
US11848963B2 (en) | Method for providing restricted service, and communications device | |
WO2021032131A1 (en) | User plane information reporting method and apparatus | |
KR20160035594A (en) | End-to-end m2m service layer sessions | |
WO2018219148A1 (en) | Method, device and system for managing transmission network slices | |
WO2022017113A1 (en) | Communication method and apparatus | |
EP3790308B1 (en) | Business service quality monitoring method, device and system | |
WO2017148419A1 (en) | Data transmission method and server | |
WO2017041577A1 (en) | Method and device for managing link aggregation member port packet loss | |
WO2022012361A1 (en) | Communication method and apparatus | |
US20160249206A1 (en) | Data transmission method and device | |
CN113114649B (en) | Method, device, equipment and medium for solving denial of service attack | |
WO2022151206A1 (en) | Communication method and network device | |
WO2022047803A1 (en) | Communication method and apparatus | |
WO2023011158A1 (en) | Certificate management method and apparatus | |
US20190149513A1 (en) | Packet transmission method, apparatus, and system | |
CA3156347A1 (en) | Communication method, apparatus, and system | |
WO2022027341A1 (en) | Wireless communication method and terminal device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20868970 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20868970 Country of ref document: EP Kind code of ref document: A1 |