CN116405564A - Access request processing method, processing device, storage medium and electronic device - Google Patents

Access request processing method, processing device, storage medium and electronic device Download PDF

Info

Publication number
CN116405564A
CN116405564A CN202310207475.7A CN202310207475A CN116405564A CN 116405564 A CN116405564 A CN 116405564A CN 202310207475 A CN202310207475 A CN 202310207475A CN 116405564 A CN116405564 A CN 116405564A
Authority
CN
China
Prior art keywords
request
information
calling
time threshold
callback
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.)
Pending
Application number
CN202310207475.7A
Other languages
Chinese (zh)
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202310207475.7A priority Critical patent/CN116405564A/en
Publication of CN116405564A publication Critical patent/CN116405564A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/61Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements
    • 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)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application discloses an access request processing method, an access request processing device, a storage medium and an electronic device, and relates to the technical field of intelligent home/intelligent families, wherein the access request processing method comprises the following steps: receiving an information calling request; ordering the information calling requests according to the receiving sequence within a time threshold of a preset timer; and calling the corresponding result to the calling party according to the ordering of the information calling request. In the technical scheme of implementing the invention, a timer is set, a plurality of information calling requests are divided through a time threshold, the information calling requests in the time threshold are ordered, and corresponding calling results are sent to a calling party. And dividing call requests needing to be subjected to actual network triggering and call requests not needing to be subjected to actual network triggering according to the ordering. The method can meet the synchronism of the calling request and the callback result while limiting the access frequency, and can ensure that a calling party obtains a new data result if the data changes.

Description

Access request processing method, processing device, storage medium and electronic device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for processing an access request, a storage medium, and an electronic device.
Background
Network activities of the internet can be frequently triggered in a short time, resulting in a large number of network requests. Such sudden flow peaks can cause certain stresses to the processing operation of the system and can also cause excessive response times. In order to limit the access frequency, serial processing is typically performed on interface calls (hereinafter referred to as calls) at the SDK level. In the previous call, when the triggered request does not return data, the subsequent call does not trigger a new request, i.e. the subsequent call shares a request with the call which actually happens and shares the same result. This approach, while limiting the frequency of access, introduces a problem of synchronizing call requests with callback results. When the first invoked request has been processed and data returned, but not yet to the end side; at this time, the background data is changed, and the terminal side triggers a second call, if the processing mode is adopted, the second call uses the result of the first request; however, the data obtained from the second call does not match the actual data.
Disclosure of Invention
In order to overcome the defects, the application provides an access request processing method, an access request processing device, a storage medium and an electronic device, which can limit access frequency and improve the synchronism of a call request and a callback result.
In a first aspect, the present invention provides an access request processing method, including:
receiving an information calling request;
ordering the information calling requests according to the receiving sequence within a time threshold of a preset timer;
and calling the corresponding result to the calling party according to the ordering of the information calling request.
In one embodiment, the method further comprises:
sending a first information calling request within the time threshold to a server, and receiving a first callback result returned by the server;
and sending the last information call request in the time threshold to the server, and receiving a second callback result returned by the server.
In one embodiment, the receiving the information call request includes:
judging whether the information calling request is received for the first time;
if yes, adding calling information of the information calling request, and starting a timer; and/or
And if not, sequencing the information calling requests.
In one embodiment, the calling the corresponding result to the calling party according to the ordering of the information calling request includes:
judging whether the timer reaches the time threshold and whether a callback result is received;
if the timer reaches the time threshold and receives the callback result, the callback result is sent to the calling party; and/or
If the timer does not reach the time threshold value but receives the callback result, temporarily storing the callback result until the timer reaches the time threshold value; and/or
And if the timer reaches the time threshold value but does not receive the callback result, sending a corresponding instruction to the server.
In one embodiment, if the timer reaches the time threshold but does not receive the callback result, sending a corresponding instruction to the server, including:
judging whether only one information call request exists in the time threshold;
if yes, waiting to receive a callback result;
if not, sending the last information calling request in the time threshold to the server.
In one embodiment, if the timer reaches the threshold value and receives the callback result, sending the callback result to the caller includes:
judging whether the information calling request is a first information calling request or not;
if the first information call request is made, a first callback result is sent to the calling party;
if the information calling request is not the first information calling request, judging whether the calling information request is the last information calling request within the time threshold;
if the information calling request is the last information calling request, a second callback result is sent to the calling party;
and if the information calling request is not the last information calling request, sending a first callback result to the calling party.
In one embodiment, the method further comprises:
judging whether all callback results for sending information calling requests to the server are received or not;
if yes, clearing call information of the information call request.
In a second aspect, the present invention provides an access request processing apparatus comprising:
the receiving module is used for receiving an information calling request;
the processing module sorts the information calling requests according to the receiving sequence within a time threshold of a preset timer;
and the calling module calls the corresponding result to the calling party according to the ordering of the information calling request.
In a third aspect, there is provided a computer-readable storage medium storing a program that when executed implements the method of any one of the above-described aspects.
In a fourth aspect, an electronic device is provided, including a memory and a processor, where the memory stores a program, and the processor implements the method according to any of the above technical solutions when executing the program.
The technical scheme provided by the invention has at least one or more of the following beneficial effects:
in the technical scheme of implementing the invention, a timer is set in a memory cache management center, a plurality of information call requests are divided through a time threshold, the information call requests in the time threshold are ordered, and the call requests needing to be subjected to actual network triggering and the call requests not needing to be subjected to actual network triggering are divided according to the ordering. The method can meet the synchronism of the calling request and the callback result while limiting the access frequency, and can ensure that a calling party obtains a new data result if data changes in the process of information calling request. After the memory cache processing center receives the callback result of the sent information calling request, the calling information is cleaned, and the redundant network request of the client and the corresponding impact on the background can be reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow chart illustrating the main steps of an access request processing method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating the main steps of determining whether to send callback results to a caller according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating the main steps of ordering callback corresponding results based on an information call request according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating the main steps of a timer threshold that does not receive a callback result and sends a corresponding instruction to a server according to an embodiment of the present invention;
FIG. 5 is a timing diagram of the main steps of a request only once and callback results returned to the request manager later than timing tasks according to an embodiment of the invention;
FIG. 6 is a timing diagram of the main steps of a request only once and callback results returned to the request manager earlier than timing tasks according to an embodiment of the invention;
FIG. 7 is a timing diagram of the main steps of a multiple call request and a first callback result return earlier than a timed task trigger according to an embodiment of the present invention;
FIG. 8 is a timing diagram of the main steps of a multiple call request with a first callback result return later than a timed task trigger earlier than a second callback result return, according to an embodiment of the present invention;
FIG. 9 is a timing diagram of the main steps of multiple call requests with a first callback result return later than a timed task trigger and a second callback result return, according to an embodiment of the present invention;
fig. 10 is a main structural block diagram of an access request processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Referring to fig. 1, fig. 1 is a schematic flow chart of main steps of an access request processing method according to an embodiment of the present invention. The access request processing method comprises the steps of S10-S30:
s10, receiving an information calling request.
In this embodiment, a processing center of the memory cache, i.e. the request manager, receives an information call request sent by a caller. The calling party firstly requests the interface layer to call the interface, and sends an information calling request to the request manager through the interface layer.
In one embodiment, step S10 receives an information call request, including: judging whether the information calling request is received for the first time; if yes, adding calling information of the information calling request, and starting a timer; if not, the following step S20 is performed.
In this embodiment, the request manager makes preliminary determination processing for the information call request issued by the caller. The request manager reads the calling information in the information calling request, if the calling information is received for the first time, that is, the calling information does not exist, the calling information of the information calling request is added in the request manager, and a timer is started. The time set by the timer can be flexibly set according to the requirements, and can be comprehensively obtained according to conditions such as use habits, access frequency and the like. If the information call request is not received for the first time (i.e., call information exists), the information call request is ordered as described in subsequent step S20.
S20, ordering the information calling requests according to the receiving sequence within a time threshold of a preset timer;
at present, most of processing methods for limiting access frequency aiming at a large number of network requests are used for carrying out serial processing on interface calls. That is, in the previous call, when the triggered request does not return data, the subsequent call does not trigger a new request, i.e., the subsequent call shares a request with the call that has actually occurred and shares the same result. In this embodiment, a timer is preset in the request manager, and the received information call requests are ordered within a set time threshold. In a series of messages received, the set time thresholds are divided into groups. The actual triggering of the call request and the condition that the actual consumption time is long when the information is called back to the end side are changed, the current dividing situation that whether the data is triggered and returned only the previous time is changed, a timer is introduced into the request manager, and a new call request dividing basis is added.
In one embodiment, after step S20, the method further comprises steps S21-S22:
s21, sending a first information calling request within the time threshold to a server, and receiving a first callback result returned by the server;
s22, sending the last information call request in the time threshold to the server, and receiving a second callback result returned by the server.
In this embodiment, the request manager invokes the network entity and sends a invoke request to the server. Because a plurality of information calling requests exist in the time threshold, the first information calling request and the last information calling request are both sent to the server according to the division of the time threshold, namely, the first information calling request and the last information calling request trigger the actual network action. The call request sent within the time threshold can obtain two callback results (a first callback result and a second callback result). The steps S21 and S22 are not sequentially performed in the time series, but the steps S21 and S22 are merely performed. That is, if only one information call request is made within the time threshold, step S21 will only occur; if there is more than one information call request within the time threshold, both steps S21 and S22 will occur.
S30, calling the corresponding result to the calling party according to the ordering of the information calling request.
In this embodiment, within the time threshold, the ordering of the requests is called according to the information received by the request manager, and the corresponding result is called back to the caller. When the previous call request is not generated but the call request does not arrive at the end side, the subsequent call requests all use the result of the previous call request, but according to the ordering, the call requests are partially combined, namely the same call result is partially adopted. At the same time, the latest calling request triggers the actual network action, and the corresponding calling result is obtained, so that the synchronism of the calling request and the calling result is ensured. The accuracy of the data obtained by the calling party is ensured while the access frequency is limited.
In one embodiment, as shown in fig. 2, fig. 2 is a flowchart illustrating main steps for determining whether to send callback results to a caller according to an embodiment of the present invention. Comprises the steps of S301-S304:
s301, judging whether a timer reaches the time threshold and whether a callback result is received;
s302, if the timer reaches the time threshold and receives the callback result, the callback result is sent to the calling party.
In this embodiment, the timer reaches the time threshold and receives the callback result, that is, the callback result reaches the request manager first, and then the timer reaches the time threshold, at this time, because there is a callback result, the callback result is sent to the caller. After the timer reaches the time threshold, a timed task will be triggered. When a callback result exists in the request manager and the timer reaches a time threshold, the callback result is sent to a calling party, and then a timing task is triggered.
Further, as shown in fig. 3, step S302 sends callback results to the caller, including steps S3021 to S3025:
s3021, judging whether the information call request is a first information call request;
s3022, if the first information call request is made, a first callback result is sent to the calling party;
s3023, if the information calling request is not the first information calling request, judging whether the calling information request is the last information calling request within the time threshold;
s3024, if the information calling request is the last time, sending a second callback result to the calling party;
s3025, if the information call request is not the last information call request, a first callback result is sent to the calling party.
In this embodiment, a first information call request within a time threshold is sent to a server, that is, an actual network action is triggered, and a first callback result is obtained. The first callback result is stored in the request manager, and in order to limit the access frequency, subsequent information calling requests (except for the last time) within the time threshold value all send the first callback result to a calling party from the request manager, namely, the subsequent calling requests are not sent to the server any more, and the actual network request is not triggered any more. In order to ensure the synchronism of the calling request and the callback result, the last information calling request in the time threshold is sent to the server, namely, the actual network request is triggered, the latest data information is obtained, and the callback result is sent to the calling party.
S303, if the timer does not reach the time threshold value but receives a callback result, temporarily storing the callback result until the timer reaches the time threshold value;
in this embodiment, only if the timer reaches the time threshold, the callback result in the request management can be sent to the caller. For this purpose, when the request manager receives the callback result but the timer does not reach the time threshold, the request manager temporarily stores the callback result, and waits for the timer to reach the time threshold.
S304, if the timer reaches the time threshold value but does not receive the callback result, a corresponding instruction is sent to the server.
Further, as shown in fig. 4, if the timer reaches the time threshold but no callback result is received, a corresponding instruction is sent to the server, specifically including steps S3041-S3043:
s3041, judging whether only one information call request exists in the time threshold;
s3042, if yes, waiting for receiving a callback result;
s3043, if not, sending the last information call request in the time threshold to the server.
In this embodiment, after the timer reaches the time threshold, whether there is only one information call request in the time threshold is determined, and if there is only one information call request, there is no call request to trigger transmission; if the information calling request is more than one time, after the time threshold is reached, triggering the timing task to send the last information calling request to the server.
In one embodiment, the method further comprises: judging whether all callback results for sending information calling requests to the server are received or not; if yes, clearing call information of the information call request. Firstly, the request manager needs to make a judgment about whether the call information exists when receiving the call request to be information, and therefore, if the actual call request is triggered twice, the request manager needs to wait for receiving two callback results, and the call information of the information call request can be cleaned.
Referring to fig. 5-9, in conjunction with a specific application scenario, according to the above method steps, specific descriptions are made herein according to the situations that the timer reaches the time threshold, the request manager receives the callback, and whether to trigger sending the information call request.
Case 1: as shown in fig. 5, there is only one request within the time threshold (the timed task does not need to trigger a new request), and callback results are returned to the request manager later than the timed task (the timer reaches the time threshold).
1. Calling party calls interface of interface layer;
2. the interface layer sends the calling request to the request manager;
3. the request manager judges that the calling information of the information calling request does not exist, adds the calling information and starts a 600ms timer;
4. the request manager invokes the network entity;
5. the network entity sends an information calling request to the server;
6. the timer reaches a time threshold;
7. only one information call request is needed in the time threshold, a new call request is not required to be triggered and sent, a callback result which is not received by the request manager is not needed, and callback contents are not available for callback;
8. a server (server) sends a callback result through a network entity;
9. the request manager receives a callback result;
10. the timing task is triggered (the timer reaches the time threshold), a callback result is sent to the interface layer, and the calling information is cleaned;
11. the request manager sends the callback result to the interface layer;
12. the interface layer sends the callback result to the caller.
Case 2, as shown in fig. 6, only one request is made within the time threshold (the timed task does not need to trigger a new request), and callback results are returned to the request manager earlier than the timed task (the timer reaches the time threshold).
1. Calling party calls interface of interface layer;
2. the interface layer sends the calling request to the request manager;
3. the request manager judges that the calling information of the information calling request does not exist, adds the calling information and starts a 600ms timer;
4. the request manager invokes the network entity;
5. the network entity sends an information calling request to the server;
6. the server sends a callback result through the network entity;
7. the request manager receives a callback result;
8. the request manager judges that the timed task is not triggered (the timer does not reach the time threshold), temporarily stores callback results, and waits for the timed task to trigger;
9. the timer reaches a time threshold;
10. only one information call request is needed in the time threshold, a new call request is not required to be triggered and sent, a request manager receives a callback result, and the call information is cleaned;
11. sending the callback result to an interface layer;
12. the interface layer sends the callback result to the caller.
In case 3, as shown in fig. 7, there are multiple call requests within the time threshold (the actual network action needs to be triggered for the last information call request to obtain the latest data), and the return of the first callback result is earlier than the request manager triggers at the timing task (the timer reaches the time threshold).
1. Calling party calls interface of interface layer;
2. the interface layer sends the first calling request to a request manager;
3. the request manager judges that the calling information of the information calling request does not exist, adds the calling information and starts a 600ms timer;
4. the request manager invokes the network entity;
5. the network entity sends a first information calling request to the server;
6. calling the interface of the interface layer again by the calling party;
7. the interface layer sends the calling request to the request manager;
8. the request manager judges that the calling information of the information calling request exists, and adds a monitor;
9. the server sends a first callback result through the network entity;
10. the request manager receives a first callback result;
11. the request manager judges that the timed task is not triggered (the timer does not reach the time threshold), temporarily stores callback results, and waits for the timed task to trigger;
12. the timer reaches a time threshold;
13. the request manager judges that a plurality of information calling requests exist, the last information calling request needs to be triggered and sent, and a first callback result is cached in the request management;
14. sending the first callback result to an interface layer;
15. the request manager invokes the network entity again;
16. the interface layer sends the first callback result to the calling party;
17. the network entity sends the last call request to the server;
18. the server returns a second callback result to the network entity;
19. the network entity sends a second callback result to the request manager;
20. the request manager judges that callback results triggered by the actual network are received twice, and the calling information is cleaned;
21. the request manager sends a second callback result to the interface layer;
22. the interface layer sends the second callback result to the caller.
In case 4, as shown in fig. 8, there are multiple call requests within the time threshold (the actual network action needs to be triggered for the last information call request to obtain the latest data), and the first callback result is returned later than the request manager is triggered by the timing task (the timer reaches the time threshold), and at the same time, the second callback result is returned to the request manager earlier than the first callback result.
1. Calling party calls interface of interface layer;
2. the interface layer sends the first calling request to a request manager;
3. the request manager judges that the calling information of the information calling request does not exist, adds the calling information and starts a 600ms timer;
4. the request manager invokes the network entity;
5. the network entity sends a first information calling request to the server;
6. calling the interface of the interface layer again by the calling party;
7. the interface layer sends the calling request to the request manager;
8. the request manager judges that the calling information of the information calling request exists, and adds a monitor;
9. the timer reaches a time threshold;
10. the request manager judges that a plurality of information calling requests exist, the last information calling request needs to be triggered and sent, and the first callback result is not cached in the request management;
11. the request manager invokes the network entity again;
12. the network entity sends the last call request to the server;
13. the server sends a first callback result through the network entity;
14. the request manager receives a first callback result;
15. the request manager judges that all callback results actually triggered are not received;
16. the request manager sends a first callback result to the interface layer;
17. the interface layer sends the first callback result to the calling party;
18. the server returns a second callback result to the network entity;
19. the network entity sends a second callback result to the request manager;
20. the request manager judges that callback results triggered by the actual network are received twice, and the calling information is cleaned;
21. the request manager sends a second callback result to the interface layer;
22. the interface layer sends the second callback result to the caller.
In case 5, as shown in fig. 9, there are multiple call requests within the time threshold (the actual network action needs to be triggered for the last information call request to obtain the latest data), and the first callback result is returned later than the request manager triggering the timing task (the timer reaches the time threshold), and at the same time, later than the second callback result is returned to the request manager.
1. Calling party calls interface of interface layer;
2. the interface layer sends the first calling request to a request manager;
3. the request manager judges that the calling information of the information calling request does not exist, adds the calling information and starts a 600ms timer;
4. the request manager invokes a network entity (network requesting entity);
5. the network entity sends a first information calling request to the server;
6. calling the interface of the interface layer again by the calling party;
7. the interface layer sends the calling request to the request manager;
8. the request manager judges that the calling information of the information calling request exists, and adds a monitor;
9. the timer reaches a time threshold;
10. the request manager judges that a plurality of information calling requests exist, the last information calling request needs to be triggered and sent, and the first callback result is not cached in the request management;
11. the request manager invokes the network entity again;
12. the network entity sends the last call request to the server;
13. the server returns a second callback result to the network entity;
14. the network entity sends a second callback result to the request manager;
15. the request manager judges that all callback results actually triggered are not received;
16. the request manager sends a second callback result to the interface layer;
17. the server sends a first callback result through the network entity;
18. the interface layer sends a second callback result to the calling party;
19. the request manager receives a first callback result;
20. the request manager judges that callback results triggered by the actual network are received twice, and the calling information is cleaned;
21. the request manager sends a first callback result to the interface layer;
22. the interface layer sends the first callback result to the caller.
Further, when the first callback result is returned later than the request manager and triggered by the timing task, and at the same time, the old data is returned later than the new data, which may be confusing to use, if the new data needs to be ensured to be returned later than the old data, whether the old data is returned or not can be checked before the new data is returned, if not, the callback is triggered again after the old data is returned, and specifically, a monitor is added. As the information calling requests are already ordered in the request manager, new and old data can be monitored according to the ordering of the calling requests.
In the technical scheme of implementing the invention, a timer is set in a memory cache management center, a plurality of information calling requests are divided through a time threshold, and the information calling requests in the time threshold are ordered; and aiming at the ordering of the information calling request, sending a corresponding calling result to a calling party. The first information call and the last information call trigger the actual network action and send corresponding callback results to the calling party; the results of the first information call are adopted for the requests of the middle several times, the synchronism of the call requests and callback results can be met while the access frequency is limited, and in the process of the data information call requests, if the data change, a calling party can be ensured to obtain new data results. And meanwhile, after the memory cache processing center receives a callback result of the sent information calling request, the calling information is cleaned, so that the redundant network request of the client and the corresponding impact on the background can be reduced.
It should be noted that, although the foregoing embodiments describe the steps in a specific order, it will be understood by those skilled in the art that, in order to achieve the effects of the present invention, the steps are not necessarily performed in such an order, and may be performed simultaneously (in parallel) or in other orders, and these variations are within the scope of the present invention.
The invention further provides an access request processing device.
Referring to fig. 10, fig. 10 is a block diagram showing the main structure of an access request processing apparatus according to an embodiment of the present invention. The access request processing device in the embodiment of the invention mainly comprises a receiving module 101, a processing module 102 and a calling module 103. The receiving module 101 is used for receiving an information calling request; the processing module 102 is configured to sort the information call requests according to a receiving order within a time threshold of a preset timer; the calling module 103 calls the ordering of the requests according to the information and calls the corresponding results back to the calling party.
Further, it should be understood that, since the respective modules are merely set to illustrate the functional units of the apparatus of the present invention, the physical devices corresponding to the modules may be the processor itself, or a part of software in the processor, a part of hardware, or a part of a combination of software and hardware. Accordingly, the number of individual modules in the figures is merely illustrative.
Those skilled in the art will appreciate that the various modules in the apparatus may be adaptively split or combined. Such splitting or combining of specific modules does not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solution after splitting or combining falls within the protection scope of the present invention. In addition, each module can also execute each corresponding sub-step in the method steps, which is not described herein.
It will be appreciated by those skilled in the art that the present invention may implement all or part of the above-described methods according to the above-described embodiments, or may be implemented by means of a computer program for instructing relevant hardware, where the computer program may be stored in a computer readable storage medium, and where the computer program may implement the steps of the above-described embodiments of the method when executed by a processor. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable storage medium may include: any entity or device, medium, usb disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier wave signals, telecommunications signals, software distribution media, and the like capable of carrying the computer program code. It should be noted that the computer readable storage medium may include content that is subject to appropriate increases and decreases as required by jurisdictions and by jurisdictions in which such computer readable storage medium does not include electrical carrier signals and telecommunications signals.
Further, the invention also provides a computer readable storage medium. In one embodiment of a computer-readable storage medium according to the present invention, the computer-readable storage medium may be configured to store a program for executing the access request processing method of the above-described method embodiment, which may be loaded and executed by a processor to implement the above-described access request processing method. For convenience of explanation, only those portions of the embodiments of the present invention that are relevant to the embodiments of the present invention are shown, and specific technical details are not disclosed, please refer to the method portions of the embodiments of the present invention. The computer readable storage medium may be a storage device including various electronic devices, and optionally, the computer readable storage medium in the embodiments of the present invention is a non-transitory computer readable storage medium.
The invention further provides an electronic device. In an embodiment of an electronic device according to the present invention, including a processor and a storage device, the storage device may be configured to store a program for executing the access request processing method of the above-described method embodiment, and the processor may be configured to execute the program in the storage device, including, but not limited to, the program for executing the access request processing method of the above-described method embodiment. For convenience of explanation, only those portions of the embodiments of the present invention that are relevant to the embodiments of the present invention are shown, and specific technical details are not disclosed, please refer to the method portions of the embodiments of the present invention. The control device may be a control device formed of various electronic devices.
The method is widely applied to intelligent digital control application scenes of whole houses such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (wireless fidelity), bluetooth. The terminal device may be not limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent stove, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video and audio, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent drinking fountain, an intelligent door lock and the like
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. An access request processing method, comprising:
receiving an information calling request;
ordering the information calling requests according to the receiving sequence within a time threshold of a preset timer;
and calling the corresponding result to the calling party according to the ordering of the information calling request.
2. The method according to claim 1, wherein the method further comprises:
sending a first information calling request within the time threshold to a server, and receiving a first callback result returned by the server;
and sending the last information call request in the time threshold to the server, and receiving a second callback result returned by the server.
3. The method of claim 1, wherein receiving the information call request comprises:
judging whether the information calling request is received for the first time;
if yes, adding calling information of the information calling request, and starting a timer; and/or
And if not, sequencing the information calling requests.
4. The method according to claim 1, wherein the calling the corresponding result to the caller according to the ordering of the information call request includes:
judging whether the timer reaches the time threshold and whether a callback result is received;
if the timer reaches the time threshold and receives the callback result, the callback result is sent to the calling party; and/or
If the timer does not reach the time threshold value but receives the callback result, temporarily storing the callback result until the timer reaches the time threshold value; and/or
And if the timer reaches the time threshold value but does not receive the callback result, sending a corresponding instruction to the server.
5. The method of claim 4, wherein if the timer reaches the time threshold but no callback result is received, sending a corresponding instruction to the server, comprising:
judging whether only one information call request exists in the time threshold;
if yes, waiting to receive a callback result;
if not, sending the last information calling request in the time threshold to the server.
6. The method of claim 4, wherein sending the callback result to the caller if the timer reaches the threshold and the callback result is received, comprises:
judging whether the information calling request is a first information calling request or not;
if the first information call request is made, a first callback result is sent to the calling party;
if the information calling request is not the first information calling request, judging whether the calling information request is the last information calling request within the time threshold;
if the information calling request is the last information calling request, a second callback result is sent to the calling party;
and if the information calling request is not the last information calling request, sending a first callback result to the calling party.
7. The method according to claim 1, wherein the method further comprises:
judging whether all callback results for sending information calling requests to the server are received or not;
if yes, clearing call information of the information call request.
8. An access request processing apparatus, comprising:
the receiving module is used for receiving an information calling request;
the processing module sorts the information calling requests according to the receiving sequence within a time threshold of a preset timer;
and the calling module calls the corresponding result to the calling party according to the ordering of the information calling request.
9. A computer-readable storage medium storing a program, characterized in that the program when executed implements the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, wherein the memory has a program stored therein, characterized in that the processor implements the method of any of claims 1 to 7 when executing the program.
CN202310207475.7A 2023-03-07 2023-03-07 Access request processing method, processing device, storage medium and electronic device Pending CN116405564A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310207475.7A CN116405564A (en) 2023-03-07 2023-03-07 Access request processing method, processing device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310207475.7A CN116405564A (en) 2023-03-07 2023-03-07 Access request processing method, processing device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN116405564A true CN116405564A (en) 2023-07-07

Family

ID=87006517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310207475.7A Pending CN116405564A (en) 2023-03-07 2023-03-07 Access request processing method, processing device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN116405564A (en)

Similar Documents

Publication Publication Date Title
CN108390933B (en) Message distribution method, device, server and storage medium
CN114938365B (en) Function module updating method and device, storage medium and electronic device
CN116033006A (en) Data processing method, system, storage medium and electronic device
CN116405564A (en) Access request processing method, processing device, storage medium and electronic device
CN116225834A (en) Alarm information sending method and device, storage medium and electronic device
CN116361155A (en) Method and device for testing software development kit, storage medium and electronic device
CN115766314A (en) Method and device for transmitting messages among components, storage medium and electronic device
CN115174512A (en) Message pushing method and device, storage medium and electronic device
CN115048392A (en) Data deletion method and device, storage medium and electronic device
CN111371675B (en) Intelligent addressing method, device, equipment and storage medium thereof
KR20220059543A (en) Event notification method, system, server device, and computer storage medium
CN115174296B (en) Equipment function access method and device, storage medium and electronic device
CN115174382B (en) Equipment upgrading method, storage medium and electronic device
CN115296958B (en) Distribution method and device of equipment control tasks, storage medium and electronic device
CN116248647A (en) Method and device for sending resource package, storage medium and electronic device
CN115174513B (en) Message pushing method and device, storage medium and electronic device
CN114697345B (en) Information updating method and device, storage medium and electronic device
CN115296948B (en) Scene information updating method and device, storage medium and electronic device
CN116578618A (en) Method and device for generating target reflow instance, storage medium and electronic device
CN116506247A (en) Equipment state updating method and device, storage medium and electronic device
CN115473852A (en) Current limiting method for user side input request, storage medium and electronic device
CN116366671A (en) Data synchronization method and device, storage medium and electronic device
CN116684374A (en) Gateway message processing method and device, storage medium and electronic device
CN116546055A (en) Service message processing method and device, storage medium and electronic device
CN116418613A (en) Message reflow processing method and device, storage medium and electronic device

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