A method, device and storage medium for data loading
By receiving front-end loading requests and generating category snapshot identifiers, the contradiction between category page linkage and reverse paging loading in e-commerce applications is solved, and accurate data updates and linkage displays are achieved, and data duplication and omissions are solved. The problem has improved system efficiency and user experience.
Patent Information
- Application Number
- CN202010226974.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-27
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2040-03-27
AI Technical Summary
E-commerce applications cannot be implemented simultaneously between category page linkage and reverse paging loading, resulting in duplication or omissions when data is updated.
By receiving front-end loading requests, a category snapshot identifier is generated, and compared with the cache identifier. If it is different, the data will be updated to realize the coordinated display of category and product information, which solves the problem of data out of synchronization and paging loading.
It realizes the coordinated display of category and product information, reduces system pressure, reduces data duplication and omissions, and improves user experience.
Smart Images

Figure CN113449229B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method, device and storage medium for loading data. Background Art
[0002] E-commerce applications generally have a category page linkage effect when displaying. When the user slides the classified products, the category currently scrolled to will be anchored and displayed on the display page. Currently, most applications pull all data at once or load in forward paging order, and a few applications can achieve reverse paging loading. Based on the aforementioned technical implementation issues, category linkage and reverse loading of most applications cannot be achieved at the same time. For example, when loading each category, it can only be loaded in forward order from page 0, or the reverse loading function is used. At this time, the category linkage function is abandoned, the category is flat, and there are no subcategories.
[0003] In addition, when loading in forward order, if the loaded data changes, the previously loaded data has been requested and rendered to the front end, and the changed data cannot be updated to the user; if new data is inserted into the front data on the server, the position of the back data will be moved back as a whole, and duplicate data may appear when the user loads the remaining page data; if the front data is deleted, the back data will be moved forward as a whole, and some data may be missed. In the process of reverse order loading, due to the addition or deletion of data, the problem of data duplication will also occur. Summary of the invention
[0004] The embodiment of the present application provides a method for loading data, which overcomes the problem that category and product information cannot be displayed in a linked manner and that duplicate or missing data is displayed.
[0005] The method includes:
[0006] Receive loading requests from the front end;
[0007] Reading a category snapshot corresponding to the loading request, and generating a first snapshot identifier corresponding to the current category snapshot based on the current category snapshot, wherein the category snapshot includes at least one commodity information included in the same category;
[0008] The first snapshot identifier is compared with the cached second snapshot identifier, and if they are the same, the product information and the category corresponding to the second snapshot identifier are displayed in conjunction with each other on the front end; otherwise, the product information and the category in the category snapshot corresponding to the first snapshot identifier are displayed in conjunction with each other on the front end.
[0009] Optionally, when the product information is edited, the category snapshot corresponding to the product information is triggered to be updated, and the category snapshot corresponding to the edited product information is generated.
[0010] Optionally, recording an editing time when the product information is edited, and storing the editing time and the corresponding first snapshot identifier;
[0011] Comparing the editing time with the generation time of the cached second snapshot identifier, and when the editing time is later than the generation time of the second snapshot identifier and the first snapshot identifier is different from the second snapshot identifier, filtering out difference data between the category snapshot corresponding to the first snapshot identifier and the category snapshot corresponding to the second snapshot identifier;
[0012] Based on the returned difference data, the product information and the category corresponding to the difference data are updated in the category snapshot corresponding to the cached second snapshot identifier, and are displayed in linkage on the front end.
[0013] Optionally, the product information and the category in the category snapshot corresponding to the first snapshot identifier are directly linked and displayed on the front end.
[0014] In another embodiment of the present invention, a data loading device is provided, the device comprising:
[0015] A receiving module, used to receive a loading request from the front end;
[0016] A generating module, configured to read the category snapshot corresponding to the loading request, and generate a first snapshot identifier corresponding to the current category snapshot based on the current category snapshot, wherein the category snapshot includes at least one commodity information included in the same category;
[0017] The first display module is used to compare the first snapshot identifier with the cached second snapshot identifier, and when they are the same, the product information and the category corresponding to the second snapshot identifier are displayed in a linked manner on the front end; otherwise, the product information and the category in the category snapshot corresponding to the first snapshot identifier are displayed in a linked manner on the front end.
[0018] Optionally, the device further comprises:
[0019] An updating module is used to trigger the updating of the category snapshot corresponding to the product information when the product information is edited, and to generate the category snapshot corresponding to the edited product information.
[0020] Optionally, a recording module is used to record the editing time when the product information is edited, and store the editing time and the corresponding first snapshot identifier;
[0021] a screening module, configured to compare the editing time with the generation time of the cached second snapshot identifier, and when the editing time is later than the generation time of the second snapshot identifier, and when the first snapshot identifier is different from the second snapshot identifier, screen out difference data between the category snapshot corresponding to the first snapshot identifier and the category snapshot corresponding to the second snapshot identifier;
[0022] The second display module is used to update the product information and the category corresponding to the difference data in the category snapshot corresponding to the cached second snapshot identifier based on the returned difference data, and perform linkage display on the front end.
[0023] Optionally, a third display module is used to display the product information and the category in the category snapshot corresponding to the first snapshot identifier directly on the front end in a linked manner.
[0024] In another embodiment of the present invention, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores instructions, and when the instructions are executed by a processor, the processor executes each step in the above-mentioned data loading method.
[0025] In another embodiment of the present invention, a terminal device is provided, including a processor, wherein the processor is used to execute each step in the above-mentioned data loading method.
[0026] Based on the above embodiment, first, a loading request from the front end is received, and secondly, the category snapshot corresponding to the loading request is read, and based on the current category snapshot, a first snapshot identifier corresponding to the current category snapshot is generated, wherein the category snapshot contains at least one product information contained in the same category, and finally, the first snapshot identifier is compared with the cached second snapshot identifier, and when they are the same, the product information corresponding to the second snapshot identifier and the category to which it belongs are displayed in conjunction on the front end, otherwise, the product information in the category snapshot corresponding to the first snapshot identifier and the category to which it belongs are displayed in conjunction on the front end. The embodiment of the present application sets the same first snapshot identifier for each category, so that the front end can more easily identify changes in the loaded data, and clears the cached data when it is different from the second snapshot identifier in the cache, that is, when the data has changed, and displays the updated data, thereby solving the problem that the product information in the loaded data is out of sync with the category to which it belongs, and the problem that the data loaded in the forward and reverse paging order is disordered. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 A schematic flow chart of a data loading method provided by embodiment 100 of the present application is shown;
[0029] Figure 2 A schematic diagram showing a specific process of a data loading method provided by embodiment 200 of the present application;
[0030] Figure 3 A schematic diagram showing the relationship between the first snapshot identifier and the category snapshot provided in an embodiment of the present application is shown;
[0031] Figure 4 A schematic diagram showing the connection between the category and product information provided in the embodiment of the present application;
[0032] Figure 5 A schematic diagram showing a specific process of another data loading method provided by embodiment 500 of the present application;
[0033] Figure 6 A schematic diagram showing a data loading device further provided by the embodiment 600 of the present application;
[0034] Figure 7 A schematic diagram of a terminal device provided in embodiment 700 of the present application is shown. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0036] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the implementation of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] Based on the problems in the prior art, an embodiment of the present application provides a method for loading data, which is mainly applicable to the field of Internet technology. Through the category snapshots corresponding to the products contained in each category, the time taken by the user to load data each time is reduced, and the system pressure is reduced. In addition, through the same category snapshot, different paging also returns the same snapshot identifier, making it easier for the front end to identify whether the data has changed, and clear the cached data when the snapshot identifier changes, solving the problems of data asynchrony and disordered data loading in forward and reverse paging. The technical solution of the present invention is described in detail with specific embodiments below to implement a method for loading data. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. As Figure 1 FIG. 1 is a flow chart of a method for loading data provided by embodiment 100 of the present application. The detailed steps are as follows:
[0038] S11, receiving a loading request from the front end.
[0039] In this step, during the running of the application, the user triggers the generation of a loading request on the front end, and the loading system receives the loading request from the front end. The loading system processes the received loading request to load the display content corresponding to the loading request on the front end. For example, when the user triggers a certain category on the front end, or performs operations such as pulling up or pulling down on the front end, the front end generates a loading request based on the user's operation and sends it to the loading system.
[0040] S12, reading the category snapshot corresponding to the loading request, and generating a first snapshot identifier corresponding to the current category snapshot based on the current category snapshot, wherein the category snapshot includes at least one commodity information included in the same category.
[0041] In this step, after receiving the loading request sent by the front end, the loading system reads the updated category snapshot corresponding to the loading request. Among them, the category snapshot contains at least one product information contained in the same category. The category is generally a classification of goods made by an online e-commerce platform to adapt to consumer users' targeted purchase of various goods in online stores. Therefore, the category generally includes at least one product information. Further, the loading system generates a category snapshot based on the product information and its category. Among them, the category snapshot is generally a fully usable copy of a data set about all product information under a specified category, and the copy includes an image of the corresponding data at a certain point in time (the time point when the copy starts). The category snapshot can be a copy of the data it represents, or a replica of the data.
[0042] Further, based on the category snapshot corresponding to the read load request, a first snapshot identifier corresponding to the category snapshot is generated, so that the front end can trigger the relevant refresh logic according to the first snapshot identifier. The front end is a paging request, where each page of product information under the same category uses the same first snapshot identifier.
[0043] S13, compare the first snapshot identifier with the cached second snapshot identifier, and if they are the same, display the product information and the category to which it belongs corresponding to the second snapshot identifier in a linked manner on the front end; otherwise, display the product information and the category to which it belongs in the category snapshot corresponding to the first snapshot identifier in a linked manner on the front end.
[0044] In this step, the loading system generally caches the second snapshot identifier of the category snapshot of the product information that has been displayed or loaded and the category to which it belongs. When there is a cache, the front end will compare the first snapshot identifier corresponding to the loading request with the cached second snapshot identifier. If they are consistent, the cached data is directly displayed on the front end, and the product information corresponding to the second snapshot identifier and the category to which it belongs are displayed in conjunction on the front end. If they are inconsistent, the cache is discarded, and the data returned by the loading system is used to display the product information in the category snapshot corresponding to the first snapshot identifier and the category to which it belongs in conjunction on the front end.
[0045] As described above, based on the above embodiment, first, the loading request of the front end is received, and secondly, the category snapshot corresponding to the loading request is read, and based on the current category snapshot, a first snapshot identifier corresponding to the current category snapshot is generated, wherein the category snapshot contains at least one product information contained in the same category, and finally, the first snapshot identifier is compared with the cached second snapshot identifier, and when they are the same, the product information corresponding to the second snapshot identifier and the category to which it belongs are displayed in conjunction on the front end, otherwise, the product information in the category snapshot corresponding to the first snapshot identifier and the category to which it belongs are displayed in conjunction on the front end. The embodiment of the present application sets the same first snapshot identifier for each category, so that the front end can more easily identify changes in the loaded data, and clears the cached data when it is different from the second snapshot identifier in the cache, that is, when the data has changed, and displays the updated data, thereby solving the problem that the product information in the loaded data is out of sync with the category to which it belongs, and the problem that the data loaded in the forward and reverse paging order is disordered.
[0046] like Figure 2 As shown, it is a schematic diagram of a specific process of a method for data loading provided by embodiment 200 of the present application. The detailed process of the specific process is as follows:
[0047] S201, receiving a loading request from a front end.
[0048] S202: If the product information is edited, update the corresponding category snapshot.
[0049] Here, when the product information is edited, the category snapshot corresponding to the product information is triggered to update, and a category snapshot corresponding to the edited product information is generated. Specifically, when the product information is edited, the operation edits the product information in the background (such as deleting product information, modifying product information, or adding product information, etc.), and a change notification is generated through the message queue to trigger the loading system. Furthermore, after receiving the change notification, the loading system will trigger a task to immediately update the currently stored category snapshot corresponding to the product information to update the product information in the category snapshot.
[0050] S203, reading the category snapshot corresponding to the loading request.
[0051] Here, obtaining product information by querying category snapshots is different from the prior art in that some applications have no snapshots of category data, and each request needs to first obtain category product information from the category system, and then query the product information from the product system, which improves the query speed.
[0052] S204: Based on the current category snapshot, generate a first snapshot identifier corresponding to the current category snapshot.
[0053] Here, according to the current category snapshot, the corresponding first snapshot identifier (Entity Tag, ETag) is generated, and then the front end can trigger the relevant refresh logic according to the Etag. Among them, the first snapshot identifier is generated by the loading system, and is used to identify the version of the product information and verify whether the product information has been modified. The category snapshot contains at least one product information contained in the same category. In addition, when displaying, the front end may need to make paging requests based on the size of the display page and the number of product information in the category. Each page of product data under the same category uses the same first snapshot identifier, rather than each page using an independent first snapshot identifier. When the paging size of the front end is different, there is no need to generate different snapshot identifiers for different paging sizes, which reduces the amount of calculation and reduces the server pressure. At the same time, the granularity is reduced. When the data of the product information contained in a certain category changes, it will not affect other category snapshots. Such as Figure 3 The figure is a schematic diagram of the relationship between the first snapshot identifier and the category snapshot shown in the embodiment of the present application. Each category snapshot may include multiple product information. Based on the conditional restrictions of the front-end display, multiple product information may need to be displayed in pages. Each page of product information under the same category snapshot carries the same first snapshot identifier.
[0054] S205: Determine whether there is a cache corresponding to the load request.
[0055] S206: When there is a cache, compare whether the first snapshot identifier and the second snapshot identifier are the same.
[0056] Here, when the front end requests data, it compares the snapshot identifier to compare the difference between the category snapshot in the local cache and the category snapshot currently requested from the loading system. If the Etag is different, it means that the cached data has changed, the current data has expired, and it is necessary to refresh and display new data to the user.
[0057] In addition, in addition to returning Etag, product information, paging size, current page number and total page number, the loading system will also return the indexes of all categories contained in the current category, so that when the front end displays to a certain position, its category will be displayed accordingly, so that the category and product information will have a linkage effect.
[0058] S207: When the information is the same or there is no cache, the product information and the category to which the product information corresponds to the second snapshot identifier are displayed in a linked manner on the front end.
[0059] In this step, when the first snapshot identifier and the second snapshot identifier are the same, the cache data corresponding to the second snapshot identifier is directly displayed in linkage on the front end. Figure 4As shown, it is a schematic diagram of the connection between the category and the product information shown in the embodiment of the present application. Among them, there are two categories under the category of "Soy Products": <Category 1> and <Category 2>. When the user clicks on the "Soy Products" category, the first page of data under the category will be requested. The first page of data starts from <Category 1>. If the user slides down, the following paginated data will continue to be pulled. When the pulled paginated data contains the data of <Category 2>, the categories on the left will be linked, and <Category 2> will be highlighted.
[0060] S208: If they are different, the product information and the category to which it belongs in the category snapshot corresponding to the first snapshot identifier are displayed in a linked manner on the front end.
[0061] Here, if the first snapshot identifier and the second snapshot identifier are different, it means that the cached data has been modified. At this time, it is necessary to display the modified data on the front end, and the product information and the category to which it belongs in the category snapshot corresponding to the first snapshot identifier should be displayed in conjunction on the front end.
[0062] Furthermore, in addition to clearing data by judging the snapshot identifier, the embodiment of the present application can also implement more complex incremental judgments, by jointly judging the editing time and the snapshot identifier, comparing the version and data update, and updating only the changed product information in the cache that has been requested to the front end, thereby implementing a more sophisticated local refresh function and reducing traffic consumption. Figure 5 As shown, another schematic diagram of a specific process of a method for data loading is provided for the embodiment 500 of the present application. After the above step S204, the following steps are also included:
[0063] S501, recording the editing time when the product information is edited, and storing the editing time and the corresponding first snapshot identifier.
[0064] Here, when the product information is modified, the modification operation is triggered, and the editing time of the modification is recorded and converted to generate Ctag. When the product information is modified multiple times, the editing time and modification content of the most recent modification are retained.
[0065] S502: Determine whether there is a cache corresponding to the loading request.
[0066] S503: When there is a cache, compare the editing time with the generation time of the cached second snapshot identifier.
[0067] S504: When the editing time is later than the generation time of the second snapshot identifier, compare whether the first snapshot identifier is the same as the second snapshot identifier.
[0068] S505: When they are different, filter out difference data between the category snapshot corresponding to the first snapshot identifier and the category snapshot corresponding to the second snapshot identifier.
[0069] Here, the difference data mainly includes the following situations:
[0070] Insert product information: Returns the location where the product information is inserted and the specific data of the product information. The front end will insert the difference data at the specified location in the cached image snapshot when displaying.
[0071] Delete product information: Returns the location where the product information is deleted. The front end will delete the product information at the specified location when displaying it.
[0072] Update product information: Returns the location of the updated product information and the data of the product information. The front end updates the specified product information when displaying.
[0073] S506: Based on the returned difference data, update the product information and the category to which the difference data corresponds in the category snapshot corresponding to the cached second snapshot identifier, and display them in a linked manner on the front end.
[0074] S507, if there is no cache or the editing time is before the generation time of the cached second snapshot identifier or the first snapshot identifier is the same as the second snapshot identifier, the product information and the category to which it belongs in the category snapshot corresponding to the second snapshot identifier are directly displayed in linkage on the front end.
[0075] This application implements the above-mentioned data loading method based on the above steps. By actively generating category snapshots through the loading system, the time taken by the user to request data each time is reduced, and the system pressure is reduced. Furthermore, by returning the same first snapshot identifier in different pages for the same category snapshot, it is easier for the front end to identify data changes, and cooperate with the front end to clear all data when it determines that the first snapshot identifier has changed, solving the problem of data asynchrony and disordered data loading in forward and reverse order. Figure 4 As shown, when the user clicks on the category "Soy Products", Category 1 will be automatically selected. At this time, it will be determined whether there is a cache. If there is no cache, the first page of data will be requested directly based on the first snapshot identifier; if there is a cache, the first snapshot identifier and the second snapshot identifier will be compared. If they are the same, the cached data will be directly displayed, and if they are different, the cached data will be discarded and the data corresponding to the first snapshot identifier will be used. If you slide down at this time, the paginated data will continue to be loaded as described above. If you slide up, the previous data will be pulled. In this process, once the snapshot identifier comparison is inconsistent, the data and cache operations will be cleared, which ensures that the user can see the latest data. In addition, the data is cleared when the data to be cleared is completely scrolled out of the screen to achieve user unawareness.
[0076] When the loading system receives a user request, it can use the first snapshot identifier ETag and the editing time Ctag values to query the category snapshot, and compare it with the latest category snapshot, compare the difference data in the two snapshot data, and then return only the difference data and cached data for display on the front end. By confirming the changed data through the two values of Etag and Ctag, a more fine-grained update is achieved, reducing traffic consumption. At the same time, the front end can cooperate to achieve partial refresh, further improving the user experience.
[0077] Based on the same inventive concept, the embodiment 600 of the present application further provides a data loading device, wherein: Figure 6 As shown, the device comprises:
[0078] The receiving module 61 is used to receive a loading request from a front end;
[0079] A generating module 62, configured to read the category snapshot corresponding to the loading request, and generate a first snapshot identifier corresponding to the current category snapshot based on the current category snapshot, wherein the category snapshot includes at least one commodity information included in the same category;
[0080] The first display module 63 is used to compare the first snapshot identifier with the cached second snapshot identifier, and when they are the same, the product information and the category corresponding to the second snapshot identifier are displayed in a linked manner on the front end; otherwise, the product information and the category in the category snapshot corresponding to the first snapshot identifier are displayed in a linked manner on the front end.
[0081] In this embodiment, the specific functions and interaction methods of the receiving module 61, the generating module 62 and the first display module 63 can be found in Figure 1 The description of the corresponding embodiments will not be repeated here.
[0082] Optionally, the device further comprises:
[0083] The updating module 64 is used to trigger the updating of the category snapshot corresponding to the product information when the product information is edited, and generate the category snapshot corresponding to the edited product information.
[0084] Optionally, the device further comprises:
[0085] A recording module 65, used to record the editing time when the product information is edited, and store the editing time and the corresponding first snapshot identifier;
[0086] A screening module 66, configured to compare the editing time with the generation time of the cached second snapshot identifier, and when the editing time is later than the generation time of the second snapshot identifier and the first snapshot identifier is different from the second snapshot identifier, screen out difference data between the category snapshot corresponding to the first snapshot identifier and the category snapshot corresponding to the second snapshot identifier;
[0087] The second display module 67 is used to update the commodity information and the category corresponding to the difference data in the category snapshot corresponding to the cached second snapshot identifier based on the returned difference data, and perform linkage display on the front end.
[0088] Optionally, the device further comprises:
[0089] The third display module 68 is used to display the product information and the category in the category snapshot corresponding to the first snapshot identifier directly on the front end.
[0090] like Figure 7 As shown, another embodiment 700 of the present application further provides a terminal device, including a processor 701, wherein the processor 701 is used to execute the steps of the above-mentioned method for loading data. Figure 4 It can also be seen that the terminal device provided in the above embodiment also includes a non-transitory computer-readable storage medium 702, on which a computer program is stored, and the computer program executes the steps of the above-mentioned data loading method when it is run by the processor 701. In practical applications, the terminal device can be one or more computers, as long as it includes the above-mentioned computer-readable medium and processor.
[0091] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, and FLASH, etc. When the computer program on the storage medium is run, each step in the above-mentioned method of loading data can be executed. In practical applications, the computer-readable medium can be included in the device / apparatus / system described in the above embodiments, or it can exist independently without being assembled into the device / apparatus / system. The above-mentioned computer-readable storage medium carries one or more programs, and when the above-mentioned one or more programs are executed, each step in the above-mentioned method of loading data can be executed.
[0092] According to the embodiments disclosed in the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof, but it is not used to limit the scope of protection of the present application. In the embodiments disclosed in the present application, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0093] The flow chart and block diagram in the accompanying drawings of the present application show the possible architecture, function and operation of the system, method and computer program product according to the various embodiments disclosed in the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in the order marked in different drawings. For example, the boxes represented by two connections can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0094] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, and all of these combinations and / or combinations fall within the scope disclosed in the present application.
[0095] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still change the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these changes, modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for loading data, characterized in that: include: Receive loading requests from the front end; Reading a category snapshot corresponding to the loading request, and generating a first snapshot identifier corresponding to the current category snapshot based on the current category snapshot, wherein the category snapshot includes at least one commodity information included in the same category; The first snapshot identifier is compared with the cached second snapshot identifier, and if they are the same, the product information and the category corresponding to the second snapshot identifier are displayed in conjunction with each other on the front end; otherwise, the product information and the category in the category snapshot corresponding to the first snapshot identifier are displayed in conjunction with each other on the front end.
2. The method according to claim 1, characterized in that Before the step of reading the category snapshot corresponding to the loading request, the method further includes: When the product information is edited, the category snapshot corresponding to the product information is triggered to be updated, and the category snapshot corresponding to the edited product information is generated.
3. The method according to claim 2, characterized in that After the step of generating a first snapshot identifier corresponding to the current category snapshot, the method further comprises: Recording the editing time when the product information is edited, and storing the editing time and the corresponding first snapshot identifier; Comparing the editing time with the generation time of the cached second snapshot identifier, and when the editing time is later than the generation time of the second snapshot identifier and the first snapshot identifier is different from the second snapshot identifier, filtering out difference data between the category snapshot corresponding to the first snapshot identifier and the category snapshot corresponding to the second snapshot identifier; Based on the returned difference data, the product information and the category corresponding to the difference data are updated in the category snapshot corresponding to the cached second snapshot identifier, and are displayed in linkage on the front end.
4. The method according to claim 3, characterized in that After the step of generating a first snapshot identifier corresponding to the current category snapshot, when there is no cache corresponding to the load request, the method further comprises: The product information and the category in the category snapshot corresponding to the first snapshot identifier are directly linked and displayed on the front end.
5. A data loading device, characterized in that: The device comprises: A receiving module, used to receive a loading request from the front end; A generating module, configured to read the category snapshot corresponding to the loading request, and generate a first snapshot identifier corresponding to the current category snapshot based on the current category snapshot, wherein the category snapshot includes at least one commodity information included in the same category; The first display module is used to compare the first snapshot identifier with the cached second snapshot identifier, and when they are the same, the product information and the category corresponding to the second snapshot identifier are displayed in a linked manner on the front end; otherwise, the product information and the category in the category snapshot corresponding to the first snapshot identifier are displayed in a linked manner on the front end.
6. The device according to claim 5, characterized in that The device further comprises: An updating module is used to trigger the updating of the category snapshot corresponding to the product information when the product information is edited, and to generate the category snapshot corresponding to the edited product information.
7. The device according to claim 5, characterized in that The device further comprises: a recording module, configured to record the editing time when the product information is edited, and store the editing time and the corresponding first snapshot identifier; a screening module, configured to compare the editing time with the generation time of the cached second snapshot identifier, and when the editing time is later than the generation time of the second snapshot identifier, and when the first snapshot identifier is different from the second snapshot identifier, screen out difference data between the category snapshot corresponding to the first snapshot identifier and the category snapshot corresponding to the second snapshot identifier; The second display module is used to update the product information and the category corresponding to the difference data in the category snapshot corresponding to the cached second snapshot identifier based on the returned difference data, and perform linkage display on the front end.
8. The device according to claim 5, characterized in that The device further comprises: The third display module is used to display the product information and the category in the category snapshot corresponding to the first snapshot identifier directly on the front end in a linked manner.
9. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores instructions, which, when executed by a processor, cause the processor to perform each step in the data loading method according to any one of claims 1 to 4.
10. A terminal device, characterized in that: The method comprises a processor, wherein the processor is used to execute each step in the data loading method according to any one of claims 1 to 4.
