Cross-page parameter transmission method and device, equipment and medium

By generating and matching parameter key-value pairs in the preset key-value pair format during cross-page delivery, the problems of excessive URLs and parameter exposure in the prior art are solved, efficient and safe parameter delivery is achieved, and web page performance is improved.

CN119892390APending Publication Date: 2025-04-25GUANGZHOU HUYA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411633588.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The existing cross-page parameter delivery method has loading problems caused by excessive URL, security risks of parameter exposure, and high development costs.

Method used

By generating a parameter key-value pair in the preset key-value pair format on the first page, and generating the first key data on the second page based on the identification information of the jump source page and the identification information of the second page, the second key data in the parameter key-value pair is found and matched to extract and pass the target parameters.

Benefits of technology

It effectively avoids the problem of excessive URL, improves the efficiency and accuracy of parameter delivery, ensures the privacy and security of parameter delivery, and reduces the workload of page loading and data caching, and improves the access speed and performance of web pages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892390A_ABST
    Figure CN119892390A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Internet, and discloses a cross-page parameter transmission method and device, equipment and a medium. The parameter transmission method comprises the steps of determining a jump target page of a first page and a to-be-transmitted target parameter; generating a parameter key value pair in a preset key value pair format based on the identification information of the first page, the identification information of the skipping target page and the target parameter; determining a jump source page of the second page; generating first key data in a preset key format based on the identification information of the jump source page and the identification information of the second page; searching second key data matched with the first key data in the parameter key value pair; and extracting a target parameter corresponding to the second key data to transmit the target parameter to the second page. According to the invention, the efficiency and accuracy of parameter transmission can be effectively improved, the resource cost can be saved, and the security and privacy of parameter transmission can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to a method, device, equipment and medium for transferring parameters across pages. Background Art

[0002] In traditional network applications, when users jump between different pages, they often need to pass parameters between pages to maintain the consistency of state information. The existing parameter passing method mainly relies on adding parameters to the URL (Uniform Resource Locator) to pass parameters. For example, if the target parameter "c=666" of page a is passed to page b in the same domain, the URL of page a may be "www.test.com / a.html", and the URL of page b may be "www.test.com / b.html?c=666".

[0003] However, with the development of Internet technology, the interaction between web pages is becoming more and more complex, and more and more parameters need to be transmitted, resulting in the parameter suffix of the target page being more and more lengthy. When the URL reaches a certain length, the URL often cannot be fully filled in, the page cannot be loaded, or the loading time is too long. The efficiency and accuracy of page jump and parameter transmission are extremely low. At the same time, since the target parameters often involve privacy information such as user identifiers, network addresses, and geographic addresses, the traditional parameter transmission method is prone to expose these privacy information, which poses a great security risk. In addition, the traditional method of adding parameters also requires presetting the loading mechanism of different URL pages and standardizing the caching method of page content, resulting in the need for cumbersome page configuration and multiple CDN (Content Delivery Network) back-to-source processing, which requires a large development cost and resource overhead. The traditional method is also unable to automatically delete the cached parameters, resulting in the appearance of dirty data, further increasing the occupancy of cached data and reducing the effectiveness and reliability of parameter transmission. Summary of the invention

[0004] The main purpose of the present invention is to provide a method, device, equipment and medium for transferring parameters across pages, aiming to solve the technical problem that the existing method for transferring parameters across pages has poor security.

[0005] A first aspect of the present invention provides a method for transferring parameters across pages, the method comprising:

[0006] Determine the jump target page of the first page and the target parameters to be passed;

[0007] Generate a parameter key-value pair in a preset key-value pair format based on the identification information of the first page, the identification information of the jump target page, and the target parameter;

[0008] Determine the jump source page of the second page;

[0009] Generate first key data in a preset key format based on the identification information of the jump source page and the identification information of the second page;

[0010] Searching for second key data in the parameter key-value pair that matches the first key data;

[0011] The target parameter corresponding to the second key data is extracted to transfer the target parameter to the second page.

[0012] Optionally, in a first implementation manner of the first aspect of the present invention, the second key data of the parameter key-value pair includes identification information of the first page and identification information of the jump target page;

[0013] The first key data includes identification information of the jump source page and identification information of the second page;

[0014] The searching for the second key data matching the first key data in the parameter key-value pair includes:

[0015] In response to determining that the identification information of the jump source page matches the identification information of the first page, and the identification information of the second page matches the identification information of the jump target page, it is determined that the second key data matches the first key data.

[0016] Optionally, in a second implementation manner of the first aspect of the present invention, after generating a parameter key-value pair in a preset key-value pair format based on the identification information of the first page, the identification information of the jump target page, and the target parameter, the method further includes:

[0017] long-term storage of the parameter key-value pairs based on a long-term storage, wherein the long-term storage is further used to determine the parameter key-value pairs matching the first key data in response to the received first key data;

[0018] After extracting the target parameter corresponding to the second key data to transfer the target parameter to the second page, the method further includes:

[0019] The target parameter is temporarily stored based on the session memory of the second page.

[0020] Optionally, in a third implementation of the first aspect of the present invention, the value data of the parameter key-value pair includes the target parameter and a generation timestamp;

[0021] After the parameter key-value pairs are stored for a long time based on the long-term storage, the method further includes:

[0022] Determining a generation time of the parameter key-value pair based on the generation timestamp;

[0023] In response to determining that the generation duration reaches a preset duration condition, deleting the corresponding parameter key-value pair from the long-term storage;

[0024] After extracting the target parameter corresponding to the second key data to transfer the target parameter to the second page, the method further includes:

[0025] Delete the corresponding parameter key-value pair in the long-term storage.

[0026] Optionally, in a fourth implementation manner of the first aspect of the present invention, after the session memory based on the second page temporarily stores the target parameter, the method further includes:

[0027] In response to a refresh instruction for the second page, the target parameter is obtained from the session memory.

[0028] Optionally, in a fifth implementation manner of the first aspect of the present invention, after the session memory based on the second page temporarily stores the target parameter, the method further includes:

[0029] In response to a jump instruction to leave the second page, the target parameter is deleted from the session memory.

[0030] Optionally, in a sixth implementation manner of the first aspect of the present invention, the long-term memory and the session memory are established based on a web page storage interface, or based on an index database.

[0031] A second aspect of the present invention further provides a cross-page parameter transfer device, the cross-page parameter transfer device comprising:

[0032] A first page processing module, used to determine a jump target page of the first page and a target parameter to be transmitted, and generate a parameter key-value pair in a preset key-value pair format based on the identification information of the first page, the identification information of the jump target page and the target parameter;

[0033] The second page processing module is used to determine the jump source page of the second page, generate the first key data in a preset key format based on the identification information of the jump source page and the identification information of the second page, search for the second key data matching the first key data in the parameter key-value pair, extract the target parameter corresponding to the second key data, and pass the target parameter to the second page.

[0034] The third aspect of the present invention also provides a computer device, which includes: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the computer device executes the cross-page parameter passing method as described above.

[0035] A fourth aspect of the present invention further provides a computer-readable storage medium, on which instructions are stored, and when the instructions are executed by a processor, the cross-page parameter transfer method as described above is implemented.

[0036] The embodiment of the present invention provides a method, device, equipment and storage medium for parameter transfer across pages. First, a parameter key-value pair in a preset key-value pair format is generated on a first page based on the identification information of the first page, the identification information of the jump target page and the target parameter. Then, on a second page, the corresponding target parameter is extracted based on the first key data determined by the identification information of the jump source page and the identification information of the second page, thereby effectively realizing parameter transfer across pages. The parameter transfer of the present invention does not require additional parameter addition to the URL, and can effectively avoid the problem that the URL cannot be written, the page cannot be loaded or the loading time is too long due to the URL being too long, improves the efficiency and accuracy of page jump and parameter transfer, and can also avoid the exposure of the target parameters, and ensure the privacy and security of parameter transfer. At the same time, the present invention can also effectively maintain the consistency of the identification information of the jump target page, greatly reducing the workload of page loading and data caching, so that the CDN can better cache the page content, improve the cache hit rate, reduce the frequency of CDN back to the source, and can effectively reduce the number of requests to the server, improve the access speed and performance of the web page, and save development costs and resource overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a schematic diagram of a first embodiment of a method for transferring parameters across pages in an embodiment of the present invention;

[0038] Figure 2 This is a functional module diagram of an embodiment of a device for transferring parameters across pages in an embodiment of the present invention;

[0039] Figure 3 The figure is a functional module diagram of an embodiment of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] 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 interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "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.

[0041] For ease of understanding, the specific process of the cross-page parameter transfer method in the embodiment of the present invention is described below. The cross-page parameter transfer method of this embodiment is applied to an electronic device, which can be a terminal, such as a smart phone, a laptop, a tablet computer, a desktop computer, etc., or a development board, a chip system, etc. Please refer to Figure 1 , Figure 1 The first embodiment of the method for transferring parameters across pages in the embodiment of the present invention is a flow chart of the first embodiment. In the embodiment, the method for transferring parameters across pages includes:

[0042] 101. Determine a jump target page of the first page and a target parameter to be transmitted;

[0043] In this embodiment, the first page is the source page where the target parameter is located, and the jump target page is the page that is automatically guided or redirected after jumping away from the first page. The jump target page can be determined by instructions such as filling in, clicking a link, triggering a control or a menu item, and the target parameter is the specific information in the first page that needs to be passed to the jump target page. It can be automatically generated and determined according to the parameter information passed by the previous page after opening the page, or it can be determined by the information manually input and selected by the user during use. The type of the target parameter can be text, number, date, timestamp or other data format, depending on the requirements and functions of the jump target page. For example, a first page is a product list page including multiple product items, and the jump target page is the product details page of one of the items. The target parameter may include information such as the product identifier, the trigger identifier, and the preferential policy identifier corresponding to the product list page. These parameters will be used to process and display the corresponding product information in the product details page of the jump target.

[0044] 102. Generate a parameter key-value pair in a preset key-value pair format based on the identification information of the first page, the identification information of the jump target page, and the target parameter;

[0045] In this embodiment, after the first page and the corresponding jump target page and target parameters are determined, a parameter key-value pair in a preset key-value pair format can be generated by taking the identification information of the first page, the identification information of the jump target page and the target parameters as objects. The identification information is a unique identifier for identifying different pages, i.e., a uniform resource identifier (URI), which can be in the form of identification information of a subset such as a uniform resource locator and a uniform resource name, as long as it can be obtained and determined through the jump target page later.

[0046] In this embodiment, the preset key-value pair format is a preset data format for transmitting the target parameter, which is presented in the format of a key-value pair to meet the data format requirements for subsequent long-term storage. The present application does not specifically limit the arrangement and expression of the key-value pair information, as long as the key name (key) of the preset key-value pair is consistent with the preset key format described later, and the key value (value) of the preset key-value pair format includes the corresponding target parameter. Taking the identification information as URL, the URL of the first page as www.test.com / a.html, the URL of the second page as www.test.com / b.html, the target parameter as c=666, the key name format of the preset key-value pair format as [current page URL+target page URL], and the key value format of the preset key-value pair format as {params:[parameters to be transmitted]} as an example, the parameter key-value pair of the preset key-value pair format generated according to the relevant information of the first page can correspond to {www.test.com / a.html+www.test.com / b.html:params:{c:666}}.

[0047] Optionally, in one embodiment, the value data of the parameter key-value pair includes a target parameter and a generation timestamp.

[0048] In this optional embodiment, a generation timestamp can be introduced into the parameter key-value pair to further manage the corresponding target parameters. The generation timestamp is used to identify the time when the parameter key-value pair is generated, and can be generated according to the time component of the page, the system time or other time identifiers. The introduction of the generation timestamp helps to manage the parameter key-value pair according to the generation duration corresponding to the generation timestamp to ensure the timeliness of the parameter key-value pair. Continuing with the above embodiment as an example, after the generation timestamp is introduced, the key value format of the preset key-value pair format can be improved to {params:[parameters to be passed], time: current time point}. Assuming that the current time point is 20240101120000, the corresponding generated parameter key-value pair can be {www.test.com / a.html+www.test.com / b.html:params:{c:666},time:20240101120000}.

[0049] This embodiment can ensure the integrity and consistency of data through the generation of the parameter key-value pair. When the parameter key-value pair is subsequently stored, it can ensure that the parameters are not easily lost or tampered with, and the required target parameters can be quickly obtained through the corresponding key name, thereby improving the efficiency and accuracy of parameter transmission. This method also does not require the modification of the identification information of the subsequent jump target page, thereby improving the jump efficiency, and also avoiding the problems of breaking the length limit and parameter exposure caused by adding too many additional parameters to the identification information such as the URL of the target page, further improving the security and privacy of page parameter transmission.

[0050] Optionally, in one embodiment, after generating a parameter key-value pair in a preset key-value pair format based on the identification information of the first page, the identification information of the jump target page and the target parameters, it also includes: long-term storage of the parameter key-value pair based on a long-term memory, wherein the long-term memory is also used to determine the parameter key-value pair that matches the first key data in response to the received first key data.

[0051] In this optional embodiment, after the generation of the parameter key-value pair is completed, the parameter key-value pair is stored for a long time based on a long-term storage device, so that the target parameters in the corresponding parameter key-value pair can be read from the long-term storage device after jumping to the target page. Among them, the long-term storage device is a persistent storage device used to store and manage the web browser, and the data stored therein can be stored permanently without being lost when the page is refreshed or closed, and the data therein can only be deleted in an active manner. The long-term storage device can be a storage space determined by a storage mechanism specific to the browser, or a storage space provided by a server such as a database, a cache system, and a cloud server, or a non-volatile memory in an electronic device, etc. As long as the parameter key-value pair can be stored and can be obtained through the key name of the key-value pair after leaving the first page and jumping to the jump target page, and can receive active deletion, it will be fine.

[0052] Optionally, in one embodiment, the long-term storage is established based on a web page storage interface, or based on an index database.

[0053] In this optional embodiment, the long-term storage is preferably established based on a network storage (WebStorage) interface, and the network storage interface can specifically be a development method provided by LocalStorage (local storage) adopted in existing Web technology, wherein LocalStorage is a local storage mechanism based on the browser, which can provide a large storage space and has good cross-session persistence. Through LocalStorage, the parameter key-value pairs can be persistently stored on the user's local device. Even if the browser window is closed, these parameters can still be retained until they are explicitly cleared or cleared due to expiration. The corresponding parameter key-value pairs are not easily lost, which can ensure the effectiveness and reliability of subsequent processing. In addition, with the development of Web technology, more network storage methods similar to LocalStorage's long-term storage mechanism will be derived. As long as the parameter key-value pairs can be stored and can be obtained through the key name of the key-value pair after leaving the first page and jumping to the jump target page, they can be understood to be within the protection scope of this solution. Establishing the long-term storage through the web page storage interface can further improve the accessibility and convenience of data.

[0054] In this optional embodiment, the long-term storage can also be established based on an indexed database (IndexedDB), which is a browser-based client storage technology that provides a way to store a large amount of structured data on the user's local device, which can effectively reduce the impact of the network on the page data. The indexed database can also store data in the form of key-value pairs, support indexing, and can efficiently query and retrieve data. Through the indexed database, efficient management of parameter key-value pairs can be achieved, and users can access this data even in an offline state. The storage of parameter key-value pairs can utilize the characteristics of the indexed database and be achieved by creating a database and an object storage space. By storing the generated parameter key-value pairs in the form of key-value pairs in the object storage space, an index can be set for each parameter key-value pair during the storage process to facilitate subsequent rapid retrieval.

[0055] This optional embodiment provides an efficient, secure and easy-to-manage cross-page parameter transfer method by using LocalStorage or a long-term storage mechanism based on IndexedDB. It not only ensures the integrity and consistency of data, but also improves the efficiency and accuracy of parameter transfer, while avoiding the modification of identification information such as the target page URL, and improving the security and privacy of page parameter transfer.

[0056] Optionally, in one embodiment, after writing the parameter key-value pair into the long-term storage, the method further includes:

[0057] (1) Determine the generation time of the parameter key-value pair based on the generation timestamp;

[0058] (2) In response to determining that the generation duration reaches a preset duration condition, deleting the corresponding parameter key-value pair from the long-term storage.

[0059] In this optional embodiment, the parameter key-value pair introduced with the generation timestamp is further processed. Based on the generation timestamp, the generation time of the parameter key-value pair can be determined by calculating the difference between the generation timestamp and the current time. When the generation time reaches the preset time condition, the corresponding parameter key-value pair is deleted from the long-term storage. For example, if the preset time condition is that the generation time is up to one hour and the generation timestamp is 12:00 on a certain day, the parameter key-value pair in the long-term storage will be deleted when it reaches 13:00 on the same day. The deletion method can be implemented by preset deletion signaling that is automatically triggered when the preset time condition is met, or by programmed scripts or applications. By deleting outdated parameter key-value pairs, it can be ensured that too much dirty data will not accumulate in the long-term storage, thereby effectively saving storage space and improving the operating efficiency of the storage, and improving the efficiency, accuracy and stability of the subsequent acquisition of the value data corresponding to the parameter key-value pair from the long-term storage.

[0060] 103. Determine the jump source page of the second page;

[0061] In the present embodiment, the second page is a web page different from the first page, and the jump source page jumps to the previous page of the jump source page, taking the commodity list page and the commodity details page in the aforementioned example as an example, if the second page is the commodity details page, the corresponding jump source page is the commodity list page. The jump source page can be obtained in a variety of ways, for example, it can be determined by parsing the Refer field in the HTTP (Hypertext Transfer Protocol, Hypertext Transfer Protocol) request header, and can also be obtained by reading the server log, reading the front-end router and using specific tracking tools. In the present embodiment, JavaScript is preferably used to obtain the jump source page of the second page, specifically, the URL of the corresponding page loaded into the current page can be obtained by the document.referrer attribute, i.e., the URL of the jump source page, so as to determine the corresponding jump source page. By the identification information of the second page and the identification information of the jump source page, the first key data for matching with the corresponding parameter key-value pair in long-term storage can be obtained later.

[0062] 104. Generate first key data in a preset key format based on the identification information of the jump source page and the identification information of the second page;

[0063] In this embodiment, after determining the jump source page of the second page, it is necessary to further determine the parameters that the current second page needs to obtain. Therefore, the subsequent steps can generate the corresponding first key data to query whether there is a matching parameter key-value pair from the long-term storage, thereby further determining the corresponding target parameters. The preset key format of the first key data corresponds to the key name format of the preset key-value pair format of the aforementioned parameter key-value pair. Since the key name format of the preset key-value pair is determined by the identification information of the first page and the identification information of the jump target page corresponding to the first page, it can be determined on the second page whether its jump source page is the first page, and whether the second page is the jump target page of the first page, and then determine whether the first key data matches the parameter key-value pair. Therefore, corresponding to the example in 102 above, the preset key format can correspond to [source page URL+current page URL], so when the second page is the current page and the jump source page is the source page, the corresponding first key data is [jump source page URL+second page URL], so that it can be used to match the corresponding parameter key-value pair in the long-term storage.

[0064] 105. Search for second key data matching the first key data in the parameter key-value pair;

[0065] 106. Extract the target parameter corresponding to the second key data to transfer the target parameter to the second page.

[0066] In this embodiment, when the first key data corresponds to the key name of the parameter key-value pair, i.e., the second key data, the corresponding target parameter can be obtained. For example, in the above-mentioned example, it is determined that the jump source page of the second page is the first page, and the jump target page of the second page is the second page, then the first key data and the second key data are both [URL of the first page, URL of the second page], so that the target parameter included in the key value of the parameter key-value pair can be obtained. In addition, the matching method can be determined by partially matching the first key data and the second key data. For example, it is only necessary to determine that the first key data and the second key data match when the structure position and data content of the identification information of the jump source page of the second page in the first key data are the same as the structure position and data content of the identification information of the first page in the second key data, or it is only necessary to determine that the first key data and the second key data match when the structure position and data content of the identification information of the second page in the first key data and the structure position and data content of the identification information of the jump target page of the first page in the second key data are the same, thereby extracting the corresponding target parameter. In addition, under the condition of the aforementioned optional embodiment of introducing a long-term storage, the target parameters are obtained by sending the first key data to the long-term storage to determine the parameter key-value pairs that match the first key data and the key values ​​covering the target parameters stored in the long-term storage for a long time, thereby achieving the acquisition of the target parameters.

[0067] Optionally, in one embodiment, the second key data of the parameter key-value pair includes identification information of the first page and identification information of the jump target page.

[0068] In this optional embodiment, the second key data includes identification information of the first page and identification information of the jump target page, to correspond to the optional implementation method in which the first key data includes identification information of the jump source page and identification information of the second page, and is used to determine whether the second page is the jump target page of the first page, and whether the first page is the jump source page of the second page, so as to determine whether the second key data matches the first key data, and then extract the key value including the target parameter corresponding to the second key data according to the parameter key value pair, realize the transmission of the target parameter, and pass the target parameter to the second page. For details, please refer to the example in 106 above, which will not be repeated here.

[0069] Optionally, in one embodiment, searching for second key data in the parameter key-value pair that matches the first key data includes: in response to determining that identification information of the jump source page matches identification information of the first page, and identification information of the second page matches identification information of the jump target page, determining that the second key data matches the first key data.

[0070] In this optional embodiment, the matching method can be specifically referred to the example in the above 106, which will not be described in detail here. This method combines two dimensions to determine whether the first key data and the second key data match, that is, according to the matching relationship between the jump source page in the second page and the first page, and the matching relationship between the second page and the jump target page of the first page, the situation of the first page jumping to the second page is determined bidirectionally, so that the target parameters of the first page can be extracted on the second page to complete the parameter transfer.

[0071] In this optional embodiment, the parameter transmission method does not require additional parameters to be added to the URL, which can effectively avoid the problem that the URL cannot be written, the page cannot be loaded or the loading time is too long due to the URL being too long, improve the efficiency and accuracy of page jumps and parameter transmission, and can also avoid the exposure of target parameters, and ensure the privacy and security of parameter transmission. At the same time, this method can also effectively maintain the consistency of the identification information of the jump target page, greatly reducing the workload of page loading and data caching, so that the CDN can better cache the page content, improve the cache hit rate, reduce the CDN's return frequency, and can effectively reduce the number of requests to the server, improve the access speed and performance of web pages, and save development costs and resource overhead.

[0072] Optionally, in one embodiment, after extracting the target parameter corresponding to the second key data to transfer the target parameter to the second page, the method further includes: deleting the corresponding parameter key-value pair in the long-term memory.

[0073] In this optional embodiment, after the jump relationship between the first page and the second page is determined as mentioned above and parameters are passed between the first page and the second page through the long-term storage device, the second page can already perform corresponding business processing through the target parameter. Therefore, the corresponding parameter key-value pairs stored therein can be deleted to ensure efficient use of storage space, avoid potential data redundancy problems, and further ensure the effectiveness and reliability of subsequent parameter transfer tasks.

[0074] Optionally, in one embodiment, after extracting the target parameter corresponding to the second key data to transfer the target parameter to the second page, the method further includes: temporarily storing the target parameter based on the session memory of the second page.

[0075] In this optional embodiment, after the target parameter is extracted, the target parameter can be further written into the session memory to ensure the stability and reliability of the session in the second page. Wherein, the session memory is a temporary memory for storing and managing the current session data, and the data stored in it is only valid in the current session, and the data stored therein will be automatically cleared when leaving the current session page. The session memory can be a storage space determined by a specific storage mechanism of the browser, or a storage space provided by a server such as a database, a cache system, and a cloud server, or a storage memory for temporarily storing data such as a random access memory, a cache, and a virtual memory in an electronic device, as long as the target parameter can be temporarily stored during the session of the second page, and the data can be cleared after leaving the second page. In addition, in order to further optimize the user experience and system performance, a timeout mechanism can also be set in the session memory. When the user does not perform any operation within a certain period of time, the system will automatically clear the target parameter in the session memory, thereby avoiding the waste of resources caused by the user's long-term inactivity, and can ensure the timely update and accuracy of the target parameter when the user re-enters the page.

[0076] Optionally, in one embodiment, the session memory is established based on a web page storage interface, or based on an index database.

[0077] In this optional embodiment, the session memory is preferably established based on a network storage interface, which can specifically be a development method provided by SessionStorage (session storage) used in existing Web technology, wherein SessionStorage is the same as the aforementioned LocalStorage, and is also a local storage mechanism based on a browser. The difference is that SessionStorage can only perform temporary session storage, and the data stored in it is only valid in the current session. When the browser tab of the current session is closed or the browser software is closed, the data stored in the SessionStorage corresponding to the current session will be cleared, and it is ensured that the session data will not continue to remain in the browser or related files, reducing memory usage and ensuring data privacy and security. In addition, with the development of Web technology, more network storage methods similar to SessionStorage's session temporary storage mechanism will be derived. As long as the target parameters can be stored, the stored data will not be lost when the session is reloaded or restored, and the target parameters can be deleted after leaving the second page, they can all be understood to be within the protection scope of this solution. Establishing the session memory through the web page storage interface can further improve the accessibility and convenience of data.

[0078] In this optional embodiment, the session memory can also be established based on the index database simulation. Specifically, the user's behavior of leaving the page can be captured by monitoring the before unload event (beforeunload) of the browser window (window), thereby controlling the retention and deletion of data stored in the index database, thereby realizing the storage mechanism of the session memory.

[0079] This optional embodiment provides a stable, efficient and easy-to-manage target parameter storage method by using SessionStorage or a session storage mechanism based on an index database, which can ensure the validity and reliability of the target parameters in the current session and ensure that the relevant data can be cleared in time after the user leaves the page, thereby saving storage space, improving the security and privacy after cross-page parameter transmission, and further ensuring the validity and reliability of the cross-page parameter transmission method.

[0080] Optionally, in one embodiment, after temporarily storing the target parameters based on the session memory of the second page, the method further includes: acquiring the target parameters from the session memory in response to a refresh instruction for the second page.

[0081] In this optional embodiment, due to the establishment of the aforementioned session memory and the storage of target parameters, when a refresh operation is performed on the second page, the second page can quickly respond to the corresponding refresh instruction and quickly retrieve the corresponding stored target parameters from the session memory. These target parameters can be reloaded and used to maintain the session state to continue the business processing flow before the refresh. This process ensures that when the page is refreshed, the user's previous operation status and data can still be retained, avoiding data loss caused by refresh, thereby improving the fluency and stability of page use.

[0082] Optionally, in one embodiment, after temporarily storing the target parameters based on the session memory of the second page, the method further includes: deleting the target parameters from the session memory in response to a jump instruction to leave the second page.

[0083] In this optional embodiment, the jump instruction to leave the second page, that is, the user exits the current page and jumps to other pages, or closes the instruction triggered by the browser to which the page belongs. Due to the temporary storage mechanism of the session memory set above, when leaving the second page, the corresponding transfer will be deleted from the session memory corresponding to the second page, thereby ensuring that after the user leaves the current page, the target parameters previously stored in the session memory will not be retained, which not only ensures the availability of the target parameters during the session, but also ensures the timely clearing of the target parameters after the session, further enhancing the privacy and security of the data, thereby providing users with a safer, more convenient and smoother browsing experience.

[0084] This embodiment first generates a parameter key-value pair in a preset key-value pair format based on the identification information of the first page, the identification information of the jump target page, and the target parameter on the first page, and then extracts the corresponding target parameter based on the first key data determined by the identification information of the jump source page and the identification information of the second page on the second page, effectively realizing the parameter transfer across pages. The parameter transfer of the present invention does not require additional parameter addition to the URL, can effectively avoid the problem that the URL cannot be written, the page cannot be loaded, or the loading time is too long due to the URL being too long, improves the efficiency and accuracy of page jump and parameter transfer, can also avoid the exposure of target parameters, and ensure the privacy and security of parameter transfer. At the same time, the present invention can also effectively maintain the consistency of the identification information of the jump target page, greatly reducing the workload of page loading and data caching, so that the CDN can better cache the page content, improve the cache hit rate, reduce the frequency of CDN back to the source, can effectively reduce the number of requests to the server, improve the access speed and performance of the web page, and save development costs and resource overhead.

[0085] In order to execute the corresponding steps in the above method embodiment and each possible implementation method, the following provides an implementation method of a cross-page parameter transfer device. Figure 2 , Figure 2 Schematic diagram of functional modules of an embodiment of a cross-page parameter transfer device in an embodiment of the present invention. In this embodiment, the cross-page parameter transfer device is applied to an electronic device, and the cross-page parameter transfer device includes:

[0086] The first page processing module 201 is used to determine the jump target page of the first page and the target parameter to be transmitted, and generate a parameter key-value pair in a preset key-value pair format based on the identification information of the first page, the identification information of the jump target page and the target parameter;

[0087] The second page processing module 202 is used to determine the jump source page of the second page, generate the first key data in a preset key format based on the identification information of the jump source page and the identification information of the second page, search for the second key data matching the first key data in the parameter key value pair, extract the target parameters corresponding to the second key data, and pass the target parameters to the second page.

[0088] Optionally, in one embodiment, the value data of the parameter key-value pair includes a target parameter and a generation timestamp.

[0089] Optionally, in one embodiment, the first page processing module 201 is further used to: perform long-term storage of parameter key-value pairs based on a long-term memory, wherein the long-term memory is further used to determine a parameter key-value pair that matches the first key data in response to the received first key data.

[0090] Optionally, in one embodiment, the long-term storage is established based on a web page storage interface, or based on an index database.

[0091] Optionally, in one embodiment, the first page processing module 201 is further specifically used to: determine the generation time of the parameter key-value pair based on the generation timestamp; in response to determining that the generation time reaches a preset time condition, delete the corresponding parameter key-value pair from the long-term storage.

[0092] Optionally, in one embodiment, the second key data of the parameter key-value pair includes identification information of the first page and identification information of the jump target page.

[0093] Optionally, in one embodiment, the second page processing module 202 is specifically used to: in response to determining that the identification information of the jump source page matches the identification information of the first page, and the identification information of the second page matches the identification information of the jump target page, determine that the second key data matches the first key data.

[0094] Optionally, in one embodiment, the second page processing module 202 is further specifically used to: delete the corresponding parameter key-value pair in the long-term storage.

[0095] Optionally, in one embodiment, the second page processing module 202 is further specifically configured to: temporarily store the target parameter based on the session memory of the second page.

[0096] Optionally, in one embodiment, the second page processing module 202 is further specifically configured to: in response to a refresh instruction for the second page, obtain a target parameter from the session memory.

[0097] Optionally, in one embodiment, the second page processing module 202 is further configured to: in response to a jump instruction to leave the second page, delete the target parameter from the session memory.

[0098] Optionally, in one embodiment, the session memory is established based on a web page storage interface, or based on an index database.

[0099] Since the embodiments of the device part correspond to the embodiments of the above-mentioned method, please refer to the above-mentioned method embodiment for the introduction of the cross-page parameter transfer device provided by the embodiment of the present invention. The embodiment of the present invention will not be repeated here, and it has the same beneficial effects as the above-mentioned cross-page parameter transfer method.

[0100] The present invention also provides a computer device, which includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the cross-page parameter transfer method as described above. Figure 33 is a functional module diagram of a computer device provided by an embodiment of the present invention. The computer device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 (for example, one or more mass storage devices) storing application programs 333 or data 332. Among them, the memory 320 and the storage medium 330 can be temporary storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device 300. Furthermore, the processor 310 can be configured to communicate with the storage medium 330 to execute a series of instruction operations in the storage medium 330 on the computer device 300.

[0101] The computer device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input and output interfaces 360, and / or one or more operating systems 331, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 3 The illustrated computer device structure does not constitute a limitation on the computer device, and may include more or fewer components than illustrated, or combine certain components, or arrange the components differently.

[0102] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the cross-page parameter passing method as described above.

[0103] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. If the integrated module or unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for 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 methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0104] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for transferring parameters across pages, characterized in that: include: Determine the jump target page of the first page and the target parameters to be passed; Generate a parameter key-value pair in a preset key-value pair format based on the identification information of the first page, the identification information of the jump target page, and the target parameter; Determine the jump source page of the second page; Generate first key data in a preset key format based on the identification information of the jump source page and the identification information of the second page; Searching for second key data in the parameter key-value pair that matches the first key data; The target parameter corresponding to the second key data is extracted to transfer the target parameter to the second page.

2. The method for transferring parameters across pages according to claim 1, characterized in that: The second key data of the parameter key-value pair includes identification information of the first page and identification information of the jump target page; The first key data includes identification information of the jump source page and identification information of the second page; The searching for the second key data matching the first key data in the parameter key-value pair includes: In response to determining that the identification information of the jump source page matches the identification information of the first page, and the identification information of the second page matches the identification information of the jump target page, it is determined that the second key data matches the first key data.

3. The method for transferring parameters across pages according to claim 1, characterized in that: After generating the parameter key-value pair in a preset key-value pair format based on the identification information of the first page, the identification information of the jump target page and the target parameter, the method further includes: long-term storage of the parameter key-value pairs based on a long-term storage, wherein the long-term storage is further used to determine the parameter key-value pairs matching the first key data in response to the received first key data; After extracting the target parameter corresponding to the second key data to transfer the target parameter to the second page, the method further includes: The target parameter is temporarily stored based on the session memory of the second page.

4. The method for transferring parameters across pages according to claim 3, characterized in that: The value data of the parameter key-value pair includes the target parameter and a generation timestamp; After the parameter key-value pairs are stored for a long time based on the long-term storage, the method further includes: Determining a generation time of the parameter key-value pair based on the generation timestamp; In response to determining that the generation duration reaches a preset duration condition, deleting the corresponding parameter key-value pair from the long-term storage; After extracting the target parameter corresponding to the second key data to transfer the target parameter to the second page, the method further includes: Delete the corresponding parameter key-value pair in the long-term storage.

5. The method for transferring parameters across pages according to claim 3, characterized in that: After the session memory based on the second page temporarily stores the target parameter, the method further includes: In response to a refresh instruction for the second page, the target parameter is obtained from the session memory.

6. The method for transferring parameters across pages according to claim 3, characterized in that: After the session memory based on the second page temporarily stores the target parameter, the method further includes: In response to a jump instruction to leave the second page, the target parameter is deleted from the session memory.

7. The method for transferring parameters across pages according to claim 3, characterized in that: The long-term storage and the session storage are established based on a web page storage interface or based on an index database.

8. A cross-page parameter transfer device, characterized in that: include: A first page processing module, used to determine a jump target page of the first page and a target parameter to be transmitted, and generate a parameter key-value pair in a preset key-value pair format based on the identification information of the first page, the identification information of the jump target page and the target parameter; The second page processing module is used to determine the jump source page of the second page, generate the first key data in a preset key format based on the identification information of the jump source page and the identification information of the second page, search for the second key data matching the first key data in the parameter key-value pair, extract the target parameter corresponding to the second key data, and pass the target parameter to the second page.

9. A computer device, characterized in that: The computer device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instruction in the memory to enable the computer device to execute the cross-page parameter passing method according to any one of claims 1 to 7.

10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by a processor, the cross-page parameter transfer method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • System internal dynamic dimension linkage jumping method and device, electronic equipment and storage medium

    CN120994923A