CN113821205A - Method and device for controlling small program page parameters, medium and electronic equipment - Google Patents

Method and device for controlling small program page parameters, medium and electronic equipment Download PDF

Info

Publication number
CN113821205A
CN113821205A CN202110080516.1A CN202110080516A CN113821205A CN 113821205 A CN113821205 A CN 113821205A CN 202110080516 A CN202110080516 A CN 202110080516A CN 113821205 A CN113821205 A CN 113821205A
Authority
CN
China
Prior art keywords
applet
target
target applet
window container
view
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110080516.1A
Other languages
Chinese (zh)
Inventor
张磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110080516.1A priority Critical patent/CN113821205A/en
Publication of CN113821205A publication Critical patent/CN113821205A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Abstract

The present disclosure relates to the field of computers, and in particular, to a method and an apparatus for controlling applet page parameters, a computer-readable storage medium, and an electronic device, where the method includes: acquiring an interface component of a host application program, and creating an applet management component in the interface component; acquiring a layout file of the interface assembly, and setting a first target applet window container in the layout file; controlling a first target applet window container to display a target applet through the applet management component; the first target applet window container has preset page parameters. Through the technical scheme of the embodiment of the disclosure, the problems that the display mode of the small program is single and the mode of displaying the small program is relatively rigid can be solved.

Description

Method and device for controlling small program page parameters, medium and electronic equipment
Technical Field
The present disclosure relates to the field of computers, and in particular, to a method and an apparatus for controlling applet page parameters, a computer-readable storage medium, and an electronic device.
Background
With the development of the internet and intelligent terminal technology, more and more applications appear on the intelligent terminal, and the forms are more and more abundant.
The existing small program is an implementation form of an application function, and can be used without downloading and installing for a user, so that the use time cost and the storage space of terminal equipment can be saved, and for developers, the development cost and the popularization cost can be saved. The small program is used as an internet platform product and has a good development prospect.
However, the existing applet generally displays the applet in a full screen mode, and the size and the position of the applet cannot be adjusted, so that the display mode of the applet is single, and the mode of displaying the applet for a user is stiff.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a method and a device for controlling applet page parameters, a computer readable storage medium, and an electronic device, which can solve the problems of a single applet display mode and a stiff applet display mode.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, a method for controlling applet page parameters is provided, including: acquiring an interface component of a host application program, and creating an applet management component in the interface component; acquiring a layout file of the interface component, and setting a first target applet window container in the layout file; controlling the first target applet window container to display the target applet through the applet management component; the first target applet window container has preset page parameters.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the acquiring an interface component of the host application includes: starting the host application program and acquiring the application file loaded by the host application program; and determining an interface component to be operated in a plurality of candidate components according to the application file.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, controlling the target applet window container to display the target applet according to the applet management component includes: the applet management component acquires a stack of the target applet window container; the applet management component controls display of the target applet located at the top of the stack in the first target applet window container.
According to a second aspect of the present disclosure, there is provided a method for controlling applet page parameters, including: responding to a target applet starting instruction, acquiring a configuration file of the target applet and initializing the configuration file into a reset state; generating a target small program view according to the configuration file, and acquiring a pre-created first target small program window container in a layout file of a host application program; and the applet management component controls the target applet view to be displayed in the first target applet window container with preset page parameters.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the acquiring a configuration file of the target applet and initializing to a reset state includes: acquiring the target applet starting instruction, wherein the target applet starting instruction comprises a storage path of the target applet; and searching a configuration file of the target small program according to the storage path of the target small program, and initializing the configuration file to be in a reset state.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the acquiring a configuration file of the target applet and initializing to a reset state includes: acquiring a configuration file of the target applet and a loading method of the target applet; initializing the target applet to a reset state according to a loading method of the target applet.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the applet managing part controls the applet view to be displayed in the applet window container, including: judging whether a second small program window container exists in the layout file of the host application program; when a second applet window container does not exist in the layout file, the applet management component controls the target applet view to be displayed in the first target applet window container; when a second applet window container exists in the layout file, comparing whether the applet view of the second applet window container is consistent with the target applet view; when the applet view is consistent with the target applet view, the applet management component reloads the target applet and displays in the second applet window container; when the applet view does not correspond to the target applet view, the applet management component controls the target applet view to be displayed in the first target applet window container.
In an exemplary embodiment of the disclosure, based on the foregoing solution, the controlling, by the applet management component, the target applet view to be displayed in the first target applet window container when the applet view is inconsistent with the target applet view includes: when the applet view is inconsistent with the target applet view, the applet management component controls the applet to pause; the applet management component controls the display of the target applet view in the first target applet window container.
According to a third aspect of the present disclosure, there is provided an apparatus for controlling applet page parameters, the apparatus comprising: the command acquisition module is used for responding to a target applet starting command, acquiring a configuration file of the target applet and initializing the configuration file; the container acquisition module is used for generating a target small program view according to the configuration file and acquiring a pre-created first target small program window container in a layout file of a host application program; and the program display module is used for controlling the target small program view to be displayed in the first target small program window container with preset page parameters by the small program management component.
According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method of controlling applet page parameters as described in the first aspect of the embodiments above.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising:
a processor; and
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method of controlling applet page parameters as described in the first aspect of the embodiments above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the method for controlling applet page parameters provided in an embodiment of the present disclosure, after an interface component of a host application is acquired, an applet management component may be created in the interface component, then a layout file of the interface component is acquired, a first target applet window container is set in the layout file, and then the applet management component controls the first target applet window container to display a target applet. The embodiment of the disclosure can adjust the page parameters of the window container for displaying the applet, so that the display mode of the applet is more diversified, the display mode for displaying the applet is more flexible, and the use experience of a user is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty. In the drawings:
FIG. 1 schematically illustrates a flow chart of a method of controlling applet page parameters to which embodiments of the disclosure may be applied;
FIG. 2 is a flow diagram that schematically illustrates determining interface components to run among a plurality of candidate components based on application files loaded by a host application in an exemplary embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart for an applet management component controlling a target applet window container at the top of a stack to display a target applet in an exemplary embodiment of the disclosure;
FIG. 4 schematically illustrates a flow chart of control of applet page parameters in an exemplary embodiment of the disclosure;
FIG. 5 schematically illustrates a flow chart for finding a configuration file of a target applet based on a storage path of the target applet in an exemplary embodiment of the present disclosure;
FIG. 6 schematically illustrates a flow chart for initializing a target applet to a reset state according to a loading method of the target applet in exemplary embodiments of the present disclosure;
FIG. 7 is a diagram illustrating repositioning of a first target applet window container in an exemplary embodiment of the disclosure;
FIG. 8 is a flow diagram that schematically illustrates a determination of whether a second applet window container exists in a layout file of a host application in an exemplary embodiment of the disclosure;
FIG. 9 schematically illustrates a flow chart for the applet management component controlling the applet pause and displaying the target applet view in the first target applet window container in an exemplary embodiment of the disclosure;
fig. 10 is a schematic diagram illustrating a composition of a control apparatus for applet page parameters in an exemplary embodiment of the disclosure;
fig. 11 schematically shows a schematic structural diagram of a computer system of an electronic device suitable for implementing an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known structures, methods, devices, implementations, materials, or operations are not shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in the form of software, or in one or more software-hardened modules, or in different networks and/or processor devices and/or microcontroller devices.
The control scheme of the applet page parameters in the disclosure can be used for controlling various applets, and the page parameters of the applets can be specifically adjusted according to the use conditions for different application programs. For example, for a certain e-commerce application software, a merchant can adjust the layout parameters of the small programs according to the business requirements of the merchant; for another example, for a certain travel application software, the customer service department can adjust the layout parameters of the small programs according to the business requirements of the customer service department; for another example, for a certain chat communication application software, a user may adjust a layout parameter of the applet according to a service requirement of the user, and when the applet is opened through the host application program, the user may obtain the applet by scanning the two-dimensional code or searching the applet. The application scenario of the control of the applet page parameters is not particularly limited.
According to the method for controlling the applet page parameters provided in the exemplary embodiment, when an interface component of a host application is acquired and an applet management component is created in the interface component, a layout file of the interface component is acquired, a first target applet window container is set in the layout file, and the applet management component controls the first target applet window container to display a target applet, wherein the first target applet window container has preset page parameters. As shown in fig. 1, the method for controlling the applet page parameter may include the following steps:
step S110: acquiring an interface component of a host application program, and creating an applet management component in the interface component;
step S120: the method comprises the steps of obtaining a layout file of an interface assembly, and setting a first target small program window container in the layout file, wherein the first target small program window container has preset page parameters;
step S130: and controlling the first target applet window container to display the target applet through the applet management component.
In the method for controlling applet page parameters provided in this example embodiment, the page parameters of the window container for displaying the applet can be adjusted according to the first target applet window container with the preset parameter layout controlled by the management component, so that the display mode of the applet is more diversified, the display mode of the applet is more flexible, and the user experience is further improved.
Next, steps S110 to S130 of the method for controlling the applet page parameter in the present exemplary embodiment will be described in more detail with reference to the drawings and the embodiments.
Step S110, acquiring an interface component of a host application program, and creating an applet management component in the interface component;
in an example embodiment of the present disclosure, the host application is based on an application used by the smart terminal, various programming languages that the user can use, and application software programmed in various programming languages. The host application may include software installed on the smart phone and run based on a corresponding system, such as an ios system, an Android system, a windows mobile system, a Symbian system, a BlackBerry OS system, and the like. Host applications may include office applications, internet applications, multimedia applications, data analysis applications, work collaboration applications, business applications. It should be noted that the present disclosure does not specifically limit the type of the host application.
In an example embodiment of the present disclosure, the host application may include an interface component, and the interface component may be used to compose the host application, generally speaking, the host application may include multiple components, and the interface component is used to display a screen, and a user may interact with content in the interface component to complete a certain task when using the terminal device.
In an example embodiment of the present disclosure, the interface component may include an activity component in an Android component, one activity component may provide one screen, and may interact with a user through the activity component, and different activity components communicate through an intent. Activity represents a screen that a user can see, and is mainly used for processing the overall work of an application program, such as monitoring system events, displaying a specified View for the user, starting other activities and the like. Activity classes are inherited by all the applications, the classes are base-layer classes provided by Android, and after other activities inherit the parent classes, various functions are realized through a parent class method.
Furthermore, the Activity component has four states, including an Active/running state, when a new Activity is started to be stacked, the Activity component is at the forefront of the screen and at the topmost end of the stack, and is in an Active state which is visible and can interact with the user; also included is Paused state, the state when Activity is overridden by another transparent or Dialog style Activity. At this point it remains connected to the window manager, the system continues to maintain its internal state so it is still visible, but it has lost focus and is therefore not available to interact with the user; a stop state is also included, which is when an Activity is covered by another Activity, lost focus and not visible; also included is a kill state, which is when Activity is reclaimed by the system or not initiated. When an Activity instance is created, destroyed, or another Activity is initiated, it transitions between the four states, which occurs depending on the actions of the user program.
In an example embodiment of the present disclosure, an applet is an application that can be used without downloading, created based on a host application. Compared with a common application program, the development cost of the small program is lower, and the small program can share the flow of the host application program attached to the small program, so that the popularization cost is saved; general application program is because the core processor of calling cell-phone is operated, so no matter APP, H5 and SAAS all can appear delay, visual deformation scheduling problem often, moreover in different cell-phone systems, different APP and H5 all can appear new system incompatibility, function show incomplete problem, and can not appear in the applet. Applets have a relatively uniform development framework during their development phase. The BUG caused in the development process is greatly reduced. Thereby enabling the applet to have a better user experience.
In an example embodiment of the present disclosure, the applet management component may complete functions of managing an applet to open, close, and rollback events, and the applet management component is a common object associated with the component interface, and various objects in the interface component may be managed by the applet management component. The applet management component may comprise an AppManager. Note that the specific form of the applet management means in the present disclosure is not particularly limited as long as the applet can be managed.
In an example embodiment of the present disclosure, an interface component of a host application may be obtained in advance, and an applet management component may be created in the interface component of the host application. Specifically, when the interface component of the host application is obtained, a storage path of the host application may be obtained first, a plurality of components corresponding to the host application are searched according to the storage path, the interface component is searched in the plurality of components, and then the applet management component is added to the interface component.
In an example embodiment of the present disclosure, the host application may be started and an application file loaded by the host application may be obtained, and then the interface component to be executed may be determined among the plurality of candidate components according to the application file. Referring to fig. 2, determining an interface component to be run among a plurality of candidate components according to an application file loaded by a host application may include the following steps S210 to S220:
step S210, starting a host application program and acquiring an application file loaded by the host application program;
in an example embodiment of the present disclosure, when an interface component of a host application needs to be acquired, the host application may be started first, and then an application file that the host application needs to be loaded is acquired. Specifically, a host application program starting command may be sent, at this time, the host application may call a host application program application starting method, load an application file required for starting the host application program, and the application file of the host application program constitutes the host application program.
Step S220, determining an interface component to be operated in the candidate components according to the application file.
In an example embodiment of the present disclosure, after the application file of the host application program is obtained, a plurality of candidate components in the application file may be obtained, and then the interface component to be executed is determined among the plurality of candidate components. For example, for an android system, the android system includes an activity component, which is a visual interface operated by a user, and provides a window for the user to complete an operation instruction, and provides a portal for interaction for the user; a Service component, typically used as logic that is time consuming to process in the background; a Broadcast receiver component, which is a type of component that filters, accepts and responds to outgoing broadcasts, and may be used to respond to an external time by an application; a Content Provider component that provides other applications with a specified data set. At this time, the candidate components are an activity component, a Service component, a Broadcast Receive component, and a Content Provider component, respectively, and the activity component can be acquired from these components.
Through the steps S210 to S220, the host application program can be started and the application file loaded by the host application program can be acquired, and then the interface component to be operated is determined in the plurality of candidate components according to the application file, so that developers can conveniently search for the interface component and configure the interface component.
Step S120, obtaining a layout file of the interface assembly, and setting a first target small program window container in the layout file;
in an example embodiment of the present disclosure, a layout file determines the state to be exposed and the elements to be exposed for an application. For example, for an android system, the layout file may be a layout file, which may be declared in two ways, (1) the UI elements are defined in an xml file: android provides tags related to the View class and subclasses thereof; (2) the layout is defined during the run time, namely the layout is completed in a code mode.
In an example embodiment of the present disclosure, a first target applet window container may be used to display an applet. Specifically, the first target applet window container has preset page parameters, and the page parameters include parameters such as a position and a size of the first target applet window container. For an android system, the lifecycle of an applet can be defined as follows: onStart: indicating that the applet is started, where the actual view and business logic of the applet is initialized; OnResume: the small program is shown to enter the foreground, is visible to the user and is the focus of the current operation of the user, and is used for notifying and awakening the service logic of the small program, such as continuing audio and video playing and the like; OnPause: the small program enters the background and is invisible for the user temporarily, and the small program is used for notifying and pausing the small program service logic, such as pausing background audio and video playing and the like; OnRemove: the fact that the applet is deleted is indicated, the applet is used for destroying service logic of stopping and destroying the applet, and cleaning and updating of an App stack and a view container can be performed inside the system.
In an example embodiment of the present disclosure, after obtaining an interface component of a host application and creating an applet management component in the interface component, a layout file for the interface component may be obtained and then a first target applet window container may be set in the layout file.
Step S130, controlling a first target small program window container to display a target small program through a small program management component;
in an example embodiment of the present disclosure, after an applet management component is created in an interface component and a first target applet window container is set in a layout file, the first target applet window container may be controlled by the applet management component to display a target applet. Specifically, the interface assembly can be controlled through the management component, so that the applet is opened in the layout file in the interface assembly, and the target applet is displayed in the first target applet window container. Furthermore, the page parameters of the first target applet window container can be adjusted in the interface assembly, so that the display state of the first target applet window container can be conveniently controlled.
In an example embodiment of the present disclosure, the applet management component may obtain a stack of a target applet window container and then the applet management component controls a target applet window container at the top of the stack to display the target applet. Referring to FIG. 3, the applet management component controls a target applet window container at the top of the stack to display a target applet may include the following steps S310-S320:
step S310, the applet management part acquires a stack of a target applet window container;
in an example embodiment of the present disclosure, an applet management component may obtain a stack of a target applet window container. Specifically, the stack is a data structure, which is a linear table capable of performing insertion or deletion operations at the tail of the table, and stores data according to the principle of last-in first-out, the first-in data is pressed to the bottom of the stack, the last data is at the top of the stack, and data is popped from the top of the stack when data needs to be read. A stack is a special linear table that can only be inserted and deleted at one end. The stack is pressed under and then stacked one by one. When taking away, only one piece can be taken from the upper side. Both reading and fetching are performed at the top, and the bottom is generally stationary. The stack is a data structure similar to a barrel stacking object, one end of the stack for deleting and inserting is called a stack top, and the other end of the stack is called a stack bottom. Insertion is generally referred to as push and deletion is referred to as pop.
In step S320, the applet managing means controls the target applet located at the top of the stack to be displayed in the first target applet window container.
In an example embodiment of the present disclosure, after the stack of the target applet window container is obtained through the above steps, the applet management component may be enabled to control the target applet located at the top of the stack. Specifically, the target applet located at the top of the stack in the stack may be obtained, and at this time, the target applet is located at the uppermost layer of the first target applet window container, and the target applet may be displayed through the first target applet window container. Further, for a rollback event of a user, the first target applet window container may determine whether a target applet on the current stack top can be rolled back, if so, roll back a page, if not, pop up the applet on the stack top, remove it, determine whether a new applet on the stack top exists, if so, wake up the new applet on the stack top, and call a life cycle of the applet on the stack top.
Through the above steps S310 to S320, the applet managing component may obtain the stack of the first target applet window container, and then the applet managing component controls the target applet located at the top of the stack to be displayed in the first target applet window container.
In an example embodiment of the present disclosure, an applet management component is created in an interface component in a host application, a first target applet window container is set in a layout file, and then the first target applet window container is controlled by the applet management component to display a target applet, so that a page parameter of the applet window container can be adjusted to display the applet, so that the display mode of the applet is more diversified, the display mode of the applet is more flexible, and the use experience of a user is improved.
In an exemplary embodiment of the disclosure, a method for controlling parameters of an applet page is also provided. Referring to fig. 4, a method for controlling parameters of an applet page may include the following steps:
s410: responding to a target applet starting instruction, acquiring a configuration file of the target applet and initializing the configuration file into a reset state;
s420: generating a target small program view according to the configuration file, and acquiring a pre-created first target small program window container in a layout file of the host application program;
s430: the applet management means controls the display of the target applet view in a first target applet window container having preset page parameters.
In the method for controlling applet page parameters provided in this example embodiment, the page parameters of the window container for displaying the applet can be adjusted according to the first target applet window container with the preset parameter layout controlled by the management component, so that the display mode of the applet is more diversified, the display mode of the applet is more flexible, and the user experience is further improved.
Next, steps S410 to S430 of the method for controlling the applet page parameter in the present exemplary embodiment will be described in more detail with reference to the drawings and the embodiments.
Step S410, responding to a target small program starting instruction, acquiring a configuration file of the target small program and initializing the configuration file into a reset state;
in an example embodiment of the present disclosure, a user may input a target applet start instruction by clicking a screen of a terminal device or scanning a two-dimensional code, the applet including the following lifecycle events, including onStart: the method comprises the following steps of acquiring applet information, managing an applet package, starting a page, jumping an error page, initializing an applet view (AppView), initializing runtime, binding data and the like. onResume: and informing the runtime to enter the foreground, so that the runtime calls back to the applet service wakeup related logic. onPause: the runtime is notified to enter the background so that it calls back to the applet service suspend related logic. onRemove: the method mainly cleans the data and the view of the small program, and the runtime is stopped and destroyed, so that the runtime calls back to the related logic of the service stopping and destroying of the small program.
After the target applet starting instruction is obtained, a configuration file of the target applet can be obtained, the configuration file of the target applet can comprise various component files of the target applet, the on Start and on Resume life cycles of the target applet are executed, and the target applet is initialized to a reset state.
In an example embodiment of the present disclosure, a target applet starting instruction may be obtained, then a configuration file of the target applet is searched according to a storage path of the target applet, and the configuration file is initialized to a reset state. As shown in fig. 5, searching the configuration file of the target applet according to the storage path of the target applet may include the following steps S510 to S520:
step S510, a target small program starting instruction is obtained, wherein the target small program starting instruction comprises a storage path of a target small program;
in an example embodiment of the present disclosure, after acquiring the target applet starting instruction, a storage path of the target applet included in the target applet starting instruction may be acquired. Specifically, the storage path of the target applet may be set in advance, so as to search for the target applet based on the storage path.
Step S520, searching the configuration file of the target applet according to the storage path of the target applet, and initializing the configuration file to a reset state. The file and/or folder line of the configuration file of the target applet may be looked up in the terminal device or the server.
In an example embodiment of the present disclosure, after the storage path of the target applet in the above step is acquired, the configuration file of the target applet may be searched through the storage path of the target applet, and then the configuration file of the target applet is initialized to the reset state.
For example, when the storage path of the target applet is l1-l2-l3, the configuration file representing the target applet is stored in folder l3 within subfolder l2 in folder l 1; alternatively, the configuration file of the target applet may be a file with a file name of l3 in subfolder l2 stored in folder l 1. It should be noted that the form of the storage path is not particularly limited in the present disclosure, as long as the configuration file associated with the target applet can be searched according to the storage path.
Through the steps S510 to S520, the target applet starting instruction can be obtained, then the configuration file of the target applet is searched according to the storage path of the target applet, and the configuration file is initialized to the reset state, so that the configuration file of the target applet can be conveniently searched.
In an example embodiment of the present disclosure, a configuration file of a target applet and a loading method of the target applet may be acquired, and the target applet may be initialized to a reset state according to the loading method of the target applet. Referring to fig. 6, initializing the target applet to a reset state according to a loading method of the target applet may include the following steps S610 to S620:
step S610, acquiring a configuration file of a target small program and a loading method of the target small program;
in an example embodiment of the present disclosure, a configuration file of a target applet may be obtained, and a loading method of the target applet may be obtained. Specifically, when the target applet is started, the configuration file of the target applet needs to be loaded by the loading method, the loading method of the target applet may be stored in the configuration file of the host application program, or may be separately stored in the terminal device or the server, and when the target applet needs to be started, the loading method of the target applet may be called in the terminal device or the server.
Step S620, initializing the target applet to a reset state according to a loading method of the target applet.
In an example embodiment of the present disclosure, after the configuration file of the target applet and the loading method of the target applet are acquired, the target applet may be initialized to the reset state according to the loading method of the target applet. Specifically, the loading method of the target applet may load the relevant information of the target applet. Such as the name of the applet, user data, applet id, etc. And assigning the information to the target applet and initializing the target applet to a reset state.
Through the above steps S610 to S620, the configuration file of the target applet and the loading method of the target applet can be acquired, and the target applet is initialized to the reset state according to the loading method of the target applet.
Step S420, generating a target small program view according to the configuration file, and acquiring a pre-created first target small program window container in the layout file of the host application program;
in an example embodiment of the present disclosure, the target applet view may be generated according to the configuration file of the target applet acquired in the above steps. For example, for an android system, an appView may be generated according to a configuration file of a target applet, and the appView mainly completes display of views and data and responds to user operations, such as a navigation bar, a menu bar, a rollback event, and the like. After generating the target applet view from the configuration file, a pre-created first target applet window container may be obtained in a layout file of the host application.
In step S430, the applet managing means controls the target applet view to be displayed in the first target applet window container having the preset page parameters.
In an example embodiment of the present disclosure, after initializing a configuration file of a target applet to a reset state, generating a target applet view according to the configuration file, and acquiring a first target applet window container, the applet management component may control the target applet view to be displayed in the first target applet window container having preset page parameters.
Specifically, the applet management component may control opening and closing of the target applet, and after the items are obtained, the applet management component may control the target applet view to be opened in the first target applet window container, where the first target applet window container has preset page parameters, and the page parameters include parameters such as a position and a size of the first target applet window container. The location parameter of the first target applet window container indicates a display location of the first target applet window container in the layout file of the host application, in other words, a location of the target applet on the display screen; the size parameter of the first target applet window container represents the size parameter of the first target applet window container in the layout file of the host application, in other words, the size of the target applet on the display screen.
For example, as shown in fig. 7, the layout file of the host application 710 may include an XOY coordinate system, an intersection point p1 of a center line of a long side and a short side of the target applet 720 may be used as a position of the target applet, and the position of the target applet in the host application may be controlled by adjusting the coordinates of p 1; the size of the target applet can also be controlled by adjusting the length of the long edge and the short edge of the first target applet window container.
In an exemplary embodiment of the present disclosure, after initializing a configuration file of a target applet to a reset state, generating a target applet view according to the configuration file, and acquiring a first target applet window container, it may be determined whether a second applet window container exists in a layout file of a host application, when the second applet window container does not exist in the layout file, the applet managing part controls the target applet view to be displayed in the first target applet window container, when the second applet window container exists in the layout file, compares whether an applet view of the second applet window container is consistent with the target applet view, when the applet view is consistent with the target applet view, the applet managing part reloads the target applet and displays the target applet in the second applet window container, when the applet view is not consistent with the target applet view, the applet management means controls the display of the target applet view in the first target applet window container. Referring to fig. 8, determining whether the second applet window container exists in the layout file of the host application may include the following steps S810 to S850:
step S810, judging whether a second small program window container exists in the layout file of the host application program;
in an example embodiment of the present disclosure, a configuration file of a target applet is initialized to a reset state, a target applet view is generated according to the configuration file, after a first target applet window container is obtained, a layout file of a host application may be obtained, and whether a second applet window container exists is searched in the layout file. Specifically, by this step, it can be detected whether there are other applet window containers in the current layout file.
Step S820, when the layout file does not have the second applet window container, the applet management component controls the target applet view to be displayed in the first target applet window container;
in an example embodiment of the present disclosure, after detecting the layout file, when the second applet window container is not found in the layout file, it indicates that there are no other applet window containers in the layout file of the host application. At this time, the applet management component may control the target applet view to be displayed in the first target applet window container.
Step S830, when a second applet window container exists in the layout file, comparing whether the applet view of the second applet window container is consistent with the target applet view;
in an example embodiment of the present disclosure, after the detection of the layout file, when the second applet window container is found in the layout file, the layout file indicating the host application includes other applet window containers. At this time, it may be determined whether the applet view in the second applet window container is consistent with the applet view acquired in the above step.
Step 840, when the applet view is consistent with the target applet view, the applet managing part reloads the target applet and displays it in the second applet window container;
in an example embodiment of the present disclosure, when it is determined that the applet view in the second applet window container is consistent with the applet view acquired in the above step, it indicates that one applet window container has been written in the layout file of the host application, and the target applet is opened in the applet window container. At this point, the applet management component may reload the target applet and then display directly in the second applet window container.
In step S850, the applet management means controls the target applet view to be displayed in the first target applet window container when the applet view is not identical to the target applet view.
In an example embodiment of the present disclosure, when it is determined that the applet view in the second applet window container is inconsistent with the applet view acquired in the above step, it indicates that one applet window container has been written in the layout file of the host application, and only that other applets are opened in the applet window container, and are not the target applet. At this time, the applet management means may control the target applet view to be displayed in the first target applet window container.
Through the above steps S810 to S850, it may be determined whether the host application includes other applet window containers, and when the host application includes other applet window containers, the applet views in the other applet window containers may be compared with the target applet view acquired in the above steps, so that the target applet is displayed in the first target applet window container or the second applet window container.
In an example embodiment of the present disclosure, the applet management component controls the applet to pause when the applet view does not correspond to the target applet view, and the applet management component may control the target applet view to be displayed in the first target applet window container. Referring to fig. 9, the applet management part controlling the applet to pause and display the target applet view in the first target applet window container may include the following steps S910 to S920:
step S910, when the small program view is not consistent with the target small program view, the small program management part controls the small program to pause;
in an example embodiment of the present disclosure, after the applet view in the second applet window container is obtained, the applet view and the target second applet view may be compared, and when the applet view is inconsistent with the target applet view, a pause method of the applet may be invoked to pause the applet in the second applet window container.
In step S920, the applet management means controls the target applet view to be displayed in the first target applet window container.
In an example embodiment of the present disclosure, after suspending the applet in the second applet window container, the first target applet window container and the target applet view obtained in the above steps may be obtained, and the applet management component is used to control the target applet view to be displayed in the first target applet window container.
Through the above steps S910 to S920, when the applet view is inconsistent with the target applet view, the applet management component controls the applet to pause, and the applet management component can control the target applet view to be displayed in the first target applet window container.
In an example embodiment of the present disclosure, after obtaining an interface component of a host application, an applet management component may be created in the interface component, then a layout file of the interface component is obtained, a first target applet window container is set in the layout file, and then the first target applet window container is controlled by the applet management component to display a target applet. The embodiment of the disclosure can adjust the page parameters of the window container for displaying the applet, so that the display mode of the applet is more diversified, the display mode for displaying the applet is more flexible, and the use experience of a user is improved.
It is noted that the above-mentioned figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
In addition, in the exemplary embodiment of the disclosure, a control device of the applet page parameter is also provided. Referring to fig. 10, an apparatus 1000 for controlling applet page parameters includes: an instruction acquisition module 1010, a container acquisition module 1020, and a program display module 1030.
The command acquisition module is used for responding to a target applet starting command, acquiring a configuration file of the target applet and initializing the configuration file; the container acquisition module is used for generating a target small program view according to the configuration file and acquiring a pre-created first target small program window container in a layout file of the host application program; and the program display module is used for controlling the target applet view to be displayed in the first target applet window container with the preset page parameters by the applet management component.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the obtaining an interface component of a host application includes: starting a host application program and acquiring an application file loaded by the host application program; and determining an interface component to be operated in the plurality of candidate components according to the application file.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, controlling a target applet window container to display a target applet according to an applet management part includes: the applet management component acquires a stack of a target applet window container; the applet management component controls a first target applet window container at the top of the stack to display the target applet.
For details that are not disclosed in the embodiments of the apparatus of the present disclosure, please refer to the embodiments of the method for controlling applet page parameters described above for details that are not disclosed in the embodiments of the apparatus of the present disclosure.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the generation method of the foregoing sub program is also provided.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 1100 according to such an embodiment of the disclosure is described below with reference to fig. 11. The electronic device 1100 shown in fig. 11 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present disclosure.
As shown in fig. 11, electronic device 1100 is embodied in the form of a general purpose computing device. The components of the electronic device 1100 may include, but are not limited to: the at least one processing unit 1110, the at least one memory unit 1120, a bus 1130 connecting different system components (including the memory unit 1120 and the processing unit 1110), and a display unit 1140.
Where the memory unit stores program code, the program code may be executed by the processing unit 1110 to cause the processing unit 1110 to perform the steps according to various exemplary embodiments of the present disclosure as described in the above-mentioned "exemplary methods" section of this specification. For example, the processing unit 1110 may perform step S110 as shown in fig. 1: acquiring an interface component of a host application program, and creating an applet management component in the interface component; step S110: the method comprises the steps of obtaining a layout file of an interface assembly, and setting a first target small program window container in the layout file, wherein the first target small program window container has preset page parameters; step S130: and controlling the first target applet window container to display the target applet through the applet management component.
As another example, an electronic device may implement the various steps shown in FIG. 1.
The storage unit 1120 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)1121 and/or a cache memory unit 1122, and may further include a read-only memory unit (ROM) 1123.
The storage unit 1120 may also include a program/utility 1124 having a set (at least one) of program modules 1125, such program modules 1125 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 thereof, may comprise an implementation of a network environment.
Bus 1130 may be representative of 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.
The electronic device 1100 may also communicate with one or more external devices 1170 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 1100, and/or any devices (e.g., router, modem, etc.) that enable the electronic device 1100 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 1150. Also, the electronic device 1100 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 1160. As shown, the network adapter 1160 communicates with the other modules of the electronic device 1100 over the bus 1130. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the above-mentioned "exemplary methods" section of this specification, when the program product is run on the terminal device.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.

Claims (11)

1. A method for controlling parameters of an applet page, comprising:
acquiring an interface component of a host application program, and creating an applet management component in the interface component;
acquiring a layout file of the interface component, and setting a first target applet window container in the layout file;
controlling the first target applet window container to display the target applet through the applet management component;
the first target applet window container has preset page parameters.
2. The method of claim 1, wherein obtaining the interface component of the host application comprises:
starting the host application program and acquiring the application file loaded by the host application program;
and determining an interface component to be operated in a plurality of candidate components according to the application file.
3. The method of claim 1, wherein controlling the target applet window container to display the target applet according to the applet management component comprises:
the applet management component acquires a stack of the target applet window container;
the applet management component controls display of the target applet located at the top of the stack in the first target applet window container.
4. A method for controlling parameters of an applet page, comprising:
responding to a target applet starting instruction, acquiring a configuration file of the target applet and initializing the configuration file into a reset state;
generating a target small program view according to the configuration file, and acquiring a pre-created first target small program window container in a layout file of a host application program;
and the applet management component controls the target applet view to be displayed in the first target applet window container with preset page parameters.
5. The method of claim 4, wherein obtaining the configuration file of the target applet and initializing to a reset state comprises:
acquiring the target applet starting instruction, wherein the target applet starting instruction comprises a storage path of the target applet;
and searching a configuration file of the target small program according to the storage path of the target small program, and initializing the configuration file to be in a reset state.
6. The method of claim 4, wherein obtaining the configuration file of the target applet and initializing to a reset state comprises:
acquiring a configuration file of the target applet and a loading method of the target applet;
initializing the target applet to a reset state according to a loading method of the target applet.
7. The method of claim 4, wherein the applet management component controls the display of the applet view in the applet window container, comprising:
judging whether a second small program window container exists in the layout file of the host application program;
when a second applet window container does not exist in the layout file, the applet management component controls the target applet view to be displayed in the first target applet window container;
when a second applet window container exists in the layout file, comparing whether the applet view of the second applet window container is consistent with the target applet view;
when the applet view is consistent with the target applet view, the applet management component reloads the target applet and displays in the second applet window container;
when the applet view does not correspond to the target applet view, the applet management component controls the target applet view to be displayed in the first target applet window container.
8. The method of claim 7, wherein controlling the target applet view to be displayed in the first target applet window container when the applet view does not correspond to the target applet view comprises:
when the applet view is inconsistent with the target applet view, the applet management component controls the applet to pause;
the applet management component controls the display of the target applet view in the first target applet window container.
9. An apparatus for controlling applet page parameters, the apparatus comprising:
the command acquisition module is used for responding to a target applet starting command, acquiring a configuration file of the target applet and initializing the configuration file;
the container acquisition module is used for generating a target small program view according to the configuration file and acquiring a pre-created first target small program window container in a layout file of a host application program;
and the program display module is used for controlling the target small program view to be displayed in the first target small program window container with preset page parameters by the small program management component.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 8.
11. An electronic device, comprising:
a processor; and
memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-8.
CN202110080516.1A 2021-01-21 2021-01-21 Method and device for controlling small program page parameters, medium and electronic equipment Pending CN113821205A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110080516.1A CN113821205A (en) 2021-01-21 2021-01-21 Method and device for controlling small program page parameters, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110080516.1A CN113821205A (en) 2021-01-21 2021-01-21 Method and device for controlling small program page parameters, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113821205A true CN113821205A (en) 2021-12-21

Family

ID=78912332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110080516.1A Pending CN113821205A (en) 2021-01-21 2021-01-21 Method and device for controlling small program page parameters, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113821205A (en)

Similar Documents

Publication Publication Date Title
JP6195182B2 (en) Application scenario identification method, power consumption management method, apparatus, and terminal device
US9934005B2 (en) Dynamically building locale objects or subsections of locale objects based on historical data
WO2020147462A1 (en) Recovery from application anomaly
US11334374B2 (en) Modifying readable and focusable elements on a page during execution of automated scripts
US10831331B2 (en) Window control for simultaneously running applications
CN103927198A (en) Software clearing method and software clearing device
CN111381920B (en) Display method and device of pop-up window assembly and electronic terminal
US10776852B2 (en) Contextual solicitation in a starter application
KR20140126702A (en) Extension activation for related documents
CN111767090A (en) Method and device for starting small program, electronic equipment and storage medium
CN109684573B (en) Target picture display method and device, storage medium and electronic equipment
CN109359092A (en) File management method, desktop display method, device, terminal and medium
CN109857537B (en) Background service starting method, device, medium and electronic equipment
US10678561B2 (en) Virtualizing extension code in an application
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN113821205A (en) Method and device for controlling small program page parameters, medium and electronic equipment
CN113110889B (en) Global message prompting method, global message prompting device, medium and electronic equipment
US20220410398A1 (en) Triggering dynamic robotic process automation
CN110119289B (en) Online page pasting method, device, medium and electronic equipment
CN109669764B (en) Processing method, apparatus, device and machine readable medium
CN108228307B (en) Application display method and device, storage medium and electronic equipment
CN113296802B (en) Virtual machine hot upgrading method, host device and storage medium
CN113127051B (en) Application resource packaging process monitoring method, device, equipment and medium
US20230376280A1 (en) Methods, systems and computer program products for optimizing computer programming for workflow development
CN116382975A (en) System for setting data restoration of application, method, device and storage medium thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination