Signal-based WeChat applet state management method and system
By using the signal of the two-way linked list data structure implemented in the WeChat applet using the TypeScript language, combined with the decorator and Effect class, the problem of complex signal dependency management is solved, and efficient state management and performance improvement is achieved.
Patent Information
- Application Number
- CN202411605742.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-07
AI Technical Summary
The existing technology cannot efficiently manage complex signal dependencies in WeChat applets, which makes it difficult to meet performance requirements. The dynamic typed language of JavaScript lacks type checking, which easily introduces hidden dangers.
The signal of the two-way linked list data structure based on TypeScript language is adopted, and the declaration of signal attributes is simplified through the decorator, the signal attributes are converted into responsive signals, and the Effect class is designed for signal collection and automatic tracking operations, and the batch update mechanism is used to improve performance.
It realizes efficient dependency tracking and notification between signals, avoids redundant calculations and updates, improves system performance, simplifies state management, and enhances code reliability and maintainability.
Smart Images

Figure CN119577273A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to a signal-based WeChat applet status management method and system. Background Art
[0002] With the widespread use of WeChat mini-programs, developers have an increasing demand for high-performance, highly maintainable code. Existing mini-program frameworks usually rely on manually calling the setData method when processing responsive data updates. This approach can easily lead to code redundancy, chaotic state management, and may cause performance issues.
[0003] Traditional responsive programming models, such as React and Vue, provide mature state management solutions, but they have certain limitations when directly applied in WeChat applets. In addition, the existing signal model mostly uses a simple dependency tracking mechanism during implementation, which cannot efficiently manage complex dependencies and is difficult to meet the performance requirements of large-scale applications. As the scale of applications increases, JavaScript, as a dynamically typed language, lacks type checking and is prone to introducing hidden dangers.
[0004] It can be seen that the above-mentioned prior art still has inconveniences and defects in use, and it is urgent to be further improved. How to create a new signal-based WeChat applet state management method and system, and efficiently implement signal management and responsive programming in WeChat applet, especially how to efficiently handle the dependency between signals, has become a goal that the industry urgently needs to improve. Summary of the invention
[0005] In view of this, the embodiments of the present disclosure provide a signal-based WeChat applet status management method and system to solve the problem that the existing signal model adopts a simple dependency tracking mechanism during implementation, cannot efficiently manage complex dependencies, and is difficult to meet the performance requirements of large-scale applications. JavaScript, as a dynamic type language, lacks type checking and is prone to introduce hidden dangers.
[0006] In a first aspect, the present disclosure provides a signal-based WeChat applet status management method, the method comprising the following steps:
[0007] Get the signal of the doubly linked list data structure implemented in TypeScript language;
[0008] Simplify the declaration of signal attributes based on decorators and convert signal attributes into responsive signals;
[0009] Design a doubly linked list Effect class for the responsive signal to perform signal collection and automatic tracking operations;
[0010] The responsive signals are processed in batches through the batch update mechanism to obtain batch signals. When the dependent signals change, the Effect class is notified to respond to the batch signals after batch processing.
[0011] When the batch signal is updated, the batch signal is automatically triggered to be recalculated based on the Effect class;
[0012] Based on the signal management framework and the mini-program integrated response, the Effect class is called to capture the signal changes and notify the page rendering update.
[0013] According to a specific implementation of an embodiment of the present disclosure, the signal of the bidirectional linked list data structure implemented based on the TypeScript language includes:
[0014] A readable and writable signal uses a doubly linked list data structure to store the current value and version information of the data and manage the associated dependencies and side effects.
[0015] According to a specific implementation of an embodiment of the present disclosure, the Effect class performs signal collection and automatic tracking operations, including:
[0016] Define side effects and manage dependent signals of the Effect class through a doubly linked list. When dependent signals change, recalculation is automatically triggered or automatic tracking operations are performed.
[0017] According to a specific implementation of the embodiment of the present disclosure, the step of batch processing the responsive signals through a batch update mechanism to obtain batch processed signals includes:
[0018] Provides a batch method to batch update signals within a function scope to avoid triggering side effects every time a signal is updated;
[0019] The recursive depth is controlled based on batchDepth and batchIteration during the reading and updating of the signal.
[0020] According to a specific implementation of an embodiment of the present disclosure, the integrated response based on the signal management framework and the mini-program includes:
[0021] Provides methods for registering, searching, and deleting signal controllers, as well as methods for managing mini-program components or pages.
[0022] According to a specific implementation of the embodiment of the present disclosure, the integrated response based on the signal management framework and the mini-program further includes:
[0023] The SignalController class is designed as the management center for signals and side effects. It provides signal update rate setting, subscription, and status update methods. It creates controllers based on the TypeScript language to manage the status of pages or components.
[0024] In a second aspect, the present disclosure provides a signal-based WeChat applet state management system, the system comprising:
[0025] A signal data module is configured to provide a signal code of a bidirectional linked list data structure implemented based on the TypeScript language;
[0026] The decorator module is configured to simplify the declaration of signal attributes and convert signal attributes into responsive signals
[0027] A signal dependency tracking module is configured to perform signal collection and automatic tracking operations on the Effect class of the bidirectional linked list designed for the responsive signal;
[0028] The batch update processing module is configured to process the responsive signals in batches through the batch update mechanism to obtain batch processing signals. When the dependent signals change, the Effect class is notified to respond to the batch processing signals after batch processing.
[0029] The signal dependency tracking module is further configured to automatically trigger recalculation of the batch signal when the batch signal is updated based on the Effect class;
[0030] The mini-program integration module is configured to respond to mini-program integration based on the signal management framework, call the Effect class to capture signal changes and notify page rendering updates.
[0031] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0032] at least one processor; and,
[0033] a memory communicatively connected to the at least one processor; wherein,
[0034] The memory stores instructions that can be executed by the at least one processor. When the instructions are executed by the at least one processor, the at least one processor implements the signal-based WeChat mini-program status management method described in any one of the first aspect or any one of the implementations of the first aspect.
[0035] In a fourth aspect, an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, which stores computer instructions, and when the computer instructions are executed by at least one processor, the at least one processor executes the signal-based WeChat applet status management method in the aforementioned first aspect or any implementation of the first aspect.
[0036] In the fifth aspect, the embodiments of the present disclosure also provide a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the signal-based WeChat mini-program status management method in the aforementioned first aspect or any implementation of the first aspect.
[0037] The embodiments of the present invention have the following advantages:
[0038] 1. The signal-based WeChat applet state management method in the embodiment of the present disclosure realizes efficient dependency tracking and notification between signals through the data structure of a bidirectional linked list, avoids redundant calculations and updates, improves system performance, and realizes efficient dependency management;
[0039] 2. Developers do not need to call setData manually. Through the responsive signal mechanism, the display of the page or component is automatically updated, which reduces the redundancy and complexity of the code and simplifies state management;
[0040] 3. Prevent circular dependencies: In the process of reading and updating signals, use variables such as currentContext and batchDepth to prevent circular dependencies and stack overflows, ensure system stability, and use TypeScript's type system to provide static type checking, which can detect type errors at compile time, avoid runtime errors, and improve code reliability;
[0041] 4. Use decorators to simplify the code. Using decorators can greatly simplify the definition of signal attributes, reduce boilerplate code, and improve code readability. Decorators provide metaprogramming capabilities, which can add new functions or modify behaviors without changing the original logic, thereby enhancing the scalability of the code.
[0042] 5. Easy to integrate and expand. The WeGet framework provides a seamless integration method with WeChat mini-program pages and components. Developers can easily apply it to existing projects to improve development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The above is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0044] Figure 1 A flowchart of a signal-based WeChat applet status management method provided in an embodiment of the present disclosure;
[0045] Figure 2 A schematic diagram of a signal flow of a bidirectional linked list data structure implemented in TypeScript language provided in an embodiment of the present disclosure;
[0046] Figure 3 A schematic diagram of a flow chart of signal collection and automatic tracking operations for the Effect class of a responsive signal provided in an embodiment of the present disclosure;
[0047] Figure 4 A schematic diagram of the structure of a bidirectional linked list of signal dependencies provided in an embodiment of the present disclosure;
[0048] Figure 5 A schematic diagram of the structure of a signal-based WeChat applet status management system provided in an embodiment of the present disclosure;
[0049] Figure 6 A schematic diagram of the process of integrating the WeGet framework provided in the embodiment of the present disclosure;
[0050] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0051] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0052] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0053] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement a device and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0054] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0055] The embodiment of the present invention provides a signal-based WeChat applet state management method and system, and relates to a signal (Signal) state management and responsive programming method and system implemented in the WeChat applet based on a bidirectional linked list, TypeScript language and decorator technology. Specifically, a signal-based WeChat applet state management method is provided, which can improve the state management efficiency and responsive performance of components and pages in the WeChat applet. By adopting the TypeScript language to increase the type system, the reliability and maintainability of the code can be improved. By using decorator (Decorator) metaprogramming, the writing of the code is simplified; the existing signal (Signal) model adopts a simple dependency tracking mechanism in the implementation process, which cannot efficiently manage complex dependencies and is difficult to meet the performance requirements of large-scale applications. JavaScript, as a dynamic type language, lacks type checking and is prone to introduce hidden dangers.
[0056] Figure 1 The flowchart of the signal-based WeChat applet status management method provided in the embodiment of the present disclosure includes at least the following steps S110 to S160.
[0057] like Figure 1 As shown, the method comprises the following steps:
[0058] Step S110: Acquire a signal of a bidirectional linked list data structure implemented based on the TypeScript language.
[0059] Exemplarily, a Signal class based on a doubly linked list is designed. The Signal class is used to create a readable and writable signal, and adopts a doubly linked list data structure to save the current value and version information of the data and manage the dependencies and side effects related thereto.
[0060] Specifically, the Signal class is written in TypeScript and uses a doubly linked list to manage dependencies. Each Signal instance maintains source and target properties. The source represents the list of nodes that depend on the signal, and the target represents the list of Effects that the signal depends on. This enables it to efficiently track and update associated Effects. By using version numbers, the update process can also be optimized to avoid unnecessary calculations.
[0061] In an embodiment of the present invention, the signal created in step S110 maintains the current execution context through the get method and set method of the signal. When reading the signal value, the dependency relationship between the signals is dynamically constructed, and the dependency relationship of the signals is stored using a bidirectional linked list structure to achieve efficient dependency addition, removal and notification.
[0062] Step S120: Simplify the declaration of signal attributes based on the decorator and convert the signal attributes into a responsive signal.
[0063] Specifically, in step S120, a decorator is designed to simplify the declaration of signal attributes, and the attributes of the class are defined as responsive signals through simple codes. The decorator automatically creates a corresponding Signal instance for the attribute, and automatically delegates to the get and set methods of the signal when reading and modifying the attribute value.
[0064] Specifically, use TypeScript's decorator syntax to define a decorator to simplify the declaration of signal properties, and define a decorator function to convert the property into a signal.
[0065] Step S130: Designing an Effect class of a bidirectional linked list for responsive signals to perform signal collection and automatic tracking operations.
[0066] In an embodiment of the present invention, the Effect class is designed to define side effects. When the dependent signal changes, it automatically triggers recalculation or execution of the set operation. The dependent signal of the Effect is managed through a bidirectional linked list to achieve efficient dependency tracking and updating.
[0067] Step S140: The responsive signals are batch processed through a batch update mechanism to obtain batch processed signals. When the dependent signals change, the Effect class is notified to respond to the batch processed signals.
[0068] Specifically, a batch method is provided to batch update signals within a function scope to avoid triggering side effects every time the signal is updated, thereby improving performance. During the batch update process, the variables batchDepth and batchIteration are used to control the recursive depth to avoid circular dependencies and stack overflows.
[0069] For example, during the signal reading and updating process, track the current context, define depth limits, prevent circular dependencies and stack overflows, define a batch function to optimize the performance when updating multiple signals, check whether it is already in the batch, if it is already in the batch, directly execute the function and return the result, if it is not in the batch, increase the batch depth, execute the passed function, run the batch regardless of whether the function is executed successfully, perform final sorting and inspection, and prevent circular dependencies and optimize performance.
[0070] Specifically, batch updates are implemented through batch functions, which can batch update signals within a scope to avoid multiple triggering of side effects and improve performance. The batch function is used for batch updates. The batch function creates a context. All updates in the context will be processed in batches. Multiple update operations can be performed in the batch processing context.
[0071] Step S150: When the batch processing signal is updated based on the Effect class, the batch processing signal is automatically triggered to be recalculated.
[0072] In the embodiment of the present invention, the Effect class automatically triggers tracking to recalculate the signals after batch processing, thereby realizing efficient dependency tracking and updating.
[0073] Step S160: Based on the signal management framework and the mini-program integrated response, the Effect class is called to capture the signal change and notify the page rendering update.
[0074] Exemplarily, the signal management framework provides methods for registering, searching, and deleting signal controllers, as well as methods for managing their relationship with mini-program components or pages. Signal management functions are integrated into the pages and components of WeChat mini-programs through high-order functions for the convenience of developers. The signal management framework is the WeGet framework, which is integrated with WeChat mini-programs. The WeGet framework integrates the advantages of TypeScript and decorators, and provides a concise interface and type-safe signal management methods.
[0075] Specifically, the integrated response based on the WeGet signal management framework and the mini-program also includes designing the SignalController class as the management center of signals and side effects, providing signal update rate setting, subscription, and status update methods, creating a controller based on the TypeScript language, and managing the status of the page or component.
[0076] like Figure 3 and Figure 4 As shown, the signal-based WeChat applet state management method proposed in the present invention implements the signal of the bidirectional linked list data structure based on the TypeScript language, realizes efficient dependency management between signals, solves the problem of low dependency tracking efficiency in the prior art, simplifies the declaration of signal attributes based on decorators, converts signal attributes into responsive signals, simplifies the definition and use of signals, improves the readability and development efficiency of the code, designs the Effect class for responsive signals, manages the dependent signals of the Effect class through a bidirectional linked list, performs signal collection and automatic tracking operations, and batch processes the responsive signals through a batch update mechanism to obtain batch processed signals. In the process of reading and updating the signals, cu rrentContext, batchDepth and other variables to prevent circular dependencies and stack overflows, prevent circular dependencies, and ensure system stability. When the dependent signal changes, the Effect class is notified to respond to the batch signal after batch processing. When the batch signal is updated based on the Effect class, it automatically triggers the recalculation of the batch signal to achieve efficient dependency tracking and updating. Based on the signal management framework and the mini program integrated response, the Effect class is called to capture the signal changes and notify the page rendering update. The signal management framework WeGet provides a seamless integration method with WeChat mini program pages and components. Developers can easily apply it to existing projects to improve development efficiency.
[0077] like Figure 2 As shown, the signal of the bidirectional linked list data structure implemented based on the TypeScript language at least includes the following steps S11 to S14.
[0078] Step S11, define and store the actual value of Signal, define the version number of Signal, define and store the list of nodes that depend on Signal, and define and store the list of Effects that Signal depends on.
[0079] Step S12: The constructor accepts an initial value and sets the version number to 0.
[0080] Step S13, when reading the value of Signal, the get method will be called, first adding a new dependent node, then updating the version number of the node, and finally returning the actual value.
[0081] Step S14, when setting the new value of Signal, the set method will be called, first check whether the new value is different from the old value, if different, update the value and notify the related Effect list.
[0082] Specifically, in the get and set methods of the signal, the current execution context is maintained. When reading the signal value, the dependency relationship between signals is dynamically constructed to implement the signal dependency tracking mechanism. A bidirectional linked list structure is used to store the signal dependency relationship to achieve efficient dependency addition, removal, and notification.
[0083] It should be noted that decorators are used to simplify signal properties. Decorators automatically create corresponding Signal instances for the properties, and automatically delegate to the get and set methods of the signal when reading and modifying property values.
[0084] Figure 5 and Figure 6 The signal-based WeChat applet state management system 400 provided by the present invention is shown, including a signal data module 410, a decorator module 420, a signal dependency tracking module 430, a batch update processing module 440 and an applet integration module 450;
[0085] The signal data module 410 is configured to provide a signal code of a bidirectional linked list data structure implemented based on the TypeScript language;
[0086] A decorator module 420, configured to simplify the declaration of signal properties and convert the signal properties into responsive signals;
[0087] A signal dependency tracking module 430 is configured to perform signal collection and automatic tracking operations on the Effect class of the bidirectional linked list of the responsive signal design;
[0088] The batch update processing module 440 is configured to pass the responsive signal through the batch update mechanism, determine the data type of the responsive signal, perform batch processing to obtain the batch processing signal, and notify the Effect class to respond to the batch processing signal after the batch processing when the dependent signal changes;
[0089] The signal dependency tracking module 430 is further configured to automatically trigger recalculation of the batch signal when the batch signal is updated based on the Effect class;
[0090] The mini-program integration module 450 is configured to integrate the mini-program response based on the signal management framework, call the Effect class to capture the signal change and notify the page rendering update.
[0091] See also Figure 7The present disclosure also provides an electronic device 50, which includes:
[0092] at least one processor; and,
[0093] a memory communicatively connected to the at least one processor; wherein,
[0094] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the signal-based WeChat applet status management method in the aforementioned method embodiment.
[0095] The embodiments of the present disclosure also provide a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the signal-based WeChat applet status management method in the aforementioned method embodiment.
[0096] The embodiments of the present disclosure also provide a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the signal-based WeChat applet status management method in the aforementioned method embodiment.
[0097] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device 50 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0098] like Figure 7 As shown, the electronic device 50 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 50 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0099] Typically, the following devices may be connected to the I / O interface 505: input devices 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 509. The communication device 509 may allow the electronic device 50 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 50 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
[0100] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0101] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0102] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0103] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains at least two Internet Protocol addresses; sends a node evaluation request including the at least two Internet Protocol addresses to a node evaluation device, wherein the node evaluation device selects an Internet Protocol address from the at least two Internet Protocol addresses and returns it; receives the Internet Protocol address returned by the node evaluation device; wherein the obtained Internet Protocol address indicates an edge node in a content distribution network.
[0104] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: receives a node evaluation request including at least two Internet Protocol addresses; selects an Internet Protocol address from the at least two Internet Protocol addresses; and returns the selected Internet Protocol address; wherein the received Internet Protocol address indicates an edge node in a content distribution network.
[0105] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0106] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0107] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0108] It should be understood that various parts of the present disclosure may be implemented in hardware, software, firmware or a combination thereof.
[0109] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A signal-based WeChat applet status management method, characterized in that: The method comprises the following steps: Get the signal of the doubly linked list data structure implemented in TypeScript language; Simplify the declaration of signal attributes based on decorators and convert signal attributes into responsive signals; Design a doubly linked list Effect class for the responsive signal to perform signal collection and automatic tracking operations; The responsive signals are processed in batches through the batch update mechanism to obtain batch signals. When the dependent signals change, the Effect class is notified to respond to the batch signals after batch processing. When the batch signal is updated, the batch signal is automatically triggered to be recalculated based on the Effect class; Based on the signal management framework and the mini-program integrated response, the Effect class is called to capture the signal changes and notify the page rendering update.
2. The signal-based WeChat applet status management method according to claim 1, characterized in that: The signal of the bidirectional linked list data structure implemented based on the TypeScript language includes: A readable and writable signal uses a doubly linked list data structure to save the current value and version information of the data and manage associated dependencies and side effects.
3. The signal-based WeChat applet status management method according to claim 2, characterized in that: The Effect class performs signal collection and automatic tracking operations, including: Define side effects and manage dependent signals of the Effect class through a doubly linked list. When dependent signals change, recalculation is automatically triggered or automatic tracking operations are performed.
4. The signal-based WeChat applet status management method according to claim 3, characterized in that: The step of batch processing the responsive signals through a batch update mechanism to obtain batch processed signals includes: Provides a batch method to batch update signals within a function scope to avoid triggering side effects every time a signal is updated; The recursive depth is controlled based on batchDepth and batchIteration during the reading and updating of the signal.
5. The signal-based WeChat applet status management method according to claim 1, characterized in that: The integrated response based on the signal management framework and the mini-program includes: Provides methods for registering, searching, and deleting signal controllers, as well as methods for managing mini-program components or pages.
6. The signal-based WeChat applet status management method according to claim 1, characterized in that: The integrated response based on the signal management framework and the mini-program also includes: The SignalController class is designed as the management center for signals and side effects. It provides signal update rate setting, subscription, and status update methods. It creates controllers based on the TypeScript language to manage the status of pages or components.
7. A signal-based WeChat applet status management system, characterized in that: The system comprises: A signal data module is configured to provide a signal code of a bidirectional linked list data structure implemented based on the TypeScript language; The decorator module is configured to simplify the declaration of signal properties and convert signal properties into responsive signals; A signal dependency tracking module is configured to perform signal collection and automatic tracking operations on the Effect class of the bidirectional linked list designed for the responsive signal; The batch update processing module is configured to process the responsive signals in batches through the batch update mechanism to obtain batch processing signals. When the dependent signals change, the Effect class is notified to respond to the batch processing signals after batch processing. The signal dependency tracking module is further configured to automatically trigger recalculation of the batch signal when the batch signal is updated based on the Effect class; The mini-program integration module is configured to respond to mini-program integration based on the signal management framework, call the Effect class to capture signal changes and notify page rendering updates.
8. An electronic device, characterized in that: The electronic device includes: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor. When the instructions are executed by the at least one processor, the at least one processor executes the signal-based WeChat mini-program status management method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed by at least one processor, cause the at least one processor to execute the signal-based WeChat applet status management method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of the signal-based WeChat mini-program status management method described in any one of claims 1 to 6.