Component state management method and device, computer equipment and storage medium

By creating dependency object management objects of function components in the application and implementing lightweight listeners using Hooks functions, the existing state management tools have solved the problem of high network overhead and learning difficulty, and achieved more efficient component state management and Development efficiency.

CN118963796APending Publication Date: 2024-11-15PING AN INT FINANCIAL LEASING CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410979257.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

Existing state management tools such as Redux, MobX or Vuex have high network overhead on applications, high learning difficulty, and affect development efficiency.

Method used

By creating a management object of the dependent object of the function component and encapsulating the management object based on the Hooks function, a lightweight listener is obtained, monitoring the update of the dependent object, and updating the status of the function component according to the updated dependent object.

Benefits of technology

It reduces the total code size and network overhead of the application, improves development efficiency, and is less difficult to learn.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963796A_ABST
    Figure CN118963796A_ABST
Patent Text Reader

Abstract

The invention provides a component state management method and device, computer equipment and a storage medium. The method comprises the steps of creating a management object of a dependency object of a function component; packaging the management object based on a Hooks function to obtain a monitor of the dependent object, and monitoring the dependent object through the monitor; and under the condition that the monitor monitors that the dependent object is updated, updating the state of the function component according to the updated dependent object. According to the method, lightweight component state management is realized, the total code volume of the application program can be effectively reduced, the network overhead of the application program is reduced, the learning difficulty is relatively low, and the development efficiency of the application is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of application development, and in particular to a component status management method, apparatus, computer equipment and storage medium. Background Art

[0002] With the rapid development of computer and software technology, enterprises can provide customers with better and more convenient business services by developing applications for customers to use. However, the business complexity of financial enterprises, insurance companies or hospitals is relatively high, and the components contained in the applications to be developed are relatively large and complex. Therefore, it is necessary to manage the status of the components in the application in order to develop maintainable, scalable and easy-to-understand applications. At present, state management tools such as Redux, MobX or Vuex are mainly used to manage the status of components in the application. However, state management tools such as Redux, MobX or Vuex are large in size, have a greater impact on the network overhead of the application, and are difficult to learn. They are extremely demanding on developers and are not conducive to improving application development efficiency. Summary of the invention

[0003] The embodiments of the present application provide a component status management method, apparatus, computer device, and storage medium, which are intended to reduce the network overhead of an application and improve application development efficiency.

[0004] In a first aspect, an embodiment of the present application provides a component status management method, including:

[0005] Create a management object for the dependent objects of the function component;

[0006] Encapsulating the management object based on the Hooks function, obtaining the listener of the dependent object, and monitoring the dependent object through the listener;

[0007] When the listener monitors that the dependent object is updated, the state of the function component is updated according to the updated dependent object.

[0008] In a second aspect, an embodiment of the present application further provides a component status management device, the component status management device comprising:

[0009] Object creation module, used to create management objects of dependent objects of function components;

[0010] A listener creation module, used to encapsulate the management object based on the hooks function to obtain a listener, and monitor the dependent object through the listener;

[0011] The state update module is used to update the state of the function component according to the updated dependent object when the dependent object is updated through the listener.

[0012] In a third aspect, an embodiment of the present application further provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the component status management method described in the first aspect are implemented.

[0013] In a fourth aspect, an embodiment of the present application further provides a storage medium for computer-readable storage, wherein a computer program is stored on the storage medium, wherein when the computer program is executed by a processor, the steps of the component status management method described in the first aspect are implemented.

[0014] The embodiments of the present application provide a component state management method, apparatus, computer equipment and storage medium. By creating a management object of a dependent object of a function component and encapsulating the management object based on a Hooks function, a lightweight listener can be obtained. The dependent object is then listened to by the listener, and when an update of the dependent object is detected, the state of the function component is updated according to the updated dependent object, thereby realizing lightweight component state management, effectively reducing the total code size of the application, reducing the network overhead of the application, and having a low learning difficulty, thereby effectively improving the development efficiency of the application. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0016] Figure 1 It is a flowchart of a component status management method provided in an embodiment of the present application;

[0017] Figure 2 It is a flowchart of another component status management method provided by an embodiment of the present application;

[0018] Figure 3 is a schematic block diagram of a component status management device provided in an embodiment of the present application;

[0019] Figure 4 yes Figure 3 A schematic block diagram of a submodule of a component status management device in;

[0020] Figure 5 It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application.

[0021] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0022] 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 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.

[0023] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0024] With the rapid development of computer and software technology, enterprises can provide customers with better and more convenient business services by developing applications for customers to use. However, the business complexity of financial enterprises, insurance companies or hospitals is relatively high, and the components contained in the applications to be developed are relatively large and complex. Therefore, it is necessary to manage the status of the components in the application in order to develop maintainable, scalable and easy-to-understand applications. At present, state management tools such as Redux, MobX or Vuex are mainly used to manage the status of components in the application. However, state management tools such as Redux, MobX or Vuex are large in size, have a greater impact on the network overhead of the application, and are difficult to learn. They are extremely demanding on developers and are not conducive to improving application development efficiency.

[0025] To solve the above problems, the embodiments of the present application provide a component state management method, device, computer equipment and storage medium. The method can obtain a lightweight listener by creating a management object of the dependent object of the function component and encapsulating the management object based on the Hooks function, and then listen to the dependent object through the listener, and when the dependent object is updated, the state of the function component is updated according to the updated dependent object, thereby realizing lightweight component state management, which can effectively reduce the total code volume of the application, reduce the network overhead of the application, and has a low learning difficulty, effectively improving the development efficiency of the application.

[0026] The component state management method can be applied to a computer device, which may include a terminal device or a server. The terminal device may include a mobile phone, a tablet computer, a laptop computer, a desktop computer, and a personal digital assistant. The server may be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0027] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0028] See also Figure 1 , Figure 1 It is a flowchart of a component status management method provided in an embodiment of the present application.

[0029] like Figure 1 As shown, the component status management method includes steps S101 to S103.

[0030] Step S101: Create a management object for the dependent object of the function component.

[0031] In this embodiment, the functional component (FunctionalComponent) to which the dependent object of the management object needs to be created can be any functional component in the application. The application can include multiple UI components, and the multiple UI components can include multiple functional components and multiple class components (Class Component). The functional component is a UI component defined by a JavaScript function, and the class component is a UI component defined using a class. Among them, the dependent object of the functional component refers to an object that has a dependency relationship with the functional component, which can specifically be data that needs to be consumed by the functional component, and the data has a need to be monitored.

[0032] In some embodiments, the dependent objects of the function components are stored in a weakMap data structure. In this embodiment, the dependent objects of the function components are stored in a weakMap data structure, so that when the dependent objects are garbage collected, the memory they occupy will be automatically released, which can reduce memory usage and improve the performance of the application, and can also avoid memory leaks.

[0033] In some embodiments, creating a management object of a dependent object of a function component may include: detecting whether the current operating environment of the function component supports the Proxy function; if the current operating environment of the function component supports the Proxy function, creating a management object of the dependent object of the function component based on the Proxy function; if the current operating environment of the function component does not support the Proxy function, creating a management object of the dependent object of the function component based on the definePropety function. Among them, the management object created based on the Proxy function is a Proxy object, and the management object created based on the definePropety function is a definePropety object. This embodiment can improve compatibility by using an object creation function that matches the current operating environment to create a management object of a dependent object of a function component.

[0034] In some embodiments, detecting whether the current operating environment of a function component supports a Proxy function may include: executing a preset environment detection instruction to obtain a detection result of the current operating environment of the function component; when the detection result includes a preset keyword, determining that the current operating environment of the function component supports the Proxy function; when the environment detection result does not include a preset keyword, determining that the current operating environment of the function component does not support the Proxy function. Among them, there is a binding relationship between the preset environment detection instruction and the preset keyword, and the preset environment detection instruction and the preset keyword can be set based on actual conditions, and the embodiments of the present application do not specifically limit this. For example, the preset environment detection instruction is proxy.toString(), and the preset keyword bound to it is native code.

[0035] Step S102: encapsulate the management object based on the Hooks function, obtain the listener of the dependent object, and monitor the dependent object through the listener.

[0036] In this embodiment, the Hooks function may include a useState function and a useEffect function. The Hooks function may encapsulate the management object of the dependent object as a listener of the dependent object, so that when the state of the dependent object changes, the listener may be used to know that the state of the dependent object has changed.

[0037] Step S103: When the listener detects that the dependent object is updated, the state of the function component is updated according to the updated dependent object.

[0038] In this embodiment, when the listener detects that the dependent object is updated, an instruction for updating the state of the function component is triggered. The instruction can be implemented by the updateState function to modify the state data of the function component and trigger re-rendering of the function component.

[0039] In some embodiments, when the relationship between the dependent object and the function component changes from a dependent relationship to a non-dependent relationship, the management object and the listener corresponding to the dependent object are deleted. This embodiment can save memory and storage space by deleting the corresponding management object and the listener created before when the dependent object of the function component is no longer dependent.

[0040] In some embodiments, Figure 2 As shown, after step S102, the following steps are also included:

[0041] Step S104: When the listener detects that the dependent object is updated, the updated dependent object is recorded as a tree node and added to the state backtracking queue bound to the function component.

[0042] In this embodiment, an empty state backtracking queue can be established in advance and bound to the function component. In this way, when the dependent object of the function component is updated, the updated dependent object can be recorded as a tree node in time and added to the state backtracking queue bound to the function component.

[0043] In some embodiments, when the dependent object of the function component is updated for the first time, an empty state backtracking queue can be established and the empty state backtracking queue can be bound to the function component. The updated dependent object can then be recorded as a tree node and added to the state backtracking queue bound to the function component.

[0044] In some embodiments, the state backtracking queue is stored in localStorage. In this embodiment, the state backtracking queue is stored in localStorage so that the state backtracking queue can be persistent and convenient for subsequent state backtracking.

[0045] Step S105: When the state backtracking instruction of the function component is obtained, the state backtracking of the function component is performed according to the state backtracking queue and the state backtracking instruction.

[0046] In this embodiment, when a dependent object is updated, the updated dependent object is recorded as a tree node and added to the state backtracking queue, which facilitates the state backtracking of the function component, improves the stability of the function component, and provides a better user experience. The state backtracking instruction can be manually triggered by the user or automatically triggered by the computer device, and this embodiment of the application does not specifically limit this.

[0047] In some embodiments, the state backtracking instruction may include a component identifier and a tree node identifier, wherein the component identifier is used to indicate the function component on which the state backtracking instruction is effective, and the tree node identifier is used to indicate the tree node used for state backtracking of the function component. According to the state backtracking queue and the state backtracking instruction, state backtracking of the function component may include: according to the state backtracking instruction, obtaining the corresponding tree node from the state backtracking queue; and according to the tree node obtained from the state backtracking queue, state backtracking of the function component. Specifically, a tree node corresponding to the tree node identifier in the state backtracking instruction is obtained from the state backtracking queue, and based on the obtained tree node, state backtracking of the function component is performed.

[0048] For example, the state backtracking queue includes tree node A, tree node B and tree node C. Tree node A is the dependency object of the function component recorded at time t1, tree node B is the dependency object of the function component recorded at time t2, and tree node C is the dependency object of the function component recorded at time t3. Time t1 is earlier than time t2, and time t2 is earlier than time t3. The identifiers of tree node A, tree node B and tree node C are Root_A, Root_B and Root_C respectively. The application to which the function component belongs is automatically restarted due to some faults, thereby triggering the state backtracking instruction of the function component, and the component identifier in the state backtracking instruction is Root_C. At this time, based on the dependency object of the function component recorded at time t3, the state of the function component is backtracked.

[0049] See also Figure 3 , Figure 3 It is a schematic block diagram of a component status management device provided in an embodiment of the present application.

[0050] like Figure 3 As shown, the component state management device 100 includes:

[0051] An object creation module 110, used to create a management object of a dependent object of a function component;

[0052] A listener creation module 120, used to encapsulate the management object based on the hooks function to obtain a listener, and monitor the dependent object through the listener;

[0053] The state updating module 130 is used to update the state of the function component according to the updated dependent object when the listener monitors that the dependent object is updated.

[0054] In some embodiments, the component status management device 100 further includes:

[0055] A node adding module, for recording the updated dependent object as a tree node and adding it to a state backtracking queue bound to the function component when the dependent object is updated through the listener;

[0056] The state backtracking module is used to perform state backtracking on the function component according to the state backtracking queue and the state backtracking instruction when the state backtracking instruction of the function component is obtained.

[0057] In some embodiments, the state backtracking queue is stored in localStorage.

[0058] In some embodiments, the state backtracking module is further used to:

[0059] According to the state backtracking instruction, obtaining the corresponding tree node from the state backtracking queue;

[0060] Perform state backtracking on the function component according to the tree node obtained from the state backtracking queue.

[0061] In some embodiments, Figure 4 As shown, the object creation module 110 includes:

[0062] A detection submodule 111 is used to detect whether the current operating environment of the function component supports the Proxy function;

[0063] A first creation submodule 112 is used to create a management object of a dependent object of the function component based on the Proxy function when the current running environment of the function component supports the Proxy function;

[0064] The second creation submodule 113 is used to create a management object of the dependent object of the function component based on the definePropety function when the current running environment of the function component does not support the Proxy function.

[0065] In some embodiments, the detection submodule is further used to:

[0066] Execute a preset environment detection instruction to obtain a detection result of the current running environment of the function component;

[0067] When the detection result includes a preset keyword, determining that the current running environment of the function component supports the Proxy function;

[0068] When the environment detection result does not include the preset keyword, it is determined that the current running environment of the function component does not support the Proxy function.

[0069] In some embodiments, the component status management device 100 further includes:

[0070] The deletion module is used to delete the management object and the listener corresponding to the dependent object when the relationship between the dependent object and the function component changes from a dependent relationship to a non-dependent relationship.

[0071] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules and units can refer to the corresponding processes in the aforementioned component status management method embodiment, and will not be repeated here.

[0072] The apparatus provided in the above embodiment may be implemented in the form of a computer program. The computer program may be Figure 5 Runs on the computer device shown.

[0073] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server or a terminal device.

[0074] like Figure 5 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a storage medium and an internal memory.

[0075] The storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any component state management method.

[0076] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0077] The network interface is used for network communication, such as sending assigned tasks, etc. 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.

[0078] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0079] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0080] Create a management object for the dependent objects of the function component;

[0081] Encapsulating the management object based on the Hooks function, obtaining the listener of the dependent object, and monitoring the dependent object through the listener;

[0082] When the listener monitors that the dependent object is updated, the state of the function component is updated according to the updated dependent object.

[0083] In some embodiments, after encapsulating the management object based on the hooks function to obtain the listener, and monitoring the dependent object through the listener, the processor is further used to implement:

[0084] When the listener monitors that the dependent object is updated, the updated dependent object is recorded as a tree node and added to the state backtracking queue bound to the function component;

[0085] When the state backtracking instruction of the function component is obtained, the state backtracking of the function component is performed according to the state backtracking queue and the state backtracking instruction.

[0086] In some embodiments, the state backtracking queue is stored in localStorage.

[0087] In some embodiments, when the processor performs state backtracking on the function component according to the state backtracking queue and the state backtracking instruction, the processor is used to implement:

[0088] According to the state backtracking instruction, obtaining the corresponding tree node from the state backtracking queue;

[0089] Perform state backtracking on the function component according to the tree node obtained from the state backtracking queue.

[0090] In some embodiments, the processor, when implementing the creation of a management object of a dependency object of a function component, is used to implement:

[0091] Detect whether the current running environment of the function component supports the Proxy function;

[0092] In the case that the current running environment of the function component supports the Proxy function, creating a management object of the dependent object of the function component based on the Proxy function;

[0093] In the case that the current running environment of the function component does not support the Proxy function, a management object of the dependent object of the function component is created based on the definePropety function.

[0094] In some embodiments, when the processor detects whether the current operating environment of the function component supports the Proxy function, it is used to implement:

[0095] Execute a preset environment detection instruction to obtain a detection result of the current running environment of the function component;

[0096] When the detection result includes a preset keyword, determining that the current running environment of the function component supports the Proxy function;

[0097] When the environment detection result does not include the preset keyword, it is determined that the current running environment of the function component does not support the Proxy function.

[0098] In some embodiments, the processor is further configured to implement:

[0099] When the relationship between the dependent object and the function component changes from a dependent relationship to a non-dependent relationship, the management object and the listener corresponding to the dependent object are deleted.

[0100] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the computer device described above can refer to the corresponding process in the aforementioned component status management method embodiment, and will not be repeated here.

[0101] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0102] An embodiment of the present application further provides a storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the component status management method of the present application.

[0103] The storage medium may be volatile or non-volatile. The storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0104] Furthermore, the storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0105] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0106] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0107] It should also be understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0108] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A component state management method, It is characterized in that include: Create a management object for the dependent objects of the function component; Encapsulating the management object based on the Hooks function, obtaining the listener of the dependent object, and monitoring the dependent object through the listener; When the listener monitors that the dependent object is updated, the state of the function component is updated according to the updated dependent object.

2. The component status management method according to claim 1, It is characterized in that After encapsulating the management object based on the hooks function to obtain a listener, and monitoring the dependent object through the listener, the method further includes: When the listener monitors that the dependent object is updated, the updated dependent object is recorded as a tree node and added to the state backtracking queue bound to the function component; When the state backtracking instruction of the function component is obtained, the state backtracking of the function component is performed according to the state backtracking queue and the state backtracking instruction.

3. The component status management method according to claim 2, It is characterized in that The state backtracking queue is stored in the form of localStorage.

4. The component status management method according to claim 2, It is characterized in that The step of performing state backtracking on the function component according to the state backtracking queue and the state backtracking instruction includes: According to the state backtracking instruction, obtaining the corresponding tree node from the state backtracking queue; Perform state backtracking on the function component according to the tree node obtained from the state backtracking queue.

5. The component status management method according to any one of claims 1 to 4, It is characterized in that The creation of a management object of a dependent object of a function component includes: Detect whether the current running environment of the function component supports the Proxy function; In the case that the current running environment of the function component supports the Proxy function, creating a management object of the dependent object of the function component based on the Proxy function; In the case that the current running environment of the function component does not support the Proxy function, a management object of the dependent object of the function component is created based on the definePropety function.

6. The component status management method according to claim 5, It is characterized in that The detecting whether the current running environment of the function component supports the Proxy function includes: Execute a preset environment detection instruction to obtain a detection result of the current running environment of the function component; When the detection result includes a preset keyword, determining that the current running environment of the function component supports the Proxy function; When the environment detection result does not include the preset keyword, it is determined that the current running environment of the function component does not support the Proxy function.

7. The component status management method according to any one of claims 1 to 4, It is characterized in that The method further comprises: When the relationship between the dependent object and the function component changes from a dependent relationship to a non-dependent relationship, the management object and the listener corresponding to the dependent object are deleted.

8. A component status management device, It is characterized in that The component status management device comprises: The object creation module is used to create management objects of dependent objects of function components; A listener creation module, used to encapsulate the management object based on the hooks function to obtain a listener, and monitor the dependent object through the listener; The state update module is used to update the state of the function component according to the updated dependent object when the dependent object is updated through the listener.

9. A computer device, It is characterized in that The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the component status management method according to any one of claims 1 to 7 are implemented.

10. A storage medium for computer-readable storage, It is characterized in that The storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the component status management method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Side effect recovery method and device, equipment and storage medium

    CN121636374A

  • Side effect recovery method, apparatus, device, and storage medium

    CN121636374B