Data state updating method and device, storage medium and computer equipment

By detecting preset actions in the global state management solution and updating related components, the problem of low data state update efficiency and performance in the prior art is solved, and finer-grained updates and performance improvements are achieved.

CN119645544APending Publication Date: 2025-03-18创优数字科技(广东)有限公司
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411592814.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the existing global state management scheme, the dependency between a single large state tree and components has low accuracy, resulting in low data state update efficiency and performance.

Method used

By detecting the trigger of preset actions, the update object and the update operation are determined, and the relevant components are determined based on the subscription list of the update object. Update the target data state in the preset data state library and generate the listener sent to the relevant components to re-render it.

Benefits of technology

It realizes finer-grained data state updates, avoids unnecessary re-rendering, and improves the efficiency and performance of data state updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645544A_ABST
    Figure CN119645544A_ABST
Patent Text Reader

Abstract

The invention provides a data state updating method and device, a storage medium and computer equipment, and the method comprises the steps: determining an updating object and an updating operation corresponding to a preset action when the triggering of the preset action is detected; determining a related component corresponding to the updated object according to the subscription list of the updated object; determining a target data state corresponding to the update object in a preset data state library and updating the target data state; when updating is completed, updating information is generated, and the updating information is sent to the monitors corresponding to all the related components, so that all the components are rendered again according to the updating information. According to the embodiment of the invention, the related components influenced by the update object can be determined through the subscription mechanism, and the update information can be generated and sent to the monitors corresponding to the related components after the update is completed, so that the related components can be re-rendered according to the update information, and the re-rendering is only carried out on the related components; and data state updating with finer granularity is realized, so that the efficiency and the performance of data state updating are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data management technology, and in particular to a data status updating method, device, storage medium and computer equipment. Background Art

[0002] Global state management is one of the core issues in modern front-end development, especially when building complex and dynamic web applications. With the rise of single-page applications (SPA), application state management has become particularly important. Traditional global state management solutions, such as Redux, provide powerful tools to manage complex state logic and ensure the predictability and consistency of the state.

[0003] However, existing global state management solutions usually have a single large state tree, and the accuracy of dependencies between components is low, resulting in rough updates of data status. As the project scale grows, the complexity of the global state management solution will also increase, further leading to low efficiency and performance of data status updates. Summary of the invention

[0004] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially that the global state management solution in the prior art is usually a single large state tree, and the accuracy of the dependencies between components is low, resulting in a relatively rough update of the data state. As the project scale grows, the complexity of the global state management solution will also increase, further leading to the technical defects of low efficiency and performance of data status updates.

[0005] In a first aspect, the present application provides a data status updating method, the method comprising:

[0006] When a preset action is detected to be triggered, an update object and an update operation corresponding to the preset action are determined;

[0007] Determining, according to the subscription list of the update object, the relevant components corresponding to the update object;

[0008] Determining a target data state corresponding to the update object in a preset data state library, and updating the target data state according to the update operation;

[0009] When the update is completed, update information is generated according to the update object and the updated target data state, and the update information is sent to the listeners corresponding to each related component, so that each component is re-rendered according to the update information.

[0010] In one embodiment, determining the update object and update operation corresponding to the preset action includes:

[0011] Determine the cursor position when the preset action is triggered;

[0012] Determine a corresponding target control according to the cursor position, and determine a corresponding update object and update operation according to the method bound to the target control;

[0013] The update object and the update operation are respectively determined as the update object and the update operation corresponding to the preset action.

[0014] In one embodiment, determining the relevant component corresponding to the update object according to the subscription list of the update object includes:

[0015] Obtain a subscription list of the update object;

[0016] Determining, according to the subscription list, a target listener that has subscribed to the change of the update object;

[0017] A component to which any target listener is applied is determined, and the determined component is determined as a related component corresponding to the update object.

[0018] In one embodiment, when the type of the update operation is a full update, determining a target data state corresponding to the update object in a preset data state library, and updating the target data state according to the update operation includes:

[0019] Determine the preset data state library;

[0020] Querying the data state library for a data state that is consistent with the update object, and determining the data state as a target data state;

[0021] A data state for updating is determined according to the updating operation, and the target data state is replaced with the determined data state for updating in the data state library to complete the updating of the target data state.

[0022] In one embodiment, when the type of the update operation is a partial update, determining a target data state corresponding to the update object in a preset data state library, and updating the target data state according to the update operation includes:

[0023] Determine the preset data state library;

[0024] Querying the data state library for a data state that is consistent with the update object, and determining the data state as a target data state;

[0025] Determining a data state for updating according to the updating operation, and merging the determined data state for updating and the target data state to obtain a composite data state;

[0026] The target data state is replaced with the composite data state in the data state library to complete the update of the target data state.

[0027] In one embodiment, the process of creating the data state library includes:

[0028] Create a state management container and its corresponding instance, and initialize the state management container to obtain a first method for updating data state, a second method for obtaining data state, and a third method for subscribing to data state changes;

[0029] The first method, the second method and the third method are mounted on the instance of the state management container, and the finally obtained state management container is determined as the data state library.

[0030] In one embodiment, generating update information according to the update object and the updated target data state, and sending the update information to the listeners corresponding to each relevant component includes:

[0031] Obtaining a preset template text, and filling the template text with information according to the update object and the updated target data state to obtain update information;

[0032] The listener corresponding to each relevant component is determined, and each determined listener is traversed, and the update information is sent to the listener being traversed during the traversal.

[0033] In a second aspect, the present application provides a data status updating device, the device comprising:

[0034] An action detection module, used to determine the update object and update operation corresponding to the preset action when detecting the triggering of the preset action;

[0035] A component determination module, used to determine the relevant components corresponding to the update object according to the subscription list of the update object;

[0036] A state update module, used to determine a target data state corresponding to the update object in a preset data state library, and update the target data state according to the update operation;

[0037] The update notification module is used to generate update information according to the update object and the updated target data state when the update is completed, and send the update information to the listeners corresponding to each related component, so that each component can be re-rendered according to the update information.

[0038] In a third aspect, the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the data status update method described in any of the above embodiments.

[0039] In a fourth aspect, the present application provides a computer device, comprising: one or more processors, and a memory;

[0040] The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, the steps of the data status updating method described in any one of the above embodiments are performed.

[0041] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0042] The data status update method, device, storage medium and computer equipment provided by the present application include: when detecting the trigger of a preset action, determining the update object and update operation corresponding to the preset action, and determining the relevant components corresponding to the update object according to the subscription list of the update object. Then, the target data state corresponding to the update object is determined in the preset data state library, and the target data state is updated according to the update operation. When the update is completed, update information is generated according to the update object and the updated target data state, and the update information is sent to the listeners corresponding to each relevant component, so that each component is re-rendered according to the update information. In the process of data status update, the relevant components affected by the change of the update object can be determined through the subscription mechanism, and then when the update is completed, the update information can be generated and sent to the listeners corresponding to each relevant component, so that each relevant component can be re-rendered according to the update information. In this way, only the relevant components are re-rendered, and a more fine-grained data status update is achieved, and unnecessary re-rendering is avoided, thereby improving the efficiency and performance of data status update. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0044] Figure 1 A flowchart of a data status updating method provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of a process for determining an update object corresponding to a preset action and an update operation provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of a process for determining relevant components corresponding to an update object according to a subscription list of the update object provided in an embodiment of the present application;

[0047] Figure 4 A schematic diagram of the structure of a data status updating device provided in an embodiment of the present application;

[0048] Figure 5 An internal structure diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0050] like Figure 1 As shown, the present application provides a data status update method, which is described by taking application to a client as an example. The data status update method specifically includes:

[0051] S101: When a preset action is detected to be triggered, an update object and an update operation corresponding to the preset action are determined.

[0052] The preset action refers to a preset interactive operation. For example, the preset action may be clicking a specific button control, etc. The update object refers to the data state that the preset action will change. The update operation refers to the operation to be performed on the update object.

[0053] In this step, when the user interacts with the client, if the user triggers a preset action, the client detects that the user has triggered the preset action, and the client can determine the corresponding update object and update operation through the triggered preset action.

[0054] Specifically, a preset action list can be set in advance, and the specified interactive operations can be merged into the preset action list. When the user interacts with the client, the user's interactive operation is detected. If the interactive operation belongs to the interactive operation specified in the preset action list, it is considered that the user has triggered the preset action. If the interactive operation does not belong to the interactive operation specified in the preset action list, it is considered that the user has not triggered the preset action. It should be noted that the interactive operations specified in the preset action list can be adjusted according to actual needs, and this application does not impose specific restrictions on this.

[0055] It can be understood that the data state in the present application can be understood as the state in the global state management method, that is, the data state refers to the data used by the application to describe the current status during the operation of the application, which includes but is not limited to data entered by the user, data obtained from the server, configuration information within the application, and display status of the interface, etc.

[0056] S102: Determine the relevant components corresponding to the update object according to the subscription list of the update object.

[0057] The subscription list refers to a list of listeners that record changes in subscribed update objects. The related component refers to a component that depends on the update object. It is understandable that when the display result or the calculation process of the display result of a component depends on the update object, the component can be determined as a related component of the update object.

[0058] In this step, the client can obtain the subscription list of the update object, and then determine the listener that has subscribed to the changes of the update object based on the subscription list of the update object, and then determine the component that depends on the update object, that is, the related components corresponding to the update object, based on the listener that has subscribed to the changes of the update object.

[0059] Specifically, a listener is a tool for listening to changes in data status. In one example, a listener can be added through the subscribe function. When a component subscribes to updates to a certain data status, the subscription can be completed through the Hook mechanism. For example, the subscribe function is called inside the useEffect function in the Hook to implement the subscription to a certain data status update.

[0060] S103: Determine a target data state corresponding to the update object in a preset data state library, and update the target data state according to the update operation.

[0061] Among them, the data state library is a centralized state container used to store the data state of the application.

[0062] In this step, when the update object and the update operation are determined, the target data state matching the update object is searched and determined in the data state library, and then the target data state in the data state library is updated using the update operation.

[0063] Furthermore, in the process of updating the target data state, the target data state in the database state library may be updated by calling a method for updating the data state in the data state library.

[0064] S104: When the update is completed, update information is generated according to the update object and the updated target data state, and the update information is sent to the listeners corresponding to each related component, so that each component is re-rendered according to the update information.

[0065] In this step, when the target data state is updated, the update object and update operation are summarized to generate update information, and then the update information is sent to the listeners of each relevant component corresponding to the update object. When the listener receives the update information, the client can compare whether the data state corresponding to the update object in the component is consistent with the updated target data state. If they are consistent, the component update may not be triggered. If they are inconsistent, the component re-rendering is triggered.

[0066] The data status update method, device, storage medium and computer equipment provided by the present application include: when detecting the trigger of a preset action, determining the update object and update operation corresponding to the preset action, and determining the relevant components corresponding to the update object according to the subscription list of the update object. Then, the target data state corresponding to the update object is determined in the preset data state library, and the target data state is updated according to the update operation. When the update is completed, update information is generated according to the update object and the updated target data state, and the update information is sent to the listeners corresponding to each relevant component, so that each component is re-rendered according to the update information. In the process of data status update, the relevant components affected by the change of the update object can be determined through the subscription mechanism, and then when the update is completed, the update information can be generated and sent to the listeners corresponding to each relevant component, so that each relevant component can be re-rendered according to the update information. In this way, only the relevant components are re-rendered, and a more fine-grained data status update is achieved, and unnecessary re-rendering is avoided, thereby improving the efficiency and performance of data status update.

[0067] like Figure 2 As shown, in one embodiment, determining the update object and update operation corresponding to the preset action includes:

[0068] S201: Determine the cursor position when a preset action is triggered.

[0069] The cursor position refers to the coordinate position that triggers a preset action in the display interface of the client.

[0070] In this step, after detecting that the user has triggered a preset action, the client may determine the cursor position according to the coordinate position of the user triggering the preset action in the display interface.

[0071] S202: Determine the corresponding target control according to the cursor position, and determine the corresponding update object and update operation according to the method bound to the target control.

[0072] In this step, the target control where the cursor is located can be determined in the display interface through the cursor position, and then the method triggered by the target control after the preset action can be queried, and the update object and update operation can be determined based on the content defined in the method.

[0073] S203: Determine the update object and the update operation as the update object and the update operation corresponding to the preset action respectively.

[0074] In this embodiment, the corresponding target control is determined by the cursor position, and the update object and update operation are determined according to the method bound to the target control. This can intuitively determine the target control, and then quickly determine the update object and update operation based on the target control.

[0075] like Figure 3 As shown, in one embodiment, determining the relevant components corresponding to the update object according to the subscription list of the update object includes:

[0076] S301: Acquire a subscription list of an update object.

[0077] S302: Determine, according to the subscription list, a target listener that has subscribed to the change of the update object.

[0078] S303: Determine a component to which any target listener is applied, and determine the determined component as a related component corresponding to the update object.

[0079] In this embodiment, after obtaining the subscription list of the update object, the listener that has subscribed to the change of the update object, that is, the target listener, can be determined according to the subscription list, and then the component that uses any target listener can be queried, and finally the queried component can be determined as the relevant component corresponding to the update object. In this process, the target listener that subscribes to the change of the update object can be determined based on the subscription list, and then the relevant components that depend on the update object can be determined through the target listener, so that only the components with actual page updates can be re-rendered to avoid unnecessary re-rendering, save system resources, and further improve the efficiency and performance of data status updates.

[0080] In one embodiment, when the type of the update operation is a full update, determining a target data state corresponding to the update object in a preset data state library, and updating the target data state according to the update operation includes:

[0081] S1: Determine a preset data state library.

[0082] S2: Query the data state consistent with the update object in the data state library, and determine the data state as the target data state.

[0083] For example, assuming that in a calculation scenario of a counter application, if the update object is count (count value), count can be updated to search for a data state named count in the data state library, and then the data state found in the data state library is determined as the target data state.

[0084] S3: Determine a data state for updating according to the update operation, and replace the target data state with the determined data state for updating in the data state library to complete the update of the target data state.

[0085] In this step, the client can determine the data state for updating according to the update operation and the target data state. For example, assuming that the update operation is to add one to the count and the target data state is 2, the data state for updating can be determined to be 3. Next, the type of the update operation is obtained. When the type of the update operation is to update all, the target data state in the data state library is replaced with the determined data state for updating.

[0086] Furthermore, in the process of updating the target data state, the target data state may be replaced by calling a method for updating the data state defined in the data state library.

[0087] In one example, the type of update operation can be adjusted by setting the replace parameter.

[0088] In one embodiment, when the type of the update operation is a partial update, determining a target data state corresponding to the update object in a preset data state library, and updating the target data state according to the update operation includes:

[0089] S1: Determine a preset data state library.

[0090] S2: Query the data state consistent with the update object in the data state library, and determine the data state as the target data state.

[0091] The description of S1 and S2 in this embodiment can refer to the description of S1 and S2 in the previous embodiment.

[0092] S3: Determine a data state for updating according to the update operation, and merge the determined data state for updating and the target data state to obtain a composite data state.

[0093] In this step, the client can determine the data state for updating according to the update operation and the target data state. For example, assuming that the update operation is to add one to the count and the target data state is 2, the data state for updating can be determined to be 3. Next, the type of the update operation is obtained. When the type of the update operation is a partial update, the determined data state for updating and the target data state are merged, and the merged data state is determined as a composite data state.

[0094] Furthermore, the process of merging the data state for updating and the target data state may include: querying the target object to be updated in the target data state according to the data state for updating, and replacing the target object in the target data state with the determined data state for updating to obtain a new target data state, i.e., a composite data state.

[0095] In one example, the determined data state for updating and the target data state may be merged by calling the Object.assign method.

[0096] Exemplarily, take calling the Object.assign method to merge the determined data state for updating and the target data state as an example. Assume that the target data state is oldState = { count: 1, name: 'product1'}, and the determined data state for updating is newState = { count: 2}. At this time, you can call the Object.assign(oldState, newState) method, and oldState will be updated to { count: 2, name: 'product1'}, which is the composite data state. It should be noted that the name attribute is not changed here because name is not redefined in the determined data state for updating.

[0097] S4: Replace the target data state with the composite data state in the data state library to complete the update of the target data state.

[0098] In the above two embodiments, based on different types of update operations, different update strategies are adopted to update the target data state in the data state library, which can improve the flexibility of data state update and help to reasonably allocate system resources, thereby improving the efficiency and performance of data state update.

[0099] In one embodiment, the process of creating a data state library includes:

[0100] S1: Create a state management container and its corresponding instance, and initialize the state management container to obtain a first method for updating data status, a second method for obtaining data status, and a third method for subscribing to data status changes.

[0101] S2: Mount the first method, the second method, and the third method to an instance of a state management container, and determine the state management container finally obtained as a data state library.

[0102] In this embodiment, a state management container can be created through a specific function, and then the created state management container is initialized to obtain a first method for updating data status, a second method for obtaining data status, and a third method for subscribing to data status changes. Then, the first method, the second method, and the third method are mounted on an instance of the state management container, so that the first method, the second method, or the third method can be called through the instance of the state management container, thereby realizing the update, acquisition, or subscription of the data status in the data state library.

[0103] Specifically, in the existing global state management solution, for each state update, an action type needs to be defined, and a corresponding action creator function needs to be created to generate an action object. For example, in a simple counter application, both increasing and decreasing counts need to define action types (such as INCREMENT, DECREMENT) and corresponding action creator functions respectively. Based on the data state library created in this embodiment, the first method, the second method, or the third method can be directly called through the instance of the data state library, thereby improving the efficiency of data state update.

[0104] In one embodiment, update information is generated according to the update object and the updated target data state, and the update information is sent to the listeners corresponding to each relevant component, including:

[0105] S1: Obtain a preset template text, and fill the template text with information according to the update object and the updated target data state to obtain update information.

[0106] S2: Determine the listener corresponding to each relevant component, and traverse each determined listener, and send update information to the listener being traversed during the traversal.

[0107] The template text refers to a preset update information template.

[0108] In this embodiment, the template text is filled with information to obtain update information, and the update information is sent to the listener corresponding to each relevant component by traversal. In this way, the template of the update information can be unified to ensure the standardization of the update information, so that the key information can be quickly and conveniently obtained when the update information is extracted.

[0109] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0110] The data status updating device provided in the embodiment of the present application is described below. The data status updating device described below and the data status updating method described above can refer to each other.

[0111] like Figure 4 As shown, the present application provides a data status updating device 400, the device comprising:

[0112] The action detection module 401 is used to determine the update object and update operation corresponding to the preset action when detecting the triggering of the preset action;

[0113] The component determination module 402 is used to determine the relevant components corresponding to the update object according to the subscription list of the update object;

[0114] The state updating module 403 is used to determine the target data state corresponding to the update object in the preset data state library, and update the target data state according to the update operation;

[0115] The update notification module 404 is used to generate update information according to the update object and the updated target data state when the update is completed, and send the update information to the listeners corresponding to each related component, so that each component is re-rendered according to the update information.

[0116] In one embodiment, the motion detection module includes:

[0117] A position determination submodule, used to determine the cursor position when a preset action is triggered;

[0118] The control determination submodule is used to determine the corresponding target control according to the cursor position, and determine the corresponding update object and update operation according to the method bound to the target control;

[0119] The information determination submodule is used to determine the update object and the update operation as the update object and the update operation corresponding to the preset action respectively.

[0120] In one embodiment, the component determination module includes:

[0121] List acquisition submodule, used to obtain the subscription list of the updated object;

[0122] A listener determination submodule, used to determine a target listener for a change of a subscribed update object according to a subscription list;

[0123] The component determination submodule is used to determine the component of any target listener of the application, and determine the determined component as the relevant component corresponding to the update object.

[0124] In one embodiment, the status update module includes:

[0125] A first determination submodule is used to determine a preset data state library;

[0126] A second determination submodule is used to search the data state library for a data state that is consistent with the update object, and determine the data state as the target data state;

[0127] The first updating submodule is used to determine the data state for updating according to the updating operation, and replace the target data state with the determined data state for updating in the data state library to complete the updating of the target data state.

[0128] In one embodiment, the status update module includes:

[0129] A third determination submodule is used to determine a preset data state library;

[0130] A fourth determination submodule is used to search the data state library for a data state that is consistent with the update object, and determine the data state as the target data state;

[0131] A state merging submodule, used to determine a data state for updating according to an updating operation, and merge the determined data state for updating and a target data state to obtain a composite data state;

[0132] The second updating submodule is used to replace the target data state with the composite data state in the data state library to complete the update of the target data state.

[0133] In one embodiment, the status update module includes:

[0134] An initialization submodule, used to create a state management container and its corresponding instance, and initialize the state management container to obtain a first method for updating data status, a second method for obtaining data status, and a third method for subscribing to data status changes;

[0135] The method mounting submodule is used to mount the first method, the second method and the third method onto the instance of the state management container, and determine the finally obtained state management container as the data state library.

[0136] In one embodiment, the update notification module includes:

[0137] The information filling submodule is used to obtain the preset template text, and fill the template text with information according to the update object and update operation to obtain the update information;

[0138] The update notification submodule is used to determine the listener corresponding to each relevant component, and traverse each determined listener, and send update information to the listener being traversed during the traversal.

[0139] The division of each module in the above-mentioned data status update device is only for illustration. In other embodiments, the data status update device can be divided into different modules as needed to complete all or part of the functions of the above-mentioned data status update device. Each module in the above-mentioned data status update device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0140] In one embodiment, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the data status update method described in any of the above embodiments.

[0141] In one embodiment, the present application also provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the data status updating method as described in any one of the above embodiments.

[0142] Indicatively, if Figure 5 As shown, Figure 5 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 500 may be provided as a server. Figure 5, the computer device 500 includes a processing component 502, which further includes one or more processors, and a memory resource represented by a memory 501, for storing instructions that can be executed by the processing component 502, such as an application. The application stored in the memory 501 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 502 is configured to execute instructions to perform the data status update method of any of the above embodiments.

[0143] The computer device 500 may further include a power supply component 503 configured to perform power management of the computer device 500, a wired or wireless network interface 504 configured to connect the computer device 500 to a network, and an input / output (I / O) interface 505. The computer device 500 may operate based on an operating system stored in the memory 501, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.

[0144] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0145] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish an entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only include those elements, but also include other elements that are not clearly listed, or also include elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, the singular "one", "one" and "described / the" may also include plural forms, unless the context clearly indicates another way. It should also be understood that the terms "include / comprise" or "have" etc. specify the existence of stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the existence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.

[0146] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0147] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data status updating method, characterized in that: The method comprises: When a preset action is detected to be triggered, an update object and an update operation corresponding to the preset action are determined; Determining, according to the subscription list of the update object, the relevant components corresponding to the update object; Determining a target data state corresponding to the update object in a preset data state library, and updating the target data state according to the update operation; When the update is completed, update information is generated according to the update object and the updated target data state, and the update information is sent to the listeners corresponding to each related component, so that each component is re-rendered according to the update information.

2. The data status updating method according to claim 1, characterized in that: The determining the update object and update operation corresponding to the preset action includes: Determine the cursor position when the preset action is triggered; Determine a corresponding target control according to the cursor position, and determine a corresponding update object and update operation according to the method bound to the target control; The update object and the update operation are respectively determined as the update object and the update operation corresponding to the preset action.

3. The data status updating method according to claim 1, characterized in that: The determining, according to the subscription list of the update object, the related component corresponding to the update object comprises: Obtain a subscription list of the update object; Determining, according to the subscription list, a target listener that has subscribed to the change of the update object; A component to which any target listener is applied is determined, and the determined component is determined as a related component corresponding to the update object.

4. The data status updating method according to claim 1, characterized in that: When the type of the update operation is a full update, determining a target data state corresponding to the update object in a preset data state library, and updating the target data state according to the update operation, includes: Determine the preset data state library; Querying the data state library for a data state that is consistent with the update object, and determining the data state as a target data state; A data state for updating is determined according to the updating operation, and the target data state is replaced with the determined data state for updating in the data state library to complete the updating of the target data state.

5. The data status updating method according to claim 1, characterized in that: When the type of the update operation is a partial update, determining a target data state corresponding to the update object in a preset data state library, and updating the target data state according to the update operation, includes: Determine the preset data state library; Querying the data state library for a data state that is consistent with the update object, and determining the data state as a target data state; Determining a data state for updating according to the updating operation, and merging the determined data state for updating and the target data state to obtain a composite data state; The target data state is replaced with the composite data state in the data state library to complete the update of the target data state.

6. The data status updating method according to any one of claims 1 to 5, characterized in that: The process of creating the data state library includes: Create a state management container and its corresponding instance, and initialize the state management container to obtain a first method for updating data state, a second method for obtaining data state, and a third method for subscribing to data state changes; The first method, the second method and the third method are mounted on the instance of the state management container, and the finally obtained state management container is determined as the data state library.

7. The data status updating method according to claim 1, characterized in that: The generating update information according to the update object and the updated target data state, and sending the update information to the listeners corresponding to each relevant component, includes: Obtaining a preset template text, and filling the template text with information according to the update object and the updated target data state to obtain update information; The listener corresponding to each relevant component is determined, and each determined listener is traversed, and the update information is sent to the listener being traversed during the traversal.

8. A data status updating device, characterized in that: The device comprises: An action detection module, used to determine the update object and update operation corresponding to the preset action when detecting the triggering of the preset action; A component determination module, used to determine the relevant components corresponding to the update object according to the subscription list of the update object; A state update module, used to determine a target data state corresponding to the update object in a preset data state library, and update the target data state according to the update operation; The update notification module is used to generate update information according to the update object and the updated target data state when the update is completed, and send the update information to the listeners corresponding to each related component, so that each component can be re-rendered according to the update information.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the data status updating method according to any one of claims 1 to 7.

10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the data status updating method according to any one of claims 1 to 7 are performed.

Citation Information

Cited By

  • Method and system for optimizing eBPF monitoring service based on dynamic subscription mechanism

    CN119906757A

  • Method and System for Optimizing eBPF Monitoring Service Based on Dynamic Subscription Mechanism

    CN119906757B

  • Client page rendering system and method based on data driving, medium, terminal and program product

    CN121858810A

  • Data-driven client-side page rendering systems, methods, media, terminals, and application products

    CN121858810B