Request processing method and device, equipment and medium

By detecting the request time difference and the switching buffer duration, it is determined whether the request meets the processing switching conditions, achieving smooth switching of the request processing method, solving the problems of error information propagation and node processing abnormalities on the Internet, and improving system stability and accuracy. .

CN118632082AActive Publication Date: 2024-09-10BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410749528.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-09-10
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

In the Internet, there are a large number of factual errors in documents, and it is necessary to detect factual errors in documents to reduce the release of wrong information. It is difficult for existing technologies to effectively detect and process request switching, resulting in the spread of wrong information in the network and abnormal node processing. .

Method used

By obtaining the request time and switching processing trigger time of the pending request, calculate the time difference, and detect whether the request meets the processing switching conditions based on the switching buffer duration and time difference, use the target processing method after switching to process the request, and implement the request Smooth switching of processing methods.

Benefits of technology

It improves the stability and accuracy of the request processing system, reduces inconsistencies in processing methods and node processing exceptions, and enables fine-grained switching of request processing methods and smooth growth in quantity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118632082A
    Figure CN118632082A
Patent Text Reader

Abstract

The invention provides a request processing method and device, equipment and a medium, and relates to the field of computers, in particular to the technical field of cloud computing and media cloud. The specific implementation scheme is as follows: obtaining the request time of a to-be-processed request; obtaining switching processing trigger time and switching buffer duration; calculating a time difference value between the switching processing trigger time and the request time; detecting whether the to-be-processed request meets a processing switching condition or not according to the switching buffer duration and the time difference; and when the to-be-processed request meets the processing switching condition, processing the to-be-processed request by adopting the switched target processing mode. According to the embodiment of the invention, the processing mode of the request can be smoothly switched.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the computer field, specifically to the field of cloud computing and media cloud technology, and in particular to a request processing method, device, equipment and medium. Background Art

[0002] In the Internet, servers handle a large number of requests.

[0003] In recent years, people have communicated with each other by publishing documents such as news, comments and articles on the Internet.

[0004] However, some documents are filled with a large number of factual errors, and factual error detection is needed to reduce the publication of erroneous information on the Internet. Summary of the invention

[0005] The present disclosure provides a request processing method, apparatus, device and medium.

[0006] According to one aspect of the present disclosure, a request processing method is provided, comprising:

[0007] Get the request time of pending requests;

[0008] Get the switching process trigger time and switching buffer duration;

[0009] Calculate the time difference between the switching process triggering time and the request time;

[0010] According to the switching buffer time length and the time difference, detecting whether the pending request meets the processing switching condition;

[0011] When the request to be processed meets the processing switching condition, the request to be processed is processed using the switched target processing mode.

[0012] According to one aspect of the present disclosure, there is provided a request processing device, comprising:

[0013] A request time acquisition module is used to obtain the request time of the pending request;

[0014] The switching time acquisition module is used to obtain the switching processing trigger time and the switching buffer duration;

[0015] A switching duration calculation module, used to calculate the time difference between the switching process trigger time and the request time;

[0016] A request switching detection module, used to detect whether the pending request meets the processing switching condition according to the switching buffer time and the time difference;

[0017] The processing mode switching module is used to process the request to be processed by adopting the switched target processing mode when the request to be processed meets the processing switching condition.

[0018] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0019] at least one processor; and

[0020] a memory communicatively connected to the at least one processor; wherein,

[0021] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the request processing method described in any embodiment of the present disclosure.

[0022] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the request processing method described in any embodiment of the present disclosure.

[0023] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the request processing method described in any embodiment of the present disclosure is implemented.

[0024] The disclosed embodiments can enable smooth switching of request processing methods.

[0025] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0027] Figure 1 is a flowchart of a request processing method disclosed in an embodiment of the present disclosure;

[0028] Figure 2 is a flowchart of another request processing method disclosed in an embodiment of the present disclosure;

[0029] Figure 3 is a flowchart of another request processing method disclosed in an embodiment of the present disclosure;

[0030] Figure 4 It is a scene diagram of a request processing method disclosed in an embodiment of the present disclosure;

[0031] Figure 5is a schematic diagram of the structure of a request processing device disclosed in an embodiment of the present disclosure;

[0032] Figure 6 It is a block diagram of an electronic device according to the request processing method disclosed in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0033] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0034] Figure 1 This is a flowchart of a request processing method disclosed in an embodiment of the present disclosure. This embodiment can be applied to the case where it is determined whether a request processing method needs to be switched. The method of this embodiment can be executed by a request processing device, which can be implemented in software and / or hardware and is specifically configured in an electronic device with certain data computing capabilities, which can be a server device.

[0035] S101. Obtain the request time of the request to be processed.

[0036] The request time may refer to the current time of processing the pending request. In a node cluster, multiple nodes process a large number of processing requests. The node may be a server or a microservice. Optionally, the node may be a node in a content delivery network (CDN). The pending request may be data transmitted in the content delivery network. Exemplarily, the pending request may be a resource acquisition request, for example, the pending request may be an acquisition request for a live stream.

[0037] S102: Obtain a switching process triggering time and a switching buffering time.

[0038] The switching processing trigger time may refer to the time for triggering the switching of the request processing operation. The switching buffer duration may refer to the duration from the start of switching the processing operation of each request to the completion of switching the processing operation of each request. Usually, the existing trigger switching processing operation will switch the processing operations of all requests that need to be switched to the target processing operation. In the embodiment of the present disclosure, starting from the switching processing trigger time, the processing operations of some requests are selected for switching, and the number of selected requests increases with time until the processing operations of all requests that need to be switched are switched to the target processing operation.

[0039] S103: Calculate the time difference between the switching process triggering time and the request time.

[0040] The time difference may refer to the time from the start time of the processing operation to the current time, and the time difference is used to determine the number of requests that need to perform the processing operation switch. In fact, the number of requests that need to be switched increases with time, and the number of requests that need to be switched corresponding to the current time can be determined based on the time difference, and based on the number, it is determined whether the request to be processed belongs to the request that needs to switch the processing operation.

[0041] S104: Detect whether the pending request satisfies a processing switching condition according to the switching buffer time length and the time difference.

[0042] The processing switching condition may refer to the condition for determining whether the processing operation of the pending request is switched. The switching buffer duration may be understood as the total duration for completing the switching of all requests that need to be switched, and the time difference may be understood as the time schedule of the current switching. Specifically, the processing switching condition may be to determine whether the ratio between the pending request and the switching buffer duration is less than the time difference; if it is less than or equal to, it is determined that the pending request satisfies the processing switching condition; if it is greater than, it is determined that the pending request does not satisfy the processing switching condition.

[0043] S105: When the request to be processed meets the processing switching condition, the request to be processed is processed using the switched target processing mode.

[0044] The pending request meets the processing switching condition, indicating that the pending request can be switched from the current processing mode to the target processing mode. The processing mode of the pending request is switched from the original processing mode to the target processing mode. Exemplarily, the processing mode of the pending request is switched from local scheduling (i.e., non-302 scheduling) to 302 scheduling. As another example, the processing mode of the pending request is switched from processing by node A to processing by node B. As another example, the processing mode of the pending request is switched from processing by the first optimization strategy to processing by the second optimization strategy, wherein the first optimization strategy may be load balancing processing, and the second optimization strategy may be normal processing, i.e., non-load balancing processing. In addition, in the aforementioned examples, the contents of the original processing mode and the target processing mode can be interchangeable.

[0045] According to the technical solution disclosed in the present invention, by obtaining the request time of the pending request and calculating the time difference between the switching processing trigger time and the request time, the progress of the pending request in the switching process is determined according to the switching buffer time and the time difference, so as to judge whether the pending request needs to switch the processing mode. It is possible to judge whether to switch the processing mode for each request separately, thereby improving the granularity of switching the processing mode. At the same time, it is possible to accurately control the smooth growth of the number of switching requests, reduce the node processing abnormalities caused by the sudden increase in the number of switching requests, and improve the stability and accuracy of the request processing system.

[0046] Figure 2 It is a flowchart of another request processing method disclosed in an embodiment of the present disclosure, which is further optimized and expanded based on the above technical solution and can be combined with the above optional implementations. The request value is obtained; the switching buffer duration is modulo-ed according to the request value to obtain a modulo result; the modulo result is compared with the time difference; when the modulo result is less than or equal to the time difference, it is determined that the request to be processed meets the processing switching condition.

[0047] S201. Obtain the request time of the request to be processed.

[0048] S202: Obtain a switching process triggering time and a switching buffering time.

[0049] S203: Calculate the time difference between the switching process triggering time and the request time.

[0050] S204: Get the request value.

[0051] The request value is used to represent the pending request. The request value may refer to the numerical value corresponding to the pending request. In practice, the pending request is mapped into the numerical space to obtain the request value. The request values ​​of different pending requests may be the same or different. The request value may be a random number or may be determined according to the identifier of the pending request.

[0052] Optionally, obtaining the request value includes: obtaining identification information of the request to be processed; and calculating the identification information to obtain the request value.

[0053] The identification information is used to identify the pending request. For example, the identification information of the pending requests sent by different users is different. For another example, the identification information of the pending requests of different resources is different. Among them, the request values ​​calculated by different servers for the same identification are the same. Different servers use the same algorithm to calculate the identification information, so that the request values ​​calculated by different servers for the same identification are the same.

[0054] Exemplarily, a hash algorithm may be used to calculate the requested stream name to obtain a hash value, which is determined as the requested value. The hash algorithm may be CRC32 or other hash algorithms.

[0055] In a specific example, the request to be processed is a request for a live stream, and the identification information of requests for different live streams is different, that is, the identification information is used to identify different live broadcast rooms.

[0056] By calculating the request value according to the identifier of the request to be processed, the request value calculated for the same request can be made the same, and the processing method of the same request can be switched to ensure consistency in the judgment result, thereby achieving consistency in the processing method of the same request, which can reduce the situation of abnormal service performance caused by inconsistent request processing methods.

[0057] S205. Perform modulo operation on the switching buffer duration according to the request value to obtain a modulo operation result.

[0058] The modulo result is used to represent the pending request.

[0059] S206: Compare the modulo result with the time difference.

[0060] S207: When the modulo result is less than or equal to the time difference, determine that the request to be processed meets a processing switching condition.

[0061] If the modulo result is less than or equal to the time difference, it is determined that the pending request meets the processing switching condition; if the modulo result is greater than the time difference, it is determined that the pending request does not meet the processing switching condition.

[0062] In fact, the switching buffer duration provides a buffer time period, during which the number of requests for switching processing methods gradually increases until it reaches a peak value, which may refer to the number of all requests that need to be switched. That is, during this time period, the processing methods of some requests are switched, and the number of requests that can be switched gradually increases. After this time period, the processing methods of all requests are switched. When the time difference is greater than the switching buffer duration, it indicates that the request time is after the buffer time period. At this time, any request that needs to switch the processing method switches the processing method. When the time difference is less than the switching buffer duration, it indicates that the request time is within the buffer time period, and at this time, some requests need to be selected for processing method switching. Using any numerical value to take the modulus of the switching buffer duration, the modulus result must be less than the time difference. Thus, by comparing the modulus result with the time difference, according to the comparison result, it is possible to accurately implement the switching of the processing methods of some requests that need to be switched within the buffer time period, and after the buffer time period, the processing methods of all requests that need to be switched are switched. In addition, the time difference gradually increases with the increase of request time. The closer the time difference is to the switching buffer duration, the more requests whose corresponding modulo results are less than the time difference. Thus, the more requests that meet the processing switching conditions. In this way, the number of requests that meet the processing switching conditions increases with time.

[0063] S208: When the pending request meets the processing switching condition, the pending request is processed using the switched target processing mode.

[0064] Optionally, the request processing method also includes: when the modulo result is greater than the time difference, determining that the pending request does not meet the processing switching condition; when the pending request does not meet the processing switching condition, processing the pending request using the original processing method before switching.

[0065] The original processing method may refer to a processing method that has not been switched. By setting the request whose modulo result is greater than the time difference value to not meet the processing switching condition, it can be achieved that some requests will not switch the processing method, which can slow down the growth of the number of switched requests and achieve a stable growth of the switched requests, thereby improving the accuracy and speed of request processing.

[0066] According to the technical solution disclosed in the present invention, the switching buffer duration is modulo the request value, and the modulo result is compared with the time difference. According to the comparison result, it is determined whether the request to be processed meets the switching condition. When the time difference gradually approaches the switching buffer duration, the number of requests for switching processing methods can be increased, and when the time difference is greater than the switching buffer duration, all requests that need to switch processing methods will have their processing methods switched, so that the processing methods of the requests that need to be switched are gradually switched over time, and finally all requests that need to be switched will have their processing methods switched, thereby achieving smooth switching at the request granularity.

[0067] Figure 3 It is a flowchart of another request processing method disclosed in accordance with an embodiment of the present disclosure, which is further optimized and expanded based on the above technical solution, and can be combined with the above optional implementation methods. The obtaining of the request time of the pending request is specifically as follows: receiving a stream request; detecting whether the stream request is a cold stream request; when the stream request is a cold stream request, determining the stream request as a pending request; obtaining the request time of the pending request; and the processing of the pending request by the switched target processing method is specifically as follows: forwarding the pending request to the cold stream centralized node for processing by the 302 scheduling method.

[0068] S301: Receive a stream request.

[0069] Stream requests are used to request data streams.

[0070] S302: Detect whether the flow request is a cold flow request.

[0071] A cold flow request may refer to a flow request with a small number of accesses. A cold flow request is opposite to a hot flow request, and a hot flow request may refer to a flow request with a large number of accesses. In addition, switching judgment may be performed by region. For example, the current node detects whether the region to which it belongs belongs to the specified region range. If it does, it detects whether the flow request is a cold flow request, and detects whether the cold flow request meets the processing switching conditions. If it does not belong to the specified region range, the flow request is processed using the original processing method before the switch.

[0072] S303: When the stream request is a cold stream request, determine the stream request as a request to be processed.

[0073] The stream requests are filtered, cold stream requests are determined as pending requests, and hot stream requests are not considered pending requests. The processing mode switching can be performed for the switching of cold stream requests.

[0074] S304: Obtain the request time of the request to be processed.

[0075] S305: Obtain the switching process triggering time and the switching buffering time.

[0076] S306: Calculate the time difference between the switching process triggering time and the request time.

[0077] S307: Detect whether the pending request meets a processing switching condition according to the switching buffer time length and the time difference.

[0078] S308: When the pending request meets the processing switching condition, the pending request is forwarded to the cold flow centralized node for processing using the 302 scheduling method.

[0079] The scheduling method 302 may refer to a scheduling method in which all cold flows are concentrated on the same node for processing. The cold flow concentration node may refer to a node that centrally processes cold flow requests.

[0080] Optionally, the switching processing trigger time includes: the switching processing trigger time includes: a specified processing mode switching start time or a specified processing mode switching end time.

[0081] The switching processing trigger time is the specified processing mode switching start time. Accordingly, when the pending request meets the processing switching condition, the processing mode of the pending request is switched from a certain processing mode to a specified processing mode, for example, from the original processing mode to the target processing mode. At this time, the original processing mode is a certain processing mode and the target processing mode is the specified processing mode. The time difference is the difference between the request time and the specified processing mode switching start time.

[0082] The switching processing trigger time is the specified processing mode switching end time. Accordingly, when the pending request meets the processing switching condition, the processing mode of the pending request is switched from the specified processing mode to a certain processing mode, for example, from the original processing mode to the target processing mode. At this time, the original processing mode is the specified processing mode, and the target processing mode is a certain processing mode. The time difference is the difference between the request time and the specified processing mode switching end time.

[0083] The designated processing mode is different from a certain processing mode, and similarly, the original processing mode is different from the target processing mode. Exemplarily, the designated processing mode is processing mode A, and the certain processing mode is processing mode B. When the pending request meets the processing switching condition, the processing mode of the pending request is switched from processing mode B to processing mode A, and when the pending request meets the processing switching condition, the processing mode of the pending request is switched from processing mode A to processing mode B.

[0084] By setting the switching processing trigger time to the switching start time or switching end time of the specified processing method, the number of switching requests can be smoothly changed for the start and end of the specified processing method, realizing smooth switching in the two scenarios of the start and end of a specific processing method, enriching the scenarios of smooth switching.

[0085] Optionally, the stream request includes: a live broadcast room data stream request.

[0086] A stream request can be a pull request for a live data stream or a push request for a live data stream. Usually, a stream request is a pull request for a live data stream. By configuring a stream request as a live data stream request, you can avoid the sudden change of switching a large number of stream requests to other processing methods in live application scenarios, and improve the stability and fault tolerance of the live streaming service system in a smooth switching manner, thereby improving the data quality and transmission performance of the live streaming.

[0087] In a specific example, the request processing method in the embodiment of the present disclosure is executed by a node in the CDN, and in particular, can be executed by an edge node. The pending request can refer to a cold stream request of a live stream. The processing method of the pending request can be switching from non-302 scheduling to 302 scheduling, or from 302 scheduling to non-302 scheduling.

[0088] In the current CDN live broadcast business, due to the different number of anchor fans and the differences in live broadcast content, the concurrent playback volume of different live streams varies greatly, that is, the degree of hotness and coldness varies greatly. The number of cold streams played is small, but the edge nodes accessed need to go back to the source to obtain content. The return of multiple edge nodes will increase the cost, so it is necessary to use 302 scheduling to concentrate all cold streams on the same node to reduce the return cost. However, when the 302 scheduling function is turned on, many cold streams will be scheduled to the same node in a short period of time, resulting in a sudden increase in the bandwidth of the scheduling domain name, affecting business stability.

[0089] In fact, for CDN, different regions correspond to different nodes, that is, multiple different nodes need to concentrate the same cold stream request into the same node or a few nodes, where the same cold stream request can refer to the request for the same live stream. These different nodes are distributed in different regions, and the upstream nodes of these nodes are also different, making it difficult to centrally control the switching processing methods of these nodes for the same cold stream request. The disclosed embodiment can accurately control the number of switches for the same cold stream request by independently determining whether the processing method needs to be switched for each request, thereby achieving a smooth change in the number of switches for the same request.

[0090] In a specific example, the durations of smooth start (smooth_start) and smooth stop (smooth_end) are preset, such as 15 minutes to 30 minutes.

[0091] When a CDN node receives a stream request for a cold stream, it calculates a hash value based on the stream name.

[0092] Smooth On:

[0093] From the time (start) when the 302 scheduling mode takes effect, a smooth start check is performed, that is, whether the cold flow request meets the processing switching conditions. The time difference (local_time-start) between the effective time, that is, the switching processing trigger time (start) and the request time (local_time) is calculated, and the time difference is in seconds. The calculated hash value is modulo the duration of smooth start (in seconds). If the modulo value is less than or equal to the time difference (hash%smooth_start≤(local_time-start)), it is determined that the cold flow request meets the processing switching conditions, and the 302 scheduling logic is effective. Otherwise, the cold flow request does not meet the processing switching conditions, and the local flow is directly pulled.

[0094] Exemplarily, 302 scheduling is started at 12:00:00, the switching process trigger time (start) is 12:00:00, and the smooth start time is 30 minutes, that is, the switching buffer time is 30 minutes, that is, 1800 seconds.

[0095] The request time of a stream request within 1 second is determined as the prior endpoint time.

[0096] For all stream requests within 12:00:01 seconds, the request time is 12:00:00, and the time difference is 0. Accordingly, 302 scheduling is not effective for all stream requests within 12:00:01 seconds.

[0097] For requests within the one-second period of 12:00:01-12:00:02, the request time is 12:00:01, and the time difference is 1. Get the hash value of the stream request and take the modulus with 1800. If the modulus result is 1, 302 scheduling will take effect on the stream request, and subsequent 302 scheduling operations will be performed. 302 scheduling will not take effect on other stream requests.

[0098] For requests within the one-second period of 12:00:02-12:00:03, the request time is 12:00:02, and the time difference is 2. The hash value of the stream request is obtained and modulo 1800. If the modulo result is 1 or 2, 302 scheduling is effective for the stream request, and subsequent 302 scheduling operations are performed. 302 scheduling is not effective for other stream requests.

[0099] For requests within the one-second period of 12:00:03-12:00:04, the request time is 12:00:03, and the time difference is 3. Get the hash value of the flow request and take the modulus with 1800. If the hash value of the modulus result is less than or equal to 3, 302 scheduling will take effect on the flow request, and subsequent 302 scheduling operations will be executed. 302 scheduling will not take effect on other flow requests.

[0100] Until 30 minutes, all cold flow requests will take effect 302 scheduling.

[0101] Smooth end:

[0102] Similar to the smooth start check, a smooth end check is performed starting from the 302 effective end time (end), that is, to detect whether the cold flow request meets the processing switching conditions. Calculate the time difference (local_time-end) between the effective time, that is, the switching processing trigger time (end) and the request time (local_time), and the time difference is in seconds. Take the modulus of the calculated hash value and the duration of smooth start (in seconds). If the modulo value is less than or equal to the time difference (hash%smooth_start≤(local_time-end)), it is determined that the cold flow request meets the processing switching conditions, and the local pull operation is effective, switching from effective 302 scheduling to ineffective 302 scheduling. Otherwise, the cold flow request does not meet the processing switching conditions, and the 302 scheduling operation is still executed.

[0103] Exemplarily, the 302 scheduling ends at 20:00:00, the switching process trigger time (end) is 20:00:00, and the smooth start time is 30 minutes, that is, the switching buffer time is 30 minutes, that is, 1800 seconds.

[0104] For all flow requests within 20:00:01 seconds, the request time is 20:00:00, and the time difference is 0. Accordingly, all flow requests within 20:00:01 seconds do not end the 302 scheduling, that is, all of them take effect.

[0105] For requests within the one-second period of 20:00:01-20:00:02, the request time is 20:00:01, and the time difference is 1. Get the hash value of the stream request and take the modulus with 1800. If the modulus result is 1, the stream request ends the 302 scheduling and performs the local stream pulling operation. The remaining stream requests are all subject to the 302 scheduling.

[0106] For requests within the one-second period of 20:00:02-20:00:03, the request time is 20:00:02, and the time difference is 2. The hash value of the stream request is obtained and modulo 1800. If the modulo result is 1 or 2, the stream request ends the 302 scheduling and performs the local stream pulling operation. The remaining stream requests are all subject to the 302 scheduling.

[0107] For requests within the one-second period of 20:00:03-20:00:04, the request time is 20:00:03, and the time difference is 3. The hash value of the stream request is obtained and modulo 1800. If the hash value of the modulo result is less than or equal to 3, the stream request ends the 302 scheduling and performs the local stream pulling operation. The remaining stream requests are all subject to the 302 scheduling.

[0108] After 30 minutes, all cold stream requests will end the 302 scheduling and execute local stream pulling operations.

[0109] The final effect is: within a period of time starting from the 302 effective time, the number of flows with effective 302 scheduling increases until all are finally enabled; within a period of time starting from the 302 stop time, the number of flows closed 302 increases until all are finally closed.

[0110] Through experiments, such as Figure 4 As shown, configuring smooth start and stop may refer to adopting the request processing method provided by the embodiment of the present disclosure, and not configuring smooth start and stop may refer to not adopting the request processing method provided by the embodiment of the present disclosure, that is, not configuring smooth start and stop may refer to the existing effective 302 scheduling method. Figure 4 In the figure, the upper blue line is the bandwidth change curve of the scheduling domain name over time during the effective 302 scheduling operation without smooth start and stop configuration, and the lower black line is the bandwidth change curve of the scheduling domain name over time during the effective 302 scheduling operation with smooth start and stop configuration. Figure 4 It shows that the black line configured with the request processing method provided by the embodiment of the present disclosure changes more smoothly at the beginning and end stages (i.e., the curve part in the red box), while the blue line that does not adopt the request processing method provided by the embodiment of the present disclosure changes more abruptly, with a sudden increase at the beginning stage and a sudden decrease at the end stage.

[0111] The 302 scheduling smooth start-stop algorithm enables the bandwidth to be smoothly increased and / or decreased when the 302 function is turned on and / or stopped, thereby avoiding the impact of bandwidth mutation on system stability and enhancing system stability.

[0112] According to the technical solution disclosed in the present invention, by performing switching judgment on the cold flow request, when the cold flow request meets the switching processing conditions, the cold flow request is forwarded to the cold flow centralized node for processing using the 302 scheduling method. This allows the bandwidth of the 302 scheduling function to change smoothly when switching, thereby avoiding the impact of bandwidth mutations on the stability of the request processing system and enhancing the stability of the request processing system.

[0113] According to an embodiment of the present disclosure, Figure 5 is a structural diagram of a request processing device in an embodiment of the present disclosure, and the embodiment of the present disclosure is applicable to the case where it is determined whether a request processing method needs to be switched. The device is implemented by software and / or hardware, and is specifically configured in an electronic device with certain data computing capabilities.

[0114] like Figure 5 The request processing device 500 shown in the figure comprises: a request time acquisition module 501, a switching time acquisition module 502, a switching duration calculation module 503, a request switching detection module 504 and a processing mode switching module 505.

[0115] The request time acquisition module 501 is used to obtain the request time of the request to be processed;

[0116] The switching time acquisition module 502 is used to obtain the switching process trigger time and the switching buffer time;

[0117] A switching duration calculation module 503, used to calculate the time difference between the switching process trigger time and the request time;

[0118] A request switching detection module 504, configured to detect whether the pending request satisfies a processing switching condition according to the switching buffer time and the time difference;

[0119] The processing mode switching module 505 is used to process the request to be processed by adopting the switched target processing mode when the request to be processed meets the processing switching condition.

[0120] According to the technical solution disclosed in the present invention, by obtaining the request time of the pending request and calculating the time difference between the switching processing trigger time and the request time, the progress of the pending request in the switching process is determined according to the switching buffer time and the time difference, so as to judge whether the pending request needs to switch the processing mode. It is possible to judge whether to switch the processing mode for each request separately, thereby improving the granularity of switching the processing mode. At the same time, it is possible to accurately control the smooth growth of the number of switching requests, reduce the node processing abnormalities caused by the sudden increase in the number of switching requests, and improve the stability and accuracy of the request processing system.

[0121] Furthermore, the request switching detection module 504 includes:

[0122] A request value obtaining unit, used for obtaining a request value;

[0123] A buffer duration modulo unit, used to perform modulo operation on the switching buffer duration according to the request value to obtain a modulo result;

[0124] A time phase detection unit, used for comparing the modulo result with the time difference;

[0125] A switching condition judgment unit is used to determine whether the request to be processed meets the processing switching condition when the modulo result is less than or equal to the time difference.

[0126] Furthermore, the request value obtaining unit includes:

[0127] An identification information acquisition subunit, used to acquire identification information of a request to be processed;

[0128] The request value calculation subunit is used to calculate the identification information to obtain a request value.

[0129] Furthermore, the request processing device further includes:

[0130] a non-switching judgment unit, configured to determine that the request to be processed does not satisfy a processing switching condition when the modulo result is greater than the time difference;

[0131] The original processing unit is used to process the request to be processed in the original processing mode before the switching when the request to be processed does not meet the processing switching condition.

[0132] Furthermore, the switching process triggering time includes: a specified processing mode switching start time or a specified processing mode switching end time.

[0133] Furthermore, the request time acquisition module 501 includes:

[0134] A stream request receiving unit, configured to receive a stream request;

[0135] A cold flow judgment unit, used to detect whether the flow request is a cold flow request;

[0136] a cold flow request acquiring unit, configured to determine the flow request as a request to be processed when the flow request is a cold flow request;

[0137] A request time acquisition unit, used to acquire the request time of the request to be processed;

[0138] Accordingly, the processing mode switching module 505 includes:

[0139] 302 scheduling switching unit, used to forward the pending request to the cold flow centralized node for processing by using 302 scheduling method.

[0140] Furthermore, the stream request includes: a live broadcast room data stream request.

[0141] The above-mentioned request processing device can execute the request processing method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the request processing method.

[0142] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0143] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0144] Figure 6 A schematic area diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0145] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the device 600 instructions can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0146] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0147] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the request processing method. For example, in some embodiments, the request processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the request processing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the request processing method in any other appropriate manner (e.g., by means of firmware).

[0148] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard objects (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0149] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / instructions specified in the flow chart and / or the area diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0150] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0151] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0152] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0153] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services. The server may also be a server of a distributed system, or a server combined with a blockchain.

[0154] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.

[0155] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, instruction systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for the application of technologies such as artificial intelligence and blockchain, as well as model training.

[0156] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution provided by this disclosure can be achieved, and this document does not limit this.

[0157] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A request processing method, comprising: Get the request time of pending requests; Get the switching process trigger time and switching buffer duration; Calculate the time difference between the switching process triggering time and the request time; According to the switching buffer time length and the time difference, detecting whether the pending request meets the processing switching condition; When the request to be processed meets the processing switching condition, the request to be processed is processed using the switched target processing mode.

2. The method according to claim 1, wherein: The detecting, according to the switching buffer time length and the time difference, whether the pending request satisfies a processing switching condition comprises: Get the request value; Taking a modulus of the switching buffer duration according to the request value to obtain a modulus result; Comparing the modulo result with the time difference; When the modulo result is less than or equal to the time difference, it is determined that the request to be processed meets the processing switching condition.

3. The method according to claim 2, wherein: The obtaining request value includes: Get identification information of pending requests; The identification information is calculated to obtain a request value.

4. The method according to claim 2, further comprising: When the modulo result is greater than the time difference, determining that the request to be processed does not meet the processing switching condition; When the pending request does not meet the processing switching condition, the pending request is processed using the original processing method before the switching.

5. The method according to claim 1, wherein: The switching process triggering time includes: a specified processing mode switching start time or a specified processing mode switching end time.

6. The method according to claim 1, wherein: The request time of obtaining the pending request includes: A streaming request is received; Detecting whether the stream request is a cold stream request; When the stream request is a cold stream request, determining the stream request as a request to be processed; Obtaining the request time of the pending request; The adopting the switched target processing mode to process the pending request includes: The pending request is forwarded to the cold flow centralized node for processing using the 302 scheduling method.

7. The method according to claim 1, wherein: The stream request includes: a live broadcast room data stream request.

8. A request processing device, comprising: A request time acquisition module is used to obtain the request time of the pending request; The switching time acquisition module is used to obtain the switching processing trigger time and the switching buffer duration; A switching duration calculation module, used to calculate the time difference between the switching process trigger time and the request time; A request switching detection module, used to detect whether the pending request meets the processing switching condition according to the switching buffer time and the time difference; The processing mode switching module is used to process the request to be processed by adopting the switched target processing mode when the request to be processed meets the processing switching condition.

9. The device according to claim 8, wherein: The request switching detection module includes: A request value obtaining unit, used for obtaining a request value; A buffer duration modulo unit, used to perform modulo operation on the switching buffer duration according to the request value to obtain a modulo result; A time phase detection unit, used for comparing the modulo result with the time difference; A switching condition judgment unit is used to determine whether the request to be processed meets the processing switching condition when the modulo result is less than or equal to the time difference.

10. The device according to claim 9, wherein: The request value obtaining unit includes: An identification information acquisition subunit, used to acquire identification information of a request to be processed; The request value calculation subunit is used to calculate the identification information to obtain a request value.

11. The apparatus according to claim 9, further comprising: a non-switching judgment unit, configured to determine that the request to be processed does not satisfy a processing switching condition when the modulo result is greater than the time difference; The original processing unit is used to process the request to be processed in the original processing mode before the switching when the request to be processed does not meet the processing switching condition.

12. The device according to claim 8, wherein: The switching process triggering time includes: a specified processing mode switching start time or a specified processing mode switching end time.

13. The device according to claim 8, wherein: The request time acquisition module includes: A stream request receiving unit, configured to receive a stream request; A cold flow judgment unit, used to detect whether the flow request is a cold flow request; a cold flow request acquiring unit, configured to determine the flow request as a request to be processed when the flow request is a cold flow request; A request time acquisition unit, used to acquire the request time of the request to be processed; The processing mode switching module includes: 302 scheduling switching unit, used to forward the pending request to the cold flow centralized node for processing by using 302 scheduling method.

14. The device according to claim 8, wherein: The stream request includes: a live broadcast room data stream request.

15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the request processing method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable the computer to execute the request processing method according to any one of claims 1-7.

17. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the request processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Task processing method, device and electronic equipment

    CN113867916A

  • Media information transmission method, computing device and storage medium

    CN113973224A

  • Video management control platform integrated with multiple video devices

    CN114390257A

  • Live broadcast link detection method, device and system, electronic equipment and storage medium

    CN117499691A

  • Accounting payment processing method, device and equipment and storage medium

    CN117575820A