Data request processing method, request processing method, device, system, equipment, medium and product
By comparing page data version information between the client and the server to determine the data update status, requests are only sent to the server when the page data is updated, thus solving the problem of wasted bandwidth when the page data is not updated and achieving more efficient data request processing.
Patent Information
- Application Number
- CN202411643399.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2026-05-15
AI Technical Summary
In existing technologies, data service requests are still sent to the server even when the page data accessed by the user has not been updated, resulting in wasted traffic and increased server load, as well as the problem of fixed expiration time for data resources.
The client determines the data update status by comparing the original version information of the page data with the latest version information, and responds to requests with cached data when there is no update. The server synchronizes the page data version information table through a preset gateway to guide client requests, and only sends requests to the server when the data is updated.
It reduces the number of unnecessary data requests, reduces traffic waste and bandwidth consumption, improves response speed, and reduces the possibility of instantaneous peak traffic on the server.
Smart Images

Figure CN122053375A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data request processing method, apparatus, system, device, medium and product. Background Technology
[0002] When a user uses the application client, each time they access an application (APP) page, they request the page data service from the server to obtain the latest data.
[0003] However, in the process of realizing this invention, it was found that at least the following technical problems exist in the prior art:
[0004] Even if the data on the page a user visits hasn't been updated, a data service request will still be sent to the server. This wastes service bandwidth and puts a heavy load on the server. Although the HTTP protocol includes a flag representing the expiration time of data resources, which can reduce the number of data service requests, the expiration time of data resources is fixed. This means there are situations where the data has changed, but the latest data cannot be retrieved because the resource's expiration time hasn't expired. Summary of the Invention
[0005] This invention provides a data request processing method, apparatus, system, device, medium, and product that can reduce the number of network data service requests, reduce traffic waste, and determine the data content of each response page data request as the latest data content.
[0006] In a first aspect, embodiments of the present invention provide a data request processing method applied to a client, the method comprising:
[0007] Once a page data request is received, determine the corresponding request and response method for that page data request.
[0008] When the request-response method is based on the data update status, the original data version information of the target page associated with the page data request is compared with the corresponding latest data version information to determine the data update status of the target page;
[0009] Among them, the original data version information is the version information corresponding to the page data of the target page cached in the client; the latest data version information is the version information corresponding to the page data of the target page obtained from the preset gateway of the server during the historical business interaction with the server.
[0010] If the data update status indicates that the page data of the target page has not been updated, the page data of the target page cached in the client will be used as the request feedback data for the page data request.
[0011] Secondly, embodiments of the present invention provide a request processing method applied to a server, the method comprising:
[0012] In response to a business request from a client obtained through a preset gateway, determine the business feedback information for the business request;
[0013] Through a preset gateway, business feedback information and a page data version information table pre-stored in the preset gateway are synchronously fed back to the client, so that when the client receives a page data request, it can determine whether to send a business request corresponding to the page data request to the server based on the page data version information table.
[0014] The page data version information table includes the latest page data version information for each page in the page data service provided by the server.
[0015] Thirdly, embodiments of the present invention provide a request processing method applied to a business service system, the method comprising:
[0016] After receiving the client's business request, the server will synchronously send the page data version information table pre-stored in the preset gateway and the business feedback information of the business request to the client.
[0017] The client's network toolkit caches the page data version information table, and when a page data request is received, it compares the original data version information of the target page associated with the page data request with the latest data version information corresponding to the page data version information table to determine the data update status of the target page.
[0018] If the client determines that the data update status indicates that the target page's data has not been updated, it will use the cached target page's data as the response data for the page data request.
[0019] Fourthly, embodiments of the present invention provide a data request processing apparatus configured on a client, the apparatus comprising:
[0020] The request-response method determination module is used to determine the request-response method corresponding to the page data request when a page data request is obtained.
[0021] The data update status determination module is used to compare the original data version information of the target page associated with the page data request with the corresponding latest data version information when the request response method is based on the data update status, in order to determine the data update status of the target page.
[0022] Among them, the original data version information is the version information corresponding to the page data of the target page cached in the client; the latest data version information is the version information corresponding to the page data of the target page obtained from the preset gateway of the server during the historical business interaction with the server.
[0023] The request feedback data determination module is used to use the page data of the target page cached in the client as the request feedback data for the page data request when the data update status indicates that the page data of the target page has not been updated.
[0024] Fifthly, embodiments of the present invention provide a request processing apparatus configured on a server, the apparatus comprising:
[0025] The business request feedback information determination module is used to determine the business feedback information of the business request in response to the business request obtained from the client through the preset gateway.
[0026] The feedback information sending module is used to synchronously send business feedback information and a page data version information table pre-stored in the preset gateway to the client through a preset gateway, so that when the client receives a page data request, it can determine whether to send a business request corresponding to the page data request to the server based on the page data version information table.
[0027] The page data version information table includes the latest page data version information for each page in the page data service provided by the server.
[0028] Sixthly, embodiments of the present invention provide a business service system, the system comprising:
[0029] Server and client;
[0030] The client is used to implement the data request processing method as described in any of the embodiments;
[0031] The server is used to implement the request processing method as described in any of the embodiments;
[0032] The server and client interact to implement the request processing method applied to the business service system in any embodiment.
[0033] In a seventh aspect, embodiments of the present invention also provide a computer device, the computer device comprising:
[0034] One or more processors;
[0035] Memory, used to store one or more programs;
[0036] When one or more programs are executed by one or more processors, the one or more processors implement the data request processing method or request processing method provided in any embodiment of the present invention.
[0037] Eighthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data request processing method or request processing method as provided in any embodiment of the present invention.
[0038] In a ninth aspect, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements the data request processing method or request processing method provided in any embodiment of the present invention.
[0039] The embodiments of the above invention have the following advantages or beneficial effects:
[0040] In this embodiment of the invention, upon receiving a page data request, the corresponding request-response method is determined. If the request-response method is based on data update status, the original data version information of the target page associated with the page data request is compared with the corresponding latest data version information to determine the data update status of the target page. The original data version information is the version information corresponding to the page data of the target page cached in the client. The latest data version information is the version information corresponding to the page data of the target page obtained from the server's preset gateway during historical business interactions with the server. If the data update status indicates that the page data of the target page has not been updated, the page data of the target page cached in the client is used as the request feedback data for the page data request. This invention solves the problem of frequent data requests wasting bandwidth for pages with low data update frequencies. It can prevent data service requests from being sent to the server when the page data has not been updated, reducing the number of requests and thus reducing bandwidth waste and usage. Attached Figure Description
[0041] Figure 1 This is a flowchart of a data request processing method provided in an embodiment of the present invention;
[0042] Figure 2 This is a flowchart of a data request processing method provided in an embodiment of the present invention;
[0043] Figure 3 This is a flowchart of a request processing method provided in an embodiment of the present invention;
[0044] Figure 4 This is a flowchart of a request processing method provided in an embodiment of the present invention;
[0045] Figure 5 This is a schematic diagram of a business service system provided in an embodiment of the present invention;
[0046] Figure 6 This is a timing diagram of the interaction between a server and a client provided in an embodiment of the present invention;
[0047] Figure 7 This is a schematic diagram of the structure of a data request processing device provided in an embodiment of the present invention;
[0048] Figure 8 This is a schematic diagram of the structure of a request processing device provided in an embodiment of the present invention;
[0049] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0050] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0051] Figure 1 This is a flowchart illustrating a data request processing method provided in an embodiment of the present invention. This embodiment is applicable to scenarios where a client displays page content to a user, particularly when the page data update frequency is relatively low. The method can be executed by a data request processing device, which can be implemented in software and / or hardware and integrated into a computer device with application development capabilities.
[0052] like Figure 1 As shown, the data request processing method applied to the client in this embodiment includes the following steps:
[0053] S110. Upon receiving a page data request, determine the corresponding request-response method for the page data request.
[0054] When users interact with a client application, they typically engage in business interactions based on the business content and corresponding functions provided by the client. During these interactions, users obtain relevant business information through the content displayed on the client's pages. Each time a user opens a page or triggers a page refresh, a page data request is initiated to ensure the page displays the latest content.
[0055] Typically, each time a client receives a page data request, it sends a data service request to the target server based on the content of the page data request, such as the associated target page, target server, and page data object, in order to obtain the latest page data corresponding to the target page from the target server.
[0056] In this embodiment, to avoid making invalid data service requests to the server for pages with outdated data when responding to page data requests from client users, a new request-response method is set up. When responding to page data requests for some pages, instead of directly sending the corresponding data service request to the server, it first determines whether it is necessary to send the corresponding data service request to the server. If it is necessary, the corresponding data service request is sent to the server; otherwise, the page data request can be responded to directly based on the page data cached locally on the client.
[0057] S120. When the request-response method is a request method based on data update status, compare the original data version information of the target page associated with the page data request with the corresponding latest data version information to determine the data update status of the target page.
[0058] The request-response method is a request method based on data update status. It can be understood as the implementation of determining whether to send a corresponding data service request to the server. It determines whether to send a corresponding business request to the server by judging whether the page data of the target page associated with the page data request has been updated.
[0059] Determining the data update status of a target page can be done by comparing the original data version information of the target page associated with the page data request with the corresponding latest data version information. If the data version information has changed, it means that the page data has been updated; if the data version information has not changed, it means that the page data has not been updated.
[0060] Among them, the original data version information is the version information corresponding to the page data of the target page cached in the client. It is the version information corresponding to the page data of the target page obtained from the preset gateway of the server during the historical business interaction with the server.
[0061] It's understandable that any business request sent from the client to the server is implemented using a network development kit (Software Development Kit). When the server sends feedback information about a business request to the client, it simultaneously sends a table containing the page data version information of the target page back to the client. Before receiving the page data request, during any business interaction between the client and the server, the server can simultaneously send the page data version information table when sending feedback data for any business request. In other words, the client stores the latest page data version information from the server's page data service.
[0062] S130. If the data update status indicates that the page data of the target page has not been updated, use the page data of the target page cached in the client as the request feedback data for the page data request.
[0063] The update status indicates that the page data of the target page has not been updated. This can be achieved by comparing the original data version information of the target page associated with the page data request with the corresponding latest data version information. If the original data version information is the same as the corresponding latest data version information, it means that the page data of the target page has not been updated. In this case, it is not necessary to send a business request corresponding to the user's page data request to the server. The page data of the target page cached in the client can be used directly as the request feedback information for the page data request.
[0064] This method reduces the number of business requests the client sends to the server, thus improving the speed of responding to user page data requests.
[0065] The technical solution of this embodiment determines the request-response method corresponding to the page data request when a page data request is received. If the request-response method is based on data update status, the original data version information of the target page associated with the page data request is compared with the corresponding latest data version information to determine the data update status of the target page. The original data version information is the version information corresponding to the page data of the target page cached in the client. The latest data version information is the version information corresponding to the page data of the target page obtained from the server's preset gateway during historical business interactions with the server. If the data update status indicates that the page data of the target page has not been updated, the page data of the target page cached in the client is used as the request feedback data for the page data request. This embodiment solves the problem of frequent data requests wasting bandwidth for pages with low data update frequency. It can prevent data service requests from being sent to the server when the page data has not been updated, reducing the number of requests and thus reducing bandwidth waste and usage.
[0066] Figure 2 This is a flowchart illustrating a data request processing method provided in an embodiment of the present invention. This embodiment belongs to the same inventive concept as the data request processing methods in the above embodiments, and further describes the process of responding to page data requests when page data has been updated. This method can be executed by a data request processing device, which can be implemented in software and / or hardware and integrated into a computer device with application development capabilities.
[0067] like Figure 2 As shown, the data request processing method in this embodiment includes the following steps:
[0068] S210. If a page data request is obtained, determine the request-response method corresponding to the page data request.
[0069] S220. When the request-response method is a request method based on data update status, compare the original data version information of the target page associated with the page data request with the corresponding latest data version information to determine the data update status of the target page.
[0070] Among them, the original data version information is the version information corresponding to the page data of the target page cached in the client. It is the version information corresponding to the page data of the target page obtained from the preset gateway of the server during the historical business interaction with the server.
[0071] The original data version information of the target page associated with the page data request is compared with the corresponding latest data version information. If the original data version information is different from the corresponding latest data version information, it means that the target page data has been updated. A business request corresponding to the page data request needs to be sent to the target server to obtain the latest page data corresponding to the target page.
[0072] The discrepancy between the original data version information and the corresponding latest data version information can encompass several scenarios. One is that the latest data version information is an update of the original data version information. Another scenario is that the original data version information does not exist, indicating that the client does not have the target page's page data cached locally. In both cases, it means that the target page's page data has been updated, and it is necessary to request the corresponding latest page data from the target server.
[0073] S230. If the update status indicates that the page data of the target page has been updated, initiate a business request corresponding to the page data request to the target server.
[0074] The client initiates a business request to the target server corresponding to the page data request. This can be done by determining the target server and the data object to be requested based on the request information in the page data request. Then, the client initiates a business request to the target server based on the request information in the page data request to obtain the latest page data for the target page.
[0075] In one optional implementation, when the client's network development kit obtains the version information (i.e., the latest data version information) of the target page's data from the preset gateway of the target server corresponding to the page data request, if the version information of the page data returned by the target server is parsed and the corresponding request delay information is obtained, then the request delay duration can be determined based on the request delay information associated with the latest data version information. Upon obtaining the page data request and determining that a corresponding business request needs to be initiated to the target server, the business request corresponding to the page data request is initiated to the target server after a delay of the corresponding request delay duration.
[0076] The data service request is initiated to the target server after a delay of a certain period of time. This means that when it is determined that the page data has been updated, the business request corresponding to the page data request will not be sent immediately, but will be sent after a certain delay. This can reduce the possibility of instantaneous traffic spikes.
[0077] S240. Obtain the response data of the business request returned by the target server through the gateway, and use the response data as the request feedback data for the page data request.
[0078] After the client initiates a business request to the target server, the target server will respond according to the content of the business request and send the corresponding data content back to the client. Therefore, the client can obtain the response data of the business request returned by the target server through the gateway, and use the response data of the business request as the feedback information for the page data request to ensure that the page data request is responded to with the latest page data.
[0079] The technical solution of this embodiment, upon receiving a page data request, determines the corresponding request-response method. If the request-response method is based on data update status, it compares the original data version information of the target page associated with the page data request with the corresponding latest data version information to determine the data update status of the target page. If the update status indicates that the page data of the target page has been updated, it initiates a business request corresponding to the page data request to the target server. It then obtains the business request response data returned by the target server via the gateway and responds to the page data request based on the business request response data. This embodiment solves the problem of frequent data requests wasting bandwidth for pages with low data update frequency. It allows business requests to be sent to the server only when the page data has been updated, reducing the number of requests and thus reducing bandwidth waste and bandwidth usage. Furthermore, it allows for delayed requests, reducing the possibility of instantaneous traffic spikes on the server and improving the operational security of the target server.
[0080] Figure 3 This is a flowchart illustrating a request processing method provided in an embodiment of the present invention. This embodiment belongs to the same inventive concept as the data request processing method in the above embodiments, and further explains the process of the server responding to the client's request. This method can be executed by a request processing device configured on the server, which can be implemented in software and / or hardware and integrated into a computer device with application development capabilities.
[0081] like Figure 3 As shown, the request processing method in this embodiment includes the following steps:
[0082] S310. In response to a business request from a client obtained through a preset gateway, determine the business feedback information of the business request.
[0083] Any business request sent from any interface of the client will reach a unified preset gateway. The gateway will parse the business request and forward it to the corresponding business processing module, which will then determine the business feedback information of the business request.
[0084] S320. Through a preset gateway, the business feedback information and the page data version information table pre-stored in the preset gateway are synchronously fed back to the client, so that when the client receives a page data request, it can determine whether to initiate a business request corresponding to the page data request to the server based on the page data version information table.
[0085] The page data version information table includes the latest page data version information for each page in the page data service provided by the server. This page data version information table is maintained by the server. After detecting an update operation on page data in the page data service, the server verifies the consistency between the updated page data and the corresponding original page data to obtain a verification result. If the verification result indicates that the updated page data is different from the original page, the server modifies the data version information of the page corresponding to the updated page data to obtain an updated page data version information table. The updated page data version information table is then saved to the preset gateway.
[0086] For example, when a marketing user (a business user maintaining business data in the business service system) modifies and configures data on the server-side (configuration service), the server compares the latest data with the original data. If no changes have occurred, the operation ends. If changes have occurred, it triggers changes in the gateway and backend data service. After the server-side data changes, it generates the latest data version information and transmits it to the preset gateway. The preset gateway stores the data version information and also stores a copy of the latest data version information in the memory of all machines on the preset gateway. The preset gateway can be replaced with other functional modules that the client-side page will definitely access.
[0087] In addition, before synchronizing the business feedback information and page data version information table back to the client, a random value can be generated and used as the request delay duration. Then, the request delay duration, page data version information table, and business feedback information can be synchronized and fed back to the client, so that when the client determines that a page data service request needs to be sent, it can delay the request delay duration before initiating a business request to the server.
[0088] Specifically, the default gateway adds a `dataVersion` field to the response header when returning an HTTP request. Its value is a string separated by underscores, in the format `version_randomtime`. The first field, `version`, is the data version information corresponding to the page data version number in the server-side data service, identified by a timestamp. The second field, `randomtime`, indicates the request delay time. After the client obtains the version number change, it does not immediately make a request, but delays for a random time between 0 and `randomtime` before initiating the request. This can reduce the generation of instantaneous traffic spikes.
[0089] When a client user initiates a data service request on the client-side page, the latest data version information is retrieved from the network SDK and compared with the data version information stored locally on the client. If the local data version information does not exist or is inconsistent with the latest data version information, it means that the data has changed, and a new data service request will be initiated. If the local data version information is consistent with the latest data version information, no data service request will be initiated.
[0090] The technical solution of this embodiment, in response to a business request obtained from a client through a preset gateway, determines the business feedback information of the business request; through the preset gateway, the business feedback information and a page data version information table pre-stored in the preset gateway are synchronously fed back to the client, so that when the client obtains a page data request, it can determine whether to initiate a business request corresponding to the page data request to the server based on the page data version information table. This technical solution solves the problem of frequent data requests wasting bandwidth for pages with low data update frequency. It can feed back page data version information in any business request, informing the client of the page data version information, so that the client only sends a data service request to the server when the page data is updated, reducing the number of requests, thereby reducing bandwidth waste and bandwidth usage. Furthermore, it can perform delayed requests, reducing the possibility of instantaneous peak traffic on the server and improving the operational security index of the target server. Figure 4 This is a flowchart illustrating a request processing method provided in an embodiment of the present invention. This embodiment belongs to the same inventive concept as the data request processing method in the above embodiments, and further explains the process of the server responding to the client's request. This method is applicable to business service systems and can be executed by request processing devices configured on the server and client sides. These devices can be implemented in software and / or hardware and integrated into computer equipment with application development capabilities.
[0091] like Figure 4 As shown, the request processing method in this embodiment includes the following steps:
[0092] S410. After receiving the client's business request, the server synchronously sends the page data version information table pre-stored in the preset gateway and the business feedback information of the business request to the client.
[0093] The default gateway can be an API (Application Program Interface) gateway, which is a traffic entry point between external requests and internal services on the server side, and implements common functions such as protocol conversion, authentication, flow control, parameter verification, and monitoring for external requests.
[0094] Any business request sent by different clients can be processed through a preset gateway, including protocol conversion, authentication, flow control, parameter validation, and monitoring. Then, the request content can be obtained, and further business feedback information can be determined based on the request content.
[0095] Normally, the server directly sends the business feedback information of the business request to the client that issued the request through the business request interface. In this embodiment, in addition to the business feedback information, the information sent back to the client also includes a page data version information table pre-stored in the preset gateway. This page data version information table includes the latest data version information of each page in the data service. In other words, the business feedback information and the latest data version information of each page in the data service pre-stored in the preset gateway are synchronously fed back to the client as the request feedback information for the business request.
[0096] The page data version information table can be a piece of information maintained by the server. In the page data of the data service, each page data will correspond to a data version information. Every time the business side modifies the business data, the server will compare the page data content before and after the modification. If the page data has been modified, the server will update the page data version information to ensure that the data version information stored in the preset gateway is the latest data version information.
[0097] Specifically, after detecting an update operation on page data in the data service, the server verifies the consistency between the updated page data and the corresponding original page data to obtain a verification result. If the verification result indicates that the updated page data is different from the original page, the server modifies the data version information of the page corresponding to the updated page data to obtain an updated page data version information table. The updated page data version information table is then saved to a preset gateway.
[0098] S420: The client's network toolkit caches the page data version information table. When a page data request is received, it compares the original data version information of the target page associated with the page data request with the latest data version information corresponding to the page data version information table to determine the data update status of the target page.
[0099] Specifically, any client interface initiates a request to the gateway through the client network SDK. When any client request receives a response from the gateway, the client network SDK obtains the data returned by the gateway. By parsing the response header, it can obtain the content corresponding to the data version information field in the response header and store the latest data version information locally.
[0100] S430. If the client determines that the data update status is that the page data of the target page has not been updated, it will use the cached page data of the target page as the request feedback data for the page data request.
[0101] S440. When the client determines that the data update status is that the page data of the target page has been updated, it sends a business request to the server corresponding to the page data request.
[0102] In one optional implementation, to avoid sudden spikes in traffic, the server randomly generates a request delay duration before synchronizing the business feedback information and the page data version information table back to the client; it then synchronizes the request delay duration with the page data version information table back to the client. Once the client determines that the page data of the target page has been updated, it sends a data service request corresponding to the page data request to the server after delaying the request delay duration. In other words, the server randomly generates the request delay duration before synchronizing the business feedback information and the latest data version information table back to the client; then, it synchronizes the request delay duration with the latest data version information in the data version information table back to the client. Accordingly, when the client needs to send a business request to the server, it will send the request after the delay duration corresponding to the request delay information.
[0103] In this embodiment, after receiving a business request from a client, the server synchronously sends a page data version information table pre-stored in a preset gateway and the business feedback information of the business request to the client. The client's network toolkit caches the page data version information table and, upon receiving a page data request, compares the original data version information of the target page associated with the page data request with the latest data version information corresponding to it in the page data version information table to determine the data update status of the target page. If the client determines that the data update status is that the page data of the target page has not been updated, it uses the cached page data of the target page as the request feedback data for the page data request. If the client determines that the data update status is that the page data of the target page has been updated, it initiates a data service request corresponding to the page data request to the server. The technical solution of this embodiment solves the problem of wasted bandwidth due to frequent data requests for pages with low data update frequency. It can feed back page data version information in any business request, informing the client of the page data version information. This allows the client to send data service requests to the server only when the page data has been updated, reducing the number of requests and thus reducing bandwidth waste and usage. Furthermore, it can perform delayed requests, reducing the possibility of instantaneous traffic spikes on the server and improving the operational security index of the target server.
[0104] Figure 5A schematic diagram of a business service system is shown, comprising a server and clients. The client implements the data request processing method as described in any embodiment; the server implements the request processing method as described in any embodiment; the server and clients interact to implement the request processing method applicable to the business service system. There may be multiple clients that interact with the server through business logic.
[0105] Figure 6 This further illustrates the sequence diagram of the interaction between the server and client in the business service system. Specifically, Figure 6 The leftmost marketing personnel refers to the business users who maintain business data on the server side of the business system; they can be business operations personnel. Page data service refers to the service that directly provides data to the client-side page. Configuration service refers to the configuration system for client-side page data. Marketing personnel use the configuration system to adjust the client-side page data at any time, updating the page data. Changes to server-side data generate data version information that is synchronized to the gateway, thereby updating the service data. When the gateway receives any client request, it synchronizes the latest data version information to the client gateway SDK. When a client user initiates a client-side page data request, it retrieves the latest data version information from the gateway and then obtains the latest version data information returned by the SDK. Furthermore, it compares the latest version data information with the originally stored version information, determining whether to request data service from the client based on the change in data version information.
[0106] pass Figure 6 The process illustrated illustrates that for data services with low data change frequency, the server can leverage the capabilities of a pre-defined gateway to write data change identifiers into the gateway's HTTP response header. Each time the client receives a user's page data request, it can first compare the local data identifier with the data identifier obtained from the gateway's response header during previous business interactions. If they don't match, then the corresponding business request for the page data request is initiated. This ensures that when service data changes, the page can immediately detect and request new data; when service data remains unchanged, no data service request is made, significantly reducing the number of service data requests and lowering the server load during concurrent multi-page data requests.
[0107] Figure 7 This is a schematic diagram of a data request processing device provided in an embodiment of the present invention. This embodiment is applicable to scenarios where a client displays page content to a user, especially for situations where the page data update frequency is relatively low. The data request processing device can be implemented by software and / or hardware and integrated into a computer terminal device with application development capabilities.
[0108] like Figure 7As shown, the data request processing device configured on the client includes: a request response method determination module 510, a data update status determination module 520, and a request feedback data determination module 530.
[0109] The request-response method determination module 510 is used to determine the request-response method corresponding to the page data request when a page data request is received. The data update status determination module 520 is used to compare the original data version information of the target page associated with the page data request with the corresponding latest data version information to determine the data update status of the target page when the request-response method is a request method based on data update status. The original data version information is the version information corresponding to the page data of the target page cached in the client. The latest data version information is the version information corresponding to the page data of the target page obtained from the preset gateway of the server during the historical business interaction with the server. The request feedback data determination module 530 is used to use the page data of the target page cached in the client as the request feedback data of the page data request when the data update status indicates that the page data of the target page has not been updated.
[0110] The technical solution of this embodiment determines the request-response method corresponding to the page data request when a page data request is received. If the request-response method is based on data update status, the original data version information of the target page associated with the page data request is compared with the corresponding latest data version information to determine the data update status of the target page. The original data version information is the version information corresponding to the page data of the target page cached in the client. The latest data version information is the version information corresponding to the page data of the target page obtained from the server's preset gateway during historical business interactions with the server. If the data update status indicates that the page data of the target page has not been updated, the page data of the target page cached in the client is used as the request feedback data for the page data request. This embodiment solves the problem of frequent data requests wasting bandwidth for pages with low data update frequency. It can prevent data service requests from being sent to the server when the page data has not been updated, reducing the number of requests and thus reducing bandwidth waste and usage.
[0111] In an alternative implementation, the data request response module 530 can be used to:
[0112] If the update status indicates that the page data of the target page has been updated, a business request corresponding to the page data request is sent to the target server.
[0113] Obtain the response data of the business request returned by the target server through the gateway, and use the response data as the request feedback data for the page data request.
[0114] In an alternative implementation, the data request response module 530 can be used to:
[0115] While obtaining the latest data version information, the corresponding request latency information is also obtained, and the request latency duration is determined based on the request latency information associated with the latest data version information.
[0116] After obtaining the page data request, a business request corresponding to the page data request is initiated to the target server after a delay period.
[0117] In an optional implementation, the target data update status determination module 520 can also be used for:
[0118] Before obtaining the page data request, any interface of the client sends a corresponding business request to the target server based on the network development kit;
[0119] Obtain the business feedback information from the target server regarding the business request based on the preset gateway. The business feedback information includes the latest data version information.
[0120] Parse the field content in the business feedback information, and determine the latest data version information based on the field content corresponding to the latest data version information.
[0121] The data request processing device configured on the client provided in the embodiments of the present invention can execute the data request processing method applied to the client provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0122] Figure 8 This is a schematic diagram of a request processing device provided in an embodiment of the present invention. This embodiment is applicable to situations where the server responds to a client's business request. The request processing device can be implemented by software and / or hardware and integrated into a computer terminal device with application development capabilities.
[0123] like Figure 8 As shown, the request processing device includes: a service request feedback information determination module 610 and a feedback information sending module 620.
[0124] The service request feedback information determination module 610 is used to determine the service feedback information of the service request in response to a service request obtained from the client through a preset gateway. The feedback information sending module 620 is used to synchronously feed back the service feedback information and the page data version information table pre-stored in the preset gateway to the client through the preset gateway, so that when the client obtains a page data request, it can determine whether to initiate a service request corresponding to the page data request to the server based on the page data version information table. The page data version information table includes the latest page data version information corresponding to each page in the page data service provided by the server.
[0125] The technical solution of this embodiment addresses the problem of wasted bandwidth due to frequent data requests for pages with low update frequencies. It pre-responds to business requests received from clients via a preset gateway, determining the business feedback information for each request. The client then synchronously feeds back this feedback information and a pre-stored page data version information table to the client, enabling the client to determine whether to initiate a corresponding business request to the server upon receiving a page data request, based on the page data version information table. The page data version information table includes the latest page data version information for each page in the server-provided page data service. This solution solves the problem of wasted bandwidth due to frequent data requests for pages with low update frequencies. It allows for feedback of page data version information in any business request, informing the client of the page data version. This ensures the client only sends data service requests to the server when page data is updated, reducing the number of requests and thus minimizing bandwidth waste. Furthermore, it allows for delayed requests, reducing the likelihood of sudden spikes in server traffic and improving the operational security of the target server.
[0126] In an optional implementation, the feedback information sending module 620 is further configured to randomly generate a value before synchronously feeding back the business feedback information and page data version information table to the client, and use the value as the request delay duration.
[0127] The request delay duration, page data version information table, and business feedback information are synchronously fed back to the client, so that when the client determines that a page data service request needs to be sent, it can delay the request delay duration before initiating a business request to the server.
[0128] In an optional implementation, the request processing apparatus further includes an information update module, used for:
[0129] After detecting an update operation on page data in the page data service, verify the consistency between the updated page data and the corresponding original page data to obtain the verification result.
[0130] If the verification result indicates that the updated page data is different from the original page, the data version information of the page corresponding to the updated page data is changed to obtain the updated page data version information table;
[0131] Save the updated page data version information table to the preset gateway.
[0132] The request processing device configured on the server provided in the embodiments of the present invention can execute the request processing method applied to the server provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0133] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 9 A block diagram of an exemplary computer device 12 suitable for implementing embodiments of the present invention is shown. Figure 9 The computer device 12 shown is merely an example and should not be construed as limiting the functionality or scope of the embodiments of the present invention. The computer device 12 can be any terminal device with computing capabilities, such as intelligent controllers and servers, mobile phones, and other terminal devices.
[0134] like Figure 9 As shown, the computer device 12 is represented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0135] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0136] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0137] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 9 Not shown; usually referred to as a "hard drive"). Although Figure 9 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0138] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0139] Computer device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the computer device 12, and / or with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that, although... Figure 9 As not shown, it can be used in conjunction with computer device 12 with other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0140] Processing unit 16 executes various functional applications and data processing by running programs stored in system memory 28, such as implementing the data request processing method provided in this embodiment, which includes:
[0141] Once a page data request is received, determine the corresponding request and response method for that page data request.
[0142] When the request-response method is based on the data update status, the original data version information of the target page associated with the page data request is compared with the corresponding latest data version information to determine the data update status of the target page;
[0143] Among them, the original data version information is the version information corresponding to the page data of the target page cached in the client; the latest data version information is the version information corresponding to the page data of the target page obtained from the preset gateway of the server during the historical business interaction with the server.
[0144] If the data update status indicates that the page data of the target page has not been updated, the page data of the target page cached in the client will be used as the request feedback data for the page data request.
[0145] Processing unit 16 executes various functional applications and data processing by running programs stored in system memory 28, such as implementing the request processing method provided in this embodiment, which includes:
[0146] In response to a business request from a client obtained through a preset gateway, determine the business feedback information for the business request;
[0147] Through a preset gateway, business feedback information and a page data version information table pre-stored in the preset gateway are synchronously fed back to the client, so that when the client receives a page data request, it can determine whether to send a business request corresponding to the page data request to the server based on the page data version information table.
[0148] The page data version information table includes the latest page data version information for each page in the page data service provided by the server.
[0149] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the data request processing method provided in any embodiment of this invention, the method comprising:
[0150] Once a page data request is received, determine the corresponding request and response method for that page data request.
[0151] When the request-response method is based on the data update status, the original data version information of the target page associated with the page data request is compared with the corresponding latest data version information to determine the data update status of the target page;
[0152] Among them, the original data version information is the version information corresponding to the page data of the target page cached in the client; the latest data version information is the version information corresponding to the page data of the target page obtained from the preset gateway of the server during the historical business interaction with the server.
[0153] If the data update status indicates that the page data of the target page has not been updated, the page data of the target page cached in the client will be used as the request feedback data for the page data request.
[0154] When executed by a processor, the program implements a request processing method as provided in any embodiment of the present invention, the method comprising:
[0155] In response to a business request from a client obtained through a preset gateway, determine the business feedback information for the business request;
[0156] Through a preset gateway, business feedback information and a page data version information table pre-stored in the preset gateway are synchronously fed back to the client, so that when the client receives a page data request, it can determine whether to send a business request corresponding to the page data request to the server based on the page data version information table.
[0157] The page data version information table includes the latest page data version information for each page in the page data service provided by the server.
[0158] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0159] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0160] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0161] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0162] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computing device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0163] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the data request processing method or request processing method provided in any embodiment of this disclosure.
[0164] In implementing a computer program product, computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0165] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A data request processing method, applied to a client, characterized in that, include: Upon receiving a page data request, determine the corresponding request-response method for the page data request; When the request-response method is a request method based on data update status, the original data version information of the target page associated with the page data request is compared with the corresponding latest data version information to determine the data update status of the target page; Wherein, the original data version information is the version information corresponding to the page data of the target page cached in the client; the latest data version information is the version information corresponding to the page data of the target page obtained from the preset gateway of the server during the historical business interaction with the server. If the data update status indicates that the page data of the target page has not been updated, the page data of the target page cached in the client will be used as the request feedback data for the page data request.
2. The method according to claim 1, characterized in that, The method further includes: When the update status indicates that the page data of the target page has been updated, a business request corresponding to the page data request is initiated to the target server; Obtain the response data of the business request returned by the target server via the gateway, and use the response data as the request feedback data of the page data request.
3. The method according to claim 2, characterized in that, Upon obtaining the latest data version information and the corresponding request latency information, the step of initiating a business request to the target server corresponding to the page data request includes: The request delay duration is determined based on the request delay information associated with the latest data version information; After obtaining the page data request, a business request corresponding to the page data request is initiated to the target server after a delay of the request delay period.
4. The method according to any one of claims 1-3, characterized in that, The process of obtaining the latest data version information includes: Before obtaining the page data request, any interface of the client sends a corresponding business request to the target server based on the network development kit; Obtain the service feedback information of the target server on the service request based on the preset gateway, wherein the service feedback information includes the latest data version information; The field content in the business feedback information is parsed, and the latest data version information is determined based on the field content corresponding to the latest data version information.
5. A request processing method, applied to a server, characterized in that, include: In response to a service request from a client obtained through a preset gateway, the service feedback information of the service request is determined; Through the preset gateway, the business feedback information and the page data version information table pre-stored in the preset gateway are synchronously fed back to the client, so that when the client receives a page data request, it can determine whether to initiate a business request corresponding to the page data request to the server according to the page data version information table. The page data version information table includes the latest page data version information for each page in the page data service provided by the server.
6. The method according to claim 5, characterized in that, Before synchronizing the business feedback information and the page data version information table back to the client, the method further includes: A random value is generated and used as the request delay duration; Correspondingly, the process of synchronously feeding back the business feedback information and the page data version information table to the client also includes: The request delay duration, the page data version information table, and the business feedback information are synchronously fed back to the client, so that when the client determines that a page data service request needs to be issued, it can delay the request delay duration before initiating the business request to the server.
7. The method according to claim 5, characterized in that, The method further includes: After detecting an update operation on page data in the page data service, verify the consistency between the updated page data and the corresponding original page data to obtain the verification result. If the verification result indicates that the updated page data is different from the original page, the data version information of the page corresponding to the updated page data is changed to obtain the updated page data version information table; The updated page data version information table is saved to the preset gateway.
8. A request processing method, applied to a business service system, characterized in that, include: After receiving the client's business request, the server will simultaneously send the page data version information table pre-stored in the preset gateway and the business feedback information of the business request to the client. The client's network toolkit caches the page data version information table, and when a page data request is received, it compares the original data version information of the target page associated with the page data request with the latest data version information corresponding to the page data version information table to determine the data update status of the target page. If the client determines that the data update status is that the page data of the target page has not been updated, it will use the cached page data of the target page as the request feedback data for the page data request.
9. A data request processing apparatus, configured on a client, characterized in that, include: The request-response method determination module is used to determine the request-response method corresponding to the page data request when a page data request is obtained. The data update status determination module is used to compare the original data version information of the target page associated with the page data request with the corresponding latest data version information when the request response method is a request method based on data update status, and to determine the data update status of the target page. Wherein, the original data version information is the version information corresponding to the page data of the target page cached in the client; the latest data version information is the version information corresponding to the page data of the target page obtained from the preset gateway of the server during the historical business interaction with the server. The request feedback data determination module is used to use the page data of the target page cached in the client as the request feedback data for the page data request when the data update status indicates that the page data of the target page has not been updated.
10. A request processing apparatus, configured on a server, characterized in that, include: The business request feedback information determination module is used to determine the business feedback information of the business request in response to a business request obtained from a client through a preset gateway. The feedback information sending module is used to synchronously send the business feedback information and the page data version information table pre-stored in the preset gateway to the client through the preset gateway, so that when the client receives a page data request, it can determine whether to initiate a business request corresponding to the page data request to the server according to the page data version information table. The page data version information table includes the latest page data version information for each page in the page data service provided by the server.
11. A business service system, characterized in that, include: Server and client; The client is used to implement the data request processing method as described in any one of claims 1-4; The server is used to implement the request processing method as described in any one of claims 5-7; The server and the client perform business interactions to implement the request processing method as described in claim 8.
12. A computer device, characterized in that, The computer device includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the data request processing method or request processing method as described in any one of claims 1-7.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the data request processing method or request processing method as described in any one of claims 1-7.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data request processing method or request processing method as described in any one of claims 1-7.