Global management method and device, electronic equipment and computer readable storage medium

By establishing global state management modules, global queues and global variables in the native applet and Taro component environment, the problem of global state association and data synchronization between native applets and Taro components is solved, and data and methods are shared, which improves development efficiency and security.

CN119597513APending Publication Date: 2025-03-11DUXIAOMAN TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411766697.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The global state association and data synchronization cannot be achieved between native applets and Taro components, resulting in high data synchronization complexity and cost.

Method used

By determining shared information, establishing a global state management module, and injecting it into the native applet and Taro component environment, creating global queues and global variables to achieve data and method associations between native applets and Taro components.

Benefits of technology

It solves the problem of global state data flow, realizes the sharing of data and methods, improves R&D migration and development efficiency, and avoids data uncontrollable and security problems caused by external tools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597513A_ABST
    Figure CN119597513A_ABST
Patent Text Reader

Abstract

The invention provides a global management method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of data processing. The global management method comprises the following steps: determining shared information, and establishing a global state management module based on the shared information; injecting the shared information into a native applet and a target component environment; the target component environment is used for creating a function module which can be executed in the native applet; creating a global queue in the native applet based on the shared information; creating a global variable in the target component environment based on the shared information; and performing global management on the shared information between the native applet and the target component environment based on the global state management module, the global queue and the global variable. According to the method, sharing of data and methods between the native applet and the target component environment is realized through the global queue and the global variable, and the problem of data circulation in a global state is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a global management method, device, electronic device and computer-readable storage medium. Background Art

[0002] The multi-terminal development framework (Taro) is an open cross-terminal and cross-framework solution. When the business requires performance on different terminals at the same time, the cost of writing multiple sets of codes for different terminals is obviously very high. At this time, through the Taro solution, only one set of code can be written to achieve the ability to adapt the business to multiple terminals.

[0003] In the above process, when native applet uses Taro components, it involves the problem of sharing data status between native applet and Taro components. There is a time difference between the operation of Taro state management tool and applet state management tool. If there is no synchronous update mechanism, the consistency of shared data cannot be ensured. In related technologies, data and method transmission is mainly carried out through event binding. The global state of native applet cannot be associated with Taro components, nor can it be linked with Taro components for data and status. The complexity and cost of data synchronization are high. Summary of the invention

[0004] In view of this, the embodiments of the present disclosure propose a global management method, device, electronic device and computer-readable storage medium to solve the problems in the related technology that the global state of the native applet cannot be associated with the Taro component, nor can it be linked with the Taro component for data and state, and the complexity and cost of data synchronization are high.

[0005] According to the first aspect of the present disclosure, a global management method is provided, including: determining shared information, and establishing a global state management module based on the shared information; injecting the shared information into a native applet and a target component environment; the target component environment is used to create functions executable in the native applet; creating a global queue in the native applet based on the shared information; creating global variables in the target component environment based on the shared information; and globally managing the shared information between the native applet and the target component environment based on the global state management module, the global queue and the global variables.

[0006] According to the second aspect of the present disclosure, a global management device is provided, including: an establishment module, used to determine shared information, and establish a global state management module based on the shared information; an injection module, used to inject the shared information into a native applet and a target component environment; the target component environment is used to create functions executable in the native applet; the establishment module is also used to create a global queue in the native applet based on the shared information; the establishment module is also used to create global variables in the target component environment based on the shared information; a management module is used to globally manage the shared information between the native applet and the target component environment based on the global state management module, the global queue and the global variables.

[0007] According to a third aspect of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory storing a program, wherein the program comprises instructions, which, when executed by the processor, cause the processor to perform the above-mentioned global management method.

[0008] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the above-mentioned global management method.

[0009] The exemplary embodiments of the present disclosure may have some or all of the following beneficial effects:

[0010] In the global management method provided in the example implementation of the present disclosure, shared information is determined, and a global state management module is established based on the shared information; the shared information is injected into the native applet and the target component environment; the target component environment is used to create functions executable in the native applet; a global queue is created in the native applet based on the shared information; a global variable is created in the target component environment based on the shared information; and the shared information between the native applet and the target component environment is globally managed based on the global state management module, the global queue, and the global variables. The global management method of the embodiment of the present disclosure injects shared information into the native applet and the target component environment, and creates a global queue in the native applet, and creates a global variable in the target component environment, so that the data and method association between the native applet and the target component environment can be realized based on the global queue and the global variables, which solves the data flow problem of the global state, plays a role in data and method sharing, and improves the efficiency of R&D migration and development.

[0011] 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 present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0013] Figure 1 A flowchart of a global management method according to an exemplary embodiment of the present disclosure is shown;

[0014] Figure 2 A schematic diagram showing a small program page of Club A according to an exemplary embodiment of the present disclosure;

[0015] Figure 3 A schematic diagram showing a details introduction page of a small program of Club A according to an exemplary embodiment of the present disclosure;

[0016] Figure 4 A flowchart of establishing a copy registration center in a native applet and establishing a global vector in a Taro component environment in another global management method according to an exemplary embodiment of the present disclosure is shown;

[0017] Figure 5 A flowchart of implementing global management when a user calls a global management method through a native page or a native component in another global management method according to an exemplary embodiment of the present disclosure is shown;

[0018] Figure 6 A flowchart of implementing global management when a user calls a global management method through a Taro component in another global management method according to an exemplary embodiment of the present disclosure is shown;

[0019] Figure 7 A schematic block diagram of a global management device according to an exemplary embodiment of the present disclosure is shown;

[0020] Figure 8 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0021] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0022] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0023] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0024] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0025] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0026] The embodiments of the present disclosure provide a global management method, device, electronic device and computer-readable storage medium. The following describes the solutions of the present disclosure with reference to the accompanying drawings.

[0027] The present disclosure embodiment first provides a global management method. Figure 1 As shown, the global management method specifically includes the following steps:

[0028] S110: Determine shared information, and establish a global state management module based on the shared information;

[0029] S120: Injecting the shared information into the native applet and the target component environment; the target component environment is used to create functions executable in the native applet;

[0030] S130: Creating a global queue in the native applet based on the shared information;

[0031] S140: Creating global variables in the target component environment based on the shared information;

[0032] S150: Perform global management of shared information between the native applet and the target component environment based on the global state management module, the global queue and the global variables.

[0033] In the global management method provided in the embodiment of the present disclosure, shared information is injected into the native applet and the target component environment, and a global queue is created in the native applet, and global variables are created in the target component environment. Thus, the association of data and methods between the native applet and the target component environment can be achieved based on the global queue and global variables, which solves the problem of data flow in the global state, plays a role in sharing data and methods, and improves the efficiency of R&D migration and development.

[0034] Next, in another embodiment, the above steps are described in more detail.

[0035] In step S110 , shared information is determined, and a global state management module is established based on the shared information.

[0036] In an embodiment of the present application, the above-mentioned shared information is data information that needs to be globally managed in a business scenario. Exemplarily, the shared information may include shared data and a sharing method.

[0037] In the embodiment of the present application, Figure 2 and Figure 3 Take the business scenario shown in the figure as an example. The business scenario is: In the mini program of Club A, click Figure 2 In the control 201 of the view A club introduction page, jump to Figure 3 The club details page shown. In this business scenario, Figure 2 When the page shown receives a click operation, it obtains the relevant information of Club A in response to the click operation and transmits the obtained information to Figure 3 That is, the above Figure 2 The page shown is the same as Figure 3 There is shared data between the pages shown, the above-mentioned relevant information of Club A is the shared data in this business scenario, and the above-mentioned click operation is the sharing method in this business scenario. It should be noted that the above scenario is only an exemplary description of data sharing between pages in the mini program, and the embodiments of the present application are not limited to this. For example, the global management method provided in the embodiments of the present application can also be used to implement global management between Taro components and mini program pages.

[0038] In the embodiment of the present application, the above-mentioned establishment of a global state management module based on shared information can be implemented as follows: modular programming is performed on the shared data and the shared information to obtain the global state management module. Specifically, the process can be implemented as follows: based on the business scenario, the shared data and the shared method are determined, and the shared data and the shared method are modularly programmed to generate a corresponding code file, which is the above-mentioned global state management module. Based on the global state management module, the shared data and the shared method in the business scenario can be managed.

[0039] In step S120, the shared information is injected into the native applet and the target component environment; the target component environment is used to create functions executable in the native applet.

[0040] In the embodiment of the present application, the above-mentioned native mini-program is developed with a certain application software as the native environment, and is a lightweight application used to implement specific services. The corresponding functions can be used without downloading and installing.

[0041] In the embodiments of the present application, illustratively, the above-mentioned native applet can be a lightweight application developed in the native environment of the instant messaging, shopping or payment applications of the smart terminal. Exemplarily, the user can obtain the above-mentioned native applet through scanning or searching functions in the instant messaging, shopping or payment applications, and obtain the functions corresponding to the native applet in the instant messaging, shopping or payment applications. Specifically, the native applet can be a small program for shopping developed by a shopping platform with the instant messaging application as the native environment. The user can search for the shopping applet through the instant messaging software, open the product page of the shopping applet in the instant messaging software, and perform operations such as product browsing and ordering. At this time, the native environment of the applet is the instant messaging software.

[0042] In an embodiment of the present application, the above-mentioned target component environment is used to create a functional module that can run in the above-mentioned native applet. For example, during the development of the above-mentioned native applet, if the current business implementation requires the global addition of a custom pop-up box, the custom pop-up box can be displayed on any page and has a relatively complex layout and interaction. At this time, the modal box (modal) of the native applet is not suitable for the custom pop-up box, and the custom pop-up box function needs to be created in the above-mentioned target component environment.

[0043] In an embodiment of the present application, the above-mentioned target component environment can be a multi-terminal development framework (Taro) environment, and the lightweight application developed based on the Taro component can be called by different application terminals.

[0044] In the embodiment of the present application, the above-mentioned injection of shared information into the native applet and the target component environment can be implemented as follows, illustratively: binding the shared data and sharing methods to the native pages and native components in the native applet; binding the shared data and sharing methods to the components in the target component environment. Specifically, the above-mentioned binding of shared data and sharing methods to the native pages and native components in the native applet refers to writing the shared data and sharing methods into the data set corresponding to the native pages and native components in the native applet; the above-mentioned binding of shared data and sharing methods to the components in the target component environment refers to writing the shared data and sharing methods into the data set corresponding to the components in the target component environment.

[0045] In an embodiment of the present application, the above-mentioned binding of shared data and shared methods with native pages and native components in the native applet can be implemented as follows: binding the shared data to the native page and native component to obtain the corresponding native page instance and native component instance; binding the shared method to the native page instance and native component instance.

[0046] In the embodiment of the present application, before the shared method is bound to the native page instance and the native component instance, the shared method can also be rewritten. Exemplarily, the rewriting can be to add an asynchronous call method to the shared method, through which the shared method can be asynchronously executed, thereby expanding the native page instance and the native component instance, and improving the execution efficiency.

[0047] In step S130 , a global queue is created in the native applet based on the shared information.

[0048] In an embodiment of the present application, the above-mentioned global queue is an instance queue composed of the above-mentioned native page instances and native component instances.

[0049] In the embodiment of the present application, when the native page or native component is running, the corresponding native page instance and native component instance are placed in the above instance queue, and when the native page or native component is uninstalled, the corresponding native page instance and native component instance are removed from the above instance queue. Through this process, the overall running performance can be guaranteed, and the instance queue is exposed to the global running environment, so that the target component environment can read the instance queue.

[0050] In an embodiment of the present application, the above-mentioned creation of a global queue in the native applet based on shared information can be implemented illustratively as follows: a global queue is created in the native applet, and the native page instance and the native component instance are copied to the global queue.

[0051] In the embodiment of the present application, after binding the shared data to the native page and the native component and obtaining the corresponding native page instance and native component instance, the obtained native page instance and native component instance can be injected into the registration center of the native applet. Further, the above-mentioned creation of a global queue in the native applet and copying the native page instance and the native component instance to the global queue can be implemented as follows: creating a copy registration center, which is the above-mentioned global queue, obtained by copying the original registration center of the above-mentioned native applet.

[0052] In step S140 , global variables are created in the target component environment based on the shared information.

[0053] In the embodiment of the present application, the above-mentioned global variable (store) includes the above-mentioned sharing method and shared data.

[0054] In an embodiment of the present application, the above creation of global variables can be achieved by creating a component state management tool in the target component environment.

[0055] In an embodiment of the present application, the following process can be implemented based on the above-mentioned component state management tool: create global variables, write shared data and shared methods into the global variables; and create an event queue based on the shared methods.

[0056] In an embodiment of the present application, taking the creation of a custom pop-up box as an example, the above-mentioned sharing method may include methods for displaying a custom pop-up box, for hiding a custom pop-up box, etc., then the event queue may include corresponding display events, hiding events, etc.

[0057] In step S150, the shared information between the native applet and the target component environment is globally managed based on the global state management module, the global queue and the global variables.

[0058] In an embodiment of the present application, the above-mentioned global management refers to the management of shared data and sharing methods between the native mini-program and the target environment components to ensure data sharing between the target component environment and the native mini-program page or component.

[0059] In an embodiment of the present application, the above-mentioned global management of shared information between the native mini-program and the target component environment based on the global state management module, the global queue and the global variables can be implemented illustratively as follows: when a global management call operation is received, the caller of the global management scheduling operation is determined; based on the preset calling method of the caller, the corresponding sharing methods in the global state management module, the global queue and the global variables are called respectively, and the shared data is updated based on the sharing method.

[0060] In the embodiment of the present application, the caller of the above-mentioned global management can be a native page or native component in the native applet, or a target component in the target component environment. That is, the user can call global management through the native page or native component of the native applet, or through the target component.

[0061] In an embodiment of the present application, when a user calls global management through a native page or native component of a native applet, the preset calling method based on the caller respectively calls the corresponding sharing methods in the global state management module, the global queue, and the global variable, and updates the shared data based on the sharing method. Exemplarily, it can be implemented as follows:

[0062] S1: Execute the shared method corresponding to the current native page instance or native component instance based on the global management call operation, and update the data bound to the current native page instance or native component instance;

[0063] S2: Determine and execute the same method as the shared method in step S1 based on the global variables of the target component environment, and update the data bound to the target component instance;

[0064] S3: Call and execute the method in the global state management module that is the same as the shared method in step S1 to update the global state data.

[0065] In the embodiment of the present application, when the user calls global management through the target component, the preset calling method based on the caller respectively calls the corresponding sharing methods in the global state management module, the global queue and the global variable, and updates the shared data based on the sharing method. Exemplarily, it can be implemented as follows:

[0066] S1: Execute the shared method bound to the current target component instance and update the data bound to the current target component instance;

[0067] S2: According to the above instance queue in the global operating environment, the same method as the shared method in step S1 is cyclically called in the queue to update the data bound to the native page instance or the native component instance;

[0068] S3: Call and execute the method in the global state management module that is the same as the shared method in step S1 to update the global state data.

[0069] The global management method of the disclosed embodiment injects shared information into the native applet and the target component environment, creates a global queue in the native applet, and creates global variables in the target component environment, so that the data and methods of the native applet and the target component environment can be associated based on the global queue and the global variables, solving the problem of data flow in the global state, playing a role in sharing data and methods, and improving the efficiency of R&D migration and development; in addition, the embodiment of the present application solves the problem that the global state management tool in the related technology cannot be expanded, avoids the problems of data uncontrollability and security caused by the use of external tools, and creates a closed-loop R&D environment within the applet; at the same time, compared with the open source capabilities in the related technology, the embodiment of the present application greatly reduces the code volume and avoids the problem of volume expansion of the published applet.

[0070] Next, in another embodiment, any native applet and Taro component are used as an example to combine Figures 4 to 6 The process of the above global management method is described in detail:

[0071] Figure 4 The process of establishing a copy registration center (corresponding to the above-mentioned global queue) in the native applet and establishing a global vector in the Taro component environment is as follows: Figure 4 As shown, the process specifically includes the following steps:

[0072] S410: Determine the shared data and sharing method that need to be globally managed.

[0073] In the embodiment of the present application, the above-mentioned shared data is the data that needs to be shared between the native applet and the Taro component, and the above-mentioned shared method is the method that needs to be shared between the native applet and the Taro component. Further, after confirming the shared data and the shared method, the embodiment of the present application modularizes the shared data and the shared method and generates corresponding code files (corresponding to the above-mentioned global state management module).

[0074] In the embodiment of the present application, after confirming the shared data and sharing method that need to be globally managed, continue to execute step S420 and step S430.

[0075] S420: Bind the shared data to the native page and native component in the native applet to obtain the corresponding native page instance and native component instance.

[0076] In an embodiment of the present application, globally managed shared data and methods are introduced into the native applet, and the shared data is bound to the currently running native page or instance of the native component.

[0077] S421: Inject the bound native page instance and native component instance into the registration center of the native applet.

[0078] S422: Create a copy registration center, and update the instances in the copy registration center based on the native page instance and the native component instance.

[0079] In an embodiment of the present application, a copy registration center (corresponding to the above-mentioned global queue or instance queue) is created in the native applet. When the native page or native component is in running state, the corresponding native page instance and native component instance are placed in the instance queue; when the native page or native component is uninstalled, that is, disappears from sight, the corresponding native page instance and native component instance are removed from the instance queue to ensure the overall operating performance and expose the instance queue to the global operating environment.

[0080] S423: Rewrite the sharing method.

[0081] In an embodiment of the present application, the above-mentioned rewriting can be implemented by adding an asynchronous calling method of the shared method. The shared method can be executed asynchronously through the asynchronous calling method, thereby expanding the above-mentioned native page instance and native component instance and improving the execution efficiency.

[0082] S424: Bind the shared method to the native page instance and the native component instance.

[0083] S430: Create a component state management tool in the Taro component environment, and bind the shared data and shared methods to the Taro component.

[0084] S431: Create global variables through the component state management tool.

[0085] In an embodiment of the present application, a global variable is created, and shared data and shared methods are written into the global variable.

[0086] S432: Create an event queue through a component status management tool.

[0087] In an embodiment of the present application, an event queue is created based on a sharing method. Taking the creation of a custom pop-up box as an example, the above-mentioned sharing method may include methods for displaying a custom pop-up box and for hiding a custom pop-up box. Then the event queue may include corresponding display events, hiding events, etc.

[0088] Figure 5 When users call global management methods through native pages or native components, the global management process is implemented, such as Figure 5 As shown, the process may specifically include the following steps:

[0089] S510: Receive an event request triggered by a user through a native page or a native component.

[0090] S511: Execute the shared method bound to the current native page or native component instance.

[0091] S512: Update the shared data bound to the current native page or native component instance.

[0092] S513: Update the instance status in the copy registration center.

[0093] S520: Search for a shared method with the same name from the global variables exposed by the Taro component.

[0094] In the embodiment of the present application, the same sharing method as step S511 is searched in the above-mentioned global variables.

[0095] S521: Calling a corresponding event in the event queue based on a shared method with the same name.

[0096] In an embodiment of the present application, based on the found shared method with the same name, a corresponding event is called in the event queue established above to execute the shared method with the same name.

[0097] S522: Update the shared data bound to the component instance.

[0098] S530: calling a shared method with the same name in the global state management module, and updating corresponding shared data.

[0099] Figure 6 When users call the global management method through the Taro component, the global management process is implemented, such as Figure 6 As shown, the process may specifically include the following steps:

[0100] S610: Receive a Taro component event triggered by a user.

[0101] S611: Call the current Taro component event in the event queue.

[0102] S612: Update the shared data bound to the component instance.

[0103] S620: Search for a shared method with the same name in the copy registration center and execute it.

[0104] S621: Update the shared data bound to the current native page or native component instance.

[0105] S630: Calling a shared method with the same name in the global state management module and updating corresponding shared data.

[0106] The global management method provided in the embodiment of the present application has the following advantages: (1) It realizes the association of data and methods between the native mini-program global state management tool and the Taro component, solves the problem of data flow of the global state, plays a role in data and method sharing, and improves the work efficiency of R&D migration and development; (2) It solves the problem that the global state management tool in the related technology cannot be expanded, avoids the problem of uncontrollable and unsafe mini-program data caused by the use of external tools, and creates a closed-loop R&D environment for the mini-program; (3) It solves the problem of excessive size of external third-party packages and avoids the expansion of the size of the released online mini-program.

[0107] The above mainly introduces the solution provided by the embodiment of the present invention from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0108] The embodiment of the present invention can divide the global management device into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0109] The present disclosure provides a global management device. Figure 7 As shown, the global management device 700 may include a creation module 710, an injection module 720, a creation module 730 and a management module 740, wherein:

[0110] Establishing module 710, for determining shared information and establishing a global state management module based on the shared information;

[0111] Injection module 720, used to inject shared information into the native applet and the target component environment; the target component environment is used to create functions executable in the native applet;

[0112] Establishing module 730, further used to create a global queue in the native applet based on the shared information;

[0113] The establishment module 730 is also used to create global variables in the target component environment based on the shared information;

[0114] The management module 740 is used to globally manage the shared information between the native applet and the target component environment based on the global state management module, the global queue and the global variables.

[0115] In the embodiment of the present application, the above-mentioned establishment module is specifically used to: perform modular programming on shared data and shared information to obtain a global state management module.

[0116] In an embodiment of the present application, the above-mentioned injection module is specifically used to: bind shared data and shared methods with native pages and native components in the native applet; bind shared data and shared methods with components in the target component environment.

[0117] In an embodiment of the present application, the above-mentioned injection module is specifically used to: bind shared data to native pages and native components to obtain corresponding native page instances and native component instances; bind shared methods to native page instances and native component instances.

[0118] In an embodiment of the present application, the above-mentioned establishment module is specifically used to: create a global queue in the native applet, and copy the native page instance and the native component instance to the global queue.

[0119] In an embodiment of the present application, the above-mentioned establishment module is specifically used to: create global variables in the target component environment, write shared methods and shared data into the global variables; create an event queue based on the shared method, and the event queue includes events corresponding to the shared method.

[0120] In an embodiment of the present application, the above-mentioned management module is specifically used to: when a global management call operation is received, determine the caller of the global management scheduling operation; based on the preset calling method of the caller, call the corresponding sharing methods in the global state management module, global queue and global variables respectively, and update the shared data based on the sharing method.

[0121] In an embodiment of the present application, when a user calls global management through a native page or native component of a native applet, the above-mentioned management module is specifically used for: S1: executing the sharing method corresponding to the current native page instance or native component instance based on the global management call operation, and updating the data bound to the current native page instance or native component instance; S2: determining and executing the same method as the sharing method of step S1 based on the global variables of the target component environment, and updating the data bound to the target component instance; S3: calling and executing the same method as the sharing method of step S1 in the global state management module, and updating the global state data.

[0122] In an embodiment of the present application, when the user calls global management through the target component, the above-mentioned management module is specifically used for: S1: executing the shared method bound to the current target component instance, and updating the data actually bound to the current target component; S2: according to the above-mentioned instance queue in the global operating environment, cyclically calling the same method in the queue as the shared method in step S1, and updating the data bound to the native page instance or the native component instance; S3: calling and executing the same method as the shared method in step S1 in the global state management module to update the global state data.

[0123] In addition, the specific implementation details of the above-mentioned global management device have been described in detail in the corresponding position of the global management method, so they will not be repeated here.

[0124] Figure 8 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 8 , which shows a structural schematic diagram of an electronic device 800 suitable for implementing the embodiments of the present disclosure. Figure 8 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.

[0125] like Figure 8As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803 to implement the global management method of the embodiment described in the present disclosure. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0126] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0127] 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 non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the global management method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

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

[0129] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0130] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0131] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0132] Determine shared information and establish a global state management module based on the shared information;

[0133] Injecting shared information into the native applet and the target component environment; the target component environment is used to create functions that can be executed in the native applet;

[0134] Create a global queue in the native applet based on shared information;

[0135] Create global variables in the target component environment based on the shared information;

[0136] Based on the global state management module, global queue and global variables, the shared information between the native applet and the target component environment is globally managed.

[0137] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

[0138] 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, but not limited to, 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).

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

[0140] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0141] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0142] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0143] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0144] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0145] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A global management method, characterized in that: include: Determine shared information, and establish a global state management module based on the shared information; Injecting the shared information into the native applet and the target component environment; The target component environment is used to create functions executable in the native applet; Creating a global queue in the native applet based on the shared information; creating a global variable in the target component environment based on the shared information; The shared information between the native applet and the target component environment is globally managed based on the global state management module, the global queue and the global variables.

2. The global management method according to claim 1, characterized in that: The shared information includes shared data and a sharing method; the global state management module is established based on the shared information, including: Modular programming is performed on the shared data and the shared information to obtain the global state management module.

3. The global management method according to claim 2, characterized in that: The injecting the shared information into the native applet and the target component environment includes: Binding the shared data and the sharing method with the native page and native components in the native applet; The shared data and the shared method are bound to the component in the target component environment.

4. The global management method according to claim 3, characterized in that: The binding of the shared data and the sharing method with the native page and the native component in the native applet includes: Binding the shared data to the native page and the native component to obtain corresponding native page instances and native component instances; The shared method is bound to the native page instance and the native component instance.

5. The global management method according to claim 4, characterized in that: The creating a global queue in the native applet based on the shared information includes: The global queue is created in the native applet, and the native page instance and the native component instance are copied to the global queue.

6. The global management method according to claim 3, characterized in that: The creating a global variable in the target component environment based on the shared information comprises: Create the global variable in the target component environment, and write the shared method and the shared data into the global variable; An event queue is created based on the sharing method, and the event queue includes events corresponding to the sharing method.

7. The global management method according to claim 4, characterized in that: The globally managing the shared information between the native applet and the target component environment based on the global state management module, the global queue and the global variable includes: When a global management calling operation is received, determining a caller of the global management scheduling operation; The corresponding sharing methods in the global state management module, the global queue and the global variable are respectively called based on the preset calling method of the caller, and the shared data is updated based on the sharing method.

8. A global management device, characterized in that: include: An establishment module is used to determine the shared information and establish a global state management module based on the shared information; An injection module, used to inject the shared information into a native applet and a target component environment; the target component environment is used to create functions executable in the native applet; The establishment module is further used to create a global queue in the native applet based on the shared information; The establishment module is further used to create global variables in the target component environment based on the shared information; A management module is used to globally manage the shared information between the native applet and the target component environment based on the global state management module, the global queue and the global variable.

9. An electronic device, comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.