A method and system for saving multi-level data of pages in steps based on Redis
By using the multi -level data saving method of multi -level data storage and management pages in complex business scenarios, the problem of data loss, slow interface response, and page stuttering are solved, and efficient data management and user experience are improved.
Patent Information
- Application Number
- CN202410168914.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-02-06
AI Technical Summary
In complex business scenarios, when the user enters data, the refresh page has been filled in with data, the data is lost, too much data is submitted at one time, and the interface response is slow, and too many components of the page rendering are stuttered.
Adopt a Redis-based method of saving multi-level data on the page step by step, obtain the form field data of the business scenario, disperse it in various sub-pages, store and update the data in Redis, and determine the display based on business rules and page cache results Which subpages are finally aggregated and saved on submission.
Realizing the data of the data and continuing editing, avoiding the loss of data, reducing the interface response time, increasing the user experience, and simplifying the process of cache management and data submission.
Smart Images

Figure CN118035184B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of page data processing, and in particular to a method and system for saving multi-level page data in steps based on Redis. Background Art
[0002] In some complex business scenarios, filling in data on the front-end page may involve dozens to hundreds of field input boxes. There are mainly the following ways to save and submit the page.
[0003] Method 1: There is only one Save button on the data filling page. After the user fills in all the required forms, click the Save button and submit at one time. Method 2: On the data filling page, after grouping the field input boxes, design multiple Save buttons and one Submit button on the same page. After each click of the Save button, the front end updates the data cache, and finally clicks Submit to submit the cached data at one time. Method 3: On the data filling page, after grouping the field input boxes, break them up into multiple sub-pages, design a Next button or Previous button for each sub-page, and add a Save and Submit button to the last sub-page. In the process, after filling in a sub-page, the data is first cached by the front end, and then click Next to enter the next sub-page to fill in and cache the data again, and finally submit the data at one time. Method 4: Based on Method 3, add a Save button to each sub-page, and add data in the draft state if the business scenario allows. The data in this state supports repeated modification and saving.
[0004] In actual applications, methods 1 and 2 have the following shortcomings: when there are many fields, the user stays on the same page for too long, the login time may expire, and refreshing the page will cause all the data filled in by the user to be lost. The first page loading will also render slowly and freeze. Submitting all the data on the page at one time will also result in slow interface response, which is not a good user experience. Method 3 has the following shortcomings: it is saved in multiple steps, each step is cached by the front end, and clicking the previous step can echo the filled data, which can be modified again, but when the page is refreshed, the page data will also be lost. Although method 4 solves the problem of data loss when refreshing the page, each sub-page save button realizes the addition or update of the current page data, and realizes the persistent storage of draft data through frequent interaction with the back-end interface. It is generally stored through relational databases, such as Mysql, Oracle, etc.; however, this method is limited by the usage scenario, increases the data in the draft state, and has a high complexity for the back-end interface implementation, which needs to meet the addition and update of each sub-page data. The final one-time submission of all sub-page data still has the problem of relatively slow interface response.
[0005] Therefore, how to provide a multi-level data step-by-step method for pages to solve problems such as the loss of filled-in data when refreshing the page when users enter data in complex business scenarios, slow interface response caused by submitting too much data at one time, and page jamming caused by too many components rendering, has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] In view of this, in order to overcome the deficiencies of the prior art, the present invention aims to provide a method and system for saving multi-level data of pages in steps based on Redis.
[0007] According to a first aspect of the present invention, a method for saving multi-level data of a page in steps based on Redis is provided, the method comprising:
[0008] Obtain the form field data of the business scenario, and scatter the obtained form field data of the business scenario in each sub-page;
[0009] When you click the Next button to enter the target subpage from the current subpage, first store the form field data that has passed the business rule verification, and then decide whether to display the target subpage based on the page cache result of the target subpage;
[0010] When you click the Previous button to enter the target subpage from the current subpage, first update the form field data stored in Redis for the current subpage, and then decide whether to display the target subpage based on the page cache result of the target subpage;
[0011] When the Save Submit button is clicked, the form field data stored in Redis for the current subpage is updated first, and then the form field data for all subpages are aggregated and submitted for saving.
[0012] Preferably, in the method of saving multi-level data of pages in steps based on Redis of the present invention, the acquired form field data of the business scenario is dispersed in sub-pages, including: dispersing the acquired form field data of the business scenario in each sub-page according to business rules, and the business rules include field type restriction rules, field length restriction rules, attachment type restriction rules, attachment size restriction rules and attachment quantity restriction rules.
[0013] Preferably, in the method for saving multi-level page data based on Redis in steps of the present invention, when entering the target sub-page from the current sub-page by clicking the next button, the form field data verified by the business rule is first stored, and then whether to display the target sub-page is determined according to the page cache result of the target sub-page, including:
[0014] When the Next button is clicked, the front-end page calls the page cache update interface to perform business rule verification on the form field data in the current sub-page. If the form field data in the current sub-page passes the business rule verification, the form field data scattered in the current sub-page is stored according to whether there is a user login scenario in the current sub-page.
[0015] When entering the target subpage, call the page cache query interface to query the cache data. When the page cache query interface obtains the cache data, the corresponding target subpage is displayed; when the page cache query interface does not obtain the cache data, the corresponding target subpage is not displayed.
[0016] Preferably, in the method for saving multi-level page data in steps based on Redis of the present invention, according to whether there is a user login scenario in the current sub-page, the form field data dispersed in the current sub-page is stored, including:
[0017] If there is a user login scenario in the current subpage, the user identity uid is used as the key in Redis, and the form field data in the current subpage is stored in Redis using a hash data structure;
[0018] If there is no user login scenario in the current sub-page, call the page cache update interface to generate a user identity uid for the current operating user according to the IP address parameter, use the generated user identity uid as the key in Redis, and use the hash data structure to store the form field data in the current sub-page in Redis.
[0019] Preferably, in the method of saving multi-level page data in steps based on Redis of the present invention, a page cache update interface is called to generate a user identity uid for the current operating user according to the IP address parameter, including: using the MD5 digest value of the IP address as the user identity uid of the current operating user.
[0020] Preferably, in the method of saving multi-level page data step by step based on Redis of the present invention, when entering the target sub-page, the page cache query interface is called to query the cache data, including: calling the page cache query interface to query the cache data according to the user identity uid and the target sub-page number.
[0021] Preferably, in the method for saving multi-level page data based on Redis in steps of the present invention, when entering the target sub-page from the current sub-page by clicking the previous button, the form field data stored in Redis of the current sub-page is updated first, and then whether to display the target sub-page is determined according to the page cache result of the target sub-page, including:
[0022] When the previous button is clicked, the front-end page calls the page cache update interface to perform business rule verification on the form field data in the current sub-page. If the form field data in the current sub-page passes the business rule verification, the form field data stored in Redis for the current sub-page is updated;
[0023] When entering the target subpage, call the page cache query interface to query the cache data. When the page cache query interface obtains the cache data, the corresponding target subpage is displayed; when the page cache query interface does not obtain the cache data, the corresponding target subpage is not displayed.
[0024] Preferably, the method of saving multi-level page data in steps based on Redis of the present invention also includes: when the cancel button is clicked, calling the page cache cancel interface according to the user identity uid to delete the form field data of the page corresponding to the current operating user from Redis.
[0025] Preferably, in the method for saving multi-level data of a page based on Redis in steps of the present invention, when the save submit button is clicked, the form field data stored in Redis of the current sub-page is updated first, and then the form field data of all sub-pages are aggregated and submitted for saving, including:
[0026] When the Save Submit button is clicked, the front-end page calls the page cache update interface to perform business rule verification on the form field data in the current sub-page. If the form field data in the current sub-page passes the business rule verification, the form field data stored in Redis for the current sub-page is updated;
[0027] Call the submission interface based on the user identity uid to aggregate the form field data of all sub-pages and persist them in the corresponding database for storage, and delete the form field data of the corresponding page of the current operating user based on the user identity uid.
[0028] According to a second aspect of the present invention, a system for saving multi-level page data in steps based on Redis is provided, the system comprising a step-by-step saving server, the step-by-step saving server being used to: obtain form field data of business scenarios, and scatter the obtained form field data of business scenarios in each sub-page; when entering a target sub-page from a current sub-page by clicking a Next button, firstly store the form field data verified by the business rules, and then decide whether to display the target sub-page according to the page cache result of the target sub-page; when entering a target sub-page from a current sub-page by clicking a Previous button, first update the form field data stored in Redis of the current sub-page, and then decide whether to display the target sub-page according to the page cache result of the target sub-page; when clicking a Save Submit button, first update the form field data stored in Redis of the current sub-page, and then aggregate the form field data of all sub-pages and submit for saving.
[0029] According to a third aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect of the present invention when executing the program.
[0030] The present invention is based on the method and system for saving multi-level data of pages in steps based on Redis, which has the following beneficial technical effects:
[0031] In complex form submission scenarios, the general page step-by-step solution is continued to avoid the problem of freezing caused by rendering too many components on the same page.
[0032] The Redis hash data structure is used for storage, and the user identity uid is used as the key to implement cross-browser echo and continue editing operations. Data is not lost when refreshing the page, which is applicable to a wider range of scenarios.
[0033] The deletion of the user-level cache involved in each step and the independent update of each sub-page cache are simpler and more convenient. There is no need to fully refresh the user cache data in each step, and the interface response is faster.
[0034] In the final submission operation, all form data is submitted at once in the traditional solution, resulting in a larger transmission data packet and more fields to be verified at one time, making the interface respond more slowly. The present invention avoids the transmission of large amounts of data in the front-end and back-end interactions and the data verification of submitting too many fields at one time. In the back-end interface, only the verified cached data needs to be obtained according to the user ID and directly saved in the database, which results in a faster response. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 It is a schematic diagram of a system for a method for saving multi-level data of pages based on Redis in steps applicable to an embodiment of the present invention;
[0037] Figure 2 This is an example diagram of a front-end operation page according to a method according to an embodiment of the present invention;
[0038] Figure 3 It is an execution flow chart of a method for saving multi-level data of pages based on Redis in steps according to an embodiment of the present invention;
[0039] Figure 4 Another execution flow chart of the method for saving multi-level data of pages based on Redis in steps according to an embodiment of the present invention;
[0040] Figure 5 This is an example diagram of a data structure stored in Redis by the method of an embodiment of the present invention;
[0041] Figure 6 A schematic diagram of the structure of the device provided by the present invention. DETAILED DESCRIPTION
[0042] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0043] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.
[0044] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0045] Figure 1 An exemplary system for a method of saving multi-level page data in steps based on Redis is shown, which is applicable to an embodiment of the present invention. Figure 1 As shown, the system may include a step-by-step storage server 101, a communication network 102 and / or one or more step-by-step storage clients 103. Figure 1 The example in the figure is a plurality of step-by-step saving clients 103. The Redis relied on in this embodiment is a non-relational database, one of the NoSQL databases, and a key-value storage middleware running on memory.
[0046] The step-by-step saving server 101 can be any appropriate server for storing information, data, programs and / or any other suitable type of content. In some embodiments, the step-by-step saving server 101 can perform appropriate functions. For example, in some embodiments, the step-by-step saving server 101 can be used to save multi-level page data step by step based on Redis. As an optional example, in some embodiments, the step-by-step saving server 101 can be used to obtain form field data of a business scenario, and disperse the obtained form field data of the business scenario in each sub-page; when entering the target sub-page from the current sub-page by clicking the next button, the form field data verified by the business rule is first stored, and then the target sub-page is displayed according to the page cache result of the target sub-page; when entering the target sub-page from the current sub-page by clicking the previous button, the form field data stored in Redis of the current sub-page is first updated, and then the target sub-page is displayed according to the page cache result of the target sub-page; when clicking the save submit button, the form field data stored in Redis of the current sub-page is first updated, and then the form field data of all sub-pages are aggregated and submitted for saving.
[0047] As another example, in some embodiments, the step-by-step saving server 101 may send a method for step-by-step saving of multi-level data of a page based on Redis to the step-by-step saving client 103 for user use according to a request of the step-by-step saving client 103 .
[0048] As an optional example, in some embodiments, the step-by-step saving client 103 is used to provide a visual step-by-step saving interface, which is used to receive a user's selection input operation based on the Redis step-by-step saving page multi-level data, and, in response to the selection input operation, obtain the step-by-step saving interface corresponding to the option selected by the selection input operation from the step-by-step saving server 101 and display the step-by-step saving interface, wherein the step-by-step saving interface at least displays information based on the Redis step-by-step saving page multi-level data and operation options for the information based on the Redis step-by-step saving page multi-level data. Figure 2The following is an example diagram of a front-end operation page according to a method according to an embodiment of the present invention.
[0049] In some embodiments, the communication network 102 can be any suitable combination of one or more wired and / or wireless networks. For example, the communication network 102 can include any one or more of the following: the Internet, an intranet, a wide area network (WAN), a local area network (LAN), a wireless network, a digital subscriber line (DSL) network, a frame relay network, an asynchronous transfer mode (ATM) network, a virtual private network (VPN) and / or any other suitable communication network. The step-by-step preservation client 103 can be connected to the communication network 102 via one or more communication links (e.g., communication link 104), and the communication network 102 can be linked to the step-by-step preservation server 101 via one or more communication links (e.g., communication link 105). The communication link can be any communication link suitable for transmitting data between the step-by-step preservation client 103 and the step-by-step preservation server 101, such as a network link, a dial-up link, a wireless link, a hard-wired link, any other suitable communication link or any suitable combination of such links.
[0050] The step-by-step saving client 103 may include any one or more clients that present an interface related to the multi-level data of the Redis-based step-by-step saving page in an appropriate form for use and operation by the user. In some embodiments, the step-by-step saving client 103 may include any suitable type of device. For example, in some embodiments, the step-by-step saving client 103 may include a mobile device, a tablet computer, a laptop computer, a desktop computer, and / or any other suitable type of client device.
[0051] Although the step-by-step saving server 101 is illustrated as one device, in some embodiments, any appropriate number of devices may be used to perform the functions performed by the step-by-step saving server 101. For example, in some embodiments, multiple devices may be used to implement the functions performed by the step-by-step saving server 101. Alternatively, a cloud service may be used to implement the functions of the step-by-step saving server 101.
[0052] Based on the above system, an embodiment of the present invention provides a method for saving multi-level data of pages in steps based on Redis, which is described below through the following embodiments.
[0053] Figure 3 FIG. 1 is an execution flow chart of a method for saving multi-level page data step by step based on Redis according to an embodiment of the present invention; Figure 3 As shown, the method for saving multi-level data of a page based on Redis in steps of this embodiment can be executed on a step-by-step saving server, and the method for saving multi-level data of a page based on Redis in steps includes the following steps:
[0054] First, in the method of this embodiment, it is necessary to first obtain the form field data of the business scenario, and then disperse the obtained form field data of the business scenario in each sub-page.
[0055] As an optional example, the method of this embodiment disperses the acquired form field data of the business scenario in each sub-page according to the business rules. For example, in the method of this embodiment, the business rules include field type restriction rules, field length restriction rules, attachment type restriction rules, attachment size restriction rules, and attachment quantity restriction rules. When implementing the method of the present invention, those skilled in the art may select other required business rules or configure other suitable business rules according to the actual application scenario, and this embodiment does not limit this. It should be noted that the method of this embodiment may also configure the number of form field data obtained by each sub-page before dispersing the form field data of the business scenario in each sub-page, and allocate corresponding form field data to each sub-page according to the number of configured form field data during subsequent dispersion.
[0056] Figure 4 Another execution flow of the method for saving multi-level page data in steps based on Redis according to an embodiment of the present invention. Figure 4 As shown, after the form field data of the business scenario is dispersed to each sub-page, the method of this embodiment can save the multi-level data of the page step by step in the following manner:
[0057] When entering the target subpage from the current subpage by clicking the Next button, the form field data verified by the business rules is first stored, and then a decision is made whether to display the target subpage based on the page cache result of the target subpage.
[0058] As an optional example, when the Next button is clicked, the front-end page calls the page cache update interface to perform business rule verification on the form field data in the current sub-page. If the form field data in the current sub-page passes the business rule verification, the form field data scattered in the current sub-page is stored based on whether there is a user login scenario in the current sub-page.
[0059] Specifically, if there is a user login scenario in the current subpage, the user identity uid is used as the key in Redis, and the form field data in the current subpage is stored in Redis using a hash data structure. It should be noted that Redis supports multiple data structure storages, and those skilled in the art can also select other data structure storages according to actual business scenarios when implementing the method of the present invention, and this embodiment does not limit this.
[0060] If there is no user login scenario in the current subpage, call the page cache update interface to generate a user identity uid for the current operating user according to the IP address parameter, use the generated user identity uid as the key in Redis, and use the hash data structure to store the form field data in the current subpage in Redis. It should be noted that in the method of this embodiment, the MD5 digest value of the IP address is used as the user identity uid of the current operating user. When implementing the method of the present invention, those skilled in the art can also select other IP address parameters according to the actual business scenario to generate a user identity uid for the current operating user. As long as the generated user identity uid does not change when refreshing the page or changing the browser, this embodiment does not limit this. Figure 5 This is an example diagram of the data structure stored in Redis according to the embodiment of the present invention.
[0061] When entering the target subpage, the page cache query interface is called to query the cache data. When the page cache query interface obtains the cache data, the corresponding target subpage is displayed; when the page cache query interface does not obtain the cache data, the corresponding target subpage is not displayed. It should be noted that in the method of this embodiment, the page cache query interface is called to query the cache data according to the user identity uid and the target subpage number.
[0062] When you enter the target subpage from the current subpage by clicking the Previous button, first update the form field data stored in Redis for the current subpage, and then decide whether to display the target subpage based on the page cache result of the target subpage.
[0063] As an optional example, in the method of this embodiment, when the previous button is clicked, the front-end page calls the page cache update interface to perform business rule verification on the form field data in the current sub-page. If the form field data in the current sub-page passes the business rule verification, the form field data stored in Redis for the current sub-page is updated; when entering the target sub-page, the page cache query interface is called to query the cache data. When the page cache query interface obtains the cache data through query, the corresponding target sub-page is displayed; when the page cache query interface does not obtain the cache data through query, the corresponding target sub-page is not displayed. In the method of this embodiment, the page cache query interface is called to query the cache data based on the user identity uid and the target sub-page number.
[0064] In the method of this embodiment, the form field data of the corresponding page can also be deleted from Redis. As an optional example, when the cancel button is clicked, the page cache cancellation interface is called according to the user identity uid to delete the form field data of the corresponding page of the current operating user from Redis.
[0065] When the Save Submit button is clicked, the form field data stored in Redis for the current subpage is updated first, and then the form field data for all subpages are aggregated and submitted for saving.
[0066] As an optional example, in the method of the embodiment of the present invention, when the Save Submit button is clicked, the front-end page calls the page cache update interface to perform business rule verification on the form field data in the current sub-page. If the form field data in the current sub-page passes the business rule verification, the form field data stored in Redis for the current sub-page is updated; the submission interface is called according to the user identity uid to aggregate the form field data of all sub-pages and persist them to the corresponding database for storage, and the form field data of the corresponding page of the current operating user is deleted according to the user identity uid.
[0067] The method and system of the present embodiment, which is based on Redis and saves multi-level data of pages in steps, continue the general page step-by-step solution in complex form submission business scenarios, avoiding the problem of freezing caused by rendering too many components on the same page; through the Redis hash type data structure storage, and the design of using the user identity uid as the key, cross-browser echo continues the editing operation, refreshes the page data without loss, and has a wider range of applicable scenarios; the deletion of the user-level cache involved in each step and the independent update of each sub-page cache are simpler and more convenient, and there is no need to fully refresh the user cache data in each step, and the interface response is faster; in the final submission operation, all form data is submitted at one time in the traditional solution, resulting in a larger transmission data packet and more fields to be verified at one time, making the interface response slower. The present invention avoids the transmission of large amounts of data in the front-end and back-end interactions and the data verification of submitting too many fields at one time. In the back-end interface, it is only necessary to obtain the cached data that has passed the verification according to the user ID and directly save it into the warehouse, which has a faster response.
[0068] like Figure 6 As shown, the present invention also provides a device, including a processor 310, a communication interface 320, a memory 330 for storing a computer program executable by the processor, and a communication bus 340. The processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 implements the above-mentioned method of saving multi-level page data step by step based on Redis by running the executable computer program.
[0069] Among them, the computer program in the memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0070] The system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected based on actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0071] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0072] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for saving multi-level data of pages in steps based on Redis, characterized in that: The method comprises: Obtain the form field data of the business scenario, and scatter the obtained form field data of the business scenario in each sub-page; When you click the Next button to enter the target subpage from the current subpage, first store the form field data that has passed the business rule verification, and then decide whether to display the target subpage based on the page cache result of the target subpage; When you click the Previous button to enter the target subpage from the current subpage, first update the form field data stored in Redis for the current subpage, and then decide whether to display the target subpage based on the page cache result of the target subpage; When the Save Submit button is clicked, the form field data stored in Redis for the current subpage is updated first, and then the form field data for all subpages are aggregated and submitted for saving.
2. The method for saving multi-level data of a page based on Redis in steps according to claim 1 is characterized in that: The obtained form field data of the business scenario is dispersed in the sub-pages, including: according to the business rules, the obtained form field data of the business scenario is dispersed in each sub-page, and the business rules include field type restriction rules, field length restriction rules, attachment type restriction rules, attachment size restriction rules and attachment quantity restriction rules.
3. The method for saving multi-level data of pages based on Redis in steps according to claim 1 is characterized in that: When you click the Next button to enter the target subpage from the current subpage, first store the form field data that has passed the business rule verification, and then decide whether to display the target subpage based on the page cache result of the target subpage, including: When the Next button is clicked, the front-end page calls the page cache update interface to perform business rule verification on the form field data in the current sub-page. If the form field data in the current sub-page passes the business rule verification, the form field data scattered in the current sub-page is stored according to whether there is a user login scenario in the current sub-page. When entering the target subpage, call the page cache query interface to query the cache data. When the page cache query interface obtains the cache data, the corresponding target subpage is displayed; when the page cache query interface does not obtain the cache data, the corresponding target subpage is not displayed.
4. The method for saving multi-level data of pages based on Redis in steps according to claim 3 is characterized in that: Depending on whether there is a user login scenario in the current sub-page, the form field data scattered in the current sub-page is stored, including: If there is a user login scenario in the current subpage, the user identity uid is used as the key in Redis, and the form field data in the current subpage is stored in Redis using a hash data structure; If there is no user login scenario in the current sub-page, call the page cache update interface to generate a user identity uid for the current operating user according to the IP address parameter, use the generated user identity uid as the key in Redis, and use the hash data structure to store the form field data in the current sub-page in Redis.
5. The method for saving multi-level page data based on Redis in steps according to claim 4 is characterized in that: The page cache update interface is called to generate a user identity uid for the current operating user according to the IP address parameter, including: using the MD5 digest value of the IP address as the user identity uid of the current operating user.
6. The method for saving multi-level data of pages based on Redis in steps according to claim 3 is characterized in that: When entering the target subpage, the page cache query interface is called to query the cache data, including: calling the page cache query interface to query the cache data according to the user identity uid and the target subpage number.
7. The method for saving multi-level data of pages based on Redis in steps according to claim 1 is characterized in that: When you click the Previous button to enter the target subpage from the current subpage, first update the form field data stored in Redis for the current subpage, and then decide whether to display the target subpage based on the page cache result of the target subpage, including: When the previous button is clicked, the front-end page calls the page cache update interface to perform business rule verification on the form field data in the current sub-page. If the form field data in the current sub-page passes the business rule verification, the form field data stored in Redis for the current sub-page is updated; When entering the target subpage, call the page cache query interface to query the cache data. When the page cache query interface obtains the cache data, the corresponding target subpage is displayed; when the page cache query interface does not obtain the cache data, the corresponding target subpage is not displayed.
8. The method for saving multi-level page data based on Redis in steps according to claim 1 is characterized in that: The method also includes: when the cancel button is clicked, calling the page cache cancel interface according to the user identity uid to delete the form field data of the page corresponding to the current operating user from Redis.
9. The method for saving multi-level data of pages based on Redis in steps according to claim 1 is characterized in that: When you click the Save Submit button, the form field data stored in Redis for the current subpage is updated first, and then the form field data of all subpages are aggregated and submitted for saving, including: When the Save Submit button is clicked, the front-end page calls the page cache update interface to perform business rule verification on the form field data in the current sub-page. If the form field data in the current sub-page passes the business rule verification, the form field data stored in Redis for the current sub-page is updated; Call the submission interface based on the user identity uid to aggregate the form field data of all sub-pages and persist them in the corresponding database for storage, and delete the form field data of the corresponding page of the current operating user based on the user identity uid.
10. A system for saving multi-level page data in steps based on Redis, characterized in that: The system includes a step-by-step saving server, which is used to: obtain form field data of a business scenario, and disperse the obtained form field data of the business scenario in each sub-page; when entering a target sub-page from a current sub-page by clicking a next button, first store the form field data that passes the business rule verification, and then decide whether to display the target sub-page according to the page cache result of the target sub-page; when entering a target sub-page from a current sub-page by clicking a previous button, first update the form field data stored in Redis of the current sub-page, and then decide whether to display the target sub-page according to the page cache result of the target sub-page; When the Save Submit button is clicked, the form field data stored in Redis for the current subpage is updated first, and then the form field data for all subpages are aggregated and submitted for saving.
Citation Information
Patent Citations
Test data acquisition method and device, computer equipment and readable storage medium
CN111290948A
Page data caching method and related equipment thereof
CN115098810A