CN109766098B - Application program running method and device and storage medium - Google Patents

Application program running method and device and storage medium Download PDF

Info

Publication number
CN109766098B
CN109766098B CN201910020126.8A CN201910020126A CN109766098B CN 109766098 B CN109766098 B CN 109766098B CN 201910020126 A CN201910020126 A CN 201910020126A CN 109766098 B CN109766098 B CN 109766098B
Authority
CN
China
Prior art keywords
view
module
logic
sub
logic module
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.)
Active
Application number
CN201910020126.8A
Other languages
Chinese (zh)
Other versions
CN109766098A (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910020126.8A priority Critical patent/CN109766098B/en
Publication of CN109766098A publication Critical patent/CN109766098A/en
Application granted granted Critical
Publication of CN109766098B publication Critical patent/CN109766098B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The application discloses an application program running method, application program running equipment and an application program storage medium, and relates to the field of program development. The first function item in the application program comprises a business logic module, a view logic control module and a sub-view logic module, and the method comprises the following steps: the sub-view logic module sends a first processing signal to the view logic control module; the view logic control module transmits a first processing signal to the service logic module; and the business logic module responds to the man-machine interaction operation according to the first processing signal. The service logic is managed through the service logic module, the sub-view logic module is managed through the view logic control module, and in the communication process, the service logic module and the sub-view logic module are communicated through the view logic control module, so that the problem that the coupling relation between the view logic and the service logic is complex is solved, the view logic and the service logic are decoupled, and the updating and the management of the first function item are facilitated.

Description

Application program running method and device and storage medium
Technical Field
The embodiment of the application relates to the field of program development, in particular to an application program running method, application program running equipment and a storage medium.
Background
A specific design mode is usually required in program development and application, the design mode provides an association relationship and a division mode among business logic, view logic and view resources in a program, and developers can realize the development of the program after dividing the business logic, the view logic and the view resources according to the design mode.
In the related art, a View Model Controller (MVC) design Model is provided for application in program development, where a Model is used to represent a Model, a View is used to represent a View, and a Controller is used to represent a Controller. In a game application developed by applying the MVC pattern, a single module is usually required to be arranged in a target function item of the game application, the single module is used for implementing all business logic functions of the target function item, and the single module manages and refers to all view logic modules in the target function item. Such as: the game application program comprises a shop, the shop is correspondingly provided with a single module, the single module is used for realizing all business logic functions of the shop, and the single module manages a view logic module of weapons, a view logic module of medicines and a view logic module of clothes in the shop.
In the game application program developed by the MVC mode, since a single module needs to implement both the service logic function and the view logic module, complex coupling conditions exist between the service logic and the view logic scripts in the function items and between the view scripts in the function items, and the game application program needs to consider complex coupling relationships in the expansion and maintenance, and the updating and maintenance process is complex.
Disclosure of Invention
The embodiment of the application provides an application program running method, application program running equipment and a storage medium, and can solve the problem that complex coupling conditions exist between business logic and view logic. The technical scheme is as follows:
in one aspect, a method for running an application program is provided, where the application program includes at least one function item, a first function item exists and includes a business logic module, a view logic control module, and at least one sub-view logic module, where the view logic control module is configured to manage the sub-view logic module, and the method includes:
the sub-view logic module sends a first processing signal to the view logic control module, wherein the first processing signal comprises a signal generated by man-machine interaction operation on display content in a display interface of the application program, and the display content is content provided by the sub-view logic module;
the view logic control module forwards the first processing signal to the service logic module;
and the business logic module responds to the human-computer interaction operation according to the first processing signal.
In another aspect, a method for running an application program is provided, where the application program includes at least one function item, and a first function item exists and includes a business logic module, a view logic control module, and at least one sub-view logic module, where the view logic control module is configured to manage the sub-view logic module, and the method includes:
the service logic module sends a second processing signal to the view logic control module, wherein the second processing signal comprises a signal for updating display content in a display interface of the application program, and the display content is provided by the sub-view logic module;
the view logic control module forwards the second processing signal to the sub-view logic module;
and the sub-view logic module updates the display content according to the second processing signal.
On the other hand, an apparatus for running an application program is provided, the application program includes at least one function item, the apparatus includes a business logic module, a view logic control module and at least one sub-view logic module, the view logic control module is used for managing the sub-view logic module;
the sub-view logic module is configured to send a first processing signal to the view logic control module, where the first processing signal includes a signal generated by a human-computer interaction operation on display content in a display interface of the application program, and the display content is content provided by the sub-view logic module;
the view logic control module is used for forwarding the first processing signal to the service logic module;
and the business logic module is used for responding to the human-computer interaction operation according to the first processing signal.
On the other hand, an apparatus for running an application program is provided, the application program includes at least one function item, the apparatus includes a business logic module, a view logic control module and at least one sub-view logic module, the view logic control module is used for managing the sub-view logic module;
the service logic module is configured to send a second processing signal to the view logic control module, where the second processing signal includes a signal for updating display content in a display interface of the application program, and the display content is provided by the sub-view logic module;
the view logic control module is used for forwarding the second processing signal to the sub-view logic module;
and the sub-view logic module is used for updating the display content according to the second processing signal.
In another aspect, a terminal is provided, which includes a processor and a memory, where at least one instruction, at least one program, a code set, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by the processor to implement the method for running an application program as provided in the embodiments of the present application.
In another aspect, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a set of codes, or a set of instructions is stored, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the execution method of the application program as provided in the embodiments of the present application.
In another aspect, a computer program product is provided, which when running on a computer, causes the computer to execute the running method of the application program as provided in the embodiments of the present application.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
because the first function item comprises the view logic control module, the service logic is managed through the service logic module, the sub-view logic module is managed through the view logic control module, and in the communication process, the service logic module and the sub-view logic module are communicated through the view logic control module, namely, the view logic control module is arranged to manage the communication and the functions of the sub-view logic module, the problem that the single piece of the service logic needs to be in charge of both the service logic and the view logic and the coupling relation between the view logic and the service logic is complex is avoided, the view logic control module is used for managing the sub-view logic and decoupling the view logic and the service logic, and the updating and the management of the first function item are facilitated.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an MVC pattern provided by an exemplary embodiment of the present application;
fig. 2 is a schematic structural diagram of an MVP mode according to an exemplary embodiment of the present application;
fig. 3 is a schematic structural diagram of an MVVM mode provided in an exemplary embodiment of the present application;
FIG. 4 is an interface diagram of functional items of an application provided by an exemplary embodiment of the present application;
FIG. 5 is a diagram illustrating call relationships among modules in a logical block of functional items in the related art, according to an exemplary embodiment of the present application;
FIG. 6 is a diagram illustrating call relationships among modules in a logical block of a functional item in the related art, according to another exemplary embodiment of the present application;
FIG. 7 is a flowchart of a method for operating an application provided by an exemplary embodiment of the present application;
fig. 8 is a flowchart of the first processing signal transferred between modules provided based on the operation method of the application program of fig. 7;
FIG. 9 is a flowchart of a method for operating an application according to another exemplary embodiment of the present application;
fig. 10 is a flowchart of second processing signals transferred between modules provided based on an operation method of the application program of fig. 9;
FIG. 11 is a diagram illustrating hooking of view resources in a view logic script according to an exemplary embodiment of the present application;
FIG. 12 is a flowchart of a method for operating an application provided by another exemplary embodiment of the present application;
FIG. 13 is a diagram illustrating hooking of view resources by a view broker module, as provided by an exemplary embodiment of the present application;
FIG. 14 is a flowchart of a method for operating an application provided by another exemplary embodiment of the present application;
FIG. 15 is a flow diagram of changing a state of a function item through an event service module as provided by an exemplary embodiment of the present application;
FIG. 16 is a schematic view of a user interface for a state change of a function item provided based on the operation method of the application program of FIG. 14;
fig. 17 is a schematic diagram of a call relationship between modules in the function item running process provided based on the running method of the application program of fig. 14;
FIG. 18 is a schematic diagram of calling relationships between modules in the MMVVD framework when the function items are run based on the function items provided by the run method of the application program of FIG. 14;
fig. 19 is a block diagram of an apparatus for running an application according to an exemplary embodiment of the present application;
fig. 20 is a block diagram of an apparatus for running an application according to another exemplary embodiment of the present application;
fig. 21 is a block diagram of an apparatus for running an application according to another exemplary embodiment of the present application;
fig. 22 is a block diagram of an apparatus for running an application according to another exemplary embodiment of the present application;
fig. 23 is a block diagram of a terminal according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In the related art, in the process of program development, the program is usually developed by adopting an MVC mode, a Model View Presenter (MVP) mode, or a model view (MVVM) mode, wherein the working principles of the three modes are explained respectively:
first, for the MVC mode, the Controller module is mainly responsible for service logic, and the View module is responsible for View logic, as shown in fig. 1, the View module can access the Model module, the Controller module can access the View module, and the Model module can access the Controller module. However, when the MVC mode is applied, the view logic and the service logic are separated, and the view logic and the view resource are coupled, which is not beneficial to the multiplexing of the view resource and the view logic;
secondly, aiming at an MVP mode, a Presenter module is mainly responsible for business logic and View logic, a View module is a passive View, the Presenter module and the View module can access each other, and the Presenter module and a Model module can also access each other, but the Presenter module needs to be responsible for the business logic and the View logic, has wide responsibility definition, is easy to form an excessively complicated code block, and cannot redirect the business logic and the View logic;
third, for the MVVM mode, as shown in fig. 3, the ViewModel module and the View module can access each other, and the ViewModel module and the Model module can also access each other, but similar to the MVP mode, the View Model module has a wide definition of responsibility, and is prone to form a too bulky code block.
Taking the above three modes as examples for application in the store function of the game application, as shown in fig. 4, the store interface 41 includes purchasing options of items 42, gift bags 43, skin 44, and diamonds 45, wherein the items 42 include ice river chips 421, gold coins 422, and star stone gift bags 423. In response to the display of the store interface 41, the description will be made from the viewpoint of the operation of the store logic block, with reference to fig. 5, the game application program is included therein; logic block a, logic block B, logic block C, and store logic block 51, wherein logic block a, logic block B, and logic block C correspond to other functional items in the game application, such as: logic block a corresponds to a training court in the game application, logic block B corresponds to a leaderboard in the game application, and logic block C corresponds to a picture in the game application.
The shop logic block 51 corresponds to a view logic module 52 and a business logic module 53, the shop logic block 51 further comprises a view logic script 511, a view logic script 512, a shop data script 513, a view resource 54, a shop singleton 55 and a prefabricated part 56, wherein the view logic script 511 and the view logic script 512 are scripts set according to the view logic module 52 and the business logic module 53, the shop singleton 55 is used for completing business logic functions in the shop logic block 51, the shop singleton 55 manages and refers to the view logic script 511, the view logic script 512 and the shop data script 513, and the shop singleton 55 is further used for communicating with the logic block A, the logic block B and the logic block C; the view logic script 511, the view logic script 512 and the store data script 513 are hung on the view resources 54, the view resources 54 are arranged in the prefabricated member 56 in a serialized mode, as can be known from the store logic block 51 shown in fig. 5, in the store logic block, the view logic is coupled with the view resources, the view logic is coupled with the business logic, and the coupling relationship between the modules is complex.
Illustratively, the coupling relationship among the function items is shown in fig. 6, wherein the dependency relationship among the activity function item 61, the animal exhibition function item 62, the daily login function item 63, the mail function item 64, the family function item 65, the friend function item 66, the task function item 67, the leader board function item 68, the chat room function item 69 and the wakefulness function item 60 is formed as a web dependency relationship, which is not beneficial to the extension, update and maintenance of the game application.
The embodiment of the application provides an MMVVD framework, which includes five parts, namely a Module, a Mediator Module, a View Module, a ViewProxy Module, and a Data base, and the functions of the five parts are described below:
a Module: and the Module is responsible for business logic in the application program, wherein the Module comprises a ModuleServer Module and a ModuleBase Module. The ModuleService module is an event service module, and is used for controlling service logic in an application program, for example: the application program comprises a function item A, a function item B and a function item C, the ModuleServer module is used for controlling the creation and destruction of the three function items, the communication among the three function items and the communication inside the function items, and the ModuleServer module is also used for switching the state of the application program; the ModuleBase module is a service logic module responsible for the service logic of a single functional item, such as: the functional item A corresponds to a ModuleBaseA module, and the ModuleBaseA module is responsible for the service logic of the functional item A; the functional item B corresponds to a ModuleBaseB module which is responsible for the service logic of the functional item B, and the functional item C corresponds to a ModuleBaseC module which is responsible for the service logic of the functional item C.
The Mediator module: and the view logic control module is responsible for the overall view logic in the functional items. Optionally, the Module may create a Mediator Module. Optionally, the Mediator module can also create and destroy the sub-view, illustratively, the shop view includes three sub-views of prop type sub-view, diamond type sub-view and skin type sub-view, and the media module can also create the currency type sub-view.
And a View module: and the view resource module comprises view resources. The view resource is a resource which is created by an art designer and is used for loading the view which needs to be generated. Such as: the shop view comprises a control resource, an image resource and a frame appearance resource, and the resources are all view resources in the view resource module.
ViewProxy module: and the View agent module is hung on the View resources in the View module, the View agent module is configured with a mapping relation between the View resources and the sub-View logic module, and the View of the sub-View logic module is loaded through the mapping relation configured in the View agent module.
Data base: and the data warehouse is used for storing data applied by each module in the application program. Optionally, the data warehouse is open to all modules.
Referring to fig. 7, fig. 7 is a flowchart of an operation method of an application program according to an exemplary embodiment of the present application, as shown in fig. 7, the application program includes at least one function item, where there is a first function item that includes a business logic module, a view logic control module, and at least one sub-view logic module, and the view logic control module is configured to manage the sub-view logic module, where the method includes:
in step 701, the sub-view logic module sends a first processing signal to the view logic control module.
Optionally, the application program may be at least one of a game application program, an instant messaging application program, a multimedia application program, and a financial application program.
Optionally, the application program is an application program developed by applying the MMVVD framework.
Optionally, the division of the function items in the application program may be divided according to functions required to be implemented in the application program, illustratively, the division of the purchasing function into stores, the division of the athletic function into training grounds, and the division of the entertainment function into restrooms is implemented. Optionally, the functional items may also be divided according to the actual design idea of the application program, which is not limited in this embodiment of the application.
Optionally, the first function item includes a view logic control module and at least two sub-view logic modules, each sub-view logic module corresponds to a part of the view of the first function item in the user interface, and the view logic control module is configured to control the at least two sub-view logic modules.
Optionally, the first processing signal includes a signal generated in a human-computer interaction operation on display content in a display interface of the application program, where the display content is content provided by the sub-view logic module. Optionally, the first processing signal is a signal generated by a touch operation on display content received by the terminal, or the first processing signal is a signal generated by an input operation on an external device on display content received by the terminal, which is schematically: the first function item is a store in the game application program, the store comprises a prop-type sub-store, a weapon A is sold in the prop-type sub-store, a purchase control is displayed below an image of the weapon A, the operation signal is a signal triggered when the purchase control is selected, and then the sub-view logic module corresponding to the purchase control sends a first processing signal to the view logic control module.
Optionally, when the display content corresponds to a parent view in the user interface, that is, the child view logic module corresponds to at least one parent view logic module, the child view logic module first sends a first processing signal to the parent view logic module, and the parent view logic module sends the first processing signal to the view logic control module. After the child view logic module sends the first processing signal to the parent view logic module, when the parent view logic module does not have a parent view logic module at an upper layer, the parent view logic module sends the first processing signal to the view logic control module; when the parent view logic module as a child view logic module also corresponds to a parent view logic module at a higher layer, the parent view logic module as a child view logic module sends a first processing signal to the parent view logic module at the higher layer, and so on until the first processing signal is sent to the view logic control module.
In step 702, the view logic control module forwards the first processing signal to the service logic module.
Optionally, the view logic control module is configured to relay the first processing signal between the sub-view logic module and the service logic module, that is, the transmission of the first processing signal among the sub-view logic module, the view logic control module, and the service logic module is layer-by-layer transmission. Optionally, the first processing signal cannot be transmitted between the sub-view logic module, the view logic control module, and the service logic module across layers, that is, the sub-view logic module cannot directly transmit the first processing signal to the service logic module, and meanwhile, the service logic module cannot directly transmit the first processing signal to the sub-view logic module.
Optionally, when the view logic control module receives the first processing signal sent by the sub-view logic module, the view logic control module defaults to forward the first processing signal to the service logic control module.
And 703, responding to the human-computer interaction operation by the service logic module according to the first processing signal.
Optionally, the service logic performs data operation corresponding to the first processing signal on the display content corresponding to the sub-view logic module according to the first processing signal, or the service logic module sends a processing request corresponding to the first processing signal to the server according to the first processing signal.
Illustratively, the first function item is a store, the store includes a prop-type sub-store, a weapon a is sold in the prop-type sub-store, the first processing signal is a touch signal corresponding to a purchase control for purchasing the weapon a, which is received by the terminal, a sub-view logic module corresponding to the first processing signal in the first function item is a sub-view logic module corresponding to the weapon a, the sub-view logic module corresponding to the weapon a sends the first processing signal to the view logic control module, and after the view logic control module sends the first processing signal to the service logic module, the service logic module sends a purchase request corresponding to the first processing signal to the server.
Fig. 8 is a flowchart illustrating a signal generated by a touch operation received by a terminal for a first processing signal, where the touch operation is a touch operation performed on content a, and the content a corresponds to a sub-view module uiprefafbclass (child). As shown in fig. 8, in step 801, the uiprefabclass (child) module sends an operation signal SendAction to the uiprefabclass (parent) module, which is a parent view module of the child view module uiprefabclass (child). Step 802, uiprefabclass (parent) module executes the onAction method. In step 803, the uiprefabclass (parent) module sends an operation signal SendAction to the uimedia module. In step 804, the UIMediator module executes the ONAction method. In step 805, the UIMediator module sends an operation signal SendAction to the ModuleBase module. In step 806, the ModuleBase module executes the onAction method to implement the response of the touch operation.
In summary, in the operation method of the application program provided in this embodiment, the first function item includes the view logic control module, the service logic is managed by the service logic module, the sub-view logic module is managed by the view logic control module, and in the communication process, the service logic module communicates with the sub-view logic module by the view logic control module, that is, the view logic control module is configured to manage the communication and the function of the sub-view logic module, so as to avoid the problem that a single piece of the service logic needs to be responsible for the service logic and also needs to manage the view logic, and the coupling relationship between the view logic and the service logic is complex, manage the sub-view logic by the view logic control module, decouple the view logic and the service logic, and facilitate the update and the management of the first function item.
In an alternative embodiment, a transmission direction of the second processing signal is opposite to a transmission direction of the first processing signal, please refer to fig. 9, fig. 9 is a flowchart of an operation method of an application program provided in an exemplary embodiment of the present application, as shown in fig. 9, the application program includes at least one function item, where there is a first function item including a service logic module, a view logic control module and at least one sub-view logic module, and the view logic control module is configured to manage the sub-view logic module, and the method includes:
step 901, the service logic module sends a second processing signal to the view logic control module.
Optionally, the second processing signal includes a signal for updating display content in a display interface of the application program, where the display content is provided by the sub-view logic module. Optionally, the second processing signal is a signal received by the terminal and sent by the server to update the display content, or the second processing signal is a signal received by the terminal and sent by the server to refresh the display content, which is schematically: the first function item is a store in the game application program, the store comprises a prop type sub-store, weapon A is sold in the prop type sub-store, the selling price of weapon A is 20, and the second processing signal is a signal sent by the server to the terminal for adjusting the selling price of weapon A to 12.
Optionally, the first function item includes a view logic control module and at least two sub-view logic modules, each sub-view logic module corresponds to a part of the view of the first function item in the user interface, and the view logic control module is configured to control the at least two sub-view logic modules.
In step 902, the view logic control module forwards the second processing signal to the sub-view logic module.
Optionally, the view logic control module is configured to relay the second processing signal between the sub-view logic module and the service logic module, that is, the transmission of the second processing signal among the sub-view logic module, the view logic control module, and the service logic module is layer-by-layer transmission. Optionally, the first processing signal cannot be transmitted between the sub-view logic module, the view logic control module, and the service logic module across layers, that is, the sub-view logic module cannot directly transmit the second processing signal to the service logic module, and meanwhile, the service logic module cannot directly transmit the second processing signal to the sub-view logic module.
Optionally, the second processing signal includes a sub-view logic module corresponding to the second processing signal, and when the view logic control module receives the second processing signal sent by the service logic module, the view logic control module sends the second processing signal according to the sub-view logic module corresponding to the second processing signal.
Optionally, when the display content corresponds to a parent view in the user interface, that is, the child view logic module corresponds to at least one parent view logic module, the view logic control module first sends a second processing signal to the parent view logic module, and the parent view logic module sends the second processing signal to the child view logic module. When the parent view logic module does not have a parent view logic module at an upper layer, the view logic control module directly sends a second processing signal to the parent view logic module; when the parent view logic module also corresponds to a parent view logic module at an upper layer as a child view logic module, the view logic control module firstly sends a second processing signal to the parent view logic module at the uppermost layer, and the parent view logic module sends the second processing signal to a child view logic module at a lower layer, and so on until the second processing signal is sent to the child view logic module.
And step 903, the sub-view logic module updates the display content according to the second processing signal.
Optionally, the sub-view logic module adjusts the display content of the sub-view logic module according to the second processing signal.
Illustratively, the first function item is a store, the store includes a property sub store, the property sub store is sold with a weapon a, the selling price of the weapon a is 20, the second processing signal is a signal sent by the server to the terminal for adjusting the selling price of the weapon a to 12, the sub-view logic module corresponding to the second processing signal in the first function item is the sub-view logic module corresponding to the weapon a, the business logic module sends the second processing signal to the view logic control module, and after the view logic control module sends the second processing signal to the sub-view logic module corresponding to the weapon a, the sub-view logic module corresponding to the weapon a adjusts the selling price display of the weapon a from 20 to 12.
Referring to fig. 10, fig. 10 is a flowchart illustrating a second processing signal as an update signal for a first function item, as shown in fig. 10, in which step 1001, the ModuleBase module executes the SendUpdateUI method. The SendUpdateUI method is a method for updating content a in the first function item, where the content a corresponds to a sub-view module uiprefafbclass (child). In step 1002, the ModuleBase module sends an update message SendUpdateUI to the UIMediator module. In step 1003, the UIMediator module executes an onapdateui method, and generates an update signal onapdateui according to the update message. In step 1004, the UIMediator module sends the update signal to the uiprefabclass (parent) module, where the uiprefabclass (parent) module is a parent view module of the child view module uiprefabclass (child). Step 1005, UIPrefabclass (parent) module executes the onUpdateUI method. In step 1006, the uiprefabclass (parent) module sends the update signal to the uiprefabclass (child) module. Step 1007, uiprefafobclass (child) module executes the onUpdateUI method and completes the update of the content a.
In summary, in the operation method of the application program provided in this embodiment, the first function item includes the view logic control module, the service logic is managed by the service logic module, the sub-view logic module is managed by the view logic control module, and in the communication process, the service logic module communicates with the sub-view logic module by the view logic control module, that is, the view logic control module is configured to manage the communication and the function of the sub-view logic module, so as to avoid the problem that a single piece of the service logic needs to be responsible for the service logic and also needs to manage the view logic, and the coupling relationship between the view logic and the service logic is complex, manage the sub-view logic by the view logic control module, decouple the view logic and the service logic, and facilitate the update and the management of the first function item.
As shown in fig. 5, the view logic script 511, the view logic script 512, and the store data script 513 are directly connected to the view resource 54, and the view resource 54 is arranged in the prefabricated component 56 in a serialized manner, that is, when the view logic script 511 and the view logic script 512 are loaded, the view resource is sequentially loaded from the view resource 54 configured in a serialized manner to realize loading of the view logic script, and a direct coupling relationship exists between the view logic and the view resource, so that after the view logic script is developed, an art designer can configure the view resource according to a loading sequence of the view resource in the view logic script.
As shown in fig. 11, the view logic script of the function item UIBack is sequentially configured with: view resources corresponding to Script (Script name) are UIBack; the view resource corresponding to ItemDetailLabel (item refinement label) is SellMoney; the view resource corresponding to itemsecount (the number of project users) is usenum label, and when loading the function item UIBack, three view resources are sequentially loaded, however, since the view resources and the view logic script are directly connected, the view logic and the view resources are coupled, the art designing and the program development workflow are interspersed, and the development efficiency is low.
In an optional embodiment, the first functional item further includes a view resource module and a view agent module, where the view agent module is connected to the view resource module, the view resource module includes view resources, and the view agent module is configured with a mapping relationship between the view resources and the sub-view logic module.
Fig. 12 is a flowchart of an application running method according to another exemplary embodiment of the present application, as shown in fig. 12, taking as an example that the method is applied to a terminal installed with an application, the application includes at least one function item, where a first function item includes a business logic module, a view logic control module, and a sub-view logic module, and the method includes:
in step 1201, the sub-view logic module determines a view index number configured in the view agent module and corresponding to the sub-view logic module.
Optionally, the view index number is an index number configured in the view agent module and used for mapping the view resource in the sub-view logic module.
Illustratively, the view proxy module and the view index numbers corresponding to the sub-view logic modules configured in the view proxy module are shown in fig. 13, in the view proxy script 131 in fig. 13, a view resource name corresponding to closeBtn (Close control) corresponding to the index number 00 is displayed as Close, a view resource name corresponding to shareuunion btn (personal sharing control) corresponding to the index number 01 is displayed as shareuunion, and a view resource name corresponding to shareeworkbtn (world sharing control) having the index number 02 is displayed as shareeworld.
Step 1202, the sub-view logic module obtains the view resource corresponding to the view index number from the view resource module and loads the view resource to obtain the view corresponding to the sub-view logic module.
Optionally, according to the view index number corresponding to the sub-view logic module, after determining the view resource corresponding to the view index number from the view resource module to load, the view corresponding to the sub-view logic module is generated.
Alternatively, the embodiment shown in fig. 12 may be implemented in combination with the embodiments shown in fig. 7 and/or fig. 9, or may be implemented separately as a separate embodiment.
In summary, in the operation method of the application program provided in this embodiment, the first function item includes the view logic control module, the service logic is managed by the service logic module, the sub-view logic module is managed by the view logic control module, and in the communication process, the service logic module communicates with the sub-view logic module by the view logic control module, that is, the view logic control module is configured to manage the communication and the function of the sub-view logic module, so as to avoid the problem that a single piece of the service logic needs to be responsible for the service logic and also needs to manage the view logic, and the coupling relationship between the view logic and the service logic is complex, manage the sub-view logic by the view logic control module, decouple the view logic and the service logic, and facilitate the update and the management of the first function item.
According to the method provided by the embodiment, the view agent module is hooked with the view resource, so that the view logic script is prevented from being directly hooked with the view resource, the view logic and the view resource are decoupled, the view resource is multiplexed through the index number, the view resource can be updated only by adding or deleting the corresponding index item in the view agent module during resource updating, and the view resource is updated conveniently.
As shown in fig. 5, the shop singleton 55 manages and refers to a view logic script 511, a view logic script 512, and a shop data script 513, the shop singleton 55 is also used for communicating with a logic block a, a logic block B, and a logic block C, the function of the shop singleton 55 is widely defined, and the logic blocks communicate with each other through the singleton, so that the logic blocks are in a mesh calling mode, and the calling manner between the logic blocks is complicated.
In an optional embodiment, an event service module is further provided in the application program, where the event service module is configured to manage communication between different function items in the application program, fig. 14 is a flowchart of an operation method of the application program according to another exemplary embodiment of the present application, and as shown in fig. 14, the method is described as being applied to a terminal as an example, and the method includes:
in step 1401, the event service module sends a first state adjustment signal to the service logic module of the first functional item.
Optionally, the first state adjustment signal is sent to the service logic module of the first function item after the second service logic module of the second function item sends the second state adjustment signal to the event service module.
Optionally, the first state adjustment signal is used to adjust a state of the first function item, such as: and when the first function item is in the running state, the running state of the first function item is adjusted to be the closing state, or when the first function item is in the closing state, the running state of the first function item is adjusted to be the running state.
Illustratively, the second function item is a game lobby, the first function item is a shop, when the game lobby is in operation, a user selects the shop in the interface, the second function item sends a touch signal to the service logic module through the view logic control module from the sub-view logic module, the service logic module sends a second state adjustment signal to the event service module, the second state adjustment signal is used for indicating that the state of the second function item is adjusted from an operating state to a closed state, and the state of the first function item is adjusted from the closed state to the operating state, and the event service module sends the first state adjustment signal to the service logic module of the first function item according to the received second state adjustment signal.
Step 1402, the service logic module completes the state adjustment of the first function item according to the first state adjustment signal.
Optionally, the service logic module executes a state adjustment method according to the first adjustment signal to implement the state adjustment of the first functional item.
Optionally, the target framework is further provided with a view service module, the terminal sends a view state adjustment signal to the view logic control module through the view service module, and the view logic control module adjusts the view state of the first function item according to the view state adjustment signal.
Referring to fig. 15, in step 1501, the ModuleService module sends a state adjustment signal ChangeGameState to the ModuleBase module. In step 1502, the ModuleBase module executes the onstate process method to adjust the status of the function item. In step 1503, the uistate service module sends a view state adjustment signal ChangeUIState to the UIMediator module. In step 1504, the uisediator module executes the onstate process method to adjust the view state of the function item.
Schematically, for example, the embodiment shown in fig. 14 is applied to a game application scenario, as shown in fig. 16, a main interface of a game is displayed in a game interface 160, the main interface includes a store control 161, a chart control 162, and a game starting control 163, the currently displayed game interface 160 is the main interface, so that a state corresponding to the main interface is an operating state, and an operating state corresponding to a match between the store, the chart, and the game is an off state, when a user selects on the store control 161, the ModuleService module sends a first state adjustment signal to the ModuleBase module of the store function item, the first state adjustment signal is used to adjust a state of the store function item to the operating state, and according to the first state adjustment signal, the game interface 164 displays the store interface, and the store is in the operating state.
It is noted that the embodiment shown in fig. 14 can be implemented in combination with at least one of the embodiments shown in fig. 7, fig. 9 and fig. 12, or can be implemented separately as a separate embodiment.
In summary, in the operation method of the application program provided in this embodiment, the first function item includes the view logic control module, the service logic is managed by the service logic module, the sub-view logic module is managed by the view logic control module, and in the communication process, the service logic module communicates with the sub-view logic module by the view logic control module, that is, the view logic control module is configured to manage the communication and the function of the sub-view logic module, so as to avoid the problem that a single piece of the service logic needs to be responsible for the service logic and also needs to manage the view logic, and the coupling relationship between the view logic and the service logic is complex, manage the sub-view logic by the view logic control module, decouple the view logic and the service logic, and facilitate the update and the management of the first function item.
According to the method provided by the embodiment, the event service module is arranged for managing the communication among different function items in the application program, so that the problem that the call relation among the function items is complex due to the fact that the single function item is communicated, the function items are communicated through the event service module in a unified mode, and the communication relation among the function items is simplified.
The method provided by the embodiment provides development efficiency through the MMVVD framework, only corresponding codes need to be added according to the template file aiming at newly added contents in the program updating process, and the code file has strong orderliness, convenient management and low error rate.
With reference to the embodiment shown in fig. 7, 9, 12 and 14, the execution logic of each module in the logic block corresponding to the function item in the embodiment of the present application is described, please refer to fig. 17, taking the first function item as an example of a store, the store corresponds to a store logic block 170 during operation, the store logic block 170 includes a template file 171, a business logic module 172, a view logic control module 173, a sub-view logic module 174, a view agent script 175, a view resource module 176 and a prefabricated part 177, wherein the business logic module 172, the view logic control module 173 and the sub-view logic module 174 inherit the template file 171, the business logic module 172, the view logic control module 173 and the sub-view logic module 174 communicate with each other through a bidirectional bubble-by-bubble communication mechanism, the view agent script 175 is hung on the view resource module 176, the sub-view logic module 174 loads the view resources in the view resources module 176 via the view proxy script 175, and the view resources in the view resources module 176 are serialized to the pre-form 177. Optionally, the store logic block communicates with logic block A, logic block B, and logic block C through an event service module 178. Optionally, the store logic block 170 further corresponds to a data warehouse 179, and the data warehouse 179 stores data applied in the store logic block 170.
Alternatively, starting from the business logic module 172, to the view logic control module 173 and then to the sub-view logic module 174, a layer-by-layer update call may be made, and each layer may make an onupdate response, taking as an example the call and response interface of the view logic control module 173, which is shown in the following code:
and updating the UI callback:
function UIMediatorClass:vOnUpdateUI(id,argument)
end
sending an update UI:
function UIMediatorClass:vOnSendUpdateUI(id,argument,dummy)
end
on the contrary, the opposite direction of the update call is an action process, taking the interface of the view logic control module 153 as an example, the interface is shown by the following codes:
and (4) operation callback:
function UIMediatorClass:vOnAction(id,argument)
end
and (3) sending operation:
function UIMediatorClass:vOnSendAction(id,argument,dummy)
end
the MMVVD framework provided in the embodiment of the present application can implement synchronous work of a program developer and a designer, and is described by taking an application of the framework of the MMVVD framework in a game application as an example, please refer to fig. 18, where the MMVVD framework 180 includes a logic portion 181 and a view portion 182, where the logic portion 181 is developed by the program developer, the design portion 182 is drawn by the designer, and the logic portion 181 includes a data warehouse 1811, a business logic module 1812, a view logic control module 1813, and a sub-view logic module 1814, where a call relationship between the modules is shown by an arrow in fig. 18. The following description is made for each block in the logic portion 181:
(1) data of the Data warehouse: various service data are stored, the data are stored and accessed in a key-value mode, and the data are shared among modules;
(2) and a business logic Module: the main body of the function item is used for realizing business logic, such as: cs communication, game state sensing, event monitoring, data refreshing, and the like, wherein interfaces of the service logic module, such as initialization, counter-initialization, game state change, view update, view callback, view creation logic control module, resource collection, and the like, are mainly defined in the template file, and part of the interfaces are shown as the following codes:
initialization:
function ModuleBaseClass:vOnInitializeModule()
end
and (3) performing inverse initialization:
function ModuleBaseClass:vOnUninitializeModule()
end
collecting resources:
function ModuleBaseClass:vOnPrepareAssetData(collection)
end
state change permission:
function ModuleBaseClass:vOnGameStateAllowSwitch(switchType,current State,targeState,userData)
return true
end
and (3) state change:
function ModuleBaseClass:vOnStatePrevSwitch(kind,switchType,current State,targeState,userData)
end
and (3) notifying after state change:
function ModuleBaseClass:vOnStatePostSwitch(kind)
end
and (4) entering a game state:
function ModuleBaseClass:vOnStateEnter(switchType,stateName,userData)
end
the game state leaves:
function ModuleBaseClass:vOnStateLeave(switchType,stateName,userData)
end
view callback:
function ModuleBaseClass:vOnAction(id,argument)
end
updating views
function ModuleBaseClass:SendUpdateUI(id,argument)
end
(3) View logic control module, media: the method mainly comprises the following steps of realizing the overall view logic of a function item, mainly defining interfaces of view logic initialization, counter initialization, view state change, module updating, child view callback, child view creation and destruction and the like of a view logic control module in a template file, wherein part of the interfaces are shown as the following codes:
acquiring a UI state:
function UIMediatorClass:vGetBelongUIStateName()
end
initialization:
function UIMediatorClass:vOnInitialize()
end
and (3) performing inverse initialization:
function UIMediatorClass:vOnUninitialize()
end
the cut-in state:
function UIMediatorClass:vOnUIStateIn(switchType,inStateName,userData)
end
an out state:
function UIMediatorClass:vOnUIStateOut(switchType,outStateName)
end
a staying state:
function UIMediatorClass:vOnUIStateStay(switchType,outStateName,inStateName,userData)
end
a resident state:
function UIMediatorClass:vOnUIStateHoldon(switchType,stateName,userData)
end
and the asynchronous creation child view logic module completes callback:
function UIMediatorClass:vOnCreateAsynPrefabClassComplete(prefabClass)
end
and updating the UI callback:
function UIMediatorClass:vOnUpdateUI(id,argument)
end
operation callback
function UIMediatorClass:vOnAction(id,argument)
end
Close rendering of child view logic:
function UIMediatorClass:vOnDisableUIPrefabRender(prefabPath)
end
displaying a full screen interface callback:
function UIMediatorClass:vOnShowFullScreen(show)
end
creating child view logic module
function UIMediatorClass:vOnCreatePrefabClass(cls,argument,customID)
end
The asynchronous creation child view logic module:
function UIMediatorClass:vOnCreateAsynPrefabClass(cls,argument,loadPriority,life,customID)
end
destroy sub-view logic module
function UIMediatorClass:vOnDestroyPrefabClass(obj)
end
Sending the updated view:
function UIMediatorClass:vOnSendUpdateUI(id,argument,dummy)
end
and (3) sending operation:
function UIMediatorClass:vOnSendAction(id,argument,dummy)
end
(4) and a sub-view logic module ViewLogic: the secondary interface or different function display areas in the corresponding game interface share the responsibility of the Mediator based on reusability and independence, the interface of view sub-logic initialization, counter initialization, view state change, media update and interactive response callback, view resource life cycle management and the like of the sub-view logic module is mainly defined in the template file, and part of the interfaces are shown as the following codes:
acquiring a resource path:
function UIPrefabClass:vGetPath()
end
and (3) calling back after the resources are loaded:
function UIPrefabClass:vOnResourceLoaded()
end
callback before resource unloading:
function UIPrefabClass:vOnResourceUnLoaded()
end
logic initialization:
function UIPrefabClass:vOnInitialize()
end
logic reverse initialization:
function UIPrefabClass:vOnUninitialize()
end
and the asynchronous creation child view logic module completes callback:
function UIPrefabClass:vOnCreateAsynPrefabClassComplete(prefabClass)
end
and updating the UI callback:
function UIPrefabClass:vOnUpdateUI(id,argument)
end
and (4) operation callback:
function UIPrefabClass:vOnAction(id,argument)
end
create child view logic:
functionUIPrefabClass:CreateChildPrefabClass(cls,parentTf,argument,customID)
end
asynchronously creating child view logic modules
functionUIPrefabClass:CreateAsynChildPrefabClass(cls,parentTf,argument,loadPriority,life,customID)
end
Destroy child view logic:
function UIPrefabClass:DestroyChildPrefabClass(obj)
end
sending an update UI:
function UIPrefabClass:SendUpdateUI(id,argument,dummy)
end
and (3) sending operation:
function UIMediatorClass:SendAction(id,argument,dummy)
end
the description is made separately for each block in the view section 182:
the view resource 1822 is authored and output by an art designer, and is subjected to serialization control reference by the upper view agent module 1821 through tool mounting, and is dynamically bound with the sub-view logic module through an index number by the view agent module 1821.
Fig. 19 is a schematic structural diagram of an operating apparatus of an application according to an exemplary embodiment of the present application, where as shown in fig. 19, the application includes at least one function item, and the apparatus includes: a business logic module 191, a view logic control module 192 and at least one sub-view logic module 193, wherein the view logic control module 192 is used for managing the sub-view logic module 193;
the sub-view logic module 193 is configured to send a first processing signal to the view logic control module 192, where the first processing signal includes a signal generated by a human-computer interaction operation on display content in a display interface of the application program, and the display content is content provided by the sub-view logic module;
the view logic control module 192 is configured to forward the first processing signal to the service logic module 191;
the service logic module 191 is configured to respond to the human-computer interaction operation according to the first processing signal.
In an optional embodiment, the first function item includes a view logic control module and at least two sub-view logic modules, and the view logic control module is configured to manage the at least two sub-view logic modules.
In an alternative embodiment, as shown in FIG. 20, the child view logic module 193 also corresponds to at least one parent view logic module 194;
the child view logic module 193 is further configured to send the first processing signal to the parent view logic module 194;
the parent view logic module 194 is configured to send the first processing signal to the view logic control module 192.
In an optional embodiment, the apparatus further comprises a view resource module 195 and a view agent module 196, the view agent module 196 is connected to the view resource module 195, the view resource module 195 includes a view resource therein, and the view agent module 196 is configured with a mapping relationship between the view resource and the sub-view logic module 193;
the sub-view logic module 193 is further configured to determine a view index number configured in the view agent module 196 and corresponding to the sub-view logic module 193;
the sub-view logic module 193 is further configured to obtain, from the view resource module 195, a view resource corresponding to the view index number for loading, so as to obtain a view corresponding to the sub-view logic module 193.
In an optional embodiment, the apparatus further comprises an event service module 197, wherein the event service module 197 is configured to manage communication between different function items in the application;
the event service module 197 is configured to send a first state adjustment signal to the service logic module 191 of the first function item, where the first state adjustment signal is sent to the service logic module 191 of the first function item after the second service logic module of the second function item sends a second state adjustment signal to the event service module;
the service logic module 191 is further configured to complete the state adjustment of the first function item according to the first state adjustment signal.
Fig. 21 is a schematic structural diagram of an operating apparatus of an application according to an exemplary embodiment of the present application, where as shown in fig. 21, the application includes at least one function item, and the apparatus includes: a business logic module 211, a view logic control module 212 and at least one sub-view logic module 213, wherein the view logic control module 212 is used for managing the sub-view logic module 213;
the service logic module 211 is configured to send a second processing signal to the view logic control module 212, where the second processing signal includes a signal for updating display content in a display interface of the application program, where the display content is provided by the sub-view logic module;
the view logic control module 212 is configured to forward the second processing signal to the sub-view logic module 213;
the sub-view logic module 213 is configured to update the display content according to the second processing signal.
In an optional embodiment, the first function item includes a view logic control module and at least two sub-view logic modules, and the view logic control module is configured to manage the at least two sub-view logic modules.
In an alternative embodiment, as shown in fig. 22, the child view logic module 213 further corresponds to at least one parent view logic module 214;
the view logic control module 212 is further configured to send the second processing signal to the parent view logic module 214;
the parent view logic module 214 is configured to send the second processing signal to the child view logic module 213.
In an optional embodiment, the apparatus further includes a view resource module 215 and a view agent module 216, the view agent module 216 is connected to the view resource module 215, the view resource module 215 includes a view resource, and the view agent module 216 is configured with a mapping relationship between the view resource and the sub-view logic module 213;
the sub-view logic module 213 is further configured to determine a view index number corresponding to the sub-view logic module 213 configured in the view agent module 216;
the sub-view logic module 213 is further configured to obtain, from the view resource module 215, a view resource corresponding to the view index number for loading, so as to obtain a view corresponding to the sub-view logic module 213.
In an optional embodiment, the apparatus further comprises an event service module 217, where the event service module 217 is configured to manage communication between different function items in the application;
the event service module 217 is configured to send a first state adjustment signal to the service logic module 211 of the first function item, where the first state adjustment signal is sent to the service logic module 211 of the first function item after a second service logic module of a second function item sends a second state adjustment signal to the event service module 217;
the service logic module 211 is further configured to complete the state adjustment of the first function item according to the first state adjustment signal.
Fig. 23 is a block diagram illustrating a terminal 2300 according to an exemplary embodiment of the present invention. The terminal 2300 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. Terminal 2300 may also be referred to by other names such as user equipment, portable terminals, laptop terminals, desktop terminals, and the like.
In general, the terminal 2300 includes: a processor 2301 and a memory 2302.
The processor 2301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 2301 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 2301 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 2301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 2301 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 2302 may include one or more computer-readable storage media, which may be non-transitory. Memory 2302 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 2302 is used to store at least one instruction for execution by the processor 2301 to implement a method for running an application program provided by the method embodiments of the present application.
In some embodiments, the terminal 2300 may further optionally include: a peripheral interface 2303 and at least one peripheral. The processor 2301, memory 2302, and peripheral interface 2303 may be connected by bus or signal lines. Various peripheral devices may be connected to peripheral interface 2303 by buses, signal lines, or circuit boards. Specifically, the peripheral device includes: at least one of a radio frequency circuit 2304, a touch display 2305, a camera 2306, an audio circuit 2307, a positioning component 2308, and a power supply 2309.
The peripheral interface 2303 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 2301 and the memory 2302. In some embodiments, the processor 2301, memory 2302, and peripheral interface 2303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 2301, the memory 2302, and the peripheral device interface 2303 can be implemented on separate chips or circuit boards, which are not limited by this embodiment.
The Radio Frequency circuit 2304 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuit 2304 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 2304 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 2304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuit 2304 may communicate with other terminals through at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (wireless fidelity) networks. In some embodiments, the rf circuit 2304 may also include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 2305 is used to display a UI (user interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 2305 is a touch display screen, the display screen 2305 also has the ability to capture touch signals on or over the surface of the display screen 2305. The touch signal may be input to the processor 2301 as a control signal for processing. At this point, the display 2305 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 2305 may be one, providing the front panel of the terminal 2300; in other embodiments, the display screen 2305 can be at least two, respectively disposed on different surfaces of the terminal 2300 or in a folded design; in still other embodiments, the display 2305 may be a flexible display disposed on a curved surface or a folded surface of the terminal 2300. Even more, the display screen 2305 may be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display 2305 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or other materials.
The camera assembly 2306 is used to capture images or video. Optionally, camera assembly 2306 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 2306 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuit 2307 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals into the processor 2301 for processing or inputting the electric signals into the radio frequency circuit 2304 to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different positions of the terminal 2300. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 2301 or the radio frequency circuit 2304 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuit 2307 may also include a headphone jack.
The positioning component 2308 is used to locate the current geographic position of the terminal 2300 for navigation or LBS (Location Based Service). The Positioning component 2308 may be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
Power supply 2309 is used to provide power to various components in terminal 2300. The power source 2309 may be alternating current, direct current, disposable batteries, or rechargeable batteries. When the power supply 2309 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 2300 also includes one or more sensors 2310. The one or more sensors 2310 include, but are not limited to: an acceleration sensor 2311, a gyro sensor 2312, a pressure sensor 2313, a fingerprint sensor 2314, an optical sensor 2315, and a proximity sensor 2316.
The acceleration sensor 2311 can detect the magnitude of acceleration in three coordinate axes of a coordinate system established with the terminal 2300. For example, the acceleration sensor 2311 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 2301 may control the touch display screen 2305 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 2311. The acceleration sensor 2311 may also be used for game or user motion data acquisition.
The gyro sensor 2312 can detect the body direction and the rotation angle of the terminal 2300, and the gyro sensor 2312 can cooperate with the acceleration sensor 2311 to acquire the 3D action of the user on the terminal 2300. The processor 2301 may implement the following functions according to the data collected by the gyro sensor 2312: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensor 2313 may be disposed on a side bezel of terminal 2300 and/or an underlying layer of touch display 2305. When the pressure sensor 2313 is arranged on the side frame of the terminal 2300, a holding signal of a user to the terminal 2300 can be detected, and the processor 2301 performs left-right hand identification or shortcut operation according to the holding signal collected by the pressure sensor 2313. When the pressure sensor 2313 is disposed at the lower layer of the touch display screen 2305, the processor 2301 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 2305. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 2314 is used for collecting a fingerprint of the user, and the processor 2301 identifies the user according to the fingerprint collected by the fingerprint sensor 2314, or the fingerprint sensor 2314 identifies the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the processor 2301 authorizes the user to perform relevant sensitive operations including unlocking a screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 2314 may be disposed on the front, back, or side of the terminal 2300. When a physical key or a vendor Logo is provided on the terminal 2300, the fingerprint sensor 2314 may be integrated with the physical key or the vendor Logo.
The optical sensor 2315 is used to collect ambient light intensity. In one embodiment, the processor 2301 may control the display brightness of the touch display screen 2305 based on the ambient light intensity collected by the optical sensor 2315. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 2305 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 2305 is turned down. In another embodiment, the processor 2301 may also dynamically adjust the shooting parameters of the camera assembly 2306 according to the intensity of ambient light collected by the optical sensor 2315.
A proximity sensor 2316, also known as a distance sensor, is typically disposed on the front panel of the terminal 2300. The proximity sensor 2316 is used to collect the distance between the user and the front surface of the terminal 2300. In one embodiment, the processor 2301 controls the touch display screen 2305 to switch from the bright screen state to the rest screen state when the proximity sensor 2316 detects that the distance between the user and the front surface of the terminal 2300 is gradually decreased; when the proximity sensor 2316 detects that the distance between the user and the front surface of the terminal 2300 is gradually increased, the processor 2301 controls the touch display screen 2305 to switch from a breath screen state to a bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 23 does not constitute a limitation of terminal 2300, and may include more or fewer components than those shown, or may combine certain components, or may employ a different arrangement of components.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, which may be a computer readable storage medium contained in a memory of the above embodiments; or it may be a separate computer-readable storage medium not incorporated in the terminal. The computer readable storage medium has at least one instruction, at least one program, a set of codes, or a set of instructions stored therein, which is loaded and executed by the processor to implement the method for running the application program as described in any one of fig. 7, fig. 9, fig. 12, and fig. 14.
Optionally, the computer-readable storage medium may include: a Read Only Memory (ROM), a Random Access Memory (RAM), a Solid State Drive (SSD), or an optical disc. The Random Access Memory may include a resistive Random Access Memory (ReRAM) and a Dynamic Random Access Memory (DRAM). The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (14)

1. An operation method of an application program, wherein the application program includes at least one function item, a first function item includes a business logic module, a view logic control module and at least one sub-view logic module, the view logic control module is configured to manage the sub-view logic module, the application program further includes a view resource module, a view agent module and a data warehouse, the view agent module is connected to the view resource module, the view resource module includes a view resource, the view agent module is configured with a mapping relationship between the view resource and the sub-view logic module, and the data warehouse is configured to store data applied by the first function item in the application program, and the method includes:
the sub-view logic module sends a first processing signal to the view logic control module, wherein the first processing signal comprises a signal generated by man-machine interaction operation on display content in a display interface of the application program, and the display content is content provided by the sub-view logic module;
the view logic control module forwards the first processing signal to the service logic module;
and the business logic module responds to the human-computer interaction operation according to the first processing signal.
2. The method of claim 1,
the first function item comprises a view logic control module and at least two sub-view logic modules, and the view logic control module is used for managing the at least two sub-view logic modules.
3. The method of claim 1, wherein the child view logic module further corresponds to at least one parent view logic module, and wherein the child view logic module sends a first processing signal to the view logic control module, comprising:
the child view logic module sends the first processing signal to the parent view logic module;
the parent view logic module sends the first processing signal to the view logic control module.
4. The method of any of claims 1 to 3, further comprising:
the sub-view logic module determines a view index number corresponding to the sub-view logic module and configured in the view agent module;
and the sub-view logic module acquires the view resource corresponding to the view index number from the view resource module and loads the view resource to obtain the view corresponding to the sub-view logic module.
5. The method according to any one of claims 1 to 3, wherein the application further comprises an event service module for managing communication between different function items in the application, the method further comprising:
the event service module sends a first state adjustment signal to the service logic module of the first function item, wherein the first state adjustment signal is sent to the service logic module of the first function item after a second service logic module of a second function item sends a second state adjustment signal to the event service module;
and the business logic module completes the state adjustment of the first function item according to the first state adjustment signal.
6. An operation method of an application program, wherein the application program includes at least one function item, a first function item includes a business logic module, a view logic control module and at least one sub-view logic module, the view logic control module is configured to manage the sub-view logic module, the application program further includes a view resource module, a view agent module and a data warehouse, the view agent module is connected to the view resource module, the view resource module includes a view resource, the view agent module is configured with a mapping relationship between the view resource and the sub-view logic module, and the data warehouse is configured to store data applied by the first function item in the application program, and the method includes:
the service logic module sends a second processing signal to the view logic control module, wherein the second processing signal comprises a signal for updating display content in a display interface of the application program, and the display content is provided by the sub-view logic module;
the view logic control module forwards the second processing signal to the sub-view logic module;
and the sub-view logic module updates the display content according to the second processing signal.
7. The method of claim 6,
the first function item comprises a view logic control module and at least two sub-view logic modules, and the view logic control module is used for managing the at least two sub-view logic modules.
8. The method of claim 6, wherein the child view logic module further corresponds to at least one parent view logic module, and wherein the view logic control module forwards the second processing signal to the child view logic module, and wherein the step of forwarding the second processing signal comprises:
the view logic control module sends the second processing signal to the parent view logic module;
the parent view logic module sends the second processing signal to the child view logic module.
9. The method according to any one of claims 6 to 8, further comprising:
the sub-view logic module determines a view index number corresponding to the sub-view logic module and configured in the view agent module;
and the sub-view logic module acquires the view resource corresponding to the view index number from the view resource module and loads the view resource to obtain the view corresponding to the sub-view logic module.
10. The method according to any one of claims 6 to 8, wherein the application further comprises an event service module for managing communication between different function items in the application, the method further comprising:
the event service module sends a first state adjustment signal to the service logic module of the first function item, wherein the first state adjustment signal is sent to the service logic module of the first function item after a second service logic module of a second function item sends a second state adjustment signal to the event service module;
and the business logic module completes the state adjustment of the first function item according to the first state adjustment signal.
11. An operating device of an application program is characterized in that the application program comprises at least one function item, the device comprises a business logic module, a view logic control module and at least one sub-view logic module, the view logic control module is used for managing the sub-view logic module, the application program further comprises a view resource module, a view agent module and a data warehouse, the view agent module is connected with the view resource module in a hanging manner, the view resource module comprises view resources, the view agent module is configured with a mapping relation between the view resources and the sub-view logic module, and the data warehouse is used for storing data applied by a first function item in the application program;
the sub-view logic module is configured to send a first processing signal to the view logic control module, where the first processing signal includes a signal generated by a human-computer interaction operation on display content in a display interface of the application program, and the display content is content provided by the sub-view logic module;
the view logic control module is used for forwarding the first processing signal to the service logic module;
and the business logic module is used for responding to the human-computer interaction operation according to the first processing signal.
12. An operating device of an application program is characterized in that the application program comprises at least one function item, the device comprises a business logic module, a view logic control module and at least one sub-view logic module, the view logic control module is used for managing the sub-view logic module, the application program further comprises a view resource module, a view agent module and a data warehouse, the view agent module is connected with the view resource module in a hanging manner, the view resource module comprises view resources, the view agent module is configured with a mapping relation between the view resources and the sub-view logic module, and the data warehouse is used for storing data applied by a first function item in the application program;
the service logic module is configured to send a second processing signal to the view logic control module, where the second processing signal includes a signal for updating display content in a display interface of the application program, and the display content is provided by the sub-view logic module;
the view logic control module is used for forwarding the second processing signal to the sub-view logic module;
and the sub-view logic module is used for updating the display content according to the second processing signal.
13. A terminal, characterized in that it comprises a processor and a memory, in which at least one instruction, at least one program, set of codes or set of instructions is stored, which is loaded and executed by the processor to implement a method of running an application according to any one of claims 1 to 10.
14. A computer-readable storage medium, in which at least one instruction, at least one program, a set of codes, or a set of instructions is stored, which is loaded and executed by a processor to implement a method for running an application program according to any one of claims 1 to 10.
CN201910020126.8A 2019-01-09 2019-01-09 Application program running method and device and storage medium Active CN109766098B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910020126.8A CN109766098B (en) 2019-01-09 2019-01-09 Application program running method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910020126.8A CN109766098B (en) 2019-01-09 2019-01-09 Application program running method and device and storage medium

Publications (2)

Publication Number Publication Date
CN109766098A CN109766098A (en) 2019-05-17
CN109766098B true CN109766098B (en) 2021-10-08

Family

ID=66453591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910020126.8A Active CN109766098B (en) 2019-01-09 2019-01-09 Application program running method and device and storage medium

Country Status (1)

Country Link
CN (1) CN109766098B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112230907B (en) * 2019-07-15 2023-09-15 腾讯科技(深圳)有限公司 Program generation method, device, terminal and storage medium
CN112527422B (en) * 2019-09-17 2024-03-22 腾讯科技(深圳)有限公司 View updating method, device, equipment and storage medium
CN112764746B (en) * 2019-11-01 2024-04-09 百度在线网络技术(北京)有限公司 Data processing method, device, electronic equipment and storage medium
CN111796577A (en) * 2020-06-29 2020-10-20 中国第一汽车股份有限公司 Data instruction processing method and device, vehicle and storage medium
CN113434173B (en) * 2021-06-24 2023-06-09 青岛海尔科技有限公司 Data processing method, device, storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2007269575A1 (en) * 2006-07-06 2008-01-10 Interdigital Vc Holdings, Inc. Method and apparatus for decoupling frame number and/or picture order count (POC) for multi-view video encoding and decoding
CN103729188A (en) * 2013-12-31 2014-04-16 福建三元达软件有限公司 Android system application program development method, Android system application program running method and Android system application program running device
CN105117938A (en) * 2015-08-19 2015-12-02 江苏农牧人电子商务股份有限公司 E-commerce framework request data analysis method based on model view controller
CN105956104A (en) * 2016-04-29 2016-09-21 努比亚技术有限公司 Business view framework and development method thereof
CN106020996A (en) * 2016-05-11 2016-10-12 腾讯科技(深圳)有限公司 Data updating method and data updating apparatus
CN107220817A (en) * 2017-06-28 2017-09-29 天津海天云创科技服务有限公司 One kind research and development data flow management system for tracking

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364176B (en) * 2008-08-12 2012-09-19 北京航空航天大学 BPEL visualized model building system based on GMF
CN106648682B (en) * 2016-12-29 2019-10-25 中南大学 A kind of dynamic data general framework of embedded system exploitation
CN107817968A (en) * 2017-11-13 2018-03-20 重庆首亨软件有限公司 A kind of computer software development system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2007269575A1 (en) * 2006-07-06 2008-01-10 Interdigital Vc Holdings, Inc. Method and apparatus for decoupling frame number and/or picture order count (POC) for multi-view video encoding and decoding
CN103729188A (en) * 2013-12-31 2014-04-16 福建三元达软件有限公司 Android system application program development method, Android system application program running method and Android system application program running device
CN105117938A (en) * 2015-08-19 2015-12-02 江苏农牧人电子商务股份有限公司 E-commerce framework request data analysis method based on model view controller
CN105956104A (en) * 2016-04-29 2016-09-21 努比亚技术有限公司 Business view framework and development method thereof
CN106020996A (en) * 2016-05-11 2016-10-12 腾讯科技(深圳)有限公司 Data updating method and data updating apparatus
CN107220817A (en) * 2017-06-28 2017-09-29 天津海天云创科技服务有限公司 One kind research and development data flow management system for tracking

Also Published As

Publication number Publication date
CN109766098A (en) 2019-05-17

Similar Documents

Publication Publication Date Title
CN108845856B (en) Object-based synchronous updating method and device, storage medium and equipment
CN109766098B (en) Application program running method and device and storage medium
CN112162671B (en) Live broadcast data processing method and device, electronic equipment and storage medium
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN112181572B (en) Interactive special effect display method, device, terminal and storage medium
KR20180095409A (en) Electronic device and method for displaying screen thereof
CN108737897B (en) Video playing method, device, equipment and storage medium
WO2022227623A1 (en) Method for displaying publish progress, and electronic device
US11954200B2 (en) Control information processing method and apparatus, electronic device, and storage medium
CN110362366B (en) Application interface display method and device
WO2022134632A1 (en) Work processing method and apparatus
CN109783183B (en) Request processing method and device, electronic equipment and storage medium
CN111131531B (en) Method and device for generating nickname in chat group and readable storage medium
CN111399736B (en) Progress bar control method, device and equipment and readable storage medium
CN109521933A (en) A kind of display control method and mobile terminal
CN111694478A (en) Content display method, device, terminal and storage medium
WO2022252563A1 (en) Information display method and electronic device
CN111857938A (en) Management method and device of popup view, terminal and storage medium
CN112870697A (en) Interaction method, device, equipment and medium based on virtual relationship formation program
CN112148499A (en) Data reporting method and device, computer equipment and medium
CN111580892A (en) Method, device, terminal and storage medium for calling service component
CN114140105A (en) Resource transfer method, device, equipment and computer readable storage medium
CN114329292A (en) Resource information configuration method and device, electronic equipment and storage medium
CN109045690B (en) Virtual pet obtaining method and device, electronic device and storage medium
CN112561107A (en) Resource management method, device, equipment and computer readable storage medium

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
GR01 Patent grant
GR01 Patent grant