Application processing devices, control methods, electronic devices, and storage media
By reorganizing the View, Presenter, and Model layers in the MVP architecture into a view module, a data transmission module, and a data processing module, the coupling problem between the Presenter and View layers is solved, a highly modular application processing device is achieved, and the system's flexibility and maintainability are improved.
Patent Information
- Application Number
- CN202210281648.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-03-21
AI Technical Summary
In the existing MVP architecture, the Presenter layer and the View layer are coupled, resulting in low modularity and the inability to modify them independently. Changes to the View layer will affect the Presenter layer.
The MVP architecture re-divides the View, Presenter, and Model layers into a view module, a data transmission module, and a data processing module. The view module is used for display and event dispatch, the data transmission module only forwards event information, and the data processing module calls the view module's interface through event information to control container information. The three are separated and independent to avoid coupling.
It achieves a high degree of modularity, so changes to the view module do not affect the data transmission and processing modules, thus improving the system's flexibility and maintainability.
Smart Images

Figure CN116820634B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of application framework technology, and more specifically, to an application processing device, control method, electronic device, and non-volatile computer-readable storage medium. Background Technology
[0002] The current MVP architecture includes a View layer, a Model layer, and a Presenter layer. The Presenter layer can connect the View layer and the Model layer and process business logic, which leads to coupling between the Presenter layer and the View layer. As a result, if the View layer changes, the Presenter layer will also change, resulting in poor modularity. Summary of the Invention
[0003] This application provides an application processing apparatus, a control method, an electronic device, and a non-volatile computer-readable storage medium.
[0004] The application processing device of this application embodiment is used in an electronic device, the electronic device including a display screen, and the application processing device including a view module, a data transmission module, and a data processing module. The view module is used to control the display screen to display a view according to container information and to send event information; the data transmission module is used to receive the event information and forward the event information to the data processing module; the data processing module is used to call the interface of the view module according to the event information to control the container information.
[0005] The control method of this application is used in an electronic device, the electronic device including a display screen, the control method including controlling the display screen to display a view according to container information and sending event information; forwarding the event information; and calling an interface of the control view according to the forwarded event information to control the container information.
[0006] The electronic device according to embodiments of this application includes a processor and a display screen. The processor is configured to control the display screen to display a view based on container information, and send event information; forward the event information; and invoke an interface for controlling the view based on the forwarded event information to control the container information.
[0007] The non-volatile computer-readable storage medium of this application includes a computer program that, when executed by one or more processors, causes the processors to perform a control method: the control method is for an electronic device, the electronic device including a display screen, the control method including controlling the display screen to display a view based on container information and sending event information; forwarding the event information; and invoking an interface for controlling the view based on the forwarded event information to control the container information.
[0008] In the application processing apparatus, control method, electronic device, and non-volatile computer-readable storage medium of this application, the view module is used to control the display screen to display the view based on the container information, and the data transmission module is only used to forward the event information sent by the view module. The container information in the view module is completely controlled by the data processing module to call the corresponding interface based on the event information. The data transmission module does not perform logical processing on the view-related data. There is no coupling between the data transmission module and the view module. When the view module changes, neither the data transmission module nor the data processing module needs to be changed, resulting in a high degree of modularity.
[0009] Additional aspects and advantages of embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of this application. Attached Figure Description
[0010] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, wherein:
[0011] Figure 1 This is a schematic diagram of the architecture of an application processing device according to certain embodiments of this application;
[0012] Figure 2 This is a schematic diagram of the application processing apparatus according to certain embodiments of this application;
[0013] Figure 3 This is a schematic diagram of the architecture of an application processing device according to certain embodiments of this application;
[0014] Figure 4 This is a flowchart illustrating the control method of some embodiments of this application;
[0015] Figure 5 This is a plan view of an electronic device according to certain embodiments of this application;
[0016] Figure 6 This is a flowchart illustrating the control method of some embodiments of this application;
[0017] Figure 7This is a flowchart illustrating the control method of some embodiments of this application;
[0018] Figure 8 This is a flowchart illustrating the control method of some embodiments of this application;
[0019] Figure 9 This is a flowchart illustrating the control method of some embodiments of this application;
[0020] Figure 10 This is a flowchart illustrating the control method of some embodiments of this application;
[0021] Figure 11 This is a flowchart illustrating the control method of some embodiments of this application;
[0022] Figure 12 This is a schematic diagram illustrating the connection state of a non-volatile computer-readable storage medium and a processor in certain embodiments of this application. Detailed Implementation
[0023] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of this application, and should not be construed as limiting the embodiments of this application.
[0024] To facilitate understanding of the solution proposed in this application, we will first introduce the existing MVP architecture:
[0025] View: This is an interface that displays data (model) and passes user commands (events) to the presenter so that they can be applied to that data. View typically contains a reference to the presenter.
[0026] Model: The Model layer is also the data layer. It differs from the Model in the MVC architecture; here, it's not just a data model. In the MVP architecture, the Model is responsible for data access operations, such as reading and writing to the database and requesting data from the network.
[0027] Presenter: The Presenter layer acts as a bridge between the View and Model layers, processing business logic. In the MVP architecture, the Model and View cannot interact directly. Therefore, the Presenter layer obtains the necessary data from the Model layer, performs appropriate processing, and then hands it over to the View layer for display. This isolates the View and Model through the Presenter, eliminating coupling between them and extracting business logic from the View.
[0028] As can be seen from the existing MVP architecture described above, the Presenter processes the business logic of the View layer, obtains the necessary data from the Model layer, processes it, and then hands it over to the View layer for display. Therefore, the interaction between the Presenter and the View layer is quite frequent, and there is coupling between them, resulting in low modularity of the overall architecture. It cannot be modified independently, and the Presenter will change accordingly when the View layer changes.
[0029] In view of this, please refer to Figure 1 This application provides an application processing device 10, which can be used in an electronic device 100. The application processing device 10 includes a view module 11, a data transmission module 12, and a data processing module 13, which correspond to the View layer, Presenter layer, and Model layer in the MVP architecture, respectively. The application processing device 10 of this application re-divides the functions of the three modules, wherein...
[0030] The view module 11 is used to control the display screen 40 to display a view based on the container information and to send event information. The container information is the information controlling the view displayed on the display screen 40 of the electronic device 100 (such as the UI displayed on the display screen 40). The event information can be generated based on the information obtained by the electronic device 100. For example, when the electronic device 100 receives a touch operation on the UI, it can generate corresponding event information, such as clicking the night mode UI icon, which generates an event information for turning on night mode. The view module 11 is used for view display and event information distribution.
[0031] The data transmission module 12 receives event information and forwards it to the data processing module 13. The data transmission module 12 is used for forwarding data (such as event information between the view module 11 and the data processing module 13). The data transmission module 12 does not perform logical processing on view-related data. There is no coupling between the data transmission module 12 and the view module 11; when the view module 11 changes, the data transmission module 12 does not need to be changed.
[0032] The data processing module 13 is used to call the interface of the view module 11 based on event information to control container information. The data processing module 13 can determine the interface of the view module 11 that needs to be called through the event information, and directly control the container information by calling the interface, thereby controlling the display of the view, so as to achieve the display control of the view without going through the data transmission module 12.
[0033] Specifically, the data processing module 13 can first generate call information through event information, and then call the interface of the view module 11 (specifically the view management unit of the view module 11) according to the call information. The data processing module 13 first parses the event information to generate call information. The call information contains information about the specific interface to be called, so as to quickly call the interface of the view module 11 according to the call information.
[0034] An interface is an entry point for a business logic to be exposed and implemented. By calling the interface and inputting the required parameters as defined in the interface definition, the interface can be invoked, and the corresponding business logic can be executed. For example, for interface A of view module 11, which is used to control the display and hiding of button A, by calling interface A and inputting the parameter: display or hide, button A can be displayed or hidden.
[0035] It is understandable that calling the interface will not cause the data processing module 13 and the view module 11 to become coupled. Therefore, when the view module 11 changes, the data processing module 13 does not need to be changed.
[0036] Thus, in the application processing device 10 of this application, the view module 11, the data transmission module 12 and the data processing module 13 are separated, and modifications to any one of the three will not affect the other two, resulting in a high degree of modularity.
[0037] The view module 11 includes a view management unit 111 and an event dispatch unit 112, which are used to implement view display and event dispatch functions, respectively.
[0038] The view management unit 111 is used to control the display screen 40 to display the view based on the container information. Optionally, the container information may include the view's status information and attribute information. The status information includes whether the view is shown or hidden, and the attribute information includes at least one of the view size, view position, and view color. All interfaces of the view module 11 are located in the view management unit 111.
[0039] For example, please see Figure 5The camera view displayed on screen 40 includes a shooting button (for starting shooting), a flash button (for turning the flash on or off), a preview image frame (for displaying a preview image within the frame), and a mode switching bar (for switching between shooting modes, video mode, night scene mode, continuous shooting mode, etc.). Each of the shooting button, flash button, preview image frame, and mode switching bar has a corresponding container located in the view management unit 111. Each container exposes a corresponding interface. When the data processing module 13 calls the interface of the view module 11, it is essentially calling the interface of the container in the view management unit 111, thereby controlling the container information.
[0040] The view management unit 111 controls the view display on the display screen 40 by controlling the container information of each container. For example, by setting the state information of the camera button's container, it can be determined whether the camera button is shown or hidden. By setting the attribute information of the camera button's container, the size of the camera button, its position on the display screen 40, and its color can be changed. Similarly, other views (such as the flash button, preview image frame, etc.) can also be controlled by controlling the container information.
[0041] The event distribution unit 112 is used to acquire event information generated by the electronic device 100 and send the event information to the event distribution unit 112.
[0042] During operation, electronic device 100 generates various event information, such as: events generated after a view receives a touch operation; notifications of the Activity lifecycle in Android; events generated after changes in device status information (such as landscape / portrait switching, resolution switching, folded or collapsed screen state); events generated after changes in temperature information; and information generated by received frames, such as notifications generated by the camera frame after the camera is turned on and off, and notifications from Google Armor's Application Management Service (AMS), Window Management Service (WMS), and Power Manager Service (PMS).
[0043] After the electronic device 100 generates event information, it will send it to the event distribution unit 112. The event distribution unit 112 will then distribute the event information, such as to the event distribution unit 112.
[0044] The data transmission module 12 includes a data distribution unit 121 and a device control unit 122.
[0045] The data distribution unit 121 is used to forward data. After receiving event information, the data distribution unit 121 forwards the event information to the data processing module 13. The data processing module 13 processes the event information to generate control information and returns the control information to the data distribution unit 121. The data distribution unit 121 can then forward the control information to the device control unit 122.
[0046] The device control unit 122 is used to control the hardware of the electronic device 100 according to control information. For example, if the event information is a camera opening event, the data processing module 13 can generate corresponding control information after processing the camera opening event, and the device control unit 122 can control the camera of the electronic device 100 to perform the opening operation according to the control information; or, for example, if the event information is a flash opening event, the data processing module 13 can generate corresponding control information after processing the flash opening event, and the device control unit 122 can control the flash of the electronic device 100 to perform the opening operation according to the control information, and so on.
[0047] It also receives feedback information after performing the camera-opening operation, indicating whether the camera opened successfully or failed, or feedback information containing image data captured by the camera.
[0048] The device control unit 122 is also used to receive feedback information returned by the electronic device 100 after performing the corresponding operation; and send the feedback information to the data distribution unit 121; the data distribution unit 121 forwards the feedback information to the data processing module 13; the data processing module 13 is also used to process the feedback information to control the display content of the display screen 40.
[0049] After the device control unit 122 controls the electronic device 100 to perform the corresponding operation, the state of the electronic component 50 (such as a camera) that performs the operation will change, such as the camera being turned on or off. After the camera is turned on, it will collect image data. The device control unit 122 can obtain feedback information from the electronic component 50 that performs the operation, such as feedback information returned after the operation of turning on the camera, indicating whether the camera was turned on successfully or failed to turn on, or feedback information returned containing image data collected by the camera.
[0050] The device control unit 122 sends feedback information to the data distribution unit 121, which then forwards the feedback information to the data processing module 13 for processing, thereby controlling the display content of the screen 40. For example, if the feedback information indicates that the camera failed to open, the data processing module 13 controls the screen 40 to directly display the message indicating that the camera failed to open. However, if the feedback information includes successful camera opening and contains image data captured by the camera, the image can be previewed directly based on the image data displayed.
[0051] The data processing module 13 includes a scheduling unit 131 and a functional unit 132.
[0052] The scheduling unit 131 is used to select the functional unit 132 that matches the event information. For example, the electronic device 100 pre-stores a function mapping table of different event information and functional units 132. By searching the function mapping table, one or more functional units 132 corresponding to the event information can be quickly found. As another example, after processing the event information, the scheduling unit 131 generates calling information, which includes a pattern corresponding to the event information (such as...). Figure 1 The pattern N shown is a positive integer. Then, the corresponding processing process (such as processing process N) is determined according to the calling information. After the processing process N runs, the corresponding functional unit 132 can be determined.
[0053] Functional unit 132 is used to execute specific business logic. After determining the functional unit 132 corresponding to the event information, a preset configuration file for each functional unit 132 can be obtained first. The functional unit 132 can then perform at least one of the following operations according to the preset configuration file:
[0054] Call the interface of the view management unit 111 to control container information;
[0055] Process event information to generate control information; and
[0056] Process feedback information to control the displayed content.
[0057] In other words, the functional unit 132 can realize the display control of the view, parse event information to generate control information for controlling the electronic components 50 of the electronic device 100, so that the device control unit 122 can control the electronic components 50 of the electronic device 100 to perform corresponding operations according to the control information, and control the display content according to the feedback information returned by the electronic components 50 of the electronic device 100.
[0058] The business logic of the data processing module 13 is implemented by dividing it into functional units 132 and scheduling it by scheduling unit 131, thereby realizing modular development of functions. For example, different shooting modes have corresponding functional units 132. There are multiple functional units 132, and each functional unit 132 includes at least one preset configuration file for executing the business logic corresponding to the functional unit 132. Each shooting mode corresponds to at least one functional unit 132.
[0059] If the basic shooting mode has a basic functional unit 132, the night scene shooting mode has a night scene functional unit 132, and the tripod mode has a tripod functional unit 132, when developing new functions, new functional units 132 can be created again without affecting existing functional units 132. Moreover, the scheduling unit 131 can also combine multiple functions to form new functions through scheduling. For example, when the shooting mode is night scene tripod mode, the night scene functional unit 132 and the tripod functional unit 132 are called simultaneously.
[0060] It is understood that the application processing device 10 described above can not only control the camera application, but also other applications such as map applications and chat software, etc., without limitation. The following examples illustrate the process by which the application processing device 10 controls the camera application of the electronic device 100.
[0061] Please see Figure 2 When the camera is turned on or when the shooting mode is switched, the camera needs to be initialized first. The camera initialization process is as follows:
[0062] The event dispatch unit 112 first receives an initialization event message, which includes initialization information. This initialization information is used to initialize the relevant electronic components 50 of the application processing device 10 and the electronic device 100. The initialization information may include first initialization information, second initialization information, and third initialization information.
[0063] Event dispatch unit 112 is used to send initialization information to data dispatch unit 121 (e.g., ... Figure 2 (Arrow 1 in the image), and then the data distribution unit 121 forwards the first initialization information to the view management unit 111 to initialize the general container of the view management unit 111 (such as...). Figure 2 Arrow 2) forwards the second initialization information to the data processing module 13 to initialize the general functional unit 132 in the data processing module 13 (such as...). Figure 2 Arrows 3 and 4 in the image), and forwarding third initialization information to device control unit 122 to initialize the general configuration of device control unit 122 (such as...). Figure 2 (Arrows 5 and 6 in the image).
[0064] The first initialization information can be used to initialize the container information of some general containers. General containers refer to containers that must be used for all shooting modes of the camera. For example, for the camera, regardless of the shooting mode, there is always a shooting button and a preview image frame. That is, the containers corresponding to the shooting button and the preview image frame are general containers. During initialization, the view management unit 111 resets the container information of the general containers according to the first initialization information to restore them to the preset container information, thereby completing the initialization.
[0065] The second initialization information can be used to initialize the general function unit 132. The general function unit 132 can be a function unit 132 used in all shooting modes, such as countdown shooting function, slow motion shooting function, etc. After the function unit 132 runs the business logic, the parameters in its corresponding configuration file may have changed. When initializing, the parameters in the configuration file of the function unit 132 need to be set through the second initialization information to restore them to the preset parameters.
[0066] The third initialization information can be used to initialize the general configuration of the device control unit 122, enabling the device control unit 122 to select the appropriate application processing device 10 frame module 14. For example, the frame module 14 includes a first frame module 141 or a second frame module 142. The functional types of the code set contained in the first frame module 141 are different from those in the second frame module 142. For example, the first frame module 141 may be the Google framework, which contains the code set for the specific implementation of most camera functions. However, for the electronic device 100, there are some personalized functions that vary depending on the hardware of the electronic device 100. Therefore, it is necessary to set up a second functional module to implement functions that the first frame module 141 cannot implement or that are difficult to implement, such as the code set for the specific implementation of the camera's image stabilization function. Based on different functional units 132, the code set of the corresponding function can be determined, thereby setting up the frame module 14 required by the device control unit 122 to control the electronic device 100 during initialization.
[0067] After initializing some common containers and functional units 132, initialization can also be performed according to the current shooting mode. The data processing module 13 can obtain the current mode information and send the mode information to the data distribution unit 121 (e.g., ...). Figure 2 (Arrow 3 in the image) Data distribution unit 121 forwards mode information to view management unit 111 and device control unit 122 (e.g., arrow 3 in the image). Figure 2 Arrows 2 and 5 in the diagram are used to initialize the functional unit 132 in the view management unit 111 corresponding to the mode information. The device control unit 122 initializes the electronic components 50 corresponding to the mode information (such as arrows 2 and 5 in the diagram) according to the mode information. Figure 2 Arrow 6 in the middle.
[0068] The containers, functional units 132, and / or electronic components 50 used differ for different shooting modes. For example, the containers and functional units 132 used for panoramic shooting mode and night scene shooting mode are different; similarly, the containers, functional units 132, and electronic components 50 used for front-facing shooting mode and rear-facing shooting mode are all different.
[0069] Therefore, after initializing the general container and functional unit 132, the container, functional unit 132 and electronic component 50 corresponding to the mode information are also initialized. Only the container, functional unit 132 and electronic component 50 required for the current shooting mode need to be initialized. The initialization content is less and the initialization efficiency can be improved.
[0070] Please continue reading. Figure 2 After initialization is complete, you can proceed to the camera opening process, which is as follows:
[0071] 1. Control the display of the view based on the camera opening event.
[0072] The event information also includes a camera-on event, which the event distribution unit 112 sends to the data distribution unit 121 (e.g., ...). Figure 2 Arrow 1), data distribution unit 121 forwards the camera opening event to data processing module 13 (e.g., arrow 1), Figure 2 (Arrow 3 in the image) The scheduling unit 131 is used to determine the functional unit 132 corresponding to the camera opening event (e.g., based on the function mapping table) based on the function mapping table. Figure 2 (Arrow 4 in the diagram) The functional unit 132 corresponding to the camera-opening event is used to call the interface of the view management unit 111 corresponding to the camera-opening event based on the configuration file, in order to control the container information. In this way, by controlling the container information through the functional unit 132 corresponding to the event information, the display control of the view can be realized.
[0073] For example, when the current shooting mode is panoramic shooting mode, the function unit 132 corresponding to the camera event includes the general function unit 132 and the function unit 132 corresponding to the panoramic shooting mode, thereby controlling the display screen 40 to display the view required for panoramic shooting by controlling the container information.
[0074] 2. Control the camera to open based on the camera open event.
[0075] The electronic device 100 also includes one or more cameras, and the scheduling unit 131 is further configured to process camera activation events to generate type information and send the type information to the data distribution unit 121 (e.g., ...). Figure 2 (Arrow 3 in the image) Data distribution unit 121 forwards type information to device control unit 122 (e.g., arrow 3 in the image). Figure 2 Arrow 5 in the image controls the camera corresponding to the type information to perform an opening operation (e.g., ...). Figure 2Arrow 6 in the image shows, for example, the type information includes the type of camera that is turned on. The camera type includes at least one of the following: front camera, rear camera, wide-angle camera, telephoto camera, etc. For example, when the current shooting mode is front portrait shooting mode, the front wide-angle camera will be turned on; when the current shooting mode is rear panorama mode, the rear telephoto camera will be turned on.
[0076] It is understood that controlling the camera to open based on a camera open event and controlling the view display based on a camera open event can be performed simultaneously, or the camera can be opened first based on a camera open event and then the view display can be controlled based on a camera open event; this is not a limitation. In the embodiments of this application, controlling the camera to open based on a camera open event and controlling the view display based on a camera open event are performed simultaneously to improve the running speed of the camera application.
[0077] 3. Obtain feedback information returned by the camera.
[0078] After the opening operation is completed, the device control unit 122 receives the first feedback information returned by the camera (such as...). Figure 2 (Arrow 6 in the image) The first feedback information includes whether the camera failed to open or opened successfully; the device control unit 122 sends the first feedback information to the data distribution unit 121 (e.g., ...). Figure 2 (Arrow 4 in the image) Data distribution unit 121 forwards the first feedback information to view management unit 111 and scheduling unit 131 (e.g., arrow 4 in the image). Figure 2 (Arrows 2 and 3 in the image) The view management unit 111 controls the display screen 40 to display information indicating whether the camera was successfully opened or not based on the first feedback information; the scheduling unit 131 determines whether to enter the preset business process or resend the type information to the data distribution unit 121 based on the first feedback information, so as to control the camera corresponding to the type information to perform the opening operation again.
[0079] For example, if the first feedback message includes "camera failed to open," the display screen 40 will show "camera failed to open," and the electronic device 100 will try to open the camera again. If the first feedback message is still "camera failed to open," the display screen 40 will display a camera malfunction message to prompt the user to have the camera repaired. If the first feedback message includes "camera opened successfully," the display screen 40 can show "camera opened successfully" and proceed to the subsequent preset business process, such as displaying a preview image after the camera is successfully opened.
[0080] Optionally, before the view management unit 111 receives the information that the camera has been successfully opened, the container corresponding to the view displayed on the display screen 40 may be controlled not to respond to input operations.
[0081] It is understandable that the view displayed on the display screen 40 is generally displayed quickly, but since the camera has not been successfully opened, the function of the view on the display screen 40 is actually unavailable. If a user input operation is received at this time, new event information may be generated, which may affect the camera opening process or the initialization process. Therefore, before the camera is successfully opened, the container corresponding to the control view does not respond to input operations, thereby ensuring that the process runs normally.
[0082] Please refer to it again. Figure 2 After completing the camera opening process, you can proceed to the preview image display process, which is as follows:
[0083] When the scheduling unit 131 receives a successful notification that the camera has been opened (e.g.) Figure 2 After arrow 3 in the image, a session will be created first. The session is used to store preview image data; after the view management unit 111 receives a successful notification that the camera has been opened (e.g., ...), a session will be created. Figure 2 Following arrow 2), the predetermined area of the display screen 40 is determined as the preview area, and the image displayed in the preview area can be determined based on the image data in the session; the device control unit 122 also receives the second feedback information returned by the camera and sends it to the data distribution unit 121 (e.g., ...). Figure 2 (Arrows 6 and 5 in the diagram) Data distribution unit 121 forwards the second feedback information to scheduling unit 131 (e.g., arrows 6 and 5 in the diagram). Figure 2 (Arrow 3 in the image) The second feedback information includes preview image data, which is stored in the session. The scheduling unit 131 displays the preview image in the preview area based on the preview image data.
[0084] Optionally, the functional unit 132 can process the preview image and store the processed preview image data in the session. For example, if the user selects different filters, the functional unit 132 corresponding to the filter will process the preview image data, thereby storing the filtered preview image data in the session. The scheduling unit 131 will then display the filtered preview image data in the preview area, thus displaying a preview image with the filter effect.
[0085] Please see Figure 3 The application processing device 10 also includes a tool module 15, which includes a view module 11, a data transmission module 12 and / or a data processing module 13 for parsing event information.
[0086] It is understandable that the view module 11, data transmission module 12, and data processing module 13 all need to parse event information to obtain relevant information. By setting up a tool module and encapsulating the code sets required by the view module 11, data transmission module 12, and data processing module 13 to parse event information into the tool module, when the view module 11, data transmission module 12, and data processing module 13 are parsing, they can simply call the interface exposed by the tool module. Moreover, the common interface of the three can be reused, thereby reducing the amount of code in the view module 11, data transmission module 12, and data processing module 13, while also reducing the overall amount of code.
[0087] In addition, tool module 15 may also include a set of code for more functions. For example, the business logic code of functional unit 132 can be encapsulated into tool module 15, and functional unit 132 can call the interface of tool module 15 when in use.
[0088] Please see Figure 4 and Figure 5 This application provides a control method. The control method includes the following steps:
[0089] 011: Control the display screen 40 to show the view based on the container information and send event information;
[0090] 012: Forwarding event information; and
[0091] 013: Call the interface of the control view based on the forwarded event information to control container information.
[0092] For a detailed description of step 011, please refer to the description of view module 11; for a detailed description of step 012, please refer to the description of data transmission module 12; and for a detailed description of step 013, please refer to the description of data processing module 13. These details will not be repeated here.
[0093] Please see Figure 6 In some implementations, the container information includes view state information and attribute information. The state information includes whether the view is shown or hidden, and the attribute information includes at least one of view size, view position, and view color. Step 011 includes:
[0094] Step 0111: Control the display screen 40 to display the view based on the status information and attribute information.
[0095] For a detailed description of step 011, please refer to the description of the view management unit 111, which will not be repeated here.
[0096] In some implementations, step 013 includes:
[0097] Step 0131: Generate call information based on the forwarded event information, and call the interface of the control view based on the call information to control the container information.
[0098] For a detailed description of step 0131, please refer to the description of data processing module 13, which will not be repeated here.
[0099] Please see Figure 7 In some implementations, the control method further includes the step of:
[0100] 014: Process event information to generate control information;
[0101] 015: Control the electronic device 100 to perform the corresponding operation according to the control information.
[0102] For detailed descriptions of steps 014 and 015, please refer to the descriptions of data processing module 13 and device control unit 122 respectively, and they will not be repeated here.
[0103] In some implementations, the control method further includes the step of:
[0104] 016: Obtain feedback information generated after electronic device 100 performs an operation;
[0105] 017: Based on the feedback information, control the display content of the display screen 40.
[0106] For detailed descriptions of steps 016 and 017, please refer to the descriptions of the device control unit 122 and the data processing module 13, respectively; they will not be repeated here.
[0107] Please see Figure 8 In some implementations, the control method further includes the step of:
[0108] 018: Based on the preset function mapping table, determine the configuration file corresponding to the event information;
[0109] Step 0131 includes:
[0110] 01311: Call the interface according to the configuration file to control container information;
[0111] Step 014 includes:
[0112] Step 0141: Process event information according to the configuration file to generate control information;
[0113] Step 017 includes:
[0114] 0171: Process feedback information according to the configuration file to control the displayed content.
[0115] For a detailed description of step 018, please refer to the description of scheduling unit 131. For a detailed description of steps 01311, 0141 and 0171, please refer to the description of functional unit 132. They will not be repeated here.
[0116] Please see Figure 9 In some implementations, the event information includes initialization information, and the control method further includes:
[0117] 019: Control view module 11 sends initialization information to data distribution unit 121;
[0118] 020: Control data distribution unit 121 forwards first initialization information to view module 11 to initialize the general container in view module 11, forwards second initialization information to data processing module 13 to initialize general function unit 132 in data processing module 13, and forwards third initialization information to device control unit 122 to initialize the general configuration of device control unit 122. The general configuration includes selecting first frame module 141 or second frame module 142. The functional types of the code set contained in first frame module 141 are different from the functional types of the code set contained in second frame module 142.
[0119] For a detailed description of steps 019 and 020, please refer to the description of the initialization process above, which will not be repeated here.
[0120] In some implementations, the control method further includes:
[0121] 021: Control data processing module 13 sends mode information to data distribution unit 121;
[0122] 022: Control data distribution unit 121 forwards mode information to view module 11 and device control unit 122 to initialize functional unit 132 in view module 11 corresponding to mode information, and controls device control unit 122 to initialize electronic component 50 corresponding to mode information.
[0123] For a detailed description of steps 021 and 022, please refer to the description of the initialization process above, which will not be repeated here.
[0124] Please see Figure 10 In some implementations, the event information also includes a camera activation event, and step 013 further includes:
[0125] 0132: Call the interface corresponding to the camera opening event to control container information.
[0126] For a detailed description of step 0132, please refer to the description of the camera opening process above; it will not be repeated here.
[0127] Please see Figure 11 In some embodiments, the electronic device 100 further includes one or more cameras, and the control method further includes:
[0128] 023: Handle camera opening events to generate type information;
[0129] 024: Control the camera corresponding to the type information to perform the opening operation based on the type information;
[0130] 025: Receive the first feedback information returned after the camera performs the opening operation. The first feedback information includes whether the camera failed to open or the camera opened successfully.
[0131] 026: Based on the first feedback information, control the display screen 40 to display information indicating whether the camera was opened successfully or failed, and determine whether to enter the preset business process or control the camera corresponding to the type information to perform the opening operation again.
[0132] For a detailed description of steps 023 to 026, please refer to the description of the camera opening process above, which will not be repeated here.
[0133] In some implementations, the control method further includes:
[0134] 027: The container corresponding to the control view does not respond to input operations until the camera is successfully opened.
[0135] For a detailed description of step 027, please refer to the description of the camera opening process above, which will not be repeated here.
[0136] In some implementations, the control method further includes:
[0137] Step 028: After receiving confirmation that the camera has been successfully turned on, acquire the preview image data; and
[0138] Step 029: Display the preview image in a predetermined area of the display screen 40 based on the preview image data.
[0139] For a detailed description of steps 028 and 029, please refer to the description of the above process for displaying the preview image; they will not be repeated here.
[0140] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0141] Please refer to it again. Figure 5This application also provides an electronic device 100. The electronic device 100 includes a processor 20. The control method of this application can be applied to the electronic device 100. The processor 20 is used to execute steps 011, 012, and 013. That is, the processor 20 is used to control the display screen 40 to display a view based on container information, and send event information; forward the event information; and call the interface for controlling the view based on the forwarded event information to control the container information. The processor can also execute any of the embodiments of the aforementioned control method.
[0142] The electronic device 100 includes a housing 30. The electronic device 100 can be a mobile phone, tablet computer, display device, laptop computer, ATM, turnstile, smartwatch, head-up display device, game console, etc. Figure 3 As shown, this application describes the embodiment of the electronic device 100 as a mobile phone as an example. It can be understood that the specific form of the electronic device 100 is not limited to a mobile phone. The housing 30 can also be used to install functional modules of the electronic device 100 such as display device, imaging device, power supply device, and communication device, so that the housing 30 provides dustproof, dropproof, and waterproof protection for the functional modules.
[0143] Please see Figure 12 This application also provides a non-volatile computer-readable storage medium 200 containing a computer program 201. When the computer program 201 is executed by one or more processors 20, the one or more processors 20 perform the control method of any of the above embodiments.
[0144] In the description of this specification, the references to terms such as "some embodiments," "in one example," "exemplarily," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0145] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0146] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. An application processing device, characterized in that, For use in an electronic device, the electronic device including a display screen and one or more cameras, the application processing device including a view module, a data transmission module and a data processing module; The view module is used to control the display screen to show the view based on the container information and to send event information; The data transmission module is used to receive the event information and forward the event information to the data processing module; The data transmission module includes a data distribution unit and a device control unit. The data distribution unit is used to forward the event information to the data processing module, receive control information generated by the data processing module after processing the event information, and forward the control information to the device control unit. The device control unit is used to control the electronic device to perform corresponding operations according to the control information. The data processing module is used to call the interface of the view module according to the event information to control the container information; the data processing module includes a scheduling unit and a functional unit, and the scheduling unit is used to determine the functional unit corresponding to the event information based on a preset functional mapping table; The event information includes a camera opening event. The data distribution unit forwards the camera opening event to the data processing module. The scheduling unit processes the camera opening event to generate type information and sends the type information to the data distribution unit. The data distribution unit forwards the type information to the device control unit to control the camera corresponding to the type information to perform an opening operation. After the opening operation is completed, the device control unit receives first feedback information returned by the camera, which includes whether the camera opening failed or succeeded. The device control unit sends the first feedback information to the data distribution unit, which forwards the first feedback information to the view management unit of the view module and the scheduling unit. The view management unit controls the display screen to show whether the camera opening was successful or failed based on the first feedback information. The scheduling unit determines whether to enter a preset business process or resend the type information to the data distribution unit based on the first feedback information to control the camera corresponding to the type information to perform the opening operation again.
2. The application processing device according to claim 1, characterized in that, The view module includes a view management unit and an event distribution unit. The view management unit is used to control the display screen to display a view according to the container information. The container information includes view status information and attribute information. The status information includes showing or hiding. The attribute information includes at least one of view size, view position, and view color. The event distribution unit is used to obtain the event information generated by the electronic device and send the event information to the event distribution unit.
3. The application processing apparatus according to claim 2, characterized in that, The data processing module is also used to generate call information based on the event information, and call the interface of the view management unit based on the call information to control the container information.
4. The application processing apparatus according to claim 1, characterized in that, The device control unit is also configured to receive feedback information returned by the electronic device after performing the operation; and send the feedback information to the data distribution unit; the data distribution unit forwards the feedback information to the data processing module; the data processing module is also configured to process the feedback information to control the display content of the display screen.
5. The application processing apparatus according to claim 4, characterized in that, The functional unit is also used to perform at least one of the following operations based on a preset configuration file: Call the interface of the view management unit to control the container information; Process the event information to generate the control information; and The feedback information is processed to control the displayed content.
6. The application processing apparatus according to claim 1, characterized in that, The functional unit includes multiple units, each of which includes at least one configuration file, and each shooting mode corresponds to at least one functional unit.
7. The application processing apparatus according to claim 2, characterized in that, The event information also includes initialization information, which includes first initialization information, second initialization information, and third initialization information. The event distribution unit is used to send the initialization information to the data distribution unit. The data distribution unit forwards the first initialization information to the view management unit to initialize the general container of the view management unit, forwards the second initialization information to the data processing module to initialize the general functional units in the data processing module, and forwards the third initialization information to the device control unit to initialize the general configuration of the device control unit. The general configuration includes selecting a first frame module or a second frame module. The first frame module contains a code set with different functional types, and the second frame module contains a code set with different functional types.
8. The application processing apparatus according to claim 7, characterized in that, The electronic device further includes electronic components. The data processing module sends mode information to the data distribution unit. The data distribution unit forwards the mode information to the view management unit and the device control unit to initialize the functional unit in the view management unit corresponding to the mode information. The device control unit initializes the electronic components corresponding to the mode information according to the mode information.
9. The application processing apparatus according to claim 1, characterized in that, The scheduling unit is also used to determine the functional unit corresponding to the camera opening event based on the functional mapping table. The functional unit corresponding to the camera opening event is used to call the interface of the view management unit corresponding to the camera opening event based on the configuration file to control the container information.
10. The application processing apparatus according to claim 2, characterized in that, Before receiving confirmation that the camera has been successfully opened, the view management unit controls the container corresponding to the view not to respond to input operations.
11. The application processing apparatus according to claim 1, characterized in that, After the scheduling unit receives a successful notification that the camera has been opened, a session is created. After the view management unit receives a successful notification that the camera has been opened, a predetermined area of the display screen is determined as a preview area. The device control unit also receives second feedback information returned by the camera and sends it to the data distribution unit. The data distribution unit forwards the second feedback information to the scheduling unit. The second feedback information includes preview image data. The preview image data is stored in the session. The scheduling unit displays the preview image in the preview area according to the preview image data.
12. The application processing apparatus according to claim 1, characterized in that, It also includes a tool module, which comprises the view module, the data transmission module, and / or the data processing module, a set of code used to parse the event information.
13. A control method, characterized in that, For an electronic device, the electronic device including a display screen and one or more cameras, the control method includes: Control the display screen to show the view based on the container information, and send event information; Forward the event information; and The interface of the control view is invoked based on the forwarded event information to control the container information; The event information includes a camera opening event. The step of calling the interface of the control view according to the forwarded event information to control the container information includes: calling the interface corresponding to the camera opening event to control the container information. The control method further includes: Process the camera opening event to generate type information; The camera corresponding to the type information is controlled to perform an opening operation according to the type information; Receive first feedback information returned after the camera performs the opening operation, the first feedback information including whether the camera failed to open or the camera opened successfully; Based on the first feedback information, the system controls the display screen to show whether the camera was successfully turned on or not, and determines whether to enter a preset business process or to control the camera corresponding to the type information to perform the turning-on operation again.
14. The control method according to claim 13, characterized in that, The container information includes view status information and attribute information. The status information includes whether the view is shown or hidden. The attribute information includes at least one of view size, view position, and view color. Controlling the display screen to show the view based on the container information includes: The display screen is controlled to show the view based on the status information and the attribute information.
15. The control method according to claim 13, characterized in that, The step of invoking the interface of the control view based on the forwarded event information to control the container information includes: The system generates call information based on the forwarded event information and calls the interface of the control view based on the call information to control the container information.
16. The control method according to claim 13, characterized in that, Also includes: The event information is processed to generate control information; The electronic device is controlled to perform corresponding operations based on the control information.
17. The control method according to claim 16, characterized in that, Also includes: Obtain the feedback information generated after the electronic device performs the operation; Based on the feedback information, the display content of the screen is controlled.
18. The control method according to claim 17, characterized in that, Also includes: Based on a preset function mapping table, determine the configuration file corresponding to the event information; The step of invoking the interface of the control view based on the forwarded event information to control the container information includes: The interface is invoked according to the configuration file to control the container information; The control information generated by processing the event information includes: The event information is processed according to the configuration file to generate the control information; The step of controlling the display content of the screen based on the feedback information includes: The feedback information is processed according to the configuration file to control the displayed content.
19. The control method according to claim 13, characterized in that, The electronic device further includes electronic components and an application processing device, which includes a view module, a data transmission module, and a data processing module. The data transmission module includes a data distribution unit and a device control unit. The event information includes initialization information, which includes first initialization information, second initialization information, and third initialization information. The control method further includes: The view module is controlled to send the initialization information to the data distribution unit; The control unit forwards the first initialization information to the view module to initialize the general container in the view module, forwards the second initialization information to the data processing module to initialize the general functional unit in the data processing module, and forwards the third initialization information to the device control unit to initialize the general configuration of the device control unit. The general configuration includes selecting a first frame module or a second frame module. The first frame module contains a code set with different functional types, and the second frame module contains a code set with different functional types.
20. The control method according to claim 19, characterized in that, The control method further includes: The data processing module is controlled to send pattern information to the data distribution unit; The data distribution unit is controlled to forward the mode information to the view module and the device control unit to initialize the functional unit in the view module corresponding to the mode information, and the device control unit is controlled to initialize the electronic component corresponding to the mode information.
21. The control method according to claim 13, characterized in that, Also includes: Before receiving confirmation that the camera has been successfully opened, the container corresponding to the view is controlled not to respond to input operations.
22. The control method according to claim 13, characterized in that, Also includes: After receiving confirmation that the camera has been successfully turned on, acquire preview image data; and The preview image is displayed in a predetermined area of the display screen based on the preview image data.
23. An electronic device, characterized in that, The electronic device includes a processor and a display screen, the processor being configured to execute the control method according to any one of claims 13-22.
24. A non-volatile computer-readable storage medium comprising a computer program, characterized in that, When the computer program is executed by the processor, the processor performs the control method according to any one of claims 13-22.
Citation Information
Patent Citations
Model variable data distribution method and system for distributed storage
CN108427555A
