Page processing method and device, storage medium and electronic device
Patent Information
- Application Number
- CN202310150265.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-02-15
AI Technical Summary
高并发量的访问请求对于服务器的响应能力和数据库的响应能力都产生了较大压力,可能导致页面卡顿或者服务器崩溃等问题
[0029] On the other hand, embodiments of this application provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the page processing method described above.
Smart Images

Figure CN118503565B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to page processing methods, apparatus, storage media, and electronic devices. Background Technology
[0002] With the development of computer technology, users can obtain various kinds of information by accessing web pages. In the computer world, various information can be abstracted into attribute information for objects, thereby realizing data organization centered on objects. This results in a large number of access requests for object-related information during page browsing, and as the number of accesses continues to increase, the response pressure from these requests also increases. High-concurrency access requests put significant pressure on the server's and database's response capabilities, potentially leading to problems such as page lag or server crashes. Summary of the Invention
[0003] To address the technical problem that high-concurrency access requests can put significant pressure on server and database response capabilities, potentially leading to page lag or server crashes, this application provides page processing methods, apparatus, storage media, and electronic devices.
[0004] On one hand, embodiments of this application provide a page processing method applied to a first server, the method comprising:
[0005] Get at least two access requests sent by the second server respectively. The second server corresponding to the access request does not have a page corresponding to the access request. Each access request includes the corresponding access object.
[0006] Each access request is clustered based on the access object to obtain at least one set of access requests, and the access requests in each set of access requests point to the same access object.
[0007] Determine the target access request in the target access request set, where the target access request set is any set of at least one access request set, and the target access request is any access request in the target access request set;
[0008] Generate target page information based on the information corresponding to the target object in the target access request;
[0009] The source addresses corresponding to each access request in the target access request set are deduplicated to obtain the source address set.
[0010] Send the target page information to the second server pointed to by each source address in the source address set. The second server pointed to by the source address is used to send the target page information to the target source address. The target source address is the source address of the access request received by the second server that is accessing the target object.
[0011] This application provides another page processing method applied to a second server, the method including:
[0012] On the other hand, this application embodiment also provides another page processing method, applied to a second server, the method including:
[0013] Get the access request and query the target page information corresponding to the access request;
[0014] If the target page information does not exist, send an access request to the first server;
[0015] The system receives target page information from a first server and sends the target page information to the target source address corresponding to the access request. The first server performs the following operations: acquires at least two access requests sent by second servers, each access request including a corresponding access object; performs clustering on each access request based on the access object to obtain at least one access request set, where each access request in the set points to the same access object; determines the target access request in the target access request set, where the target access request set is any one of the at least one access request sets, and the target access request is any one of the access requests in the target access request set; generates target page information based on the information corresponding to the target object in the target access request; performs deduplication on the source addresses corresponding to each access request in the target access request set to obtain a source address set; and sends the target page information to the second server pointed to by each source address in the source address set.
[0016] On the other hand, embodiments of this application provide a page processing apparatus applied to a first server, the apparatus comprising:
[0017] The first acquisition module is used to acquire at least two access requests sent by the second servers respectively. The second server corresponding to the access request does not have a page corresponding to the access request. Each access request includes the corresponding access object.
[0018] The clustering module is used to cluster each access request based on the access object, resulting in at least one set of access requests, where the access requests in each set of access requests point to the same access object.
[0019] The target access request module is used to determine the target access request in the target access request set. The target access request set is any set in at least one access request set, and the target access request is any access request in the target access request set.
[0020] The page generation module is used to generate target page information based on the information corresponding to the target object in the target access request;
[0021] The deduplication module is used to deduplicatize the source addresses corresponding to each access request in the target access request set, thereby obtaining the source address set.
[0022] The first sending module is used to send target page information to the second server pointed to by each source address in the source address set. The second server pointed to by the source address is used to send target page information to the target source address. The target source address is the source address of the access request received by the second server that is accessed with the target object as the access object.
[0023] On the other hand, embodiments of this application also provide another page processing apparatus, applied to a second server, the apparatus comprising:
[0024] The second acquisition module is used to acquire access requests and query the target page information corresponding to the access requests.
[0025] The second sending module is used to send an access request to the first server when the target page information does not exist;
[0026] The third sending module is used to receive target page information fed back by the first server and send the target page information to the target source address corresponding to the access request; wherein, the first server is used to perform the following operations: obtain at least two access requests sent by the second server respectively, each access request including a corresponding access object; perform clustering on each access request based on the access object to obtain at least one access request set, and the access requests in each access request set point to the same access object; determine the target access request in the target access request set, the target access request set being any set among the at least one access request set, and the target access request being any access request in the target access request set; generate target page information according to the information corresponding to the target object in the target access request; perform deduplication processing on the source addresses corresponding to each access request in the target access request set to obtain a source address set; and send the target page information to the second server pointed to by each source address in the source address set.
[0027] On the other hand, embodiments of this application provide a computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the page processing method described above.
[0028] On the other hand, embodiments of this application provide an electronic device, including at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the above-described page processing method by executing the instructions stored in the memory.
[0029] On the other hand, embodiments of this application provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the page processing method described above.
[0030] This application provides a page processing method that can process access requests sent by multiple second servers. By generating target page information for each access request pointing to the same access object from each second server, and responding to the second server corresponding to each access request pointing to the same access object with this target page information, the method completes the processing of concurrent requests from multiple servers. This reduces the processing pressure caused by the first server generating pages for each second server separately, effectively preventing server crashes due to excessive response volume. Furthermore, by obtaining target page information from the second server and returning it to the target source address indicated by multiple related access requests, the method completes concurrent responses to a large number of access requests, reducing page lag. Attached Figure Description
[0031] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram of a feasible implementation framework for the page processing method provided in the embodiments of this application;
[0033] Figure 2 This is a flowchart illustrating the page processing method provided in an embodiment of this application;
[0034] Figure 3 This is a schematic diagram illustrating the method for writing updated data to a data cache service and search directory provided in an embodiment of this application;
[0035] Figure 4 This is a schematic diagram of the latest version of the data synchronization method provided in the embodiments of this application;
[0036] Figure 5 This is a schematic diagram of the data return method provided in an embodiment of this application;
[0037] Figure 6 This is a schematic diagram of the page processing framework provided in an embodiment of this application;
[0038] Figure 7 This is a block diagram of the page processing apparatus provided in the embodiments of this application;
[0039] Figure 8 This is a block diagram of another page processing apparatus provided in the embodiments of this application;
[0040] Figure 9 This is a schematic diagram of the hardware structure of a device for implementing the method provided in the embodiments of this application. Detailed Implementation
[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the embodiments of this application.
[0042] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the present application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
[0043] To make the objectives, technical solutions, and advantages disclosed in the embodiments of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the embodiments of this application.
[0044] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "multiple" means two or more. To facilitate understanding of the above-described technical solutions and their resulting technical effects in the embodiments of this application, the embodiments of this application first explain the relevant technical terms:
[0045] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. It encompasses network technologies, information technologies, integration technologies, management platform technologies, and application technologies based on cloud computing business models. These technologies can form resource pools, allowing for flexible and convenient on-demand use. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, each resource may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.
[0046] Data caching service (Union): This data caching service stores updated data when data stored in the database is updated.
[0047] Binlog: This refers to the underlying operation log of the database, primarily used for master-slave replication and data recovery. The log records CRUD operations on the data. During master-slave replication, the master database synchronizes this log with the slave database, and the slave database replays the events in the log, thus achieving master-slave synchronization.
[0048] Kafka (Message Pipeline): A distributed data messaging service that doesn't process messages but acts as a message pipeline connecting senders and consumers. It retrieves messages from senders and then publishes them to receivers. Message pipelines are backed up on different machines for high availability. Furthermore, through partitioning, they can process messages in parallel, improving processing efficiency.
[0049] Self-developed local cache (Wuji): refers to a local caching library that caches data locally.
[0050] A webpage typically contains multiple clickable objects. When a user wants to learn more about a specific object, clicking it redirects to that object's details page. In related technologies, each time the server receives a request to access an object, it accesses the database to retrieve the object's details and generates the corresponding details page. However, in some special cases, the server may receive a large number of requests for the same object within a short period. Therefore, the server needs to repeatedly generate the same details page within this short timeframe. This sudden increase in access volume can cause database crashes, and the large processing load in a short period can also cause page generation to lag, preventing the server from returning the page correctly.
[0051] In view of this, this application proposes a page processing method. This method determines any one access request from among multiple access requests pointing to the same access object and generates a page only once for that request, which greatly reduces the processing load of the first server and improves the smoothness of processing. Then, the second server matches the generated page to multiple access requests pointing to the same object, thereby achieving efficient feedback to user requests and effectively improving the processing efficiency of user requests.
[0052] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating a feasible implementation framework of the page processing method provided in the embodiments of this specification, such as... Figure 1 As shown, this implementation framework may include at least a client 10 and a server 20. The client 10 and server 20 communicate via a network 30. This implementation framework can also be considered a page processing system. Server 20 includes at least two second servers and a first server. Server 20 can be a standalone physical server, a server cluster consisting of multiple physical servers, or a distributed system. Server 20 can also be located in a cloud environment, serving as a watermarking node within that cloud environment. This node can be any node within the cloud environment. By using server 20 in the cloud environment, data can be automatically synchronized and backed up by default, preventing data loss and saving on the hardware costs required by physical servers.
[0053] Each client 10 can send an access request to a second server in server 20. The first server in server 20 receives at least two access requests sent by the second servers respectively. The second server corresponding to the access request does not have a page corresponding to the access request. Each access request includes a corresponding access object. Clustering is performed on each access request based on the access object to obtain at least one set of access requests. The access requests in each set of access requests point to the same access object. The target access request in the target access request set is determined. The target access request set is any set of at least one access request set, and the target access request is any access request in the target access request set. Target page information is generated based on the information corresponding to the target object in the target access request. The source addresses corresponding to each access request in the target access request set are deduplicated to obtain a set of source addresses. The target page information is sent to the second server pointed to by each source address in the set of source addresses. The second server pointed to by the source address sends the target page information to the target source address. The target source address is the source address of the access request received by the second server that has the target object as the access object, i.e., the corresponding client 10.
[0054] The framework described in this application embodiment can provide the page processing capabilities required for applications in various scenarios, including but not limited to cloud technology, cloud gaming, cloud rendering, artificial intelligence, smart transportation, assisted driving, video media, smart communities, and instant messaging. Each component in this framework can be a terminal device or a server. Terminal devices include, but are not limited to, mobile phones, computers, intelligent voice exchange devices, smart home appliances, and in-vehicle terminals.
[0055] The following describes a page processing method according to an embodiment of this application. Figure 2 This document illustrates a flowchart of a page processing method provided in an embodiment of this application. This page processing method can be executed based on the server 20 described above. While this application provides the method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive methods. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual systems, terminal devices, or server products, the method can be executed sequentially according to the embodiments or accompanying drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). The above method may include:
[0056] Step S201: Obtain at least two access requests sent by the second servers respectively. The second server corresponding to the access request does not have a page corresponding to the access request. Each access request includes the corresponding access object.
[0057] In this embodiment of the disclosure, the access request may be issued by the client. Optionally, when user A clicks or swipes on an object in the client's application software, application program or website, the client issues an access request for that object. Optionally, obtaining access requests from at least two second servers can be achieved by having multiple access requests from multiple users first reach the external network for domain name configuration. After configuration, the load balancing service forwards the requests to at least two second servers. Alternatively, multiple second servers can be set up within region S to receive access requests from users in that region. For example, region S can be divided into multiple sub-regions A, B, C, etc., and a second server can be set up in each sub-region to receive access requests from the corresponding sub-region. For instance, if n access requests from n users in region S first reach the external network for domain name configuration, the load balancing service forwards the requests to the second server corresponding to each user. Access requests from users in sub-region A are forwarded to the second server in sub-region A for processing, access requests from users in sub-region B are forwarded to the second server in sub-region B for processing, and access requests from users in sub-region C are forwarded to the second server in sub-region C for processing. In this way, access requests from users within region S can be handled by multiple second servers, reducing the processing pressure on a single second server handling high-concurrency requests in region S and reducing the occurrence of response delays. Each second server matches the page corresponding to its received access request in its own server cache. After matching, each second server sends at least one access request (if no corresponding page exists) to the first server. The first server then receives the access requests from the second servers. For example, 50 users each send one access request through a client. These 50 requests first reach the external network for domain name configuration. After configuration, the load balancer forwards them to three second servers. Second server A receives 20 access requests, second server B receives 12, and second server C receives 18. Each second server matches the page corresponding to its received access request in its own server cache. After matching, if no corresponding page is found, second server A sends the 20 access requests (if no corresponding page exists) to the first server, second server B sends the 12 requests (if no corresponding page exists) to the first server, and second server C sends the 18 requests (if no corresponding page exists) to the first server. Optionally, the accessed object can be a transaction item in an application, application program, or website. Optionally, the access request may carry identification information of the corresponding access object, such as the access object's serial number or identifier.
[0058] Step S202: Cluster each access request based on the access object to obtain at least one set of access requests, and the access requests in each set of access requests point to the same access object.
[0059] In this embodiment, taking the first server receiving 50 access requests, each targeting one of three access objects, as an example, each access request carries corresponding access object identification information. When the access object is a traded item, the access object identification information is the traded item code, i.e., the traded item ID number. The 50 access requests are input into a clustering model, which includes the ID numbers of all traded items in the application software, application program, or website. The traded item ID number carried by each of the 50 access requests is matched with the ID number of each traded item in the model. For example, if access request 1 carries a traded item ID number of "1028", it is matched with the ID number of each traded item in the model. After a match is found with the traded item ID number "1028", the access request is placed into the access request set corresponding to the access request with the traded item ID number "1028". After the 50 access requests are matched, three non-empty access request sets are obtained. Therefore, the above three access request sets are output. In summary, clustering the 50 access requests based on the access object yields three sets of access requests: access requests in set A are all for traded item A, access requests in set B are all for traded item B, and access requests in set C are all for traded item C.
[0060] Step S203: Determine the target access request in the target access request set. The target access request set is any set in at least one access request set, and the target access request is any access request in the target access request set.
[0061] In this embodiment of the disclosure, optionally, access request set A contains 22 access requests for traded item A, access request set B contains 15 access requests for traded item B, and access request set C contains 13 access requests for traded item C. The target access request set can be any of the three access request sets. The target access request can be any access request in access request set A, access request set B, or access request set C. Optionally, the target access request can also be the access request that was sent earliest in the target access request set.
[0062] Step S204: Generate target page information based on the information corresponding to the target object in the target access request.
[0063] In this embodiment of the disclosure, generating target page information based on the information corresponding to the target object in the target access request includes the following steps:
[0064] Step S2041: Obtain first target data by accessing the first cache area. The first cache area is used to store first attribute data corresponding to each object and carrying version information. The first target data is first attribute data related to the target object and meets the preset version information requirements. The first target data belongs to the information corresponding to the target object.
[0065] In this embodiment, the first attribute data carries version information and is a type of long-term cached data that is only updated when the version information is updated. The first target data belongs to the first attribute data. When the target object is a traded item A, the first target data related to the target object can be the name of traded item A, the category of traded item A (e.g., daily necessities, food, digital devices, or furniture), reviews of traded item A, the basic inventory of traded item A, and recommendations for traded items related to traded item A. The first attribute data includes the name of each traded item, the category of each traded item (e.g., daily necessities, food, digital devices, or furniture), reviews of each traded item, the basic inventory of each traded item, and recommendations for traded items related to each traded item. The first attribute data is typically updated very infrequently; therefore, it carries version information during storage and is only updated when the version information is updated. Optionally, the first target data can be obtained by generating a first target data retrieval instruction based on the target access request and retrieving the first target data from the first cache according to the first target data retrieval instruction, or by matching the first target data corresponding to the access object identification information carried in the target access request in the first cache.
[0066] In this embodiment of the disclosure, obtaining the first target data includes:
[0067] Step S301: Access the first cache area. The first cache area is used to store the first attribute data corresponding to each object. The data cached in the first cache area carries version information.
[0068] In this embodiment of the disclosure, after the first server determines the target access request, it accesses the first cache area. The first cache area is used to store the first attribute data corresponding to each object. For example, when there are three items to be traded, the first cache area stores the first attribute data corresponding to item A, item B, and item C. The first attribute data is usually updated slowly, especially the item name, which usually does not change. Due to the large amount of first attribute data, the first cache area can be set up with multiple sub-cache areas. Optionally, the first attribute data can be stored in the first cache area according to the data attributes and stored in the corresponding sub-cache areas. For example, the data of the item name attribute is stored in the item name sub-cache area, and the data of the basic inventory attribute is stored in the basic inventory sub-cache area. Optionally, the first attribute data can be stored in the first cache area according to the storage space size of each sub-cache area. For example, the amount of first attribute data equivalent to the storage space size of sub-cache area a can be stored in sub-cache area a, and the remaining amount of first attribute data equivalent to the storage space size of sub-cache area b can be stored in sub-cache area b, until the first attribute data storage is complete, preventing data loss due to data overflow in a sub-cache area. The data cached in the first cache area carries version information to identify whether the data is the latest updated data.
[0069] Step S302: If the data cached in the first cache includes target data related to the target object, and the version information of the target data indicates that the target data is the latest version, then the target data is determined as the first target data.
[0070] In this embodiment, the target object is the object pointed to by the target request. Taking a traded item as an example, assuming there are three traded items, namely traded item A, traded item B, and traded item C, and the traded item pointed to by the target request is traded item A, then the target object is traded item A. The target data related to the target object can be the name, category, basic inventory, reviews, and related traded item recommendations of traded item A. Taking the basic inventory information of traded item A as an example, the data cached in the first cache area includes the basic inventory information corresponding to traded item A indicated by the target access request, and if the version information of the basic inventory information indicates that the basic inventory information is the latest version, then the basic inventory information is determined as the first target data. The name information and category information of traded item A are similarly handled. Optionally, the retrieval of the first target data for the same traded item adopts a single-concurrency mode, that is, the first attribute data of the same traded item is retrieved only once to prevent the impact on downstream concurrency caused by cache penetration.
[0071] As can be seen from the above, by setting a first cache area to cache the first attribute data corresponding to each object, the embodiments of this disclosure can realize the cache backup of the first attribute data and reduce data loss; by accessing the first cache area and determining the target data in the first cache area as the first target data, the direct access to the database can be reduced, thereby reducing the impact of high-concurrency requests on the database and protecting the stability of the database.
[0072] In an optional embodiment, obtaining the first target data further includes:
[0073] Step S303: If the data cached in the first cache does not include the target data, access the data cache service, determine the target data related to the target object in the data cache service as the first target data, the data cache service is used to cache the updated first attribute data in the database, and the database is used to store the full data related to each object.
[0074] In this embodiment, the data caching service stores updated first attribute data from the database. The target data indicated by the target access request can be the first attribute data corresponding to the traded item A pointed to by the target access request. The data cached in the first cache area does not include the target data indicated by the target access request, indicating that the first attribute data corresponding to traded item A has not yet been synchronized to the first cache area. The first attribute data corresponding to traded item A is stored in the data caching service. At this time, the data caching service should be accessed to determine the latest version of the target data corresponding to the target access request in the data caching service as the first target data. Optionally, the writing of the latest version of the target data here adopts a single-concurrency mode, that is, the latest version of the target data for the same traded item is only written once to prevent the impact on downstream concurrency caused by cache penetration.
[0075] or,
[0076] Step S304: If the data cached in the first cache area includes the target data, and the version information of the target data indicates that the target data is not the latest version, access the data cache service and determine the target data related to the target object in the data cache service as the first target data.
[0077] In this embodiment of the disclosure, the data cached in the first cache area includes target data, but the version information of the target data indicates that the target data is not the latest version. This means that after the target data is written into the first cache area, the target data in the database has been updated. Taking the name of the transaction item A as an example, the name of the transaction item A is cached in the first cache area. However, after caching, the name of the transaction item A has been updated. The latest version of the name of the transaction item A is stored in the data cache service. At this time, the data cache service should be accessed, and the name of the latest version of the transaction item A corresponding to the target access request in the data cache service should be determined as the first target data.
[0078] As can be seen from the above, this embodiment of the present disclosure uses a data caching service to record the updated first attribute data in the database, thereby realizing the copying and backup of the updated data in the database. Since the updated first attribute data is recorded in the data caching service, accessing the data caching service to determine the first target data can reduce the amount of direct access to the database, thereby reducing the impact of high-concurrency requests on the database and protecting the stability of the database.
[0079] In an optional embodiment, the method further includes writing target data related to the target object in the data caching service into a first cache area.
[0080] In this embodiment of the disclosure, the data caching service stores the updated first attribute data in the database, and writes the target data related to the target object in the data caching service into the first cache area, that is, writes the latest version of the first attribute data corresponding to the traded item A into the first cache area.
[0081] As can be seen from the above, this embodiment of the present disclosure achieves the synchronization of the latest version data to the first cache area by writing the target data related to the target object in the data caching service into the first cache area, ensuring the timeliness of the data in the first cache area, which helps to directly determine the target data of the latest version from the first cache area during the subsequent page generation process, and simplifies the data processing process.
[0082] In an optional embodiment, the above method further includes:
[0083] Step S401: Obtain the update status information of the database, which is used to store all data related to each object.
[0084] In this embodiment of the disclosure, obtaining the database update status information can be achieved by accessing the data version information in the database. If the data version has been updated, it can be determined that the database has been updated. The database is used to store all data related to each object. For example, the names, categories, basic inventory, reviews, coupons, related transaction item recommendations, promotional prices, real-time inventory, etc. of all traded items.
[0085] Step S402: If the update status information indicates that the stored data in the database has been updated, write the updated data to the log record. The updated data carries version information.
[0086] In this embodiment, the log is the database's underlying operation log (binlog), which is mainly used for database master-slave replication and data recovery. The log records CRUD operations on data in the database. During the data caching service's synchronization update process, the database synchronously records the log with the data caching service.
[0087] Step S403: Based on the log, write the updated data to the data cache service and the search directory. The search directory is used to retrieve object information.
[0088] In this embodiment of the disclosure, the data caching service replays the data in the log, thereby enabling the data caching service to store updated data. Furthermore, after the data caching service has finished storing the updated data, it can also write the updated data to a search directory for retrieval or management.
[0089] In an optional embodiment, the above implementation process is as follows: Figure 3 As shown, when a transaction item is available for listing, the management console uploads the item to the database (DB). The database performs internal full table and online table synchronization, and the binlog records this update to the data cache service (union). After storing the data, the data cache service sends a data synchronization message to the downstream via the message pipeline (Kafka). Specifically, the binlog message is transmitted to the message pipeline (Kafka), and the downstream completes the data update by parsing the message data.
[0090] In an optional embodiment, such as Figure 4 As shown, the process of synchronizing the latest version of data in this application can be as follows:
[0091] For each modification to the relevant information of the traded item, the latest version number information is obtained and synchronized to the data cache service (union) through the database (mysql) record log (binlog). After the data cache service (union) successfully stores the information, it sends a message for relay. The version number synchronization service receives the message and synchronizes the latest traded item version number information to the self-developed local cache. The self-developed local cache then synchronizes the final version number information to each sub-cache area storing the first attribute data.
[0092] Based on the above, this embodiment of the present disclosure, by employing a logging system capable of recording database update actions, can save all data addition, deletion, modification, and query operations to prevent data loss. By recording the logging system, the updated data is written to the data cache service and the search directory, enabling the synchronization of the updated data to the data cache service, facilitating the determination of the first target data from the data cache service. By writing the updated data to the search directory, the retrieval and management of object information can be achieved.
[0093] Step S2042: Obtain second target data by accessing the second cache area. The second cache area is used to store second attribute data corresponding to each object and carrying cache time information. The second target data is second attribute data related to the target object and meets the preset cache time requirements. The update frequency of the second attribute data is less than the update frequency of the first attribute data. The second target data belongs to the information corresponding to the target object.
[0094] In this embodiment, the second attribute data carries cache time information. The second attribute data is a type of data that is continuously updated in the cache. It typically changes frequently as transactions proceed, with a relatively high update frequency. An update will occur if the cache time exceeds a preset cache time requirement. The second target data belongs to the second attribute data category. The second attribute data includes information such as the price of each traded item, the real-time inventory of each traded item, and coupons for each traded item. When the target object is traded item A, the second target data related to the target object can be information such as the price of traded item A, the real-time inventory of traded item A, and coupons for traded item A. Optionally, the second target data can be obtained by generating a second target data retrieval instruction based on the target access request and retrieving the second target data from the second cache according to the second target data retrieval instruction; or by matching the second target data corresponding to the access object identification information carried in the target access request in the second cache.
[0095] In this embodiment of the disclosure, obtaining the second target data specifically includes the following steps:
[0096] Step S501: Access the second cache area, which is used to store the second attribute data corresponding to each object. The data cached in the second cache area carries cache time information.
[0097] In this embodiment of the disclosure, the second cache is used to store the second attribute data corresponding to each object. For example, when there are three items in total, the second cache stores the second attribute data corresponding to item A, item B, and item C. The data cached in the second cache carries cache time information, which is used to determine the time when the second attribute data is cached in the second cache.
[0098] Step S502: If the difference between the request time information and the cache time information is less than a preset threshold, the second attribute data related to the target object is determined as the second target data.
[0099] In this embodiment of the disclosure, since information such as inventory and price changes continuously over time, after the client sends a page access request, it is necessary to provide the client with the most up-to-date information such as inventory and price. When the difference between the request time information and the cache time information is less than a preset threshold, it indicates that the time when the access request was sent is almost the same as the time when the second attribute data is cached in the second cache area. The second attribute data related to the target object is determined as the second target data. For example, when the target object is a transaction item A, the second attribute data such as the price of transaction item A and the real-time inventory of transaction item A are determined as the second target data.
[0100] As can be seen from the above, by setting a second cache area to cache the second attribute data corresponding to each object, the embodiments of this disclosure can realize the cache backup of the second attribute data and reduce data loss; by accessing the second cache area and determining the target data in the second cache area as the second target data, the direct access to the database during the data determination process can be reduced, thereby reducing the impact of high-concurrency requests on the database and protecting the stability of the database.
[0101] Step S503: If the difference between the request time information and the cache time information is greater than a preset threshold, update the data cached in the second cache area to obtain the update result; determine the second attribute data related to the target object in the update result as the second target data.
[0102] In this embodiment of the disclosure, when the difference between the request time information and the cache time information is greater than a preset threshold, it indicates that the time difference between the user's request and the time when the second attribute data is cached in the second cache area is large. If the second attribute data corresponding to the target object cached in the second cache area at this time is determined as the second target data, the timeliness of the data cannot be guaranteed, and the data in the second cache area needs to be updated. Optionally, the update process can be to cache the latest second attribute data in the database into the second cache area according to a preset update frequency to obtain the update result, and determine the second attribute data related to the target object in the update result as the second target data, such as: the updated real-time inventory information related to the traded item A is determined as the second target data.
[0103] Based on the above, this embodiment of the present disclosure can determine whether the cached data in the second cache area meets the timeliness requirements of the data by comparing the request time information and the cache time information. When the difference between the request time information and the cache time information is greater than a preset threshold, the cached data in the second cache area is updated to ensure that the cached data in the second cache area always maintains its timeliness and guarantees the timeliness of the second target data.
[0104] Step S2033: Generate target page information based on the first target data and the second target data.
[0105] In this embodiment, the server's concurrent request processing capabilities for the first attribute data and the second attribute data are different. For the first attribute data, it is determined whether the first attribute data is dirty by comparing the version information of the data in at least one first cache area to see if it is the latest version. Therefore, the first attribute data is long-term, non-expiring data; the cached data is only updated when the version number changes. Because the first attribute data uses a non-expiring local cache, it can handle any high concurrency request pressure by infinitely expanding the machine; for example, using 20 machines with 8 cores and 8GB of memory can achieve a concurrency performance of 200,000+ / s, i.e., a processing capacity of 200,000+ per second. Therefore, for the second target data, which has a higher concurrent request processing capability than the second attribute data, the first attribute data needs to be used as a fallback to ensure the overall data availability. The above-mentioned generation of target page information based on the first and second target data includes the following steps:
[0106] Step S601: If the data volume is less than the data volume threshold, determine the target page information based on the first target data and the second target data.
[0107] In this embodiment of the disclosure, the data volume threshold is determined based on the server's concurrent processing capability for the second attribute data. If the data volume of the second target data is less than the data volume threshold within a preset time period, it indicates that the data volume of the second target data does not exceed the server's aggregation layer's concurrent processing capability for the second attribute data, and the server can complete the aggregation of the second target data. Therefore, the first target data and the second target data are aggregated by the aggregation layer to determine the target page information.
[0108] Step S602: When the data volume is greater than or equal to the data volume threshold, determine the first sub-data and the second sub-data based on the second target data. The first sub-data represents the data in the second target data that does not exceed the data volume threshold, and the second sub-data represents the data in the second target data that exceeds the data volume threshold.
[0109] In this embodiment of the disclosure, if the amount of the second target data within a preset time period exceeds a data volume threshold, it indicates that the amount of the second target data exceeds the concurrent processing capacity of the server aggregation layer for the second type of data, and the server cannot complete the processing of the second target data. In this case, the excess portion needs to be returned as a fallback using the first attribute data. Data in the second target data that does not exceed the preset data volume threshold is determined as the first sub-data, and data in the second target data that exceeds the preset data volume threshold is determined as the second sub-data.
[0110] Step S603: The data stored in the first cache that has the same data type as the second sub-data is identified as the third sub-data; based on the first sub-data, the third sub-data, and the first target data, the target page information is determined.
[0111] In this embodiment of the disclosure, taking the inventory information of traded items as an example, the inventory information of traded items included in the second sub-data is the updated real-time inventory quantity of traded items. The data in the first attribute data that has the same data type as the second sub-data, namely the basic inventory quantity of the traded items, is determined as the third sub-data. The first sub-data utilizes the concurrent processing capability of the server aggregation layer for the second attribute data, and the third sub-data and the first target data utilize the concurrent processing capability of the server aggregation layer for the first attribute data. The first sub-data, the third sub-data, and the first target data are aggregated to determine the target page information.
[0112] For example, such as Figure 5 As shown, the data aggregation layer has different processing capabilities for the first and second target data. Therefore, it's necessary to perform a fallback return of the first target data for any data in the second target data that exceeds a certain data volume threshold, ensuring the overall data availability. Figure 5 As shown: 200,000 requests per second arrive at the data aggregation layer. The data aggregation layer forwards these 200,000 requests per second to the corresponding services for the first and second target data. However, since the maximum concurrent processing capacity of the second target data service is 100,000 per second, 100,000 requests per second will not return a response. Meanwhile, the first target data service can fully support the 200,000 requests per second and return them normally. The data aggregation layer uses the first target data service to return the 100,000 requests that did not return a response. This completes the process of returning all 200,000 requests per second normally.
[0113] Based on the above, this embodiment of the disclosure designs different target page information generation processes for different amounts of second target data. When the amount of second target data is greater than the data volume threshold, the second target data exceeding the threshold is returned as a fallback using the first attribute data, which ensures the overall availability of the data, avoids the occurrence of unresponsive access requests due to the lack of return of some data, reduces the generation of blank pages, and improves the stability of the service.
[0114] Step S205: Perform deduplication on the source addresses corresponding to each access request in the target access request set to obtain the source address set.
[0115] In this embodiment of the disclosure, since each second server sends multiple access requests to the first server, taking second server A as an example, if second server A sends five access requests for traded item A to the first server, then the same source address corresponding to each of the five access requests is sent five times simultaneously. If the source addresses are not deduplicated, the same target page information corresponding to the five access requests will be sent to second server A five times, greatly increasing the unnecessary amount of data transmission. Therefore, deduplicating the source addresses can reduce the number of repeated transmissions. Optionally, deduplicating the source addresses corresponding to each access request in the target access request set can be performed by clustering the source addresses corresponding to each access request to determine the number of source address categories, and obtaining a source address set based on the source addresses indicated by each category of addresses.
[0116] Step S206: Send target page information to the second server pointed to by each source address in the source address set. The second server pointed to by the source address is used to send target page information to the target source address. The target source address is the source address of the access request received by the second server that uses the target object as the access object.
[0117] In this embodiment of the disclosure, sending target page information to the second server pointed to by each source address in the source address set can be done by configuring the data transmission format of the target page information to the data transmission format pointed to by the communication protocol between the second server pointed to by each source address in the source address set and the first server, and then sending the configured target page information to the second server pointed to by each source address in the source address set.
[0118] In an optional embodiment, the above method further includes:
[0119] Determine the template information corresponding to the target page information. The template information is used to record each account associated with the target object, as well as the page adaptation information corresponding to each account.
[0120] Optionally, in this embodiment of the disclosure, the template information is cached in the template cache library of the first server. Determining the template information corresponding to the target page information may involve searching in the template cache library of the first server for template information that matches the page type or page format indicated by the target page information.
[0121] Optionally, the target page information is sent to the second server pointed to by each source address in the source address set, including: sending the target page information and template information to the second server pointed to by each source address in the source address set. The second server pointed to by the source address is also used to determine the target page adaptation information in the template information according to the target account indicated by the access request when an access request related to the target object is obtained, generate page response information according to the target page information and the target page adaptation information, and return the page response information to the target source address.
[0122] In this embodiment of the disclosure, sending target page information and template information to the second server pointed to by each source address in the source address set can be achieved by integrating the target page information and the corresponding template information into a data packet, sending the data packet to the second server pointed to by each source address in the source address set, and the second server obtaining the target page information and template information by parsing the data packet. Optionally, sending target page information and template information to the second server pointed to by each source address in the source address set can be achieved by configuring the data transmission format of the data packet integrating the target page information and template information to the data transmission format pointed to by the communication protocol between the second server pointed to by each source address in the source address set and the first server, and sending the configured data packet integrating the target page information and template information to the second server pointed to by each source address in the source address set.
[0123] As can be seen from the above, this embodiment of the present disclosure determines the target page adaptation information in the template information according to the target account indicated by the access request, thereby achieving the matching of different page adaptation information for different accounts. By generating page response information based on the target page information and the target page adaptation information, and returning the page response information to the target source address, the personalized page adaptation of the same target page information for different accounts is completed, and the diversified presentation of the target page information is realized.
[0124] This application embodiment also provides another page processing method, applied to a second server, the method including the following steps:
[0125] Step S701: Obtain the access request and query the target page information corresponding to the access request.
[0126] In this embodiment, the access request is initiated by the user client. Specifically, when a user clicks on a specific item in their application software or application, the user client sends an access request for that item, carrying object information. Optionally, obtaining at least one access request can be achieved by first configuring a domain name after the user request reaches the external network, and then forwarding it to a second server by a load balancing service. The second server caches the page generated by the first server. After receiving the access request, the second server first checks its cached pages for target page information associated with the object pointed to by the access request.
[0127] Step S702: If the target page information does not exist, send an access request to the first server, receive the target page information returned by the first server, and send the target page information to the target source address corresponding to the access request.
[0128] In this embodiment of the disclosure, if no target page information exists, the second server sends an access request to the first server to trigger the first server to generate the corresponding target page information. The target page information returned by the first server is obtained and returned to the target source address indicated in the access request. Optionally, the target source address can be the client that generated the access request.
[0129] As can be seen from the above, by sending an access request to the first server when the target page information does not exist, this embodiment of the present disclosure can avoid repeatedly requesting the first server to generate the target page information when the second server has cached the corresponding target page information. This embodiment of the present disclosure helps to reduce the concurrency of access requests, reduce the processing load of the first server, and make the server's processing of access requests more efficient.
[0130] In an optional embodiment, the above method further includes:
[0131] Obtain the template information corresponding to the target page. The template information is used to record the accounts associated with the access object, as well as the page adaptation information corresponding to each account.
[0132] In this embodiment of the disclosure, obtaining the template information corresponding to the target page information may involve obtaining an integrated data packet containing the target page information and template information from a first server, and parsing the integrated data packet to obtain the template information corresponding to the target page information.
[0133] The first server determines the target page adaptation information from the template information based on the target account indicated by the access request, generates page response information based on the target page information and the target page adaptation information, and returns the page response information to the target source address; the first server is also used to determine the template information corresponding to the target page information; and sends the template information to the second server pointed to by each source address in the source address set.
[0134] In this embodiment of the disclosure, determining the target page adaptation information in the template information based on the target account indicated by the access request can be done by determining the target page adaptation information matching the user level of the target account in the template information, or by determining the target page adaptation information matching the account ID (account identification information) of the target account in the template information. Optionally, generating page response information based on the target page information and the target page adaptation information can be done when the target page information contains transaction item prices and coupon information corresponding to users of different levels. In this case, the final transaction item prices and coupon information presented in the target page information can be determined based on the target page adaptation information to obtain the page response information. For example, if the target page information contains both transaction item price and coupon information corresponding to users of level A and users of level B, and the target account is a user of level A, the price and coupon information presented in the page response information generated based on the target page information and the target page adaptation information will be the transaction item price and coupon information corresponding to users of level A. Optionally, generating page response information based on target page information and target page adaptation information can be achieved by setting the page presentation style for user A based on the target page adaptation information and the page response information generated according to the target page information corresponding to user A, provided that the target page adaptation information indicates the presentation style of the target page information.
[0135] As can be seen from the above, this embodiment of the present disclosure achieves the matching of different page adaptation information for different accounts by determining the target page adaptation information corresponding to the target account indicated by the access request in the template information. By generating page response information based on the target page information and the target page adaptation information, and returning the page response information to the target source address, the personalized page adaptation of the same target page information for different accounts is completed, and the diversified presentation of the target page information is realized.
[0136] In an optional embodiment, after sending the access request to the first server, the method further includes:
[0137] Obtain the target page information returned by the first server; establish the correspondence between the target page information and the object pointed to by the access request.
[0138] In this embodiment of the disclosure, after obtaining the target page information returned by the first server, the second server needs to establish a correspondence between the target page information and the object pointed to by the access request in order to correctly return the target page information to the corresponding access request. Optionally, establishing the correspondence between the target page information and the object pointed to by the access request can be achieved by matching the object identifier codes of the target page information and the object pointed to by the access request.
[0139] As can be seen from the above, by establishing a correspondence between target page information and the object pointed to by the access request, the embodiments of this disclosure can accurately link the object with the corresponding target page information, prevent errors in the return of target page information, and improve the accuracy of the return of target page information.
[0140] Step S703: If target page information exists, return the target page information to the source address indicated by the access request.
[0141] In this embodiment of the disclosure, if the second server has cached target page information corresponding to the access request, the first server does not need to generate the corresponding target page information again, and the target page information cached by the second server is returned to the source address indicated by the access request.
[0142] As can be seen from the above, by returning the target page information to the source address indicated by the access request when the target page information exists, this embodiment of the present disclosure can avoid repeatedly requesting the first server to generate the target page information when the second server has cached the corresponding target page information. This embodiment of the present disclosure helps to reduce the concurrency of access requests, reduce the processing load of the first server, and make the server's processing of access requests more efficient.
[0143] In one specific implementation, such as Figure 6 As shown, the entire framework of this disclosure consists of five layers:
[0144] 1. Business Layer. Includes: a client for sending asynchronous requests; a second service for receiving user requests and requesting the first service to perform page composition; and the first service for composing pages to obtain desired data details.
[0145] 2. Item Aggregation Layer. This layer primarily provides data adaptation, including data aggregation, data compatibility debugging, and protocol adaptation. It can also match user requests to the nearest server for page generation and perform data fallback operations.
[0146] 3. Item Recall Layer. This layer primarily comprises real-time aggregation of secondary target data related to the traded items and stable aggregation of primary target data. Different aggregation layers have varying caching and rate-limiting capabilities. For primary target data aggregation, multiple caching and rate-limiting circuit breakers ensure data validity. For secondary target data aggregation, local caching and rate-limiting capabilities provide real-time recall for downstream services. Here, primary target data provides basic static information about the traded items, while secondary target data ensures the real-time availability of inventory and promotional prices. If the secondary target data service fails, the aggregation layer service can use primary target data as a fallback, ensuring the stability of data recall.
[0147] 4. Heterogeneous Write Layer. For basic information messages related to traded items, write to the `union` basic information table; for basic inventory information, write to the `union` inventory table. Binlog synchronization is used here to improve data consistency across multiple storage locations.
[0148] 5. Downstream Dependency Layer: Microservices that the transaction item access service depends on (coupons, users, points, pricing, reviews, etc.)
[0149] Reference Figure 7 This application also provides a page processing apparatus applied to a first server, the apparatus comprising:
[0150] The first acquisition module 801 is used to acquire at least two access requests sent by the second servers respectively. The second server corresponding to the access request does not have a page corresponding to the access request. Each access request includes the corresponding access object.
[0151] Clustering module 802 is used to cluster each access request based on the access object to obtain at least one set of access requests, and the access requests in each set of access requests point to the same access object.
[0152] The target access request module 803 is used to determine the target access request in the target access request set, wherein the target access request set is any set in at least one access request set, and the target access request is any access request in the target access request set;
[0153] Page generation module 804 is used to generate target page information based on the information corresponding to the target object in the target access request;
[0154] The deduplication module 805 is used to deduplicatize the source addresses corresponding to each access request in the target access request set to obtain the source address set.
[0155] The first sending module 806 is used to send target page information to the second server pointed to by each source address in the source address set. The second server pointed to by the source address is used to send target page information to the target source address. The target source address is the source address of the access request received by the second server that uses the target object as the access object.
[0156] In an optional embodiment, the above apparatus further includes a template information module for performing the following steps:
[0157] Determine the template information corresponding to the target page information. The template information is used to record each account associated with the target object, as well as the page adaptation information corresponding to each account.
[0158] Upon receiving an access request related to the target object, the target page adaptation information is determined from the template information based on the target account indicated in the access request. The page response information is then generated based on the target page information and the target page adaptation information, and the page response information is returned to the target source address.
[0159] In an optional embodiment, the page generation module 804 is further configured to perform the following steps:
[0160] By accessing the first cache area, the first target data is obtained. The first cache area is used to store the first attribute data corresponding to each object and carrying version information. The first target data is the first attribute data related to the target object and meets the preset version information requirements. The first target data belongs to the information corresponding to the target object.
[0161] By accessing the second cache area, the second target data is obtained. The second cache area is used to store the second attribute data corresponding to each object and carrying cache time information. The second target data is the second attribute data related to the target object and meets the preset cache time requirements. The update frequency of the second attribute data is less than the update frequency of the first attribute data. The second target data belongs to the information corresponding to the target object.
[0162] Based on the first target data and the second target data, generate target page information.
[0163] In an optional embodiment, the page generation module 804 is further configured to perform the following steps:
[0164] If the data cached in the first cache includes target data related to the target object, and the version information of the target data indicates that the target data is the latest version, then the target data is identified as the first target data.
[0165] In an optional embodiment, the page generation module 804 is further configured to perform the following steps:
[0166] If the data cached in the first cache does not include the target data, the data cache service is accessed, and the target data related to the target object in the data cache service is determined as the first target data. The data cache service is used to cache the updated first attribute data in the database, and the database is used to store all data related to each object.
[0167] or,
[0168] If the data cached in the first cache area includes the target data, and the version information of the target data indicates that the target data is not the latest version, the data caching service is accessed, and the target data related to the target object in the data caching service is identified as the first target data.
[0169] In an optional embodiment, the above apparatus further includes: a writing module, configured to perform the following steps:
[0170] Write the target data related to the target object in the data caching service into the first cache area.
[0171] In an optional embodiment, the above apparatus further includes an update module for performing the following steps:
[0172] Retrieve update status information from the database, which stores all data related to each object;
[0173] When the update status information indicates that the stored data in the database has been updated, the updated data is written to the log, and the updated data carries version information.
[0174] Based on the logs, updated data is written to the data cache service and the search directory, which is used to retrieve object information.
[0175] In an optional embodiment, the target access request carries request time information, and the page generation module 804 is further configured to perform the following steps:
[0176] If the difference between the request time information and the cache time information is less than a preset threshold, the second attribute data related to the target object will be determined as the second target data.
[0177] In an optional embodiment, the page generation module 804 is further configured to perform the following steps:
[0178] If the difference between the request time information and the cache time information is greater than a preset threshold, the data cached in the second cache area is updated to obtain the update result; the second attribute data related to the target object in the update result is determined as the second target data.
[0179] In an optional embodiment, the page generation module 804 is further configured to perform the following steps:
[0180] Determine the amount of data for the second target within a preset time period;
[0181] If the amount of data is less than the data volume threshold, the target page information is determined based on the first target data and the second target data.
[0182] When the data volume is greater than or equal to the data volume threshold, the first sub-data and the second sub-data are determined based on the second target data. The first sub-data represents the data in the second target data that does not exceed the data volume threshold, and the second sub-data represents the data in the second target data that exceeds the data volume threshold.
[0183] Data stored in the first cache that has the same data type as the second sub-data is identified as the third sub-data; based on the first sub-data, the third sub-data, and the first target data, the target page information is determined.
[0184] Reference Figure 8 This application also provides another page processing apparatus for use on a second server, the apparatus comprising:
[0185] The second acquisition module 901 is used to acquire access requests and query the target page information corresponding to the access requests.
[0186] The second sending module 902 is used to send an access request to the first server when the target page information does not exist;
[0187] The third sending module 903 is used to receive target page information fed back by the first server and send the target page information to the target source address corresponding to the access request; wherein, the first server is used to perform the following operations: obtain at least two access requests sent by the second server respectively, each access request including a corresponding access object; perform clustering on each access request based on the access object to obtain at least one access request set, and the access requests in each access request set point to the same access object; determine the target access request in the target access request set, the target access request set being any set among the at least one access request set, and the target access request being any access request in the target access request set; generate target page information according to the information corresponding to the target object in the target access request; perform deduplication processing on the source addresses corresponding to each access request in the target access request set to obtain a source address set; and send the target page information to the second server pointed to by each source address in the source address set.
[0188] In an optional embodiment, the above-described apparatus further includes an adapter module for performing the following operations:
[0189] Obtain the template information corresponding to the target page information. The template information is used to record each account associated with the access object, as well as the page adaptation information corresponding to each account.
[0190] The first server determines the target page adaptation information from the template information based on the target account indicated by the access request, generates page response information based on the target page information and the target page adaptation information, and returns the page response information to the target source address; the first server is also used to determine the template information corresponding to the target page information; and sends the template information to the second server pointed to by each source address in the source address set.
[0191] In an optional embodiment, the above-described apparatus further includes:
[0192] The first return module is used to return the target page information to the source address indicated by at least two access requests, if the target page information exists.
[0193] In an optional embodiment, after sending an access request to the first server, the apparatus further includes a second return module for performing the following operations:
[0194] Obtain the target page information returned by the first server;
[0195] Establish a mapping between the target page information and the objects pointed to by at least two access requests.
[0196] The apparatus portion of the embodiments in this application is based on the same inventive concept as the method embodiment, and will not be described in detail here.
[0197] Furthermore, Figure 9 A schematic diagram of a hardware structure for implementing the method provided in the embodiments of this application is shown. This device can participate in or include the apparatus or system provided in the embodiments of this application. Figure 9 As shown, device 10 may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 9 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, device 10 may also include a... Figure 9 The more or fewer components shown, or having the same Figure 9 The different configurations shown.
[0198] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuitry are generally referred to herein as "data processing circuitry". This data processing circuitry may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be wholly or partially integrated into any other element within device 10 (or mobile device). As involved in the embodiments of this application, this data processing circuitry serves as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0199] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method described in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the page processing method described above. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the device 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0200] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of device 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a radio frequency (RF) module used for wireless communication with the Internet.
[0201] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of device 10 (or mobile device).
[0202] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some implementations, multitasking and parallel processing are also possible or may be advantageous.
[0203] The embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and server embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0204] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0205] The instructions in the aforementioned storage medium can execute a page processing method applied to the first server, the method including:
[0206] Get at least two access requests sent by the second server respectively. The second server corresponding to the access request does not have a page corresponding to the access request. Each access request includes the corresponding access object.
[0207] Each access request is clustered based on the access object to obtain at least one set of access requests, and the access requests in each set of access requests point to the same access object.
[0208] Determine the target access request in the target access request set, where the target access request set is any set of at least one access request set, and the target access request is any access request in the target access request set;
[0209] Generate target page information based on the information corresponding to the target object in the target access request;
[0210] The source addresses corresponding to each access request in the target access request set are deduplicated to obtain the source address set.
[0211] Send the target page information to the second server pointed to by each source address in the source address set. The second server pointed to by the source address is used to send the target page information to the target source address. The target source address is the source address of the access request received by the second server that is accessing the target object.
[0212] In an optional embodiment, the above method further includes:
[0213] Determine the template information corresponding to the target page information. The template information is used to record each account associated with the target object, as well as the page adaptation information corresponding to each account.
[0214] The system sends target page information and template information to the second server pointed to by each source address in the source address set. The second server pointed to by the source address is also used to determine the target page adaptation information in the template information according to the target account indicated by the access request when an access request related to the target object is obtained. The system generates page response information based on the target page information and the target page adaptation information and returns the page response information to the target source address.
[0215] In an optional embodiment, target page information is generated based on the information corresponding to the target object in the target access request, including:
[0216] By accessing the first cache area, the first target data is obtained. The first cache area is used to store the first attribute data corresponding to each object and carrying version information. The first target data is the first attribute data related to the target object and meets the preset version information requirements. The first target data belongs to the information corresponding to the target object.
[0217] By accessing the second cache area, the second target data is obtained. The second cache area is used to store the second attribute data corresponding to each object and carrying cache time information. The second target data is the second attribute data related to the target object and meets the preset cache time requirements. The update frequency of the second attribute data is less than the update frequency of the first attribute data. The second target data belongs to the information corresponding to the target object.
[0218] Based on the first target data and the second target data, generate target page information.
[0219] In an optional embodiment, obtaining the first target data by accessing the first cache includes:
[0220] If the data cached in the first cache includes target data related to the target object, and the version information of the target data indicates that the target data is the latest version, then the target data is identified as the first target data.
[0221] In an optional embodiment, obtaining the first target data by accessing the first cache area further includes:
[0222] If the data cached in the first cache does not include the target data, the data cache service is accessed, and the target data related to the target object in the data cache service is determined as the first target data. The data cache service is used to cache the updated first attribute data in the database, and the database is used to store all data related to each object.
[0223] or,
[0224] If the data cached in the first cache area includes the target data, and the version information of the target data indicates that the target data is not the latest version, the data caching service is accessed, and the target data related to the target object in the data caching service is identified as the first target data.
[0225] In an optional embodiment, the method further includes writing target data related to the target object in the data caching service into a first cache area.
[0226] In an optional embodiment, the above method further includes:
[0227] Retrieve update status information from the database, which stores all data related to each object;
[0228] When the update status information indicates that the stored data in the database has been updated, the updated data is written to the log, and the updated data carries version information.
[0229] Based on the logs, updated data is written to the data cache service and the search directory, which is used to retrieve object information.
[0230] In an optional embodiment, the target access request carries request time information, and the second target data is obtained by accessing the second cache, including:
[0231] If the difference between the request time information and the cache time information is less than a preset threshold, the second attribute data related to the target object will be determined as the second target data.
[0232] In an optional embodiment, obtaining the second target data by accessing the second cache includes:
[0233] If the difference between the request time information and the cache time information is greater than a preset threshold, the data cached in the second cache area is updated to obtain the update result; the second attribute data related to the target object in the update result is determined as the second target data.
[0234] In an optional embodiment, target page information is generated based on the first target data and the second target data, including:
[0235] Determine the amount of data for the second target within a preset time period;
[0236] If the amount of data is less than the data volume threshold, the target page information is determined based on the first target data and the second target data.
[0237] When the data volume is greater than or equal to the data volume threshold, the first sub-data and the second sub-data are determined based on the second target data. The first sub-data represents the data in the second target data that does not exceed the data volume threshold, and the second sub-data represents the data in the second target data that exceeds the data volume threshold.
[0238] Data stored in the first cache that has the same data type as the second sub-data is identified as the third sub-data; based on the first sub-data, the third sub-data, and the first target data, the target page information is determined.
[0239] The instructions in the aforementioned storage medium can execute a page processing method applied to a second server, the method including:
[0240] Get the access request and query the target page information corresponding to the access request;
[0241] If the target page information does not exist, send an access request to the first server;
[0242] The system receives target page information from a first server and sends the target page information to the target source address corresponding to the access request. The first server performs the following operations: acquires at least two access requests sent by second servers, each access request including a corresponding access object; performs clustering on each access request based on the access object to obtain at least one access request set, where each access request in the set points to the same access object; determines the target access request in the target access request set, where the target access request set is any one of the at least one access request sets, and the target access request is any one of the access requests in the target access request set; generates target page information based on the information corresponding to the target object in the target access request; performs deduplication on the source addresses corresponding to each access request in the target access request set to obtain a source address set; and sends the target page information to the second server pointed to by each source address in the source address set.
[0243] In an optional embodiment, the above method further includes:
[0244] Obtain the template information corresponding to the target page information. The template information is used to record each account associated with the access object, as well as the page adaptation information corresponding to each account.
[0245] The first server determines the target page adaptation information from the template information based on the target account indicated by the access request, generates page response information based on the target page information and the target page adaptation information, and returns the page response information to the target source address; the first server is also used to determine the template information corresponding to the target page information; and sends the template information to the second server pointed to by each source address in the source address set.
[0246] In an optional embodiment, the above method further includes:
[0247] If target page information exists, return the target page information to the source address indicated by at least two access requests.
[0248] In an optional embodiment, after sending an access request to the first server, the above method further includes:
[0249] Obtain the target page information returned by the first server;
[0250] Establish a mapping between the target page information and the objects pointed to by at least two access requests.
[0251] This application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the page processing method described above.
[0252] The above are merely preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present application should be included within the protection scope of the present application.
Claims
1. A page processing method, characterized in that, Applied to a first server, the method includes: Obtain at least two access requests sent by a second server, wherein the second server corresponding to the access request does not have a page corresponding to the access request, and each access request includes a corresponding access object; Each access request is clustered based on the access object to obtain at least one set of access requests, and the access requests in each set of access requests point to the same access object. Determine the target access request in the target access request set, wherein the target access request set is any set in the at least one access request set, and the target access request is any access request in the target access request set; Based on the information corresponding to the target object in the target access request, generate target page information; The source addresses corresponding to each access request in the target access request set are deduplicated to obtain the source address set. The target page information is sent to the second server pointed to by each source address in the source address set. The second server pointed to by the source address is used to send the target page information to the target source address. The target source address is the source address of the access request received by the second server that is accessed with the target object as the access object.
2. The method according to claim 1, characterized in that, The method further includes: Determine the template information corresponding to the target page information. The template information is used to record each account associated with the target object, and the page adaptation information corresponding to each account. Sending the target page information to the second server pointed to by each source address in the source address set includes: sending the target page information and the template information to the second server pointed to by each source address in the source address set. The second server pointed to by the source address is further configured to, upon receiving an access request related to the target object, determine the target page adaptation information in the template information based on the target account indicated by the access request, generate page response information based on the target page information and the target page adaptation information, and return the page response information to the target source address.
3. The method according to claim 1, characterized in that, The step of generating target page information based on the information corresponding to the target object in the target access request includes: By accessing the first cache area, first target data is obtained. The first cache area is used to store first attribute data corresponding to each object and carrying version information. The first target data is first attribute data related to the target object and meets the preset version information requirements. The first target data belongs to the information corresponding to the target object. By accessing the second cache area, second target data is obtained. The second cache area is used to store second attribute data corresponding to each object and carrying cache time information. The second target data is second attribute data related to the target object and meets the preset cache time requirement. The update frequency of the second attribute data is less than the update frequency of the first attribute data. The second target data belongs to the information corresponding to the target object. The target page information is generated based on the first target data and the second target data.
4. The method according to claim 3, characterized in that, The step of obtaining the first target data by accessing the first cache includes: If the data cached in the first cache area includes target data related to the target object, and the version information of the target data indicates that the target data is the latest version, then the target data is identified as the first target data.
5. The method according to claim 3 or 4, characterized in that, The step of obtaining the first target data by accessing the first cache area also includes: If the data cached in the first cache does not include the target data, the data caching service is accessed, and the target data related to the target object in the data caching service is determined as the first target data. The data caching service is used to cache the updated first attribute data in the database, and the database is used to store all data related to each object. or, If the data cached in the first cache area includes the target data, and the version information of the target data indicates that the target data is not the latest version, the data caching service is accessed, and the target data related to the target object in the data caching service is identified as the first target data.
6. The method according to claim 5, characterized in that: Write the target data related to the target object in the data caching service into the first cache area.
7. The method according to claim 1, characterized in that, The method further includes: Obtain update status information from the database, which is used to store all data related to each object; When the update status information indicates that the stored data in the database has been updated, the updated data is written to the log, and the updated data carries version information. Based on the recorded logs, the updated data is written to the data cache service and the search directory, which is used to retrieve object information.
8. The method according to claim 3, characterized in that, The target access request carries request time information, and the step of obtaining the second target data by accessing the second cache includes: If the difference between the request time information and the cache time information is less than a preset threshold, the second attribute data related to the target object is determined as the second target data.
9. The method according to claim 8, characterized in that, The step of obtaining the second target data by accessing the second cache includes: If the difference between the request time information and the cache time information is greater than a preset threshold, the data cached in the second cache area is updated to obtain an update result; the second attribute data related to the target object in the update result is determined as the second target data.
10. The method according to claim 3, characterized in that, The step of generating the target page information based on the first target data and the second target data includes: Determine the amount of the second target data within a preset time period; If the amount of data is less than the data volume threshold, the target page information is determined based on the first target data and the second target data. When the data volume is greater than or equal to the data volume threshold, a first sub-data and a second sub-data are determined based on the second target data. The first sub-data represents the data in the second target data that does not exceed the data volume threshold, and the second sub-data represents the data in the second target data that exceeds the data volume threshold. Data stored in the first cache that has the same data type as the second sub-data is identified as the third sub-data; the target page information is determined based on the first sub-data, the third sub-data, and the first target data.
11. A page processing method, characterized in that, Applied to a second server, the method includes: Obtain the access request and query the target page information corresponding to the access request; If the target page information does not exist, the access request is sent to the first server; Receive the target page information fed back by the first server, and send the target page information to the target source address corresponding to the access request; The first server is used to perform the following operations: Obtain at least two access requests sent by the second server, each of which includes a corresponding access object; Each access request is clustered based on the access object to obtain at least one set of access requests, and the access requests in each set of access requests point to the same access object. Determine the target access request in the target access request set, wherein the target access request set is any set in the at least one access request set, and the target access request is any access request in the target access request set; Based on the information corresponding to the target object in the target access request, generate target page information; The source addresses corresponding to each access request in the target access request set are deduplicated to obtain the source address set. The target page information is sent to the second server pointed to by each source address in the source address set.
12. The method according to claim 11, characterized in that, The method further includes: Obtain the template information corresponding to the target page information. The template information is used to record each account associated with the access object, and the page adaptation information corresponding to each account. The first server determines the target page adaptation information from the template information based on the target account indicated by the access request, generates page response information based on the target page information and the target page adaptation information, and returns the page response information to the target source address; the first server is also used to determine the template information corresponding to the target page information; and send the template information to the second server pointed to by each source address in the source address set.
13. A page processing apparatus, characterized in that, Applied to a first server, the device includes: The first acquisition module is used to acquire at least two access requests sent by the second servers respectively, wherein there is no page corresponding to the access request in the second server corresponding to the access request, and each access request includes a corresponding access object; The clustering module is used to cluster each of the access requests based on the access object to obtain at least one set of access requests, and the access requests in each set of access requests point to the same access object. The target access request module is used to determine a target access request in a target access request set, wherein the target access request set is any set in the at least one access request set, and the target access request is any access request in the target access request set; The page generation module is used to generate target page information based on the information corresponding to the target object in the target access request; The deduplication module is used to deduplicatize the source addresses corresponding to each access request in the target access request set to obtain a source address set. The first sending module is used to send the target page information to the second server pointed to by each source address in the source address set. The second server pointed to by the source address is used to send the target page information to the target source address. The target source address is the source address of the access request received by the second server that is accessed with the target object as the access object.
14. A page processing apparatus, characterized in that, The apparatus is applied to at least two second servers and includes: The second acquisition module is used to acquire access requests and query the target page information corresponding to the access requests. The second sending module is used to send the access request to the first server if the target page information does not exist; The third sending module is used to receive target page information fed back by the first server and send the target page information to the target source address corresponding to the access request; wherein, the first server is used to perform the following operations: obtain access requests sent by at least two second servers respectively, each access request including a corresponding access object; perform clustering on each access request based on the access object to obtain at least one access request set, and the access requests in each access request set point to the same access object; determine the target access request in the target access request set, the target access request set being any set among the at least one access request set, and the target access request being any access request in the target access request set; generate target page information according to the information corresponding to the target object in the target access request; perform deduplication processing on the source addresses corresponding to each access request in the target access request set to obtain a source address set; and send the target page information to the second server pointed to by each source address in the source address set.
15. An electronic device, characterized in that, The method includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements a page processing method as claimed in any one of claims 1-10, or a page processing method as claimed in any one of claims 11-12, by executing the instructions stored in the memory.
Citation Information
Patent Citations
Request processing method and device
CN111221862A
Data processing method, device and system, electronic equipment and storage medium
CN115357779A