Methods and devices for storing page data, storage media, and computer equipment

By loading a state management library in the browser and using a state container for persistent data storage, the problem of container storage not being persistent is solved, thus improving the user experience of mobile medical business processing.

CN117271867BActive Publication Date: 2026-03-13PING AN INT FINANCIAL LEASING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-02
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, browser-based container storage cannot persist data, causing users to repeatedly enter information when handling medical services on mobile devices, which affects the user experience.

Method used

By persistently storing state data, the system uses state containers to read and update data in local storage, avoiding duplicate input. This includes loading a pre-defined state management library, generating listener functions, serialization processing, and managing difference files.

Benefits of technology

This eliminates the need for users to repeatedly enter information, improving user experience and increasing the efficiency and accuracy of data storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117271867B_ABST
    Figure CN117271867B_ABST
Patent Text Reader

Abstract

This application relates to the field of digital healthcare technology and discloses a method, apparatus, storage medium, and computer device for storing page data. The method includes: responding to a browser page opening request, determining at least one first source code file corresponding to a first page indicated by the browser page opening request; starting a first state container for each of the first source code files, and using each first state container to read historical state data corresponding to each source code file in a local storage space; displaying the first page based on the historical state data, and obtaining state data to be stored generated on the first page by calling any of the first source code files; determining a target first state container according to the called source code file corresponding to the state data to be stored, and storing the state data to be stored as historical state data of the called source code file in the local storage space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of digital healthcare and data storage technology, and in particular to a method and apparatus for storing page data, a storage medium, and a computer device. Background Technology

[0002] There are two common methods for storing data in front-end development: browser-based local storage (including cookies, sessionStorage, and localStorage) and framework-based container storage (such as Vuex, Redux, and Flux). Local storage is mainly used for passing values ​​between pages, but it cannot pass values ​​between components. To meet development needs, container technology is now widely used in front-end development. While container storage can be used for passing values ​​between components, the data it saves is stored in memory, making it difficult to persist.

[0003] With the widespread adoption of mobile devices and the development of technology, conducting medical services through mobile applications (APPs) is becoming increasingly common, such as online registration, online consultations, and online prescriptions. User medical services are typically a continuous process; for example, a single consultation may lead to multiple prescriptions. If users have to repeatedly enter previously entered consultation and patient information for each prescription, it would be a burden. However, the limited data storage capacity in memory and the difficulty of persistent data storage using container technology have not yet been effectively resolved. Summary of the Invention

[0004] In view of this, this application provides a method, apparatus, storage medium, and computer device for storing page data. By persistently storing state data, once state data based on a certain source code file is generated, the state data can be directly accessed through a state container without requiring the user to repeatedly input information. Furthermore, if the state data based on a certain source code file changes, the state data can also be updated and stored through the state container, thereby effectively improving the user experience.

[0005] According to one aspect of this application, a method for storing page data is provided, the method comprising:

[0006] In response to a browser page open request, identify the first page indicated by the browser page open request and determine at least one first source code file corresponding to the first page;

[0007] Start the first state container for each of the first source code files, and use each first state container to read the historical state data corresponding to each source code file from the local storage space;

[0008] The first page is displayed based on the historical state data, and the state data to be stored generated on the first page by calling any of the first source code files is obtained.

[0009] Based on the source code file to be called corresponding to the state data to be stored, a target first state container is determined, and the state data to be stored is stored as historical state data of the source code file to be called in the local storage space.

[0010] Optionally, the method further includes:

[0011] When the browser starts, it loads a preset state management library, which includes state storage attributes, state modification attributes, and state monitoring attributes. The state storage attributes are used to define the data type of the state to be stored, the state modification attributes are used to define the method for modifying the data type of the state, and the state monitoring attributes are used to define the method for monitoring the state data.

[0012] Optionally, obtaining the state data to be stored generated on the first page by calling any of the first source code files includes:

[0013] Based on the state storage attribute and the state monitoring attribute, a listening function is generated for the state change data of the state data type;

[0014] The listening function listens for new state data generated on the first page by calling any of the first source code files, and identifies whether the new state data belongs to the state data to be stored based on the historical state data.

[0015] Optionally, after loading the preset state management library, the method further includes:

[0016] Send a query message to the server corresponding to the preset state management library to query whether there is any state data type modification information corresponding to the preset state management library in the server;

[0017] When the change information of the state data type to be stored is found, the state data type defined in the state storage attribute is modified based on the state data type modification information and the state modification attribute in the preset state database.

[0018] Optionally, after loading the preset state management library, the method further includes:

[0019] When the server pushes the second state data type modification information, the state data type defined in the state storage attribute is modified based on the second state data type modification information and the state modification attribute in the preset state database.

[0020] Optionally, storing the state data to be stored as historical state data of the invoked source code file in the local storage space includes:

[0021] The state data to be stored is serialized, and the first state container identifier corresponding to the called source code file is used as the key, and the serialized state data to be stored is used as the value to generate state data key-value pairs, and the state data key-value pairs are stored in the local storage space.

[0022] Accordingly, reading the historical state data corresponding to each of the source code files from the local storage space includes:

[0023] A state data query statement is generated based on the first state container identifier corresponding to the source code file, and the state data query statement is used to query the historical state data key-value pairs corresponding to the source code file in the local storage space.

[0024] The historical state data key-value pairs are parsed, and the parsed values ​​are used as the historical state data corresponding to the first source code file.

[0025] Optionally, after displaying the historical state data on the first page, the method further includes:

[0026] In response to a request to close the first page, close the first state container; and / or,

[0027] In response to a page switching request indicating a switch from the first page to the second page, at least one second source code file corresponding to the second page is determined, a difference file in the first source code file that is different from each of the second source code files is identified, the state container corresponding to the difference file is closed, and the second state container corresponding to the other files in the second source code file besides the difference file is started.

[0028] According to another aspect of this application, a storage device for page data is provided, the device comprising:

[0029] The request-response module is used to respond to a browser page open request, identify the first page indicated by the browser page open request, and determine at least one first source code file corresponding to the first page;

[0030] The container start-stop module is used to start the first state container of each of the first source code files, and use each first state container to read the historical state data corresponding to each source code file in the local storage space.

[0031] The data acquisition module is used to display the first page based on the historical state data, and to acquire the state data to be stored generated on the first page by calling any of the first source code files;

[0032] The data storage module is used to determine the target first state container based on the called source code file corresponding to the state data to be stored, and store the state data to be stored as historical state data of the called source code file in the local storage space.

[0033] Optionally, the device further includes:

[0034] The library loading module is used to load a preset state management library when the browser starts. The preset state management library includes state storage attributes, state modification attributes, and state monitoring attributes. The state storage attributes are used to define the data type of the state to be stored. The state modification attributes are used to define the method for modifying the data type of the state. The state monitoring attributes are used to define the method for monitoring the state data.

[0035] Optionally, the data acquisition module is used for:

[0036] Based on the state storage attribute and the state monitoring attribute, a listening function is generated for the state change data of the state data type;

[0037] The listening function listens for new state data generated on the first page by calling any of the first source code files, and identifies whether the new state data belongs to the state data to be stored based on the historical state data.

[0038] Optionally, the library loading module is further configured to:

[0039] Send a query message to the server corresponding to the preset state management library to query whether there is any state data type modification information corresponding to the preset state management library in the server;

[0040] When the change information of the state data type to be stored is found, the state data type defined in the state storage attribute is modified based on the state data type modification information and the state modification attribute in the preset state database.

[0041] Optionally, the library loading module is further configured to:

[0042] When the server pushes the second state data type modification information, the state data type defined in the state storage attribute is modified based on the second state data type modification information and the state modification attribute in the preset state database.

[0043] Optionally, the data storage module is further configured to:

[0044] The state data to be stored is serialized, and the first state container identifier corresponding to the called source code file is used as the key, and the serialized state data to be stored is used as the value to generate state data key-value pairs, and the state data key-value pairs are stored in the local storage space.

[0045] Accordingly, the container opening and closing module is also used for:

[0046] A state data query statement is generated based on the first state container identifier corresponding to the source code file, and the state data query statement is used to query the historical state data key-value pairs corresponding to the source code file in the local storage space.

[0047] The historical state data key-value pairs are parsed, and the parsed values ​​are used as the historical state data corresponding to the first source code file.

[0048] Optionally, the container opening and closing module is further configured to:

[0049] In response to a request to close the first page, close the first state container; and / or,

[0050] In response to a page switching request indicating a switch from the first page to the second page, at least one second source code file corresponding to the second page is determined, a difference file in the first source code file that is different from each of the second source code files is identified, the state container corresponding to the difference file is closed, and the second state container corresponding to the other files in the second source code file besides the difference file is started.

[0051] According to another aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the above-described method for storing page data.

[0052] According to another aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described method for storing page data.

[0053] By employing the above technical solutions, this application provides a method, apparatus, storage medium, and computer device for storing page data. When a request is made to open a first page, the first source code file corresponding to the first page is first determined, and a first state container for each first source code file is started. Then, the first state container is used to read the historical state data corresponding to the source code file from the local storage space, thereby displaying the historical state data at the corresponding position on the first page. Simultaneously, new state data to be stored generated on the first page by calling any first source code file is continuously acquired. Finally, the state data to be stored is associated with the called source code file and persistently stored in the local storage space. This embodiment of the application, by persistently storing state data, allows state data based on a specific source code file to be directly called through the state container after it has been generated only once, eliminating the need for repeated information input by the user. Furthermore, if the state data based on a specific source code file changes, the state container can also update and store the state data, thereby effectively improving the user experience.

[0054] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0055] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0056] Figure 1 A flowchart illustrating a method for storing page data according to an embodiment of this application is shown;

[0057] Figure 2 A flowchart illustrating another method for storing page data provided in an embodiment of this application is shown;

[0058] Figure 3 This illustration shows a schematic diagram of the structure of a page data storage device provided in an embodiment of this application;

[0059] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation

[0060] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0061] This embodiment provides a method for storing page data, such as Figure 1 As shown, the method includes:

[0062] Step 101: In response to the browser page open request, identify the first page indicated by the browser page open request, and determine at least one first source code file corresponding to the first page.

[0063] In this embodiment of the application, when a user requests to open a certain page while using a browser, the client responds to the browser's page opening request, determines the first page requested by the user, and determines all the first source code files, such as JS files, that support the operation of the first page. Different pages of the browser provide different functions, such as the function of inputting patient information and the function of selecting a doctor for registration. The implementation of the functions on the page depends on each JS file.

[0064] Step 102: Start the first state container for each of the first source code files, and use each first state container to read the historical state data corresponding to each source code file in the local storage space.

[0065] The browser in this embodiment is a browser developed based on container technology. Each source code file corresponds to its own state container. The browser uses the state container to manage the state data of the functions supported by the source code file. After determining the first source code files corresponding to the first page, the first state container corresponding to each first source code file is started, and the historical state data that has been persistently stored in the local storage space of each first state container is read.

[0066] Step 103: Based on the historical state data, display the first page and obtain the state data to be stored generated on the first page by calling any of the first source code files.

[0067] Step 104: Based on the source code file to be called corresponding to the state data to be stored, determine the target first state container, and store the state data to be stored as the historical state data of the source code file to be called in the local storage space.

[0068] In this embodiment, after determining each first source code file corresponding to the first page and reading the historical state data corresponding to each first source code file, the historical state data can be filled into the corresponding positions on the first page when the first page is displayed. For example, if the historical state data includes patient information, the patient information can be filled into the patient information field on the first page, avoiding repeated information entry by the user. Simultaneously, while the user is browsing the first page, new state data generated on the first page is continuously monitored, and the monitored new state data is used as state data to be stored. For example, if the user changes patient information on the page, the changed patient information can be considered as new state data. Furthermore, when persistently storing the state data to be stored, it is also necessary to determine which first source code file was called to generate the state data. The state container then associates the state data to be stored with the called source code file, so that when the user requests to open a page again, and the called source code file is required to support the page's execution, the historical state data of the called source code file can be quickly retrieved. By persistently storing state data, once state data based on a source code file is generated, it can be directly accessed through the state container without requiring users to repeatedly input information. Furthermore, if the state data based on a source code file changes, it can also be updated and stored through the state container, thereby effectively improving the user experience.

[0069] By applying the technical solution of this embodiment, when a request is made to open the first page, the first source code file corresponding to the first page is first determined, and a first state container for each first source code file is started. Then, the historical state data corresponding to the source code file is read from the local storage space using the first state container, thereby displaying the historical state data at the corresponding position on the first page. Simultaneously, new state data to be stored generated on the first page by calling any first source code file is continuously acquired. Finally, the state data to be stored is associated with the called source code file and persistently stored in the local storage space. This embodiment of the application, by persistently storing state data, allows state data based on a specific source code file to be directly called through the state container after it has been generated only once, eliminating the need for repeated information input by the user. Furthermore, if the state data based on a specific source code file changes, the state container can also update and store the state data, thereby effectively improving the user experience.

[0070] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, another method for storing page data is provided, such as... Figure 2 As shown, the method includes:

[0071] Step 201: When the browser starts, a preset state management library is loaded. The preset state management library includes a state storage attribute, a state modification attribute, and a state monitoring attribute. The state storage attribute is used to define the data type of the state to be stored. The state modification attribute is used to define the method for modifying the data type of the state. The state monitoring attribute is used to define the method for monitoring the state data.

[0072] In this application's embodiments, the state container is implemented based on a self-developed preset state management library. Currently, the commonly used state management library is Vuex, which is a heavyweight library that can impact device performance, especially on mobile devices, causing significant device overhead and resulting in lag. This application supports the use of the state container by developing a lightweight state management library. After analyzing the key attributes of the state management library based on actual needs, the inventors determined that the required key attributes are the state storage attribute (`state`), the state modification attribute (`action`), and the state monitoring attribute (`getter`). These three key attributes are then used to construct the preset state management library. Specifically, the state storage attribute defines the data type of the state to be stored, i.e., the data type of the state to be persistently stored; the state modification attribute defines the method for modifying the state data type, i.e., the method for modifying the state data type defined by the state storage attribute. Specifically, the modification information of the state data type can be obtained through an API interface, and the defined modification method can be used to modify the state data type defined by the state storage attribute; the state monitoring attribute defines the method for listening to state data, i.e., the method for listening to state data on the page. In practical applications, when the client launches the browser, the preset state management library is automatically loaded so that the state container can use the resources in the library after it is started.

[0073] This self-developed preset state management library has only three key properties: `state`, `getter`, and `action`. Compared to the Vuex state management library, it lacks mutations, allowing direct modification of state data through synchronous and asynchronous actions. It also eliminates the need for nested modules, enabling the creation of independent repositories via `defineStore`. Syntactically, it is more concise and easier to understand and use than the Vuex library. In terms of size, the final self-developed preset state management library is only 1KB, and its performance far surpasses that of the Vuex state management library integration.

[0074] Optionally, in this embodiment of the application, the method further includes the following after step 201:

[0075] A query message is sent to the server corresponding to the preset state management library to query whether there is state data type modification information corresponding to the preset state management library in the server; when the state data type modification information to be stored is found, the state data type defined in the state storage attribute is modified based on the state data type modification information and the state modification attribute in the preset state database.

[0076] When the server pushes the second state data type modification information, the state data type defined in the state storage attribute is modified based on the second state data type modification information and the state modification attribute in the preset state database.

[0077] In the above embodiments, the state storage attributes in the preset state management library define the state data types that need to be stored. Developers can modify the state data types according to actual needs. When the browser loads the preset state management library, it can send query information to the server to actively check whether there is any first state data type modification information. If it exists, the modification method defined in the state modification attribute of the preset state management library is used to modify the state data type defined in the state storage attribute to the modification type indicated by the first state data type modification information. This achieves the modification of the state data type so that when the state container listens to the state data on the page, it can listen according to the latest state data type defined in the state storage attribute.

[0078] In addition, if the server generates second-state data type modification information during the user's use of the browser, it can also receive the second-state data type modification information pushed by the server in real time and dynamically modify the state modification attributes in the loaded preset state management library.

[0079] Step 202: In response to the browser page open request, identify the first page indicated by the browser page open request, and determine at least one first source code file corresponding to the first page.

[0080] Step 203: Start the first state container for each of the first source code files; use each first state container to generate a state data query statement based on the first state container identifier corresponding to the source code file, and use the state data query statement to query the historical state data key-value pairs corresponding to the source code file in the local storage space, parse the historical state data key-value pairs, and use the parsed values ​​as the historical state data corresponding to the first source code file.

[0081] In this embodiment, when a user requests to open the first page, the first source code file corresponding to the first page is determined, and the first state container corresponding to each first source code file is launched. Then, a state data query statement is generated using each first state container to query historical state data. The historical state data is stored in the local storage space in the form of key-value pairs. Specifically, the state container identifier is used as the key, and the state data is used as the value. The state data query statement carries the first state container identifier, thereby retrieving the corresponding value from the local storage space, deserializing and parsing it to obtain the historical state data.

[0082] Step 204: Based on the historical state data displayed on the first page, generate a listening function for state change data of the state data type based on the state storage attribute and the state monitoring attribute; use the listening function to listen for new state data generated on the first page by calling any of the first source code files, and identify whether the new state data belongs to the state data to be stored based on the historical state data.

[0083] In this embodiment, the retrieved historical state data can be directly displayed on the first page. Subsequently, as the user continues browsing the first page, new state data may be generated. The first state container can call the state storage attribute and state monitoring attribute in the preset state management library to generate a listening function. This listening function is used to monitor state data generated on the page that has the same data type as the state data defined by the state storage attribute, and to determine whether to store the new state data as state data to be stored by comparing it with historical state data after detecting new state data generated on the page. Specifically, if the new state data is the same as the historical state data, it is not stored; if they are different, the new state data is stored.

[0084] Step 205: Based on the called source code file corresponding to the state data to be stored, determine the target first state container, and perform serialization processing on the state data to be stored. Use the identifier of the first state container corresponding to the called source code file as the key and the serialized state data to be stored as the value to generate state data key-value pairs, and store the state data key-value pairs in the local storage space.

[0085] In this embodiment, after obtaining the state data to be stored corresponding to the called source code file, the state data to be stored is serialized to reduce the storage space occupied by the state data. Using the identifier of the target first state container of the called source code file as the key and the serialized state data to be stored as the value, a state data key-value pair is generated and stored in the local storage space. Data in the local storage space with the same key as the state data key-value pair is replaced with the state data key-value pair to update the historical state data of the called source code file. This ensures that the latest state data of the source code file is stored in the local storage space, reducing the space occupied by the state data and improving the efficiency of subsequent queries on historical state data.

[0086] Step 206: In response to the request to close the first page, close the first state container.

[0087] Step 207: In response to a page switching request indicating a switch from the first page to the second page, determine at least one second source code file corresponding to the second page, identify difference files in the first source code file that are different from each of the second source code files, close the state container corresponding to the difference file, and start the second state container corresponding to the other files in the second source code file besides the difference file.

[0088] In this embodiment, the state container closes when the page is closed. If the user closes the first page, the browser automatically closes the first state container corresponding to the first page. However, if the user switches from the first page to the second page, the browser first queries the second source code file corresponding to the second page, compares the first and second source code files, and identifies the parts in the first and second source code files that differ from each other as "difference files." Since the functionality of the second page does not depend on these difference files, the state container corresponding to these difference files can be closed. Furthermore, for parts in the second source code file that are included but not in the first source code file (i.e., other files in the second source code file besides the difference files), since the functionality of the second page depends on these other files, the corresponding second state container is activated. It is understood that for the parts in the first and second source code files that are identical, the state container corresponding to these parts remains active during page switching and does not need to be closed. This avoids the device performance overhead caused by frequently starting and stopping the state container, improves the effectiveness of the state container, and further avoids the need to reread historical state data when starting and stopping the state container, thus improving the efficiency of state data utilization.

[0089] Furthermore, as Figure 1 To specifically implement the method, this application provides a storage device for page data, such as... Figure 3As shown, the device includes:

[0090] The request-response module is used to respond to a browser page open request, identify the first page indicated by the browser page open request, and determine at least one first source code file corresponding to the first page;

[0091] The container start-stop module is used to start the first state container of each of the first source code files, and use each first state container to read the historical state data corresponding to each source code file in the local storage space.

[0092] The data acquisition module is used to display the first page based on the historical state data, and to acquire the state data to be stored generated on the first page by calling any of the first source code files;

[0093] The data storage module is used to determine the target first state container based on the called source code file corresponding to the state data to be stored, and store the state data to be stored as historical state data of the called source code file in the local storage space.

[0094] Optionally, the device further includes:

[0095] The library loading module is used to load a preset state management library when the browser starts. The preset state management library includes state storage attributes, state modification attributes, and state monitoring attributes. The state storage attributes are used to define the data type of the state to be stored. The state modification attributes are used to define the method for modifying the data type of the state. The state monitoring attributes are used to define the method for monitoring the state data.

[0096] Optionally, the data acquisition module is used for:

[0097] Based on the state storage attribute and the state monitoring attribute, a listening function is generated for the state change data of the state data type;

[0098] The listening function listens for new state data generated on the first page by calling any of the first source code files, and identifies whether the new state data belongs to the state data to be stored based on the historical state data.

[0099] Optionally, the library loading module is further configured to:

[0100] Send a query message to the server corresponding to the preset state management library to query whether there is any state data type modification information corresponding to the preset state management library in the server;

[0101] When the change information of the state data type to be stored is found, the state data type defined in the state storage attribute is modified based on the state data type modification information and the state modification attribute in the preset state database.

[0102] Optionally, the library loading module is further configured to:

[0103] When the server pushes the second state data type modification information, the state data type defined in the state storage attribute is modified based on the second state data type modification information and the state modification attribute in the preset state database.

[0104] Optionally, the data storage module is further configured to:

[0105] The state data to be stored is serialized, and the first state container identifier corresponding to the called source code file is used as the key, and the serialized state data to be stored is used as the value to generate state data key-value pairs, and the state data key-value pairs are stored in the local storage space.

[0106] Accordingly, the container opening and closing module is also used for:

[0107] A state data query statement is generated based on the first state container identifier corresponding to the source code file, and the state data query statement is used to query the historical state data key-value pairs corresponding to the source code file in the local storage space.

[0108] The historical state data key-value pairs are parsed, and the parsed values ​​are used as the historical state data corresponding to the first source code file.

[0109] Optionally, the container opening and closing module is further configured to:

[0110] In response to a request to close the first page, close the first state container; and / or,

[0111] In response to a page switching request indicating a switch from the first page to the second page, at least one second source code file corresponding to the second page is determined, a difference file in the first source code file that is different from each of the second source code files is identified, the state container corresponding to the difference file is closed, and the second state container corresponding to the other files in the second source code file besides the difference file is started.

[0112] It should be noted that other corresponding descriptions of the functional units involved in the page data storage device provided in this application embodiment can be found by referring to... Figures 1 to 2 The corresponding descriptions in the method will not be repeated here.

[0113] This application also provides a computer device, which may specifically be a personal computer, a server, a network device, etc. Figure 4 As shown, the computer device includes a bus, a processor, memory, and a communication interface, and may also include an input / output interface and a display device. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores location information. The network interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.

[0114] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0115] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, having stored thereon a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0116] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0118] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0119] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0120] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for storing page data, characterized in that, The method includes: In response to a browser page open request, identify the first page indicated by the browser page open request and determine at least one first source code file corresponding to the first page; Start the first state container for each of the first source code files, and use each first state container to read the historical state data corresponding to each source code file from the local storage space; The first page is displayed based on the historical state data, and the state data to be stored generated on the first page by calling any of the first source code files is obtained. Based on the source code file to be called corresponding to the state data to be stored, a target first state container is determined, and the state data to be stored is stored as historical state data of the source code file to be called in the local storage space.

2. The method according to claim 1, characterized in that, The method further includes: When the browser starts, it loads a preset state management library, which includes state storage attributes, state modification attributes, and state monitoring attributes. The state storage attributes are used to define the data type of the state to be stored, the state modification attributes are used to define the method for modifying the data type of the state, and the state monitoring attributes are used to define the method for monitoring the state data.

3. The method according to claim 2, characterized in that, The step of obtaining the state data to be stored generated on the first page by calling any of the first source code files includes: Based on the state storage attribute and the state monitoring attribute, a listening function is generated for the state change data of the state data type; The listening function listens for new state data generated on the first page by calling any of the first source code files, and identifies whether the new state data belongs to the state data to be stored based on the historical state data.

4. The method according to claim 2, characterized in that, After loading the preset state management library, the method further includes: Send a query message to the server corresponding to the preset state management library to query whether there is any state data type modification information corresponding to the preset state management library in the server; When the change information of the state data type to be stored is found, the state data type defined in the state storage attribute is modified based on the state data type modification information and the state modification attribute in the preset state management library.

5. The method according to claim 2, characterized in that, After loading the preset state management library, the method further includes: When the server pushes the second state data type modification information, the state data type defined in the state storage attribute is modified based on the second state data type modification information and the state modification attribute in the preset state management library.

6. The method according to any one of claims 1 to 5, characterized in that, The step of storing the state data to be stored as historical state data of the called source code file in the local storage space includes: The state data to be stored is serialized, and the first state container identifier corresponding to the called source code file is used as the key, and the serialized state data to be stored is used as the value to generate state data key-value pairs, and the state data key-value pairs are stored in the local storage space. Accordingly, reading the historical state data corresponding to each of the source code files from the local storage space includes: A state data query statement is generated based on the first state container identifier corresponding to the source code file, and the state data query statement is used to query the historical state data key-value pairs corresponding to the source code file in the local storage space. The historical state data key-value pairs are parsed, and the parsed values ​​are used as the historical state data corresponding to the first source code file.

7. The method according to any one of claims 1 to 5, characterized in that, After displaying the historical state data on the first page, the method further includes: In response to a request to close the first page, close the first state container; and / or, In response to a page switching request indicating a switch from the first page to the second page, at least one second source code file corresponding to the second page is determined, a difference file in the first source code file that is different from each of the second source code files is identified, the state container corresponding to the difference file is closed, and the second state container corresponding to the other files in the second source code file besides the difference file is started.

8. A storage device for page data, characterized in that, The device includes: The request-response module is used to respond to a browser page open request, identify the first page indicated by the browser page open request, and determine at least one first source code file corresponding to the first page; The container start-stop module is used to start the first state container of each of the first source code files, and use each first state container to read the historical state data corresponding to each source code file in the local storage space. The data acquisition module is used to display the first page based on the historical state data, and to acquire the state data to be stored generated on the first page by calling any of the first source code files; The data storage module is used to determine the target first state container based on the called source code file corresponding to the state data to be stored, and store the state data to be stored as historical state data of the called source code file in the local storage space.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.

10. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data management method and device thereof for applet, computer equipment and storage medium

    CN112416410A

  • Small program user information management method and device, computer equipment and storage medium

    CN114281434A