CN112948108A - Request processing method and device and electronic equipment - Google Patents

Request processing method and device and electronic equipment Download PDF

Info

Publication number
CN112948108A
CN112948108A CN202110121998.0A CN202110121998A CN112948108A CN 112948108 A CN112948108 A CN 112948108A CN 202110121998 A CN202110121998 A CN 202110121998A CN 112948108 A CN112948108 A CN 112948108A
Authority
CN
China
Prior art keywords
request
target
sent
candidate
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110121998.0A
Other languages
Chinese (zh)
Other versions
CN112948108B (en
Inventor
郝学智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202110121998.0A priority Critical patent/CN112948108B/en
Publication of CN112948108A publication Critical patent/CN112948108A/en
Application granted granted Critical
Publication of CN112948108B publication Critical patent/CN112948108B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

According to the request processing method, the request processing device and the electronic equipment disclosed by the embodiment of the disclosure, when a request to be sent is received, whether a target candidate request is included in stored candidate requests or not can be searched, when the target candidate request is searched, the request to be sent can be firstly cached, the request to be sent cannot be sent immediately, and whether the request to be sent is multiplexed with the target candidate request or not can be determined after a target request result of the target candidate request is received. That is, in this way, the number of links required for sending a request can be reduced, so that the memory consumption required in the process of sending a request can be reduced, the processing pressure of the processor can be reduced, and the process of obtaining the corresponding request result can be more efficient.

Description

Request processing method and device and electronic equipment
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a request processing method and apparatus, and an electronic device.
Background
With the development of scientific technology, the functions of various applications are more and more complex, so that more contents are displayed on a certain page, for convenience of management, a plurality of page modules can be used for controlling the displayed contents respectively, and each page module can have the capability of information acquisition.
For example: a stock detail page, in which there may be a stock data display box, which displays the highest price, lowest price, volume of bargain, etc. of the stock today (a page module a may be used to acquire these data), at the top of the page, there may also be dynamically displayed the price information of the current stock (a page module B may be used to acquire these data), and in the page, there may also be a time-share chart, displaying the stock price change information (a page module C may be used to acquire these data). When entering a stock detail page, the three page units all acquire the stock detail information, and only after acquiring the detail information, the detail information is processed differently.
Disclosure of Invention
This disclosure is provided to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The embodiment of the disclosure provides a request processing method, a request processing device and electronic equipment, which can enable a request to be sent to multiplex a request result of a target candidate request without sending the request to be sent when the target candidate request matched with the request to be sent is found; therefore, the memory consumption in the request sending process can be reduced, and the acquisition efficiency of the request result can be improved.
In a first aspect, an embodiment of the present disclosure provides a request processing method, including: acquiring a request to be sent; searching a target candidate request in stored candidate requests, wherein the candidate requests comprise requests which do not receive corresponding request results, and target request contents indicated by the target candidate requests are the same as request contents indicated by the requests to be sent; and responding to the searched target candidate request, and determining whether the request to be sent is multiplexed with the target request result or not based on the target request result of the target candidate request.
In a second aspect, an embodiment of the present disclosure provides a request processing apparatus, including: an obtaining unit, configured to obtain a request to be sent; the device comprises a searching unit, a judging unit and a sending unit, wherein the searching unit is used for searching a target candidate request in stored candidate requests, the candidate requests comprise requests which do not receive corresponding request results, and target request contents indicated by the target candidate request are the same as request contents indicated by the requests to be sent; and the determining unit is used for responding to the searched target candidate request and determining whether the request to be sent is multiplexed with the target request result or not based on the target request result of the target candidate request.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the request processing method according to the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the steps of the request processing method as described above in the first aspect.
According to the request processing method, the request processing device and the electronic equipment provided by the embodiment of the disclosure, when the request to be sent is received, whether the stored candidate requests include the target candidate request or not can be searched, when the target candidate request is searched, the request to be sent can be firstly cached, the request to be sent cannot be sent immediately, and whether the request to be sent is multiplexed with the target candidate request or not can be determined after the target request result of the target candidate request is received. That is, in this way, the number of links required for sending a request can be reduced, so that the memory consumption required in the process of sending a request can be reduced, the processing pressure of the processor can be reduced, and the process of obtaining the corresponding request result can be more efficient.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a flow diagram for one embodiment of a request processing method according to the present disclosure;
FIG. 2 is an interaction diagram for one embodiment of a request processing method according to the present disclosure;
FIG. 3A is an interaction diagram of another embodiment of a request processing method according to the present disclosure;
FIG. 3B is an interface presentation schematic diagram for one embodiment of a request processing method in accordance with the present disclosure;
FIG. 4 is a schematic block diagram illustration of one embodiment of a request processing device according to the present disclosure;
FIG. 5 is an exemplary system architecture to which the request processing method of one embodiment of the present disclosure may be applied;
fig. 6 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Referring to fig. 1, a flow diagram of one embodiment of a request processing method according to the present disclosure is shown. The request processing method can be applied to terminal equipment. The request processing method as shown in fig. 1 includes the following steps:
step 101, a request to be sent is obtained.
Here, the request to be sent may be a get request (a request for acquiring certain data). In other words, the request to be sent may be understood as a request for requesting to obtain specific data.
In some embodiments, an application on the terminal device may set an NM module (network manager) for managing the request transmission, and this module is used to process (e.g., receive a request, store a request, etc.) the request that the application needs to transmit. As an example, the NM module may receive a request to send.
In some embodiments, when an application needs to send a network request, an NM module may be used to create an http link, and the http link may be used to pull corresponding data (which may be regarded as a request result). That is, the number of requests is the same as the number of http links.
Step 102, in the stored candidate requests, a target candidate request is searched.
Here, the candidate request includes a request for which a corresponding request result is not received, and the target request content indicated by the target candidate request is the same as the request content indicated by the request to be sent. As an example, when the application is a stock application, when a stock transaction detail needs to be obtained, a request can be sent, and the request can be understood as a request to be sent, and correspondingly, the stock transaction detail can be understood as a request content indicated by the request to be sent.
Here, a candidate request may be understood as a request currently obtaining a result of a corresponding request, and a corresponding request that has obtained a result of a request does not belong to the candidate request.
As an example, request a, request B request the same content, the NM module may only send request a, but not request B. Since the request a and the request B do not receive the request result at this time, both the request a and the request B can be understood as candidate requests.
Here, after the request to be sent is obtained, since the request to be sent does not obtain the request result at this time, when a new request is received, the request to be sent may also be regarded as a candidate request.
Here, the target candidate request and the request to be sent may be information acquisition type requests, and the information acquisition type requests may be understood as get requests, and as an example, the request for requesting to acquire corresponding data may be understood as information acquisition type requests.
In some embodiments, the NM module may temporarily buffer the candidate requests, and when a new request to be sent is received, may determine the content of the request indicated by the request to be sent; whether candidate request content indicated by a certain candidate request is the same as request content indicated by a request to be sent or not can be determined (if the request content indicated by the certain candidate request is a transaction detail of stock a and the request content indicated by the request to be sent is also a request detail of stock a, the candidate request can be determined as a target candidate request at this time); if so, the candidate request may be determined to be the target candidate request.
Step 103, in response to finding the target candidate request, determining whether the request to be sent is multiplexed with the target request result based on the target request result of the target candidate request.
In some embodiments, when the target candidate request is found, the request to be sent is not sent immediately, and after the target request result of the target candidate request is received, whether to multiplex the target request result is determined. As an example, when the target request result indicates a target candidate request, the request is successful; the request to be sent can directly multiplex the target request result.
Here, when the request to be sent multiplexes the target request result, the NM module may not create an http link for the request to be sent, so that the number of http links may be reduced, the memory required for the application to send the request may be reduced, and the efficiency of obtaining the request result may be increased.
For better understanding of the idea provided by the present application, the description is made with reference to fig. 2, and any module that can generate a request in an application can be regarded as a request generation module. After request a, request B, and request C are sent to the NM module, the NM module may store request a, request B, and request C, and then determine whether to send request a, request B, and request C to other electronic devices, and if request D, request E, and request F are already stored in the NM module and the content of the request indicated by request D is the same as the content of the request indicated by request a, only request B and request C may be sent to other electronic devices at this time without sending request a to other electronic devices.
With continued reference to fig. 3A and 3B, request generation module a, request generation module B, and request generation module C may be modules in the same page, e.g., the application is a stock application, at which point, in the transaction detail page of the stock, there may be many places to display the transaction detail information of the stock, and the display form of the transaction detail information may be different, as shown in fig. 3B, the stock ticker information in region 1 is shown in the form of specific numbers, while the stock ticker information in region 2 is shown in the form of curves, while the stock deal information in area 3 may be presented in the form of a bar graph, i.e., the module shown in the control area 1 can be regarded as a request generation module a, the module shown in the control area 2 can be regarded as a request generation module B, and the module shown in the control area 3 can be regarded as a request generation module C. When a user opens the page, the request generation module a, the request generation module B and the request generation module C can all send requests to the NM module, and the content of the requests of the request a, the request B and the request C is the same and is the itemized details of stocks, so that the NM module can only send one request to other electronic devices at this time, and if only the request a is sent to other electronic devices, the request B and the request C can directly multiplex the request result of the request a. Furthermore, the number of links is greatly reduced.
It can be seen that, when a request to be sent is received, whether a target candidate request is included in stored candidate requests can be searched, when the target candidate request is found, the request to be sent can be cached first, and the request to be sent is not sent immediately, and whether the request to be sent is multiplexed with the target candidate request can be determined after a target request result of the target candidate request is received. That is, in this way, the number of links required for sending a request can be reduced, so that the memory consumption required in the process of sending a request can be reduced, the processing pressure of the processor can be reduced, and the process of obtaining the corresponding request result can be more efficient.
In some embodiments, in response to determining that the target request result includes information indicating that the request was successful, determining that the request to be sent multiplexes the target request result.
In some embodiments, when the request content of the target candidate request is a transaction detail of a stock and the target transaction result includes the transaction detail, it may indicate that the target request result includes information indicating that the request is successful, so that the request to be sent may multiplex the target request result.
In some embodiments, in response to determining that the target request result includes information indicating a request failure, determining that the request to be sent does not multiplex the target request result; and the request to be sent can be sent, and a request result corresponding to the request to be sent is received.
Here, the request to be sent may be sent to a corresponding other electronic device, which may be, for example, a server, a terminal, or the like. As an example, the corresponding other electronic device may obtain the request content indicated by the request to be sent, generate a corresponding request result according to the obtained request content, and return the request result to the execution main body.
In some embodiments, when the network condition is not good, it may be that the target request result that needs to be obtained cannot be correctly obtained, for example, when the request content indicated by the target candidate request is a certain data (a transaction detail of a certain stock), when the network condition is not good and the transaction detail needs to occupy a larger memory, it may not be that the transaction detail is normally obtained at this time, and thus the returned result may include information indicating that the request fails, that is, in the returned request result, there is no transaction detail information, and only there is information indicating that the request fails. Of course, in the specific embodiment, the information for indicating the request failure may be set according to specific situations, and the specific form of the information for indicating the request failure is not limited herein. As an example, special identification information may be used to characterize the request failure.
In some embodiments, when the request to be sent does not reuse the target request result, it may be characterized that the target request result is not adapted to the request to be sent, that is, the request content indicated by the request to be sent is not included in the target request result. Further, at this time, a request to be sent may be sent, so as to obtain a request result corresponding to the request to be sent.
In some embodiments, the target candidate request is resent in response to determining that the target request result has not been received within a preset time threshold from sending the target candidate request.
In some embodiments, when the network status is not good, the target candidate request may not be sent in time (or it is understood that the target candidate request is not sent to other electronic devices in time), so that the other electronic devices cannot feed back the target request result. Therefore, when the target request result is not received before the preset time length threshold value is exceeded, the target candidate request can be sent once again, so that the situation that the target candidate request cannot be sent to other electronic equipment due to poor network state is avoided. Meanwhile, the mode adopted by the embodiment can effectively avoid the condition that the link is established for the request to be sent due to poor network state. That is, when the target request result is not received, the link is not immediately created for the request to be sent, but the target candidate request is sent again (because, when the network status is not good, if a link is newly created, the pressure for sending the target candidate request is further increased undoubtedly, and thus it may be more difficult to obtain the target request result). Therefore, the number of links in the process of acquiring the request result by the application can be effectively reduced by the method, so that the acquisition of the request result is more efficient.
It can be seen that, when the target request result includes information indicating that the request is successful, the NM module may obtain the request result of the request to be sent (multiplexing the target request result) without creating a link for the request to be sent; therefore, the efficiency of obtaining the request result of the request to be sent can be improved, and meanwhile, the occupied amount of the memory in the request sending process can be reduced due to the fact that the number of the created links can be reduced, and the efficiency of obtaining the target request result can also be improved.
In order to further understand the beneficial effects brought by the present application, the following examples are given: if the NM module has cached 10 requests and has created 8 links (where 2 requests may need to multiplex the request result of the request for creating the link), that is, there are 10 candidate requests at this time, when the NM module receives 3 requests to be sent again, if the request content indicated by each of the 3 requests to be sent is the same as the request content indicated by 3 candidate requests (at this time, the 3 candidate requests may be regarded as 3 target candidate requests) of the 10 candidate requests, at this time, the NM module may not create corresponding links for the 3 requests to be sent, but only cache the 3 requests to be sent. That is, although the NM module stores 13 requests (i.e., there are 13 candidate requests), there are only 8 links, which reduces the memory consumption. Meanwhile, when all the 3 target request results include information indicating that the request is successful, the 3 candidate requests (which may also be understood as requests to be sent) may directly multiplex the received target request results.
In some embodiments, the request to send is sent in response to determining that the target candidate request is not found.
In some embodiments, when the target candidate request is not found, the request that has created the link currently may be characterized, and the request is not used for obtaining the same request content as the request content indicated by the request to be sent. Therefore, at this time, a corresponding link can be created for the request to be sent, and the tape sending request is sent to other electronic devices; correspondingly, the request to be sent can also be understood as a candidate request, and when a new request is received again, if the request content indicated by the new request is the same as the request content indicated by the request to be sent; the new request may only need to be cached without creating a corresponding link for the new request, that is, the new request may reuse the request result of the request to be sent.
In some embodiments, in response to receiving a request result, a candidate request corresponding to the request result is deleted.
In some embodiments, in order to reduce the number of stored candidate requests, when a request result is received, a candidate request corresponding to the request result may be deleted, thereby reducing the number of requests cached in the NM module.
In some embodiments, when two requests are for the same content, the content may have been changed for the period of time if the interval is longer. For example, the following steps are carried out: if the request content indicated by the request a is the transaction detail of the stock a, if the request a is sent to other electronic devices and the other electronic devices have returned the transaction detail of the stock a, then the request B is received, if the request content indicated by the request B is also the transaction detail of the stock a, and at this time, the transaction detail of the stock a may have changed, so that if the request B multiplexes the request results of the request a, the request result of the request B may be inaccurate. Furthermore, when the request a receives the request result, the request a may be deleted, that is, when the request B is received, the request a is not a candidate request, and at this time, the request B may be sent to another electronic device. The design can ensure the accuracy of the request result corresponding to the request.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of a request processing apparatus, which corresponds to the embodiment of the request processing method shown in fig. 1, and which is particularly applicable to various electronic devices.
As shown in fig. 4, the request processing apparatus of the present embodiment includes: an obtaining unit 401, configured to obtain a request to be sent; a searching unit 402, configured to search for a target candidate request in stored candidate requests, where the candidate request does not receive a request of a corresponding request result, and a target request content indicated by the target candidate request is the same as a request content indicated by the request to be sent; a determining unit 403, configured to determine, in response to finding the target candidate request, whether the request to be sent multiplexes the target request result based on a target request result of the target candidate request.
In some embodiments, the determining unit 403 is further specifically configured to: and in response to determining that the target request result includes information indicating that the request is successful, determining that the request to be sent multiplexes the target request result.
In some embodiments, the determining unit 403 is further specifically configured to determine that the request to be sent does not multiplex the target request result in response to determining that the target request result includes information indicating a request failure; the apparatus further includes a sending and receiving unit 404, configured to send the request to be sent, and receive a request result corresponding to the request to be sent.
In some embodiments, the sending and receiving unit 404 is further specifically configured to: and in response to determining that the target request result has not been received within a preset time threshold from the sending of the target candidate request, sending the target candidate request again.
In some embodiments, the apparatus further includes a storage unit 405, configured to send the request to be sent in response to determining that the target candidate request is not found.
In some embodiments, the apparatus further includes a deleting unit 406, configured to delete, in response to receiving the request result, the candidate request corresponding to the request result.
Referring to fig. 5, fig. 5 illustrates an exemplary system architecture to which the request processing method of one embodiment of the present disclosure may be applied.
As shown in fig. 5, the system architecture may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 may be the medium used to provide communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 501, 502, 503 may interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have various client applications installed thereon, such as a web browser application, a search-type application, and a news-information-type application. The client application in the terminal device 501, 502, 503 may receive the instruction of the user, and complete the corresponding function according to the instruction of the user, for example, add the corresponding information in the information according to the instruction of the user.
The terminal devices 501, 502, 503 may be hardware or software. When the terminal devices 501, 502, 503 are hardware, they may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like. When the terminal devices 501, 502, and 503 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 505 may be a server providing various services, for example, receiving an information acquisition request sent by the terminal device 501, 502, 503, and acquiring the presentation information corresponding to the information acquisition request in various ways according to the information acquisition request. And the relevant data of the presentation information is sent to the terminal equipment 501, 502, 503.
It should be noted that the information processing method provided by the embodiment of the present disclosure may be executed by a terminal device, and accordingly, the request processing means may be provided in the terminal devices 501, 502, and 503. In addition, the information processing method provided by the embodiment of the present disclosure may also be executed by the server 505, and accordingly, an information processing apparatus may be provided in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to fig. 6, shown is a schematic diagram of an electronic device (e.g., a terminal device or a server of fig. 5) suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a request to be sent; searching a target candidate request in stored candidate requests, wherein the candidate requests comprise requests which do not receive corresponding request results, and target request contents indicated by the target candidate requests are the same as request contents indicated by the requests to be sent; and responding to the searched target candidate request, and determining whether the request to be sent is multiplexed with the target request result or not based on the target request result of the target candidate request.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation on the unit itself, for example, acquisition unit 401 may also be described as "acquiring a unit to be requested".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A method for processing a request, comprising:
acquiring a request to be sent;
searching a target candidate request in stored candidate requests, wherein the candidate requests comprise requests which do not receive corresponding request results, and target request contents indicated by the target candidate requests are the same as request contents indicated by the request to be sent;
and in response to finding the target candidate request, determining whether the request to be sent multiplexes the target request result based on the target request result of the target candidate request.
2. The method of claim 1, wherein the determining whether the request to be sent multiplexes the target request result based on the target request result of the target candidate request comprises:
in response to determining that the target request result includes information indicating that the request is successful, determining that the request to be sent multiplexes the target request result.
3. The method of claim 2, wherein the determining whether the request to be sent multiplexes the target request result based on the target request result of the target candidate request comprises:
in response to determining that the target request result includes information indicating a request failure, determining that the request to be sent does not multiplex the target request result; and
the method further comprises the following steps:
and sending the request to be sent and receiving a request result corresponding to the request to be sent.
4. The method of claim 1, further comprising:
and in response to determining that the target request result has not been received within a preset time threshold from the sending of the target candidate request, resending the target candidate request.
5. The method of claim 1, further comprising:
and responding to the determined target candidate request which is not found, and sending the request to be sent.
6. The method of claim 1, further comprising:
in response to receiving the request result, the candidate request corresponding to the request result is deleted.
7. A request processing apparatus, comprising:
an obtaining unit, configured to obtain a request to be sent;
the device comprises a searching unit, a judging unit and a sending unit, wherein the searching unit is used for searching a target candidate request in stored candidate requests, the candidate requests comprise requests which are sent in a preset time period and do not receive corresponding request results, and target request contents indicated by the target candidate request are the same as request contents indicated by the requests to be sent;
and the determining unit is used for responding to the searched target candidate request and determining whether the request to be sent multiplexes the target request result or not based on the target request result of the target candidate request.
8. The apparatus according to claim 7, wherein the determining unit is further configured to: in response to determining that the target request result includes information indicating that the request is successful, determining that the request to be sent multiplexes the target request result.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202110121998.0A 2021-01-26 2021-01-26 Request processing method and device and electronic equipment Active CN112948108B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110121998.0A CN112948108B (en) 2021-01-26 2021-01-26 Request processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110121998.0A CN112948108B (en) 2021-01-26 2021-01-26 Request processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112948108A true CN112948108A (en) 2021-06-11
CN112948108B CN112948108B (en) 2024-03-15

Family

ID=76239128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110121998.0A Active CN112948108B (en) 2021-01-26 2021-01-26 Request processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112948108B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685326A (en) * 2012-08-31 2014-03-26 盐城睿泰数字科技有限公司 WEB concurrent data transmission method and WEB application system
CN107832165A (en) * 2017-11-23 2018-03-23 国云科技股份有限公司 A kind of method for lifting distributed system processing request stability
CN109067914A (en) * 2018-09-20 2018-12-21 星环信息科技(上海)有限公司 Proxy Method, device, equipment and the storage medium of Web service
CN110147934A (en) * 2019-04-17 2019-08-20 深圳壹账通智能科技有限公司 Service request processing method, device, computer equipment and storage medium
CN110879837A (en) * 2018-09-06 2020-03-13 华为技术有限公司 Information processing method and device
CN111190709A (en) * 2019-11-19 2020-05-22 泰康保险集团股份有限公司 Method and device for processing request, electronic equipment and readable storage medium
CN111259044A (en) * 2020-01-15 2020-06-09 网易(杭州)网络有限公司 Data query method, device, equipment and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685326A (en) * 2012-08-31 2014-03-26 盐城睿泰数字科技有限公司 WEB concurrent data transmission method and WEB application system
CN107832165A (en) * 2017-11-23 2018-03-23 国云科技股份有限公司 A kind of method for lifting distributed system processing request stability
CN110879837A (en) * 2018-09-06 2020-03-13 华为技术有限公司 Information processing method and device
CN109067914A (en) * 2018-09-20 2018-12-21 星环信息科技(上海)有限公司 Proxy Method, device, equipment and the storage medium of Web service
CN110147934A (en) * 2019-04-17 2019-08-20 深圳壹账通智能科技有限公司 Service request processing method, device, computer equipment and storage medium
CN111190709A (en) * 2019-11-19 2020-05-22 泰康保险集团股份有限公司 Method and device for processing request, electronic equipment and readable storage medium
CN111259044A (en) * 2020-01-15 2020-06-09 网易(杭州)网络有限公司 Data query method, device, equipment and medium

Also Published As

Publication number Publication date
CN112948108B (en) 2024-03-15

Similar Documents

Publication Publication Date Title
CN111488185B (en) Page data processing method, device, electronic equipment and readable medium
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN111246228B (en) Method, device, medium and electronic equipment for updating gift resources of live broadcast room
CN111400625B (en) Page processing method and device, electronic equipment and computer readable storage medium
CN110633126B (en) Information display method and device and electronic equipment
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN111258736A (en) Information processing method and device and electronic equipment
CN111163324B (en) Information processing method and device and electronic equipment
CN112269959A (en) Display content control method and device, readable medium and electronic equipment
CN111694629A (en) Information display method and device and electronic equipment
CN111309254A (en) Data processing method and device, readable medium and electronic equipment
CN111596992B (en) Navigation bar display method and device and electronic equipment
CN110619101B (en) Method and apparatus for processing information
CN111798251A (en) Verification method and device of house source data and electronic equipment
CN111756953A (en) Video processing method, device, equipment and computer readable medium
CN112084441A (en) Information retrieval method and device and electronic equipment
CN113163483B (en) Timestamp updating method and device and electronic equipment
CN111581556B (en) Page data processing method, device, electronic equipment and readable medium
CN111444457B (en) Data release method and device, storage medium and electronic equipment
CN111625745B (en) Recommendation method, recommendation device, electronic equipment and computer readable medium
CN112948108B (en) Request processing method and device and electronic equipment
CN112966008B (en) Data caching method, loading method, updating method and related devices
CN111581305B (en) Feature processing method, device, electronic equipment and medium
CN113157365B (en) Program running method, program running device, electronic equipment and computer readable medium
CN111581562B (en) Resource refreshing display method, device, equipment and storage medium

Legal Events

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