Page management method, system, electronic device and storage medium
By adopting a strategic mode in the RN page management, the logic of each RN page is independently configured in different strategic categories, solving the code redundancy and maintenance difficulties of multi -RN page management, and achieved efficient page loading and performance improvement.
Patent Information
- Application Number
- CN202210608561.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-05-31
AI Technical Summary
The existing technology cannot effectively manage multiple RN pages, resulting in code redundancy, maintenance difficulties and performance impact.
Adopt a strategic mode, configure the logic of each RN page in different strategic classes, so that each RN page has independent logic and does not couple with other business logic. The client calls the specific strategy class and view component of the target by passing the call parameter, and efficiently loads the target RN page.
The logic independence of each RN page is realized, the code redundance is avoided, the development efficiency and maintenance convenience are improved, the maintenance cost is reduced, and the performance experience of the client is improved.
Smart Images

Figure CN114968209B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of page development, and in particular to a page management method, system, electronic device and storage medium. Background Art
[0002] React Native (RN for short) is a cross-platform mobile application development framework that supports iOS (a mobile operating system) and Android (a mobile operating system). It has a rich UI (User Interface) experience and has become a popular mobile development technology. More and more mobile applications use RN for page development.
[0003] Currently, for the management of RN pages, in the case of multiple RN pages (such as live broadcast scenarios), all RN pages are managed through a Manager object, which has the following problems: the logic of all RN pages is mixed together, which not only causes code redundancy, resulting in the need to write basic logic for each RN page separately, but also makes maintenance and expansion inconvenient. Every time an RN page is modified, every logic needs to be changed, and every time a new RN page is added, the basic logic needs to be rewritten. In addition, the coupling is serious, resulting in complex page calls, affecting client performance.
[0004] It can be seen that the current RN page management method cannot achieve effective management of multiple RN pages.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] In view of this, the present invention provides a page management method, system, electronic device and storage medium, which, at least based on the policy mode, configures the logic of each RN page in a different policy class, so that each RN page has independent logic cohesive in its own policy class, and is not coupled with other business logic, thereby realizing the logical independence of each RN page, which not only avoids code redundancy and improves development efficiency, but also facilitates subsequent maintenance and expansion, and reduces maintenance costs; in addition, when loading the RN page, the client does not need to pay attention to the specific page logic, and can call the corresponding policy class by passing in the calling parameters. Based on the called policy class and the view component of the multi-page structure, the target RN page can be efficiently loaded and generated, thereby improving the client's performance experience and realizing effective management of multiple RN pages.
[0007] According to one aspect of the present invention, there is provided a page management method, which is applied to a multi-page structure developed based on a cross-platform mobile application development framework RN, and the page management method comprises: in response to a page call request, parsing the call parameters of the page call request, and obtaining the target specific policy class corresponding to the call parameters; the multi-page structure is based on a policy pattern, and is configured with a plurality of specific policy classes, each of which is configured with the page logic of the corresponding RN page; calling the target specific policy class and the view component of the multi-page structure, and configuring the display style of the multi-page structure in the view component; and loading and generating the target RN page according to the page logic and the display style configured in the target specific policy class.
[0008] In some embodiments, the multi-page structure is further configured with a context component, which depends on the view component and each of the specific strategy classes; in the context component, based on the factory pattern, a mapping relationship between call parameters and specific strategy classes is configured.
[0009] In some embodiments, the page logic configured in the target specific policy class includes: loading logic, callback logic, removal logic and refresh logic of the target RN page.
[0010] In some embodiments, the multi-page structure is further configured with an abstract policy class, and each of the specific policy classes inherits the abstract policy class.
[0011] In some embodiments, the page management method also includes: in response to a policy addition request, configuring a new specific policy class in the multi-page structure, so that the new specific policy class inherits the abstract policy class of the multi-page structure, and makes the context component of the multi-page structure dependent on the new specific policy class.
[0012] In some embodiments, the page management method further includes: in response to a policy modification request, modifying a corresponding specific policy class in the multi-page structure.
[0013] In some embodiments, the view component uses a frame layout method to perform RN page layout.
[0014] According to one aspect of the present invention, there is provided a page management system, which is applied to a multi-page structure developed based on a cross-platform mobile application development framework RN, and the page management system comprises: a parsing module, which is used to respond to a page call request, parse the call parameters of the page call request, and obtain the target specific policy class corresponding to the call parameters; the multi-page structure is based on a policy pattern, and is configured with multiple specific policy classes, each of which is configured with the page logic of the corresponding RN page; a calling module, which is used to call the target specific policy class and the view component of the multi-page structure, and the display style of the multi-page structure is configured in the view component; a loading module, which is used to load and generate the target RN page according to the page logic and the display style configured in the target specific policy class.
[0015] According to one aspect of the present invention, there is provided an electronic device, comprising: a processor; and a memory, wherein the memory stores executable instructions; wherein when the executable instructions are executed by the processor, the page management method as described in any of the above embodiments is implemented.
[0016] According to one aspect of the present invention, a computer-readable storage medium is provided for storing a program, wherein when the program is executed by a processor, the page management method as described in any of the above embodiments is implemented.
[0017] The beneficial effects of the present invention compared with the prior art include at least:
[0018] The page management scheme of the present invention is at least based on the strategy mode, and the page logic of each RN page is configured in different specific strategy classes, so that each RN page has independent logic cohesive in its own specific strategy class, and is not coupled with other business logic, so as to realize the logical independence of each RN page. It not only avoids code redundancy and eliminates the need to write basic logic for each RN page separately, thereby improving development efficiency, but also facilitates subsequent maintenance and expansion. When modifying / adding RN pages, only changes need to be made to a single RN page, thereby reducing maintenance costs. In addition, when loading the RN page, the client does not need to pay attention to the specific page logic, but can call the corresponding target specific strategy class by passing in the calling parameters, thereby realizing simple and convenient page calling. Based on the called target specific strategy class and the view component of the multi-page structure, the target RN page can be efficiently loaded and generated, thereby improving the performance experience of the client and realizing effective management of multiple RN pages.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification are used to explain the principles of the present invention. Obviously, the accompanying drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0021] Figure 1 A schematic diagram showing the steps of a page management method in one embodiment of the present invention;
[0022] Figure 2 A class diagram showing a multi-page structure in one embodiment of the present invention;
[0023] Figure 3 A schematic diagram of modules of a page management system in one embodiment of the present invention is shown;
[0024] Figure 4 A schematic structural diagram of an electronic device in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0025] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to make the present invention comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art.
[0026] The accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0027] In addition, the processes shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps can be decomposed, some steps can be combined or partially combined, and the actual execution order may change according to the actual situation. It should be noted that the embodiments of the present invention and the features in different embodiments can be combined with each other without conflict.
[0028] The page management method of the embodiment of the present invention is applied to a multi-page structure developed based on the cross-platform mobile application development framework RN, and is used to manage multiple RN pages on the Android mobile platform. In scenarios with multiple RN pages, such as live broadcast scenarios on e-commerce platforms, there are multiple RN pages such as live broadcast rooms, live comment areas, live broadcast gift lists, live broadcast shopping cards, etc., which are interrelated and nested. The current RN page management method manages all RN pages through a Manager object, and mixes all page logics together, which neither guarantees the logical independence of RN pages nor achieves effective management of RN pages. The page management method of the embodiment of the present invention, that is, for situations with multiple RN pages such as live broadcast scenarios, achieves effective management of multiple RN pages by ensuring the logical independence of different RN pages and uniformly managing the loading of different RN pages.
[0029] Hereinafter, the page management method of an embodiment of the present invention will be described by taking the management of multiple RN pages in a live broadcast scenario as an example. In the following embodiment, the so-called RN page specifically refers to a full-screen View nested in the live broadcast page.
[0030] Figure 1 Shows the main steps of the page management method, Figure 2 A class diagram showing a multi-page structure, combined with Figure 1 and Figure 2 As shown, in one embodiment, the page management method includes:
[0031] Step S110, in response to the page call request, parse the call parameters of the page call request, and obtain the target specific policy class corresponding to the call parameters; the multi-page structure is based on the policy mode and is configured with multiple specific policy classes, and each specific policy class is configured with the page logic of the corresponding RN page.
[0032] The Strategy pattern is suitable for managing a group of algorithms of the same type, encapsulating these algorithms in different classes, and calling the corresponding algorithms according to the execution scenario. Specifically in this embodiment, in the strategy pattern, some independent specific strategy classes are defined to encapsulate the page logic of different RN pages. The page logic of each RN page corresponds to a specific strategy class, that is, each specific strategy class encapsulates the page logic of an RN page. In order to ensure the consistency of these specific strategy classes, an abstract strategy class is also used to define the basic logic of each RN page.
[0033] The page logic configured in the target specific policy class includes: the target RN page loading logic (such as creating an RN link), callback logic (i.e., callback for loading success / failure), removal logic, and refresh logic. Traditional RN refresh logic and loading logic are written in different methods, which are easy to miss when modifying. This embodiment writes the refresh logic and loading logic together, which can facilitate the modification of the page logic of the target RN page and facilitate maintenance.
[0034] Figure 2 In the example, a "Live Shop Card Strategy" 210 is shown. The multi-page structure can also be configured with other specific strategy classes. Figure 2 The following are shown as limitations. In the specific strategy class 210 of the live shopping card, the page logic of the RN page corresponding to the live shopping card is configured, including the attribute "live Goods" (live goods), the type is "String" (string); the method "get Tag" (get tag), the return value type is "String"; the method "getBundle" (get Bundle, an executable file), the return value type is "Bundle"; the method "get URL" (get URL, Uniform Resource Locator, Uniform Resource Locator), the return value type is "String"; the method "getId" (get Id, Identity document, unique identifier), the return value type is "Int" (integer); the method "notifyUpdate" (notify update), no return value ("void"); the method "view Display Listener" (view display listener), no return value; the method "on Error" (error handling), no return value.
[0035] The multi-page structure is also configured with an abstract strategy class, and each specific strategy class inherits the abstract strategy class. Figure 2 , indicating the "Live Base RN Strategy" (strategy base class of live RN, i.e., abstract strategy class) 220. In the abstract strategy class 220, the basic logic of the RN page in the live scene is configured, including the attribute "room Param" (room parameter), the type is "ILive Room Base Data" (live room basic data); the method is inherited by the specific strategy class 210 of the live shopping card mentioned above, and will not be repeated.
[0036] Through the strategy pattern, the page logic of each RN page is configured in different specific strategy classes, so that each RN page has independent logic cohesive in its own specific strategy class, without being coupled with other business logic, thereby achieving logical independence of each RN page and reusing the basic logic of the RN page, thereby streamlining the page development code and improving page development efficiency.
[0037] Step S120, calling the target specific strategy class and the view component of the multi-page structure, and configuring the display style of the multi-page structure in the view component.
[0038] The target specific strategy class is a specific strategy class corresponding to the call parameters of the page call request, in which the page logic of the target page to be generated is configured. The multi-page structure is also configured with a context component, which depends on the view component and each specific strategy class; in the context component, based on the factory mode, the mapping relationship between the call parameters and the specific strategy class is configured.
[0039] In the context component, the usage logic of the algorithm, such as the calling logic, is configured. The specific implementation of the algorithm is configured in the specific strategy class.
[0040] Reference Figure 2 As shown, the "Live RN Strategy Context" (strategy context of live RN, i.e., context component) 230 is illustrated. The context component 230 depends on the specific strategy class 210 of the live shopping card and the "Live RN View" (live RN view, i.e., view component) 240. The context component 230 is used to respond to the page call request of the client. If the client needs to call a strategy, it only needs to communicate with the context component 230 without communicating with the specific implementation, thereby achieving decoupling between the client and the specific implementation. In the context component 230, based on the factory pattern, the attribute "rn Map" (RN mapping relationship) and the methods "show Shop Card" (show shopping card) and "hide Shop Card" (hide shopping card) are configured.
[0041] The view component 240 is configured with the attributes "room context", "rn fragment" and "strategy", as well as the methods "show" and "remove". The view component 240 can use the frame layout method 250 to perform RN page layout.
[0042] The context component 230 can determine the target specific policy class corresponding to the call parameters of the page call request based on the Map, and call the target specific policy class and the view component 240 .
[0043] Step S130, loading and generating the target RN page according to the page logic and display style configured in the target specific policy class.
[0044] Through the strategy mode + factory mode, the RN loading process is optimized. The strategy mode ensures the completeness of the loading logic of the RN page. Through the factory mode, the caller (i.e. the client) does not need to pay attention to the specific page logic when loading the RN page. It only needs to pass in the call parameters (such as triggering a shopping card button on the live page) to call the corresponding target specific strategy class. The relevant logic of the RN page can be implemented through simple and convenient page calls. Based on the called target specific strategy class and view component, the target RN page can be efficiently loaded and generated on the client, optimizing the client's RN page loading process and improving the client's loading performance and experience.
[0045] In one embodiment, the page management method also includes: in response to a policy addition request, configuring a new specific policy class in the multi-page structure, so that the new specific policy class inherits the abstract policy class of the multi-page structure, and makes the context component of the multi-page structure dependent on the new specific policy class; in response to a policy modification request, modifying the corresponding specific policy class in the multi-page structure.
[0046] Through the strategy mode, the logic of the RN page is more cohesive, and maintenance and expansion are more convenient. The newly added / modified page logic is configured in its own strategy class, which is not coupled with the logic of other RN pages, and the logic of other pages will not be affected by changing one RN page.
[0047] In summary, the above-mentioned page management solution, based on the strategy mode and the factory mode, configures the page logic of each RN page in each specific strategy class, so that each RN page has independent logic cohesive in its own specific strategy class, and is not coupled with other business logic, so as to realize the logical independence of each RN page. It not only avoids code redundancy, but also eliminates the need to write the basic logic for each RN page separately, realizes the reuse of basic logic, thereby improving development efficiency, and is also convenient for subsequent maintenance and expansion. When modifying / adding a new RN page, only a single RN page needs to be modified, thereby reducing maintenance costs; in addition, when loading the RN page, the client does not need to pay attention to the specific page logic, but can call the corresponding target specific strategy class by passing in the calling parameters, so as to realize simple and convenient page calling; based on the called target specific strategy class and the view component of the multi-page structure, it can efficiently load and generate the target RN page, improve the client's loading performance and other management experience, and realize effective management of multiple RN pages.
[0048] The embodiment of the present invention also provides a page management system, which can be used to implement the page management method described in any of the above embodiments. The features and principles of the page management method described in any of the above embodiments can be applied to the following page management system embodiments. In the following page management system embodiments, the features and principles of multi-RN page management that have been explained are not repeated.
[0049] Figure 3 Shows the main modules of the page management system, refer to Figure 3 As shown, in one embodiment, the page management system 300 is applied to a multi-page structure developed based on a cross-platform mobile application development framework RN, including: a parsing module 310, which is used to respond to a page call request, parse the call parameters of the page call request, and obtain the target specific policy class corresponding to the call parameters; the multi-page structure is based on a policy pattern, and is configured with multiple specific policy classes, and each specific policy class is configured with the page logic of the corresponding RN page; a calling module 320, which is used to call the target specific policy class and the view component of the multi-page structure, and the display style of the multi-page structure is configured in the view component; a loading module 330, which is used to load and generate the target RN page according to the page logic and display style configured in the target specific policy class.
[0050] Furthermore, the page management system 300 may also include modules for implementing other process steps of the above-mentioned embodiments of the page management method. The specific principles of each module can refer to the description of the above-mentioned embodiments of the page management method. The class diagram of the page management system 300 can refer to Figure 2 As shown, the description will not be repeated here.
[0051] As described above, the page management system of the present invention can configure the page logic of each RN page in each specific policy class based on the strategy pattern and the factory pattern, so that each RN page has independent logic cohesive in its own specific policy class, and is not coupled with other business logic, thereby realizing the logical independence of each RN page. It not only avoids code redundancy, but also eliminates the need to write the basic logic for each RN page separately, thereby realizing the reuse of basic logic, thereby improving development efficiency, and is also convenient for subsequent maintenance and expansion. When modifying / adding a new RN page, only a single RN page needs to be modified, thereby reducing maintenance costs. In addition, when loading the RN page, the client does not need to pay attention to the specific page logic, but can call the corresponding target specific policy class by passing in the call parameters, thereby realizing simple and convenient page calls. Based on the called target specific policy class and the view component of the multi-page structure, the target RN page can be efficiently loaded and generated, thereby improving the client's loading performance and other management experiences, thereby realizing effective management of multiple RN pages.
[0052] An embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein executable instructions are stored in the memory, and when the executable instructions are executed by the processor, the page management method described in any of the above embodiments is implemented.
[0053] The electronic device of the present invention can configure the page logic of each RN page in each specific policy class based on the strategy mode and the factory mode, so that each RN page has an independent logic cohesive in its own specific policy class, and is not coupled with other business logics, thereby realizing the logical independence of each RN page. It not only avoids code redundancy and eliminates the need to write the basic logic for each RN page separately, thereby realizing the reuse of the basic logic, thereby improving development efficiency, but also facilitates subsequent maintenance and expansion. When modifying / adding a new RN page, only a single RN page needs to be modified, thereby reducing maintenance costs. In addition, when loading the RN page, the client does not need to pay attention to the specific page logic, but can call the corresponding target specific policy class by passing in the call parameters, thereby realizing simple and convenient page calls. Based on the called target specific policy class and the view component of the multi-page structure, the target RN page can be efficiently loaded and generated, thereby improving the client's loading performance and other management experiences, thereby realizing effective management of multiple RN pages.
[0054] Figure 4 is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. It should be understood that: Figure 4 The modules are only schematically shown, and these modules may be virtual software modules or actual hardware modules. The combination and splitting of these modules and the addition of other modules are all within the protection scope of the present invention.
[0055] like Figure 4 As shown, the electronic device 400 is in the form of a general computing device. The components of the electronic device 400 include but are not limited to: at least one processing unit 410, at least one storage unit 420, a bus 430 connecting different platform components (including the storage unit 420 and the processing unit 410), a display unit 440, etc.
[0056] The storage unit 420 stores program codes, which can be executed by the processing unit 410, so that the processing unit 410 performs the steps of the page management method described in any of the above embodiments. For example, the processing unit 410 can perform the following steps: Figure 1 Steps shown.
[0057] The storage unit 420 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 4201 and / or a cache storage unit 4202 , and may further include a read-only storage unit (ROM) 4203 .
[0058] The storage unit 420 may also include a program / utility 4204 having one or more program modules 4205, such program modules 4205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0059] Bus 430 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0060] The electronic device 400 can also communicate with one or more external devices, which can be one or more of a keyboard, a pointing device, a Bluetooth device, etc. These external devices enable the user to communicate interactively with the electronic device 400. The electronic device 400 can also communicate with one or more other computing devices, and the computer device shown includes a router and a modem. This communication can be performed through an input / output (I / O) interface 450. In addition, the electronic device 400 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 460. The network adapter 460 can communicate with other modules of the electronic device 400 through a bus 430. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0061] The embodiment of the present invention further provides a computer-readable storage medium for storing a program, which implements the page management method described in any of the above embodiments when the program is executed. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the page management method described in any of the above embodiments.
[0062] When the storage medium of the present invention is executed by the processor, it can implement the configuration of the page logic of each RN page in each specific policy class based on the strategy mode and the factory mode, so that each RN page has an independent logic cohesive in its own specific policy class, and is not coupled with other business logics, so as to achieve the logical independence of each RN page, which not only avoids code redundancy and eliminates the need to write the basic logic for each RN page separately, thereby achieving the reuse of the basic logic, thereby improving the development efficiency, but also facilitates subsequent maintenance and expansion. When modifying / adding a new RN page, only a single RN page needs to be modified, thereby reducing the maintenance cost; in addition, when loading the RN page, the client does not need to pay attention to the specific page logic, and can call the corresponding target specific policy class by passing in the call parameters, thereby realizing simple and convenient page calling; based on the called target specific policy class and the view component of the multi-page structure, the target RN page can be efficiently loaded and generated, and the client's loading performance and other management experiences can be improved, thereby realizing effective management of multiple RN pages.
[0063] The storage medium may be a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the storage medium of the present invention is not limited thereto, and may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0064] The storage medium may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of readable storage media include, but are not limited to, an electrical connection with one or more wires, a portable 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 thereof.
[0065] The readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. The data signal of this propagation may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable signal medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0066] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device, such as through the Internet using an Internet service provider.
[0067] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A page management method, applied to a multi-page structure developed based on a cross-platform mobile application development framework RN, characterized in that: The page management method comprises: In response to a page call request, parsing the call parameters of the page call request, and obtaining a target specific policy class corresponding to the call parameters; the multi-page structure is based on a policy mode and is configured with multiple specific policy classes, each of which is configured with a page logic corresponding to the RN page; Calling the target specific strategy class and the view component of the multi-page structure, and configuring the display style of the multi-page structure in the view component; According to the page logic configured in the target specific policy class and the display style, the target RN page is loaded and generated.
2. The page management method according to claim 1, characterized in that: The multi-page structure is further configured with a context component, and the context component depends on the view component and each of the specific strategy classes; In the context component, a mapping relationship between call parameters and specific strategy classes is configured based on the factory mode.
3. The page management method according to claim 1, characterized in that: The page logic configured in the target specific strategy class includes: The loading logic, callback logic, removal logic and refresh logic of the target RN page.
4. The page management method according to claim 1, characterized in that: The multi-page structure is also configured with an abstract policy class, and each of the specific policy classes inherits the abstract policy class.
5. The page management method according to claim 1, characterized in that: Also includes: In response to a policy addition request, a new specific policy class is configured in the multi-page structure, so that the new specific policy class inherits the abstract policy class of the multi-page structure, and the context component of the multi-page structure depends on the new specific policy class.
6. The page management method according to claim 1, characterized in that: Also includes: In response to the policy modification request, the corresponding specific policy class in the multi-page structure is modified.
7. The page management method according to claim 1, characterized in that: The view component uses a frame layout method to perform RN page layout.
8. A page management system, applied to a multi-page structure developed based on a cross-platform mobile application development framework RN, characterized in that: The page management system includes: A parsing module, used to respond to a page call request, parse the call parameters of the page call request, and obtain the target specific policy class corresponding to the call parameters; the multi-page structure is based on the policy mode and is configured with multiple specific policy classes, and each of the specific policy classes is configured with the page logic of the corresponding RN page; A calling module, used for calling the target specific strategy class and the view component of the multi-page structure, wherein the display style of the multi-page structure is configured in the view component; The loading module is used to load and generate the target RN page according to the page logic configured in the target specific policy class and the display style.
9. An electronic device, characterized in that: include: A processor; a memory storing executable instructions; When the executable instruction is executed by the processor, the page management method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the page management method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
File generation method and page configuration method and device
CN114398023A
Pluggable framework
US20200201607A1