WO2023179140A1 - Application-processing apparatus, control method, electronic device, and storage medium - Google Patents

Application-processing apparatus, control method, electronic device, and storage medium Download PDF

Info

Publication number
WO2023179140A1
WO2023179140A1 PCT/CN2022/141953 CN2022141953W WO2023179140A1 WO 2023179140 A1 WO2023179140 A1 WO 2023179140A1 CN 2022141953 W CN2022141953 W CN 2022141953W WO 2023179140 A1 WO2023179140 A1 WO 2023179140A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
control
view
unit
event
Prior art date
Application number
PCT/CN2022/141953
Other languages
French (fr)
Chinese (zh)
Inventor
邹剑
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2023179140A1 publication Critical patent/WO2023179140A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Definitions

  • the present application relates to the field of application framework technology, and more specifically, to an application processing device, a control method, an electronic device and a non-volatile computer-readable storage medium.
  • the current MVP architecture includes the View layer, Model layer and Presenter layer.
  • the Presenter layer can connect the View layer and the Model layer and process business logic.
  • Embodiments of the present application provide an application processing device, a control method, an electronic device, and a non-volatile computer-readable storage medium.
  • the application processing device in the embodiment of the present application is used in an electronic device, the electronic device includes a display screen, and the application processing device includes a view module, a data transmission module and a data processing module.
  • the view module is used to control the display screen display view according to the container information and 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 The processing module is configured to call the interface of the view module according to the event information to control the container information.
  • the control method in the embodiment of the present application is used in an electronic device, and the electronic device includes a display screen.
  • the control method includes controlling the display screen to display a view according to container information, and sending event information; forwarding the event information; and forwarding according to The event information calls the interface of the control view to control the container information.
  • the electronic device in the embodiment of the present application includes a processor and a display screen.
  • the processor is configured to control the display screen display view according to the container information and send event information; forward the event information; and call the interface of the control view according to the forwarded event information to control the container information.
  • the non-volatile computer-readable storage medium of the embodiment of the present application contains a computer program.
  • the computer program When the computer program is executed by one or more processors, it causes the processor to execute the following control method: the control method is used for electronic Device, the electronic device includes a display screen, and the control method includes controlling the display screen to display a view according to container information, and sending event information; forwarding the event information; and calling an interface for controlling the view according to the forwarded event information. , to control the container information.
  • Figure 1 is a schematic architectural diagram of an application processing device according to certain embodiments of the present application.
  • Figure 2 is a schematic diagram of the principle of an application processing device according to certain embodiments of the present application.
  • Figure 3 is a schematic architectural diagram of an application processing device according to certain embodiments of the present application.
  • Figure 4 is a schematic flowchart of a control method in some embodiments of the present application.
  • Figure 5 is a schematic plan view of an electronic device according to certain embodiments of the present application.
  • Figure 6 is a schematic flowchart of a control method in some embodiments of the present application.
  • Figure 7 is a schematic flowchart of a control method in some embodiments of the present application.
  • Figure 8 is a schematic flowchart of a control method in some embodiments of the present application.
  • Figure 9 is a schematic flowchart of a control method in some embodiments of the present application.
  • Figure 10 is a schematic flowchart of a control method in some embodiments of the present application.
  • Figure 11 is a schematic flowchart of a control method in some embodiments of the present application.
  • Figure 12 is a schematic diagram of the connection status of a non-volatile computer-readable storage medium and a processor in some embodiments of the present application.
  • View is an interface that displays data (model) and transmits user instructions (events) to the presenter to act on that data. View usually contains a reference to Presenter.
  • Model layer is also the data layer. It is different from the Model in the MVC architecture, where it is not just a data model. In the MVP architecture, Model is responsible for data access operations, such as reading and writing databases, network data requests, etc.
  • Presenter For the Presenter layer, it is the bridge connecting the View layer and the Model layer and processes business logic. In the MVP architecture, Model and View cannot interact directly. Therefore, in the Presenter layer, it will obtain the required data from the Model layer, perform some appropriate processing, and then hand it over to the View layer for display. In this way, the View and the Model are isolated through the Presenter, so that there is no coupling between the View and the Model, and the business logic is also extracted from the View.
  • the Presenter will process the business logic of the View layer, obtain the required data from the Model layer, process it, and then hand it over to the View layer for display. Therefore, the interaction between the Presenter and the View layer is relatively frequent, and there is coupling between the two. As a result, the Presenter layer and the View layer are coupled and cannot be modified independently. After the View layer changes, the Presenter will change accordingly, and the degree of modularity lower.
  • the application processing device of this application is used in electronic equipment.
  • the electronic equipment includes a display screen.
  • the application processing device includes a view module, a data transmission module and a data processing module.
  • the view module is used to control the display screen to display views based on container information and send event information;
  • the data transmission module is used to receive 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 based on the event information to control the container information.
  • 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 the view according to the container information.
  • the container information includes the state information and attribute information of the view.
  • the state information includes display 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 event information generated by the electronic device and send the event information to the event distribution unit.
  • the data processing module is also configured to generate calling information based on the event information, and call the interface of the view management unit based on the calling information to control the container information.
  • the data transmission module includes a data distribution unit and a device control unit.
  • the data distribution unit is used to forward 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 is used to control the electronic device to perform corresponding operations according to the control information.
  • the device control unit is also configured to receive feedback information returned after the electronic device performs an 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 feedback information to control what is displayed on the display.
  • the data processing module includes a scheduling unit and a functional unit.
  • the scheduling unit is used to determine the functional unit corresponding to the event information based on a preset function mapping table.
  • the functional unit is also used to execute based on the preset configuration file. At least one of the following operations: calling the interface of the view management unit to control container information; processing event information to generate control information; and processing feedback information to control display content.
  • each functional unit includes at least one configuration file, and each shooting mode corresponds to at least one functional unit.
  • the event information includes initialization information
  • the initialization information includes first initialization information, second initialization information, and third initialization information.
  • the event distribution unit is configured to send the initialization information to the data distribution unit, and the data distribution unit forwards the third initialization information.
  • An initialization message is sent to the view management unit to initialize the general container of the view management unit, a second initialization message is forwarded to the data processing module to initialize a general functional unit in the data processing module, and a third initialization message is forwarded to the device control unit to initialize the device.
  • the general configuration includes selecting a first framework module or a second framework module.
  • the functional type of the code set contained in the first framework module is different from the functional type of the code set contained in the second framework module.
  • the electronic device further includes electronic components
  • the data processing module sends the 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 view management unit corresponding to the mode information.
  • the functional unit of the device control unit initializes the electronic components corresponding to the mode information according to the mode information.
  • the event information also includes a camera opening event.
  • the data distribution unit forwards the camera opening event to the data processing module.
  • the scheduling unit is used to determine the functional unit corresponding to the camera opening event based on the function mapping table.
  • the camera opening event corresponds to the
  • the functional unit 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.
  • the electronic device further includes one or more cameras
  • the scheduling unit is also configured to process the camera opening event to generate type information, and send 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 executing the opening operation, the device control unit receives the first feedback information returned by the camera, and the first feedback information includes failure to open the camera or successful opening of the camera; the device control unit sends a third Feedback information to the data distribution unit, the data distribution unit forwards the first feedback information to the view management unit and the scheduling unit, the view management unit controls the display screen to display information about the success or failure of camera opening based on the first feedback information, and the scheduling unit controls the display screen to display information about the success or failure of camera opening based on the first feedback information.
  • the information is determined to enter the preset business process or the type information is sent to the data distribution unit again to control the camera corresponding to the type information to perform the opening operation again.
  • the view control unit controls the container corresponding to the view not to respond to the input operation.
  • a session is created; after the view management unit receives the success of opening the camera, it determines the predetermined area of the display screen as the preview area; the device control unit also receives the third response returned by the camera.
  • the second feedback information is sent 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 in the preview area according to the preview image data. image.
  • the application processing device further includes a tool module.
  • the tool module includes a view module, a data transmission module, and/or a code set used by the data processing module to parse event information.
  • the control method of this application is used for electronic equipment.
  • the electronic equipment includes a display screen.
  • the control method includes: controlling the display screen display view according to the container information and sending event information; forwarding the event information; and calling the interface of the control view according to the forwarded event information. to control container information.
  • the container information includes status information and attribute information of the view.
  • the status information includes showing or hiding.
  • the attribute information includes at least one of view size, view position and view color. Controlling the display screen to display the view according to the container information includes: : Control the display view based on status information and attribute information.
  • calling the interface of the control view according to the forwarded event information to control the container information includes: generating the calling information according to the forwarded event information, and calling the interface of the control view according to the calling information to control the container information.
  • control method further includes: processing event information to generate control information; and controlling the electronic device to perform corresponding operations according to the control information.
  • control method further includes: obtaining feedback information generated after the electronic device performs an operation; and controlling the display content of the display screen based on the feedback information.
  • control method also includes: determining the configuration file corresponding to the event information based on a preset function mapping table; calling the interface of the control view according to the forwarded event information to control the container information, including: calling according to the configuration file interface to control container information; process event information to generate control information, including: processing event information according to the configuration file to generate control information; control the display content of the display screen based on feedback information, including: processing feedback information according to the configuration file to Control what is displayed.
  • the electronic device further includes electronic components, the electronic device further includes an application processing device, the application processing device 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, and the event
  • the information includes initialization information, and the initialization information includes first initialization information, second initialization information, and third initialization information.
  • the control method also includes: controlling the view module to send initialization information to the data distribution unit; controlling the data distribution unit to forward the first initialization information to The view module initializes 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 framework module or a second framework module, and the function type of the code set contained in the first framework module is different from the functional type of the code set included in the second framework module.
  • control method further includes: controlling the data processing module to send mode information to the data distribution unit; controlling the data distribution unit to forward the mode information to the view module and the device control unit to initialize functions corresponding to the mode information in the view module unit, and controls the device control unit to initialize the electronic components corresponding to the mode information.
  • the event information also includes a camera opening event
  • calling an interface that controls the view according to the forwarded event information to control the container information includes: calling an interface corresponding to the camera opening event to control the container information.
  • the electronic device further includes one or more cameras
  • the control method further includes: processing a camera opening event to generate type information; controlling the camera corresponding to the type information to perform an opening operation according to the type information; and receiving the camera to perform an opening operation.
  • the first feedback information returned after the first feedback information includes the camera opening failure or the camera opening success; according to the first feedback information, the display screen is controlled to display the camera opening success or failure information, and determines to enter the preset business process or control and type again.
  • the camera corresponding to the information performs the opening operation.
  • control method further includes: controlling the container corresponding to the view not to respond to the input operation before receiving a successful opening of the camera.
  • control method further includes: obtaining preview image data after receiving that the camera is successfully opened; and displaying the preview image in a predetermined area of the display screen according to the preview image data.
  • the electronic device of this application includes a processor and a display screen.
  • the processor is used to control the display screen display view according to the container information and send event information; forward the event information; and call the interface of the control view according to the forwarded event information to control the container information.
  • the non-volatile computer-readable storage medium of the present application includes a computer program.
  • the computer program When the computer program is executed by a processor, it causes the processor to execute the control method of any of the above embodiments.
  • 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 respectively correspond to the MVP architecture.
  • View layer, Presenter layer and Model layer the application processing device 10 of this application has re-divided the functions of the three layers, among which,
  • the view module 11 is used to control the display screen 40 to display the view according to the container information, and send event information.
  • the container information is information that controls the view displayed on the display screen 40 of the electronic device 100 (such as the UI displayed on the display screen 40), and the event information can be generated according to the information obtained by the electronic device 100. For example, the electronic device 100 receives a response to the UI. When the touch operation is performed, the corresponding event information can be generated. For example, clicking the night scene mode UI icon can generate the event information for turning on the night scene mode.
  • the view module 11 is used for view display and distribution of event information.
  • the data transmission module 12 is used to receive event information and forward the event information 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.
  • the data processing module 13 is used to call the interface of the view module 11 according to the event information to control the 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.
  • the display control of the view can be realized without going through the data transmission module 12.
  • the data processing module 13 can also first generate the calling information through the event information, and then according to the interface of the view module 11 (specifically, the view management unit of the view module 11) called by the calling information, the data processing module 13 first parses the event information. , to generate calling information, which contains information about the specific interface that needs to be called, so that the interface of the view module 11 can be quickly called according to the calling information.
  • the interface is an entrance where the business logic is exposed to the outside and can be used to implement the business logic.
  • the call of the interface can be completed.
  • the corresponding execution can be performed.
  • Business logic For example, interface A of the view module 11 is used to control the display and hiding of button A. By calling interface A and inputting parameters: display or hide, button A can be displayed or hidden.
  • 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.
  • the degree of modularity is higher.
  • the view module 11 includes a view management unit 111 and an event distribution unit 112. They are used to implement view display and event distribution functions respectively.
  • the view management unit 111 is used to control the display screen 40 to display views according to the container information.
  • the container information may include status information and attribute information of the view.
  • the status information includes showing or hiding, and the attribute information includes at least one of view size, view position, and view color.
  • the interfaces of the view module 11 are all located in the view management unit 111.
  • the camera view displayed on the display screen 40 includes a shooting button (used to start shooting), a flash button (used to turn on or off the flash button), and a preview image frame (used to display a preview image in the image frame). ) and mode switching bar (can slide to switch shooting mode, video mode, night scene mode, continuous shooting mode, etc.).
  • the shooting button, flash button, preview image frame, and mode switching bar all have corresponding containers.
  • the containers are located in the view management unit 111. Each container exposes a corresponding interface.
  • the interface of the data processing module 13 calling the view module 11 is the calling view.
  • the interface of the container in the management unit 111 thereby controlling container information.
  • the view management unit 111 can control the view display of the display screen 40 by controlling the container information of each container. For example, by setting the status information of the container of the shooting button, it can be determined whether to display or hide the shooting button. By setting the attribute information of the container of the shooting button, the size of the shooting button, the position of the shooting button on the display screen 40, and the color of the shooting button can be changed. wait. Similarly, other views (such as flash buttons, preview image boxes, etc.) can also implement view display control by controlling container information.
  • the event distribution unit 112 is used to obtain event information generated by the electronic device 100 and send the event information to the event distribution unit 112 .
  • the event information may be: generated after the view receives a touch operation; notifications of the Activity life cycle in Android; device status information (such as horizontal and vertical Switching, resolution switching, folding screen folding or folding state) changes; generated when temperature information changes; information generated by the received frame, such as notification information generated by the camera frame after the camera is turned on and off, the application of Google Light Armor Notifications of management service (Activity Manager Service, AMS), window management service (Window Manager Service, WMS), and power management service (Power Manager Service, PMS).
  • AMS Active Manager Service
  • WMS Window Manager Service
  • PMS Power Manager Service
  • the electronic device 100 After the electronic device 100 generates event information, it will be sent to the event distribution unit 112, and the event distribution unit 112 will distribute the event information again, such as to the event distribution unit 112.
  • the data transmission module 12 includes a data distribution unit 121 and a device control unit 122.
  • the data distribution unit 121 is used to implement data forwarding. After the data distribution unit 121 receives the event information, it 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 may forward the control information to the device control unit 122 .
  • the device control unit 122 is used to control the hardware device of the electronic device 100 according to the control information.
  • the event information is a camera opening event.
  • the data processing module 13 can generate corresponding control information after processing the camera opening event.
  • the device control unit 122 controls the camera of the electronic device 100 to perform an opening operation according to the control information; or for example, the event information is a flash light opening event.
  • the data processing module 13 can generate corresponding control information after processing the flash light opening event, and the device control unit 122 controls the flash light of the electronic device 100 to perform an opening operation according to the control information.
  • the device control unit 122 is also used to receive feedback information returned after the electronic device 100 performs 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 The feedback information is processed to control the display content of the display screen 40 .
  • the state of the electronic component 50 (such as a camera) of the electronic device 100 that performs the operation will change.
  • the camera is turned on or off.
  • image data will be collected.
  • the device control unit 122 can obtain the feedback information of the electronic component 50 that performs the operation, such as obtaining the returned feedback information of successful or failed opening of the camera after performing the operation of opening the camera, or the returned feedback information including the image data collected by the camera.
  • the device control unit 122 sends the feedback information to the data distribution unit 121, and the data distribution unit 121 forwards the feedback information to the data processing module 13 for processing, thereby controlling the display content of the display screen 40.
  • the data processing module 13 controls the display screen 40 to directly display the prompt information that the camera fails to open.
  • the feedback information includes that the camera is opened successfully and contains image data collected by the camera, the preview image can be directly displayed based on the image data.
  • the data processing module 13 includes a scheduling unit 131 and a functional unit 132.
  • the scheduling unit 131 is used to select the functional unit 132 that matches the event information.
  • the electronic device 100 has pre-stored function mapping tables for 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 queried.
  • the scheduling unit 131 processes the event information and generates calling information.
  • the calling information includes a pattern corresponding to the event information (pattern N as shown in Figure 1, N is a positive integer), and then determines the processing corresponding to the pattern based on the calling information. Process (such as processing process N), after processing process N is run, the corresponding functional unit 132 can be determined.
  • the functional unit 132 is used to execute specific business logic. After determining the functional unit 132 corresponding to the event information, the preset configuration file of each functional unit 132 can be obtained first, and the functional unit 132 can perform at least one of the following operations according to the preset configuration file:
  • the functional unit 132 can implement display control of views and parse event information to generate control information for controlling the electronic components 50 of the electronic device 100 , so as to facilitate the device control unit 122 to control the electronic components 50 of the electronic device 100 according to the control information. Corresponding operations are performed, and the display content is controlled according to feedback information returned by the electronic component 50 of the electronic device 100 .
  • the business logic of the data processing module 13 is divided through the functional unit 132, and scheduling is implemented through the scheduling unit 131, thereby realizing modular development of functions.
  • different shooting modes have corresponding functional units 132, and the functional unit 132 includes multiple,
  • 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.
  • the scheduling unit 131 can also realize the combination of multiple functions to form new functions through scheduling. For example, when the shooting mode is the night scene tripod mode, the night scene function unit 132 and the tripod function unit 132 are called at the same time.
  • the above-mentioned application processing device 10 can not only realize the control of camera applications, but also can realize other applications such as map applications, chat software, etc., which are not limited here.
  • the following describes the control process of the camera application of the electronic device 100 by the application processing device 10 through multiple examples.
  • the camera initialization process is as follows:
  • the event distribution unit 112 first receives event information for initialization.
  • the event information includes initialization information, and initializes the application processing device 10 and related electronic components 50 of the electronic device 100 through the initialization information.
  • the initialization information may include first initialization information, second initialization information, and third initialization information.
  • the event distribution unit 112 is used to send initialization information to the data distribution unit 121 (arrow 1 in Figure 2), 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 ( (arrow 2 in Figure 2), forwarding the second initialization information to the data processing module 13 to initialize the general functional unit 132 in the data processing module 13 (arrow 3 and arrow 4 in Figure 2), and forwarding the third initialization information to the device control unit 122 to initialize the general configuration of the device control unit 122 (arrows 5 and 6 in Figure 2).
  • the first initialization information can be used to initialize the container information of some general containers.
  • the general container refers to the container that must be used for all shooting modes of the camera. For example, for the camera, no matter which shooting mode, there are shooting buttons and
  • the preview image box that is, the containers corresponding to the shooting button and the preview image box are all universal containers.
  • the view management unit 111 resets the container information of the general container according to the first initialization information to restore the default container information, thereby completing the initialization.
  • the second initialization information can be used to initialize the general functional unit 132.
  • the general functional unit 132 can be the functional unit 132 used in all shooting modes, such as countdown shooting function, slow motion shooting function, etc.; after running the business logic, the functional unit 132 , the internal parameters of the corresponding configuration file may have changed.
  • the parameters in the configuration file of the functional unit 132 need to be set through the second initialization information to restore the preset parameters.
  • the third initialization information may be used to initialize the general configuration of the device control unit 122 so that the device control unit 122 can select a suitable framework module 14 of the application processing device 10 , for example, the framework module 14 includes the first framework module 141 or the second framework module 142 , the functional types of the code collection contained in the first framework module 141 are different from the functional types of the code collection contained in the second framework module 142.
  • the first framework module 141 can be a Google framework, which contains the specific implementation of most functions of the camera.
  • the code set for the corresponding function can be determined according to different functional units 132, so that the device control unit 122 is set during initialization.
  • the frame module 14 is required for the control of the electronic device 100 .
  • initialization can also be performed according to the current shooting mode.
  • the data processing module 13 can obtain the current mode information.
  • the data processing module 13 sends the mode information to the data distribution unit 121 (arrow 3 in Figure 2).
  • the data distribution unit 121 forwards the mode information to the view management unit 111 and the device control unit. 122 (arrow 2 and arrow 5 in Figure 2) to initialize the functional unit 132 corresponding to the mode information in the view management unit 111.
  • the device control unit 122 initializes the electronic component 50 corresponding to the mode information according to the mode information (arrow 6 in FIG. 2 ).
  • the containers, functional units 132, and/or electronic components 50 used in different shooting modes There are differences in the containers, functional units 132, and/or electronic components 50 used in different shooting modes. For example, in the panoramic shooting mode and the night scene shooting mode, the containers and functional units 132 corresponding to the two are different; as another example, in the front shooting mode and the rear shooting mode, the containers, functional units 132 and electronic components 50 corresponding to both are the same. different.
  • the container, functional unit 132 and electronic component 50 corresponding to the mode information are also initialized, and only the container, functional unit 132 and electronic component 50 required for the current shooting mode are initialized. That’s it, the initialization content is less, which can improve the initialization efficiency.
  • the event information also includes the event of opening the camera.
  • the event distribution unit 112 sends the event of opening the camera to the data distribution unit 121 (arrow 1 in Figure 2).
  • the data distribution unit 121 forwards the event of opening the camera to the data processing module 13 (as shown in Figure 2).
  • Arrow 3 the scheduling unit 131 is used to determine the functional unit 132 corresponding to the open camera event based on the function mapping table (arrow 4 in Figure 2), and the functional unit 132 corresponding to the open camera event is used to call based on the configuration file.
  • opening the functional unit 132 corresponding to the camera event includes a general functional unit 132 and a functional unit 132 corresponding to the panoramic shooting mode, thereby controlling the container information to control the display screen 40 to display the panoramic shooting location. required view.
  • the electronic device 100 also includes one or more cameras.
  • the scheduling unit 131 is also used to process the camera opening event to generate type information, and send the type information to the data distribution unit 121 (arrow 3 in Figure 2).
  • the data distribution unit 121 forwards
  • the type information is sent to the device control unit 122 (arrow 5 in Figure 2) to control the camera corresponding to the type information to perform an opening operation (arrow 6 in Figure 2).
  • the type information includes the type of the camera that is opened, the camera
  • the type includes at least one of front camera, rear camera, wide-angle camera, telephoto camera, etc. If the current shooting mode is front portrait shooting mode, the front wide-angle camera will be turned on; the current shooting mode is rear panorama mode, the rear telephoto camera will be turned on.
  • controlling the opening of the camera according to the opening camera event and controlling the display of the view according to the opening camera event can be performed simultaneously, or the opening of the camera can be controlled first according to the opening camera event, and then the display of the view can be controlled according to the opening camera event.
  • the opening of the camera is controlled based on the camera opening event and the display of the view is controlled synchronously according to the camera opening event, so as to improve the running speed of the camera application.
  • the device control unit 122 receives the first feedback information returned by the camera (arrow 6 in Figure 2).
  • the first feedback information includes failure to open the camera or successful opening of the camera; the device control unit 122 sends the first feedback information to the data distribution unit 121 (arrow 4 in Figure 2), the data distribution unit 121 forwards the first feedback information to the view management unit 111 and the scheduling unit 131 (arrows 2 and 3 in Figure 2), the view management unit 111
  • the display screen 40 is controlled to display information on the success or failure of camera opening according to the first feedback information; the scheduling unit 131 determines to enter the preset business process according to the first feedback information or sends the type information to the data distribution unit 121 again to control the type information corresponding to the type information.
  • the camera performs the opening operation again.
  • the display screen 40 displays a failure to open the camera, and the electronic device 100 controls the camera again to perform the opening operation. If the first feedback information at this time still indicates a failure to open the camera, the display screen 40 displays the failure to open the camera. 40 displays camera abnormality information to prompt the user to repair the camera. In the case where the first feedback information includes that the camera is opened successfully, the display screen 40 may display the information that the camera is opened successfully, and enter the subsequent preset business process. For example, after the camera is opened successfully, a preview image will generally be displayed.
  • the container corresponding to the view displayed on the display screen 40 may be controlled not to respond to the input operation.
  • the view display on the display screen 40 is generally faster, but because the camera has not been opened successfully, the function of the view on the display screen 40 is actually unavailable. At this time, if the user's input operation is received, a new view may be generated. Event information, thus affecting the process of opening the camera or the process of initialization. Therefore, until the camera is opened successfully, the container corresponding to the control view will not respond to the input operation, thus ensuring the normal operation of the process.
  • the scheduling unit 131 After the scheduling unit 131 receives the success of opening the camera (arrow 3 in Figure 2), it will first create a session, which is used to store preview image data; the view management unit 111 receives the success of opening the camera (arrow 3 in Figure 2) 2), the predetermined area of the display screen 40 is determined to be 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 (such as Arrows 6 and 5 in Figure 2), the data distribution unit 121 forwards the second feedback information to the scheduling unit 131 (arrow 3 in Figure 2), the second feedback information includes preview image data, and the preview image data is stored in the session , the scheduling unit 131 displays the preview image in the preview area according to the preview image data.
  • the data distribution unit 121 such as Arrows 6 and 5 in Figure 2
  • the data distribution unit 121 forwards the second feedback information to the scheduling unit 131 (arrow 3 in Figure 2),
  • the functional unit 132 may process the preview image and store the processed preview image data into the session. If the user selects different filters, the preview image data is filtered according to the functional unit 132 corresponding to the filter, and the filter-processed preview image data is stored in the session.
  • the scheduling unit 131 performs filter processing on the preview image data according to the filter-processed preview image data.
  • the preview image data is displayed in the preview area, thereby displaying a preview image with a filter effect.
  • the application processing device 10 further includes a tool module 15 .
  • the tool module 15 includes a view module 11 , a data transmission module 12 and/or a code set used by the data processing module 13 to parse event information.
  • the view module 11, the data transmission module 12 and the data processing module 13 all need to parse the event information to obtain information related to the event information.
  • the code set required to parse event information is encapsulated into the tool module.
  • the view module 11, data transmission module 12 and data processing module 13 perform parsing, it is enough to call the interface exposed by the tool module, and the interface common to the three can Reuse is achieved, thereby reducing the code amount of the view module 11, the data transmission module 12 and the data processing module 13, and at the same time reducing the overall code amount.
  • the tool module 15 can also include a code set with more functions.
  • the business logic code of the functional unit 132 can be encapsulated into the tool module 15, and the functional unit 132 can call the interface of the tool module 15 during use.
  • control method includes steps:
  • 011 Control the display screen 40 to display the view according to the container information, and send event information;
  • 013 Call the interface of the control view based on the forwarded event information to control the container information.
  • step 011 For the specific description of step 011, please refer to the description of the view module 11.
  • step 012 For the specific description of step 012, please refer to the description of the data transmission module 12.
  • step 013 For the specific description of step 013, please refer to the description of the data processing module 13, which will not be repeated here.
  • the container information includes status information and attribute information of the view.
  • the status information includes showing or hiding
  • the attribute information includes at least one of view size, view position and view color.
  • Step 011 includes:
  • Step 0111 Control the display screen 40 to display the view according to the status information and attribute information.
  • step 011 For the specific description of step 011, please refer to the description of the view management unit 111, which will not be described again here.
  • step 013 includes:
  • Step 0131 Generate calling information based on the forwarded event information, and call the interface of the control view based on the calling information to control the container information.
  • control method further includes the steps:
  • 014 Process event information to generate control information
  • step 014 and step 015 please refer to the descriptions of the data processing module 13 and the device control unit 122 respectively, and will not be described again here.
  • control method further includes the steps of:
  • step 016 and step 017 please refer to the descriptions of the device control unit 122 and the data processing module 13 respectively, and will not be described again here.
  • control method further includes the steps:
  • Step 0131 includes:
  • Step 014 includes:
  • Step 0141 Process event information according to the configuration file to generate control information
  • Step 017 includes:
  • 0171 Process feedback information according to the configuration file to control the display content.
  • step 018 please refer to the description of the scheduling unit 131.
  • step 01311, step 0141 and step 0171 please refer to the description of the functional unit 132, which will not be described again here.
  • the event information includes initialization information
  • the control method also includes:
  • the control view module 11 sends initialization information to the data distribution unit 121;
  • the general configuration includes selecting the first framework module 141 or the second framework module 142, the function type of the code set included in the first framework module 141 and the The code sets included in the two framework modules 142 have different functional types.
  • step 019 and step 020 please refer to the description of the above initialization process respectively, and will not be repeated here.
  • control method further includes:
  • step 021 and step 022 please refer to the description of the above initialization process respectively, and will not be repeated here.
  • the event information also includes a camera opening event
  • step 013 also includes:
  • step 0132 please refer to the description of the process of opening the camera above, and will not be repeated here.
  • the electronic device 100 further includes one or more cameras
  • the control method further includes:
  • the 025 Receive the first feedback information returned after the camera performs the opening operation.
  • the first feedback information includes failure to open the camera or successful opening of the camera;
  • control the display screen 40 According to the first feedback information, control the display screen 40 to display the information of success or failure of camera opening, and determine to enter the preset business process or control the camera corresponding to the type information again to perform the opening operation.
  • steps 023 to 026 please refer to the description of the process of opening the camera above, and will not be repeated here.
  • control method further includes:
  • the container corresponding to the control view does not respond to the input operation.
  • step 027 please refer to the description of the process of opening the camera above, and will not be repeated here.
  • control method further includes:
  • Step 028 After receiving the successful opening of the camera, obtain the preview image data
  • Step 029 Display the preview image in a predetermined area of the display screen 40 according to the preview image data.
  • step 028 and step 029 please refer to the description of the process of displaying the preview image above, and will not be described again here.
  • An embodiment of the present application also provides an electronic device 100.
  • Electronic device 100 includes processor 20 .
  • the control method of the embodiment of the present application can be applied to the electronic device 100 .
  • the processor 20 is used to execute step 011, step 012 and step 013. That is, the processor 20 is used to control the display screen 40 to display the view according to the container information, and send event information; forward the event information; and call the interface for controlling the view according to the forwarded event information to control the container information.
  • the processor may also execute any embodiment of the foregoing control methods.
  • the electronic device 100 includes a housing 30 .
  • the electronic device 100 may be a mobile phone, a tablet computer, a display device, a laptop computer, a teller machine, a gate, a smart watch, a head-mounted display device, a game console, etc.
  • FIG. 3 the embodiment of the present application is explained by taking 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 casing 30 can also be used to install functional modules such as a display device, imaging device, power supply device, and communication device of the electronic device 100, so that the casing 30 can provide dustproof, anti-fall, waterproof and other protection for the functional modules.
  • an embodiment of the present application also provides a non-volatile computer-readable storage medium 200 containing a computer program 201.
  • the computer program 201 is executed by one or more processors 20, the one or more processors 20 are caused to execute the control method of any of the above embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

An application-processing apparatus (10), a control method, an electronic device (100), and a non-volatile computer-readable storage medium (300). The application-processing apparatus comprises: a view module (11), which controls, according to container information, a display screen (40) to display a view, and sends event information; a data transmission module (12), which receives the event information and forwards the event information to a data processing module (13); and the data processing module (13), which calls an interface of the view module (11) according to the event information, so as to control the container information.

Description

应用处理装置、控制方法、电子设备及存储介质Application processing device, control method, electronic device and storage medium
优先权信息priority information
本申请请求2022年3月21日向中国国家知识产权局提交的、专利申请号为2022102816485的专利申请的优先权和权益,并且通过参照将其全文并入此处。This application requests the priority and rights of the patent application with patent application number 2022102816485 filed with the State Intellectual Property Office of China on March 21, 2022, and the full text of which is incorporated herein by reference.
技术领域Technical field
本申请涉及应用框架技术领域,更具体而言,涉及一种应用处理装置、控制方法、电子设备及非易失性计算机可读存储介质。The present application relates to the field of application framework technology, and more specifically, to an application processing device, a control method, an electronic device and a non-volatile computer-readable storage medium.
背景技术Background technique
目前的MVP架构中,包括View层、Model层和Presenter层,Presenter层可连接View层与Model层并对业务逻辑进行处理。The current MVP architecture includes the View layer, Model layer and Presenter layer. The Presenter layer can connect the View layer and the Model layer and process business logic.
发明内容Contents of the invention
本申请实施方式提供一种应用处理装置、控制方法、电子设备及非易失性计算机可读存储介质。Embodiments of the present application provide an application processing device, a control method, an electronic device, and a non-volatile computer-readable storage medium.
本申请实施方式的应用处理装置用于电子设备,所述电子设备包括显示屏,所述应用处理装置包括视图模块、数据传输模块和数据处理模块。所述视图模块用于根据容器信息控制所述显示屏显示视图,并发送事件信息;所述数据传输模块用于接收所述事件信息并转发所述事件信息到所述数据处理模块;所述数据处理模块用于根据所述事件信息调用所述视图模块的接口,以控制所述容器信息。The application processing device in the embodiment of the present application is used in an electronic device, the electronic device includes a display screen, and the application processing device includes a view module, a data transmission module and a data processing module. The view module is used to control the display screen display view according to the container information and 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 The processing module is configured to call the interface of the view module according to the event information to control the container information.
本申请实施方式的控制方法用于电子设备,所述电子设备包括显示屏,所述控制方法包括根据容器信息控制所述显示屏显示视图,并发送事件信息;转发所述事件信息;及根据转发的所述事件信息调用控制视图的接口,以控制所述容器信息。The control method in the embodiment of the present application is used in an electronic device, and the electronic device includes a display screen. The control method includes controlling the display screen to display a view according to container information, and sending event information; forwarding the event information; and forwarding according to The event information calls the interface of the control view to control the container information.
本申请实施方式的电子设备包括处理器和显示屏。所述处理器用于根据容器信息控制所述显示屏显示视图,并发送事件信息;转发所述事件信息;及根据转发的所述事件信息调用控制视图的接口,以控制所述容器信息。The electronic device in the embodiment of the present application includes a processor and a display screen. The processor is configured to control the display screen display view according to the container information and send event information; forward the event information; and call the interface of the control view according to the forwarded event information to control the container information.
本申请实施方式的非易失性计算机可读存储介质包含计算机程序,当所述计算机程序被一个或多个处理器执行时,使得所述处理器执行如下控制方法:所述控制方法用于电子设备,所述电子设备包括显示屏,所述控制方法包括根据容器信息控制所述显示屏显示视图,并发送事件信息;转发所述事件信息;及根据转发的所述事件信息调用控制视图的接口,以控制所述容器信息。The non-volatile computer-readable storage medium of the embodiment of the present application contains a computer program. When the computer program is executed by one or more processors, it causes the processor to execute the following control method: the control method is used for electronic Device, the electronic device includes a display screen, and the control method includes controlling the display screen to display a view according to container information, and sending event information; forwarding the event information; and calling an interface for controlling the view according to the forwarded event information. , to control the container information.
本申请的实施方式的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实施方式的实践了解到。Additional aspects and advantages of embodiments of the 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 the application.
附图说明Description of the drawings
本申请的上述和/或附加的方面和优点从结合下面附图对实施方式的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and readily understood from the description of the embodiments in conjunction with the following drawings, in which:
图1是本申请某些实施方式的应用处理装置的架构示意图;Figure 1 is a schematic architectural diagram of an application processing device according to certain embodiments of the present application;
图2是本申请某些实施方式的应用处理装置的原理示意图;Figure 2 is a schematic diagram of the principle of an application processing device according to certain embodiments of the present application;
图3是本申请某些实施方式的应用处理装置的架构示意图;Figure 3 is a schematic architectural diagram of an application processing device according to certain embodiments of the present application;
图4是本申请某些实施方式的控制方法的流程示意图;Figure 4 is a schematic flowchart of a control method in some embodiments of the present application;
图5是本申请某些实施方式的电子设备的平面示意图;Figure 5 is a schematic plan view of an electronic device according to certain embodiments of the present application;
图6是本申请某些实施方式的控制方法的流程示意图;Figure 6 is a schematic flowchart of a control method in some embodiments of the present application;
图7是本申请某些实施方式的控制方法的流程示意图;Figure 7 is a schematic flowchart of a control method in some embodiments of the present application;
图8是本申请某些实施方式的控制方法的流程示意图;Figure 8 is a schematic flowchart of a control method in some embodiments of the present application;
图9是本申请某些实施方式的控制方法的流程示意图;Figure 9 is a schematic flowchart of a control method in some embodiments of the present application;
图10是本申请某些实施方式的控制方法的流程示意图;Figure 10 is a schematic flowchart of a control method in some embodiments of the present application;
图11是本申请某些实施方式的控制方法的流程示意图;Figure 11 is a schematic flowchart of a control method in some embodiments of the present application;
图12是本申请某些实施方式的非易失性计算机可读存储介质和处理器的连接状态示意图。Figure 12 is a schematic diagram of the connection status of a non-volatile computer-readable storage medium and a processor in some embodiments of the present application.
具体实施方式Detailed ways
下面详细描述本申请的实施方式,实施方式的示例在附图中示出,其中,相同或类似的标号自始至终表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施方式是示例性的,仅用于解释本申请的实施方式,而不能理解为对本申请的实施方式的限制。The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application and cannot be understood as limiting the embodiments of the present application.
为方便理解本申请的方案,这里先介绍一下现有的MVP架构:In order to facilitate the understanding of the solution of this application, here is an introduction to the existing MVP architecture:
View:是显示数据(model)并且将用户指令(events)传送到presenter以便作用于那些数据的一个接口。View通常含有Presenter的引用。View: is an interface that displays data (model) and transmits user instructions (events) to the presenter to act on that data. View usually contains a reference to Presenter.
Model:对于Model层也是数据层。它区别于MVC架构中的Model,在这里不仅仅只是数据模型。在MVP架构中Model它负责对数据的存取操作,例如对数据库的读写,网络的数据的请求等。Model: The Model layer is also the data layer. It is different from the Model in the MVC architecture, where it is not just a data model. In the MVP architecture, Model is responsible for data access operations, such as reading and writing databases, network data requests, etc.
Presenter:对于Presenter层他是连接View层与Model层的桥梁并对业务逻辑进行处理。在MVP架构中Model与View无法直接进行交互。所以在Presenter层它会从Model层获得所需要的数据,进行一些适当的处理后交由View层进行显示。这样通过Presenter将View与Model进行隔离,使得View和Model之间不存在耦合,同时也将业务逻辑从View中抽离。Presenter: For the Presenter layer, it is the bridge connecting the View layer and the Model layer and processes business logic. In the MVP architecture, Model and View cannot interact directly. Therefore, in the Presenter layer, it will obtain the required data from the Model layer, perform some appropriate processing, and then hand it over to the View layer for display. In this way, the View and the Model are isolated through the Presenter, so that there is no coupling between the View and the Model, and the business logic is also extracted from the View.
从上述现有MVP架构可以看出,Presenter会对View层的业务逻辑进行处理,从Model层获得所需要的数据并进行处理后,以交给View层进行显示。因此,Presenter和View层的交互较为频繁,两者之间存在耦合,导致Presenter层与View层的发生耦合,无法独立进行修改,在View层发生变更后,Presenter会随之发生变更,模块化程度较低。As can be seen from the above existing MVP architecture, the Presenter will process the business logic of the View layer, obtain the required data from the Model layer, process it, and then hand it over to the View layer for display. Therefore, the interaction between the Presenter and the View layer is relatively frequent, and there is coupling between the two. As a result, the Presenter layer and the View layer are coupled and cannot be modified independently. After the View layer changes, the Presenter will change accordingly, and the degree of modularity lower.
本申请的应用处理装置用于电子设备,电子设备包括显示屏,应用处理装置包括视图模块、数据传输模块和数据处理模块;视图模块用于根据容器信息控制显示屏显示视图,并发送事件信息;数据传输模块用于接收事件信息并转发事件信息到数据处理模块;数据处理模块用于根据事件信息调用视图模块的接口,以控制容器信息。The application processing device of this application is used in electronic equipment. The electronic equipment includes a display screen. The application processing device includes a view module, a data transmission module and a data processing module. The view module is used to control the display screen to display views based on container information and send event information; The data transmission module is used to receive 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 based on the event information to control the container information.
在某些实施方式中,视图模块包括视图管理单元和事件分发单元,视图管理单元用于根据容器信息控制显示屏显示视图,容器信息包括视图的状态信息和属性信息,状态信息包括显示或隐藏,属性信息包括视图尺寸、视图位置和视图颜色中至少一个,事件分发单元用于获取电子设备产生的事件信息,并发送事件信息到事件分发单元。In some embodiments, 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 the view according to the container information. The container information includes the state information and attribute information of the view. The state information includes display 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 event information generated by the electronic device and send the event information to the event distribution unit.
在某些实施方式中,数据处理模块还用于根据事件信息生成调用信息,并根据调用信息调用视图管理单元的接口,以控制容器信息。In some implementations, the data processing module is also configured to generate calling information based on the event information, and call the interface of the view management unit based on the calling information to control the container information.
在某些实施方式中,数据传输模块包括数据分发单元和设备控制单元,数据分发单元用于转发事件信息到数据处理模块、接收数据处理模块处理事件信息后生成的控制信息、及转发控制信息到设备控制单元,设备控制单元用于根据控制信息控制电子设备执行对应的操作。In some embodiments, the data transmission module includes a data distribution unit and a device control unit. The data distribution unit is used to forward 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 is used to control the electronic device to perform corresponding operations according to the control information.
在某些实施方式中,设备控制单元还用于接收电子设备执行操作后返回的反馈信息;并发送反馈信息到数据分发单元;数据分发单元转发反馈信息到数据处理模块;数据处理模块还用于处理反馈信息,以控制显示屏的显示内容。In some embodiments, the device control unit is also configured to receive feedback information returned after the electronic device performs an 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 feedback information to control what is displayed on the display.
在某些实施方式中,数据处理模块包括调度单元和功能单元,调度单元用于基于预设的功能映射表,确定事件信息对应的功能单元,功能单元还用于基于预设的配置文件,执行以下至少一个操作:调用视图管理单元的接口,以控制容器信息;处理事件信息以生成控制信息;和处理反馈信息以控制显示内容。In some embodiments, the data processing module includes a scheduling unit and a functional unit. The scheduling unit is used to determine the functional unit corresponding to the event information based on a preset function mapping table. The functional unit is also used to execute based on the preset configuration file. At least one of the following operations: calling the interface of the view management unit to control container information; processing event information to generate control information; and processing feedback information to control display content.
在某些实施方式中,功能单元包括多个,每个功能单元至少包括一个配置文件,每个拍摄模式对应至少一个功能单元。In some embodiments, there are multiple functional units, each functional unit includes at least one configuration file, and each shooting mode corresponds to at least one functional unit.
在某些实施方式中,事件信息包括初始化信息,初始化信息包括第一初始化信息、第二初始化信息、和第三初始化信息,事件分发单元用于发送初始化信息到数据分发单元,数据分发单元转发第一初始化信息到视图管理单元以初始化视图管理单元的通用容器、转发第二初始化信息到 数据处理模块以初始化数据处理模块中的通用的功能单元、及转发第三初始化信息到设备控制单元以初始化设备控制单元的通用配置,通用配置包括选择第一框架模块或第二框架模块,第一框架模块包含的代码集合的功能种类和第二框架模块中包含的代码集合的功能种类不同。In some embodiments, the event information includes initialization information, the initialization information includes first initialization information, second initialization information, and third initialization information. The event distribution unit is configured to send the initialization information to the data distribution unit, and the data distribution unit forwards the third initialization information. An initialization message is sent to the view management unit to initialize the general container of the view management unit, a second initialization message is forwarded to the data processing module to initialize a general functional unit in the data processing module, and a third initialization message is forwarded to the device control unit to initialize the device. A general configuration of the control unit. The general configuration includes selecting a first framework module or a second framework module. The functional type of the code set contained in the first framework module is different from the functional type of the code set contained in the second framework module.
在某些实施方式中,电子设备还包括电子元件,数据处理模块发送模式信息到数据分发单元,数据分发单元转发模式信息到视图管理单元和设备控制单元,以初始化视图管理单元中与模式信息对应的功能单元,设备控制单元根据模式信息初始化与模式信息对应的电子元件。In some embodiments, the electronic device further includes electronic components, the data processing module sends the mode information to the data distribution unit, and the data distribution unit forwards the mode information to the view management unit and the device control unit to initialize the view management unit corresponding to the mode information. The functional unit of the device control unit initializes the electronic components corresponding to the mode information according to the mode information.
在某些实施方式中,事件信息还包括打开摄像头事件,数据分发单元转发打开摄像头事件到数据处理模块,调度单元用于基于功能映射表,确定打开摄像头事件对应的功能单元,打开摄像头事件对应的功能单元用于基于配置文件,调用与打开摄像头事件对应的视图管理单元的接口,以控制容器信息。In some embodiments, the event information also includes a camera opening event. The data distribution unit forwards the camera opening event to the data processing module. The scheduling unit is used to determine the functional unit corresponding to the camera opening event based on the function mapping table. The camera opening event corresponds to the The functional unit 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.
在某些实施方式中,电子设备还包括一个或多个摄像头,调度单元还用于处理打开摄像头事件以生成类型信息,并发送类型信息到数据分发单元,数据分发单元转发类型信息到设备控制单元,以控制与类型信息对应的摄像头执行打开操作;在执行完打开操作后,设备控制单元接收摄像头返回的第一反馈信息,第一反馈信息包括摄像头打开失败或摄像头打开成功;设备控制单元发送第一反馈信息到数据分发单元,数据分发单元转发第一反馈信息到视图管理单元和调度单元,视图管理单元根据第一反馈信息控制显示屏显示摄像头打开成功或失败的信息,调度单元根据第一反馈信息确定进入预设业务流程或再次发送类型信息到数据分发单元,以控制与类型信息对应的摄像头再次执行打开操作。In some embodiments, the electronic device further includes one or more cameras, and the scheduling unit is also configured to process the camera opening event to generate type information, and send 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 executing the opening operation, the device control unit receives the first feedback information returned by the camera, and the first feedback information includes failure to open the camera or successful opening of the camera; the device control unit sends a third Feedback information to the data distribution unit, the data distribution unit forwards the first feedback information to the view management unit and the scheduling unit, the view management unit controls the display screen to display information about the success or failure of camera opening based on the first feedback information, and the scheduling unit controls the display screen to display information about the success or failure of camera opening based on the first feedback information. The information is determined to enter the preset business process or the type information is sent to the data distribution unit again to control the camera corresponding to the type information to perform the opening operation again.
在某些实施方式中,在接收到摄像头打开成功之前,视图控制单元控制视图对应的容器不响应输入操作。In some implementations, before receiving that the camera is successfully opened, the view control unit controls the container corresponding to the view not to respond to the input operation.
在某些实施方式中,在调度单元接收到打开摄像头成功后,创建会话;在视图管理单元接收到打开摄像头成功后,确定显示屏的预定区域为预览区域;设备控制单元还接收摄像头返回的第二反馈信息并发送到数据分发单元,数据分发单元将第二反馈信息转发到调度单元,第二反馈信息包括预览图像数据,预览图像数据存储在会话,调度单元根据预览图像数据在预览区域显示预览图像。In some implementations, after the scheduling unit receives the success of opening the camera, a session is created; after the view management unit receives the success of opening the camera, it determines the predetermined area of the display screen as the preview area; the device control unit also receives the third response returned by the camera. The second feedback information is sent 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 in the preview area according to the preview image data. image.
在某些实施方式中,应用处理装置还包括工具模块,工具模块包括视图模块、数据传输模块和/或数据处理模块用于解析事件信息的代码集合。In some embodiments, the application processing device further includes a tool module. The tool module includes a view module, a data transmission module, and/or a code set used by the data processing module to parse event information.
本申请的控制方法用于电子设备,电子设备包括显示屏,控制方法包括:根据容器信息控制显示屏显示视图,并发送事件信息;转发事件信息;及根据转发的事件信息调用控制视图的接口,以控制容器信息。The control method of this application is used for electronic equipment. The electronic equipment includes a display screen. The control method includes: controlling the display screen display view according to the container information and sending event information; forwarding the event information; and calling the interface of the control view according to the forwarded event information. to control container information.
在某些实施方式中,容器信息包括视图的状态信息和属性信息,状态信息包括显示或隐藏,属性信息包括视图尺寸、视图位置和视图颜色中至少一个,根据容器信息控制显示屏显示视图,包括:根据状态信息和属性信息控制显示屏显示视图。In some embodiments, the container information includes status information and attribute information of the view. The status information includes showing or hiding. The attribute information includes at least one of view size, view position and view color. Controlling the display screen to display the view according to the container information includes: : Control the display view based on status information and attribute information.
在某些实施方式中,根据转发的事件信息调用控制视图的接口,以控制容器信息,包括:根据转发的事件信息生成调用信息,并根据调用信息调用控制视图的接口,以控制容器信息。In some embodiments, calling the interface of the control view according to the forwarded event information to control the container information includes: generating the calling information according to the forwarded event information, and calling the interface of the control view according to the calling information to control the container information.
在某些实施方式中,控制方法还包括:处理事件信息以生成的控制信息;根据控制信息控制电子设备执行对应的操作。In some embodiments, the control method further includes: processing event information to generate control information; and controlling the electronic device to perform corresponding operations according to the control information.
在某些实施方式中,控制方法还包括:获取电子设备执行操作后生成的反馈信息;根据反馈信息,控制显示屏的显示内容。In some embodiments, the control method further includes: obtaining feedback information generated after the electronic device performs an operation; and controlling the display content of the display screen based on the feedback information.
在某些实施方式中,控制方法还包括:基于预设的功能映射表,确定事件信息对应的配置文件;根据转发的事件信息调用控制视图的接口,以控制容器信息,包括:根据配置文件调用接口,以控制容器信息;处理事件信息以生成的控制信息,包括:根据配置文件处理事件信息以生成控制信息;根据反馈信息,控制显示屏的显示内容,包括:根据配置文件处理反馈信息,以控制显示内容。In some implementations, the control method also includes: determining the configuration file corresponding to the event information based on a preset function mapping table; calling the interface of the control view according to the forwarded event information to control the container information, including: calling according to the configuration file interface to control container information; process event information to generate control information, including: processing event information according to the configuration file to generate control information; control the display content of the display screen based on feedback information, including: processing feedback information according to the configuration file to Control what is displayed.
在某些实施方式中,电子设备还包括电子元件,电子设备还包括应用处理装置,应用处理装置包括视图模块、数据传输模块和数据处理模块,数据传输模块包括数据分发单元和设备控制单元,事件信息包括初始化信息,初始化信息包括第一初始化信息、第二初始化信息、和第三初始 化信息,控制方法还包括:控制视图模块发送初始化信息到数据分发单元;控制数据分发单元转发第一初始化信息到视图模块以初始化视图模块中的通用容器、转发第二初始化信息到数据处理模块以初始化数据处理模块中的通用功能单元、及转发第三初始化信息到设备控制单元以初始化设备控制单元的通用配置,通用配置包括选择第一框架模块或第二框架模块,第一框架模块包含的代码集合的功能种类和第二框架模块中包含的代码集合的功能种类不同。In some embodiments, the electronic device further includes electronic components, the electronic device further includes an application processing device, the application processing device 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, and the event The information includes initialization information, and the initialization information includes first initialization information, second initialization information, and third initialization information. The control method also includes: controlling the view module to send initialization information to the data distribution unit; controlling the data distribution unit to forward the first initialization information to The view module initializes 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 framework module or a second framework module, and the function type of the code set contained in the first framework module is different from the functional type of the code set included in the second framework module.
在某些实施方式中,控制方法还包括:控制数据处理模块发送模式信息到数据分发单元;控制数据分发单元转发模式信息到视图模块和设备控制单元,以初始化视图模块中与模式信息对应的功能单元,并控制设备控制单元初始化与模式信息对应的电子元件。In some embodiments, the control method further includes: controlling the data processing module to send mode information to the data distribution unit; controlling the data distribution unit to forward the mode information to the view module and the device control unit to initialize functions corresponding to the mode information in the view module unit, and controls the device control unit to initialize the electronic components corresponding to the mode information.
在某些实施方式中,事件信息还包括打开摄像头事件,根据转发的事件信息调用控制视图的接口,以控制容器信息,包括:调用与打开摄像头事件对应的接口,以控制容器信息。In some embodiments, the event information also includes a camera opening event, and calling an interface that controls the view according to the forwarded event information to control the container information includes: calling an interface corresponding to the camera opening event to control the container information.
在某些实施方式中,电子设备还包括一个或多个摄像头,控制方法还包括:处理打开摄像头事件以生成类型信息;根据类型信息控制与类型信息对应的摄像头执行打开操作;接收摄像头执行打开操作后返回的第一反馈信息,第一反馈信息包括摄像头打开失败或摄像头打开成功;根据第一反馈信息控制显示屏显示摄像头打开成功或失败的信息、并确定进入预设业务流程或再次控制与类型信息对应的摄像头执行打开操作。In some embodiments, the electronic device further includes one or more cameras, and the control method further includes: processing a camera opening event to generate type information; controlling the camera corresponding to the type information to perform an opening operation according to the type information; and receiving the camera to perform an opening operation. The first feedback information returned after the first feedback information includes the camera opening failure or the camera opening success; according to the first feedback information, the display screen is controlled to display the camera opening success or failure information, and determines to enter the preset business process or control and type again. The camera corresponding to the information performs the opening operation.
在某些实施方式中,控制方法还包括:在接收到摄像头打开成功之前,控制视图对应的容器不响应输入操作。In some implementations, the control method further includes: controlling the container corresponding to the view not to respond to the input operation before receiving a successful opening of the camera.
在某些实施方式中,控制方法还包括:在接收到摄像头打开成功后,获取预览图像数据;及根据预览图像数据在显示屏的预定区域显示预览图像。In some embodiments, the control method further includes: obtaining preview image data after receiving that the camera is successfully opened; and displaying the preview image in a predetermined area of the display screen according to the preview image data.
本申请的电子设备包括处理器和显示屏,处理器用于根据容器信息控制显示屏显示视图,并发送事件信息;转发事件信息;及根据转发的事件信息调用控制视图的接口,以控制容器信息。The electronic device of this application includes a processor and a display screen. The processor is used to control the display screen display view according to the container information and send event information; forward the event information; and call the interface of the control view according to the forwarded event information to control the container information.
本申请的非易失性计算机可读存储介质包括计算机程序,计算机程序被处理器执行时,使得处理器执行上述任一实施方式的控制方法。The non-volatile computer-readable storage medium of the present application includes a computer program. When the computer program is executed by a processor, it causes the processor to execute the control method of any of the above embodiments.
有鉴于此,请参阅图1,本申请提供一种应用处理装置10,可用于电子设备100,应用处理装置10包括视图模块11、数据传输模块12和数据处理模块13,分别对应MVP架构中的View层、Presenter层和Model层,本申请的应用处理装置10重新对三者的功能进行了划分,其中,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 respectively correspond to the MVP architecture. View layer, Presenter layer and Model layer, the application processing device 10 of this application has re-divided the functions of the three layers, among which,
视图模块11用于根据容器信息控制显示屏40显示视图,并发送事件信息。容器信息为控制显示在电子设备100的显示屏40上的视图的信息(如显示屏40显示的UI),事件信息则可根据电子设备100获取的信息生成,例如,电子设备100接收到对UI的触控操作时,即可生成对应的事件信息,如点击夜景模式UI图标,即可生成打开夜景模式的事件信息。视图模块11用于进行视图显示以及事件信息的分发。The view module 11 is used to control the display screen 40 to display the view according to the container information, and send event information. The container information is information that controls the view displayed on the display screen 40 of the electronic device 100 (such as the UI displayed on the display screen 40), and the event information can be generated according to the information obtained by the electronic device 100. For example, the electronic device 100 receives a response to the UI. When the touch operation is performed, the corresponding event information can be generated. For example, clicking the night scene mode UI icon can generate the event information for turning on the night scene mode. The view module 11 is used for view display and distribution of event information.
数据传输模块12用于接收事件信息并转发事件信息到数据处理模块13。数据传输模块12用于数据(如视图模块11和数据处理模块13之间的事件信息)的转发。数据传输模块12并不会对视图相关的数据进行逻辑处理,数据传输模块12和视图模块11之间不存在耦合,在视图模块11发生变更时,数据传输模块12不需要变更。The data transmission module 12 is used to receive event information and forward the event information 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.
数据处理模块13用于根据事件信息调用视图模块11的接口,以控制容器信息。数据处理模块13可通过事件信息确定需要调用的视图模块11的接口,通过调用接口的形式直接控制容器信息,从而控制视图的显示,无需经过数据传输模块12即可实现视图的显示控制。The data processing module 13 is used to call the interface of the view module 11 according to the event information to control the 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. The display control of the view can be realized without going through the data transmission module 12.
具体地,数据处理模块13还可通过事件信息首先生成调用信息,然后根据调用信息调用的视图模块11(具体为视图模块11的视图管理单元)的接口,数据处理模块13对事件信息先进行解析,以生成调用信息,调用信息包含了具体需要调用的接口的信息,从而根据调用信息快速调用视图模块11的接口。Specifically, the data processing module 13 can also first generate the calling information through the event information, and then according to the interface of the view module 11 (specifically, the view management unit of the view module 11) called by the calling information, the data processing module 13 first parses the event information. , to generate calling information, which contains information about the specific interface that needs to be called, so that the interface of the view module 11 can be quickly called according to the calling information.
其中,接口为一个业务逻辑向外暴露的可用于实现该业务逻辑的入口,通过调用接口,将接口定义的需要输入的参数输入,即可完成接口的调用,接口被调用后即可执行相应的业务逻辑。例如,对于视图模块11的接口A,其用于控制按钮A的显示和隐藏,通过调用接口A,并输入参数:显示或隐藏,即可实现按钮A的显示或隐藏。Among them, the interface is an entrance where the business logic is exposed to the outside and can be used to implement the business logic. By calling the interface and inputting the parameters defined by the interface that need to be entered, the call of the interface can be completed. After the interface is called, the corresponding execution can be performed. Business logic. For example, interface A of the view module 11 is used to control the display and hiding of button A. By calling interface A and inputting parameters: display or hide, button A can be displayed or hidden.
可以理解,调用接口的方式不会导致数据处理模块13和视图模块11发生耦合,因此,在视 图模块11发生变更时,数据处理模块13也不需要变更。It can be understood that the method of calling the interface will not cause the data processing module 13 and the view module 11 to be coupled. Therefore, when the view module 11 changes, the data processing module 13 does not need to be changed.
如此,本申请的应用处理装置10中,将视图模块11、数据传输模块12和数据处理模块13三者分离,对三者中的任意一者的修改均不会影响其他两者,模块化程度较高。In this way, in the application processing device 10 of the present 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. The degree of modularity is higher.
视图模块11包括视图管理单元111和事件分发单元112。分别用于实现视图显示以及事件分发功能。The view module 11 includes a view management unit 111 and an event distribution unit 112. They are used to implement view display and event distribution functions respectively.
视图管理单元111用于根据容器信息控制显示屏40显示视图。可选地,容器信息可包括视图的状态信息和属性信息,状态信息包括显示或隐藏,属性信息包括视图尺寸、视图位置和视图颜色中至少一个。视图模块11的接口均位于视图管理单元111中。The view management unit 111 is used to control the display screen 40 to display views according to the container information. Optionally, the container information may include status information and attribute information of the view. The status information includes showing or hiding, and the attribute information includes at least one of view size, view position, and view color. The interfaces of the view module 11 are all located in the view management unit 111.
例如,显示屏40(图5所示)显示的摄像头视图包括拍摄按钮(用于开始拍摄)、闪光灯按钮(用于打开或关闭闪光灯按钮)、预览图像框(用于在图像框内显示预览图像)和模式切换条(可滑动切换拍摄模式、视频模式、夜景模式、连拍模式等)。拍摄按钮、闪光灯按钮、预览图像框、模式切换条均存在对应的容器,容器位于视图管理单元111,每个容器均暴露有对应的接口,数据处理模块13调用视图模块11的接口即为调用视图管理单元111中的容器的接口,从而控制容器信息。For example, the camera view displayed on the display screen 40 (shown in FIG. 5 ) includes a shooting button (used to start shooting), a flash button (used to turn on or off the flash button), and a preview image frame (used to display a preview image in the image frame). ) and mode switching bar (can slide to switch shooting mode, video mode, night scene mode, continuous shooting mode, etc.). The shooting button, flash button, preview image frame, and mode switching bar all have corresponding containers. The containers are located in the view management unit 111. Each container exposes a corresponding interface. The interface of the data processing module 13 calling the view module 11 is the calling view. The interface of the container in the management unit 111, thereby controlling container information.
视图管理单元111通过控制每个容器的容器信息,即可实现显示屏40视图显示控制。例如,通过设置拍摄按钮的容器的状态信息,可确定显示还是隐藏拍摄按钮,通过设置拍摄按钮的容器的属性信息,可改变拍摄按钮的尺寸、拍摄按钮在显示屏40的位置、拍摄按钮的颜色等。同样地,其他的视图(如闪光灯按钮、预览图像框等)也可以通过控制容器信息实现视图显示控制。The view management unit 111 can control the view display of the display screen 40 by controlling the container information of each container. For example, by setting the status information of the container of the shooting button, it can be determined whether to display or hide the shooting button. By setting the attribute information of the container of the shooting button, the size of the shooting button, the position of the shooting button on the display screen 40, and the color of the shooting button can be changed. wait. Similarly, other views (such as flash buttons, preview image boxes, etc.) can also implement view display control by controlling container information.
事件分发单元112用于获取电子设备100产生的事件信息,并发送事件信息到事件分发单元112。The event distribution unit 112 is used to obtain event information generated by the electronic device 100 and send the event information to the event distribution unit 112 .
电子设备100在运行过程中,会产生各种各样的事件信息,例如事件信息可以是:视图接收到的触控操作后产生;安卓中的Activity生命周期的通知;设备状态信息(如横纵切换、分辨率切换、折叠屏折叠或收起状态)变化后产生;温度信息发生变化产生;接收的框架产生的信息,例如摄像头框架在摄像头开启和关闭后产生的通知信息,谷歌光甲的应用管理服务(Activity Manager Service,AMS)、窗口管理服务(Window Manager Service,WMS)、电量管理服务(Power Manager Service,PMS)的通知。During the operation of the electronic device 100, various event information will be generated. For example, the event information may be: generated after the view receives a touch operation; notifications of the Activity life cycle in Android; device status information (such as horizontal and vertical Switching, resolution switching, folding screen folding or folding state) changes; generated when temperature information changes; information generated by the received frame, such as notification information generated by the camera frame after the camera is turned on and off, the application of Google Light Armor Notifications of management service (Activity Manager Service, AMS), window management service (Window Manager Service, WMS), and power management service (Power Manager Service, PMS).
在电子设备100产生事件信息后,会发送到事件分发单元112,事件分发单元112会将事件信息再进行分发,如分发到事件分发单元112。After the electronic device 100 generates event information, it will be sent to the event distribution unit 112, and the event distribution unit 112 will distribute the event information again, such as to the event distribution unit 112.
数据传输模块12包括数据分发单元121和设备控制单元122。The data transmission module 12 includes a data distribution unit 121 and a device control unit 122.
数据分发单元121用于实现数据的转发。在数据分发单元121接收到事件信息后,将事件信息转发到数据处理模块13,数据处理模块13会对事件信息进行处理,从而生成控制信息,并返回控制信息给数据分发单元121,数据分发单元121可将控制信息转发给设备控制单元122。The data distribution unit 121 is used to implement data forwarding. After the data distribution unit 121 receives the event information, it 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 may forward the control information to the device control unit 122 .
设备控制单元122用于根据控制信息实现电子设备100的硬件设备的控制。例如事件信息为打开摄像头事件,数据处理模块13处理打开相机事件后即可生成对应的控制信息,设备控制单元122根据控制信息控制电子设备100的摄像头执行打开操作;或者例如事件信息为打开闪光灯事件,数据处理模块13处理打开闪光灯事件后即可生成对应的控制信息,设备控制单元122根据控制信息控制电子设备100的闪光灯执行打开操作等。The device control unit 122 is used to control the hardware device of the electronic device 100 according to the control information. For example, the event information is a camera opening event. The data processing module 13 can generate corresponding control information after processing the camera opening event. The device control unit 122 controls the camera of the electronic device 100 to perform an opening operation according to the control information; or for example, the event information is a flash light opening event. , the data processing module 13 can generate corresponding control information after processing the flash light opening event, and the device control unit 122 controls the flash light of the electronic device 100 to perform an opening operation according to the control information.
并接收执行打开摄像头操作后,返回的摄像头打开成功或打开失败的反馈信息,或者返回的包含摄像头采集的图像数据的反馈信息。And receive the feedback information returned after the camera opening operation is successful or failed, or the feedback information returned includes the image data collected by the camera.
设备控制单元122还用于接收电子设备100执行对应操作后返回的反馈信息;并发送反馈信息到数据分发单元121;数据分发单元121转发反馈信息到数据处理模块13;数据处理模块13还用于处理反馈信息,以控制显示屏40的显示内容。The device control unit 122 is also used to receive feedback information returned after the electronic device 100 performs 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 The feedback information is processed to control the display content of the display screen 40 .
在设备控制单元122控制电子设备100执行对应操作后,电子设备100执行操作的电子元件50(如摄像头)的状态会发生改变,如摄像头打开或关闭,摄像头打开后会采集图像数据,设备控制单元122可获取执行操作的电子元件50的反馈信息,例如获取执行打开摄像头操作后,返回的摄像头打开成功或打开失败的反馈信息,或者返回的包含摄像头采集的图像数据的反馈信息。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) of the electronic device 100 that performs the operation will change. For example, the camera is turned on or off. After the camera is turned on, image data will be collected. The device control unit 122 can obtain the feedback information of the electronic component 50 that performs the operation, such as obtaining the returned feedback information of successful or failed opening of the camera after performing the operation of opening the camera, or the returned feedback information including the image data collected by the camera.
设备控制单元122将反馈信息发送给数据分发单元121,数据分发单元121将反馈信息转发 给数据处理模块13进行处理,从而控制显示屏40的显示内容。例如,在反馈信息为摄像头打开失败的情况下,在数据处理模块13控制显示屏40直接显示摄像头打开失败的提示信息。而在反馈信息包括摄像头打开成功,且包含摄像头采集的图像数据时,则可直接根据图像数据显示预览图像。The device control unit 122 sends the feedback information to the data distribution unit 121, and the data distribution unit 121 forwards the feedback information to the data processing module 13 for processing, thereby controlling the display content of the display screen 40. For example, when the feedback information is that the camera fails to open, the data processing module 13 controls the display screen 40 to directly display the prompt information that the camera fails to open. When the feedback information includes that the camera is opened successfully and contains image data collected by the camera, the preview image can be directly displayed based on the image data.
数据处理模块13包括调度单元131和功能单元132。The data processing module 13 includes a scheduling unit 131 and a functional unit 132.
调度单元131用于选取与事件信息匹配的功能单元132。例如,电子设备100预存了不同事件信息和功能单元132的功能映射表,通过查找功能映射表,即可快速查询到事件信息对应的一个或多个功能单元132。再例如,调度单元131处理事件信息后生成调用信息,调用信息包含了与事件信息对应的模式(如图1所示的模式N,N为正整数),然后根据调用信息确定与模式对应的处理进程(如处理进程N),处理进程N运行后即可确定对应的功能单元132。The scheduling unit 131 is used to select the functional unit 132 that matches the event information. For example, the electronic device 100 has pre-stored function mapping tables for 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 queried. For another example, the scheduling unit 131 processes the event information and generates calling information. The calling information includes a pattern corresponding to the event information (pattern N as shown in Figure 1, N is a positive integer), and then determines the processing corresponding to the pattern based on the calling information. Process (such as processing process N), after processing process N is run, the corresponding functional unit 132 can be determined.
功能单元132用于执行具体的业务逻辑。在确定与事件信息对应的功能单元132后,可先获取每个功能单元132预设的配置文件,功能单元132即可根据预设的配置文件执行以下至少一个操作:The functional unit 132 is used to execute specific business logic. After determining the functional unit 132 corresponding to the event information, the preset configuration file of each functional unit 132 can be obtained first, and the functional unit 132 can perform at least one of the following operations according to the preset configuration file:
调用视图管理单元111的接口,以控制容器信息;Call the interface of the view management unit 111 to control container information;
处理事件信息以生成控制信息;和Process event information to generate control information; and
处理反馈信息以控制显示内容。Process feedback information to control display content.
也即是说,功能单元132可以实现视图的显示控制、解析事件信息以生成控制电子设备100的电子元件50的控制信息,以方便设备控制单元122根据控制信息来控制电子设备100的电子元件50执行对应的操作、以及根据电子设备100的电子元件50返回的反馈信息来控制显示内容。That is to say, the functional unit 132 can implement display control of views and parse event information to generate control information for controlling the electronic components 50 of the electronic device 100 , so as to facilitate the device control unit 122 to control the electronic components 50 of the electronic device 100 according to the control information. Corresponding operations are performed, and the display content is controlled according to feedback information returned by the electronic component 50 of the electronic device 100 .
通过功能单元132将数据处理模块13的业务逻辑实现分割,通过调度单元131实现调度,从而实现功能的模块化开发,例如不同的拍摄模式均存在对应的功能单元132,功能单元132包括多个,每个功能单元132至少包括一个预设的配置文件,以用于执行功能单元132对应的业务逻辑。每个拍摄模式则对应至少一个功能单元132。The business logic of the data processing module 13 is divided through the functional unit 132, and scheduling is implemented through the scheduling unit 131, thereby realizing modular development of functions. For example, different shooting modes have corresponding functional units 132, and the functional unit 132 includes multiple, 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.
如基础拍摄模式存在基础功能单元132、夜景拍摄模式存在夜景功能单元132、脚架模式存在脚架功能单元132,在进行新功能的开发时,可再次创建新的功能单元132,而不会影响已存在的功能单元132。而且,调度单元131通过调度还可以实现多个功能的组合以形成新的功能,如拍摄模式为夜景脚架模式时,即同时调用夜景功能单元132和脚架功能单元132。For example, there is a basic functional unit 132 in the basic shooting mode, a night scene functional unit 132 in the night scene shooting mode, and a tripod functional unit 132 in the tripod mode. When developing new functions, a new functional unit 132 can be created again without affecting the Existing functional unit 132. Moreover, the scheduling unit 131 can also realize the combination of multiple functions to form new functions through scheduling. For example, when the shooting mode is the night scene tripod mode, the night scene function unit 132 and the tripod function unit 132 are called at the same time.
可以理解,上述应用处理装置10不仅能够实现相机应用的控制,还能够实现其他应用如地图应用、聊天软件等,在此不作限制。下面通过多个例子,说明上述应用处理装置10实现电子设备100的相机应用的控制过程。It can be understood that the above-mentioned application processing device 10 can not only realize the control of camera applications, but also can realize other applications such as map applications, chat software, etc., which are not limited here. The following describes the control process of the camera application of the electronic device 100 by the application processing device 10 through multiple examples.
请参阅图2,在相机打开或者相机切换拍摄模式时,相机需要先进行初始化,相机的初始化流程如下:Please refer to Figure 2. When the camera is turned on or the camera switches shooting modes, the camera needs to be initialized first. The camera initialization process is as follows:
事件分发单元112首先接收到进行初始化的事件信息,事件信息中包含了初始化信息,通过初始化信息来对应用处理装置10以及电子设备100的相关电子元件50进行初始化。初始化信息可包括第一初始化信息、第二初始化信息、和第三初始化信息。The event distribution unit 112 first receives event information for initialization. The event information includes initialization information, and initializes the application processing device 10 and related electronic components 50 of the electronic device 100 through the initialization information. The initialization information may include first initialization information, second initialization information, and third initialization information.
事件分发单元112用于发送初始化信息到数据分发单元121(如图2中的箭头1),然后由数据分发单元121转发第一初始化信息到视图管理单元111以初始化视图管理单元111的通用容器(如图2中的箭头2)、转发第二初始化信息到数据处理模块13以初始化数据处理模块13中的通用的功能单元132(如图2中的箭头3和箭头4)、及转发第三初始化信息到设备控制单元122以初始化设备控制单元122的通用配置(如图2中的箭头5和箭头6)。The event distribution unit 112 is used to send initialization information to the data distribution unit 121 (arrow 1 in Figure 2), 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 ( (arrow 2 in Figure 2), forwarding the second initialization information to the data processing module 13 to initialize the general functional unit 132 in the data processing module 13 (arrow 3 and arrow 4 in Figure 2), and forwarding the third initialization information to the device control unit 122 to initialize the general configuration of the device control unit 122 ( arrows 5 and 6 in Figure 2).
其中,第一初始化信息可用于一些通用容器的容器信息的初始化,通用容器指的是对于相机所有拍摄模式都必须用到的容器,如对于相机而言,不管哪个拍摄模式,均存在拍摄按钮和预览图像框,即拍摄按钮和预览图像框对应的容器均为通用容器。在初始化时,视图管理单元111根据第一初始化信息将通用容器的容器信息重新进行设置,以恢复成预设的容器信息,从而完成初始化。Among them, the first initialization information can be used to initialize the container information of some general containers. The general container refers to the container that must be used for all shooting modes of the camera. For example, for the camera, no matter which shooting mode, there are shooting buttons and The preview image box, that is, the containers corresponding to the shooting button and the preview image box are all universal containers. During initialization, the view management unit 111 resets the container information of the general container according to the first initialization information to restore the default container information, thereby completing the initialization.
第二初始化信息可用于通用功能单元132的初始化,通用的功能单元132可以是所有拍摄模式都会用到的功能单元132,如倒计时拍摄功能、慢动作拍摄功能等;功能单元132在运行业务 逻辑后,其对应的配置文件可能内部的参数发生了改变,在进行初始化时,需要通过第二初始化信息将功能单元132的配置文件中的参数进行设置,以恢复成预设的参数。The second initialization information can be used to initialize the general functional unit 132. The general functional unit 132 can be the functional unit 132 used in all shooting modes, such as countdown shooting function, slow motion shooting function, etc.; after running the business logic, the functional unit 132 , the internal parameters of the corresponding configuration file may have changed. During initialization, the parameters in the configuration file of the functional unit 132 need to be set through the second initialization information to restore the preset parameters.
第三初始化信息可用于设备控制单元122的通用配置的初始化,使得设备控制单元122能够选择合适的应用处理装置10的框架模块14,例如框架模块14包括第一框架模块141或第二框架模块142,第一框架模块141包含的代码集合的功能种类和第二框架模块142中包含的代码集合的功能种类不同,如第一框架模块141可以是谷歌框架,其包含了相机大部分功能的具体实现的代码集合,但对于电子设备100而言,还存在一些个性化的功能,根据电子设备100的硬件情况不同而不同,因此,则需要设置第二功能模块,以实现第一框架模块141实现不了或者实现起来较难的功能,如相机的防抖功能的具体实现的代码集合,根据不同的功能单元132,即可确定对应的功能的代码集合,从而在初始化时就设置好设备控制单元122进行电子设备100的控制所需的框架模块14。The third initialization information may be used to initialize the general configuration of the device control unit 122 so that the device control unit 122 can select a suitable framework module 14 of the application processing device 10 , for example, the framework module 14 includes the first framework module 141 or the second framework module 142 , the functional types of the code collection contained in the first framework module 141 are different from the functional types of the code collection contained in the second framework module 142. For example, the first framework module 141 can be a Google framework, which contains the specific implementation of most functions of the camera. However, for the electronic device 100, there are also some personalized functions, which vary according to the hardware conditions of the electronic device 100. Therefore, a second functional module needs to be set up to achieve what the first framework module 141 cannot. Or for functions that are difficult to implement, such as the code set for the specific implementation of the camera's anti-shake function, the code set for the corresponding function can be determined according to different functional units 132, so that the device control unit 122 is set during initialization. The frame module 14 is required for the control of the electronic device 100 .
在进行通用的一些容器和功能单元132的初始化后,还可根据当前拍摄模式来进行初始化。数据处理模块13能够获取到当前的模式信息,数据处理模块13发送模式信息到数据分发单元121(如图2中的箭头3),数据分发单元121转发模式信息到视图管理单元111和设备控制单元122(如图2中的箭头2和箭头5),以初始化视图管理单元111中与模式信息对应的功能单元132。设备控制单元122根据模式信息初始化与模式信息对应的电子元件50(如图2中的箭头6)。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. The data processing module 13 sends the mode information to the data distribution unit 121 (arrow 3 in Figure 2). The data distribution unit 121 forwards the mode information to the view management unit 111 and the device control unit. 122 (arrow 2 and arrow 5 in Figure 2) to initialize the functional unit 132 corresponding to the mode information in the view management unit 111. The device control unit 122 initializes the electronic component 50 corresponding to the mode information according to the mode information (arrow 6 in FIG. 2 ).
不同的拍摄模式对应的容器、功能单元132、和/或用到的电子元件50是存在差异的。例如全景拍摄模式和夜景拍摄模式,两者对应的容器和功能单元132是不同的;再例如,前置拍摄模式和后置拍摄模式,两者对应的容器、功能单元132和电子元件50均是不同的。There are differences in the containers, functional units 132, and/or electronic components 50 used in different shooting modes. For example, in the panoramic shooting mode and the night scene shooting mode, the containers and functional units 132 corresponding to the two are different; as another example, in the front shooting mode and the rear shooting mode, the containers, functional units 132 and electronic components 50 corresponding to both are the same. different.
因此,在初始化通用的容器和功能单元132后,对与模式信息对应的容器、功能单元132和电子元件50也进行初始化,仅需初始化当前拍摄模式所需的容器、功能单元132和电子元件50即可,初始化内容较少,可提高初始化效率。Therefore, after the general container and functional unit 132 are initialized, the container, functional unit 132 and electronic component 50 corresponding to the mode information are also initialized, and only the container, functional unit 132 and electronic component 50 required for the current shooting mode are initialized. That’s it, the initialization content is less, which can improve the initialization efficiency.
请继续参阅图2,在完成初始化后,即可进入打开相机流程,打开相机流程如下:Please continue to refer to Figure 2. After the initialization is completed, you can enter the process of opening the camera. The process of opening the camera is as follows:
1、根据打开相机事件控制视图的显示。1. Control the display of the view based on the camera opening event.
事件信息还包括打开摄像头事件,事件分发单元112将打开摄像头事件发送到数据分发单元121(如图2中的箭头1),数据分发单元121转发打开摄像头事件到数据处理模块13(如图2中的箭头3),调度单元131用于基于功能映射表,确定打开摄像头事件对应的功能单元132(如图2中的箭头4),打开摄像头事件对应的功能单元132用于基于配置文件,调用与打开摄像头事件对应的视图管理单元111的接口,以控制容器信息。如此,通过与事件信息对应的功能单元132单元来控制容器信息,即可实现视图的显示控制。The event information also includes the event of opening the camera. The event distribution unit 112 sends the event of opening the camera to the data distribution unit 121 (arrow 1 in Figure 2). The data distribution unit 121 forwards the event of opening the camera to the data processing module 13 (as shown in Figure 2). Arrow 3), the scheduling unit 131 is used to determine the functional unit 132 corresponding to the open camera event based on the function mapping table (arrow 4 in Figure 2), and the functional unit 132 corresponding to the open camera event is used to call based on the configuration file. Open the interface of the view management unit 111 corresponding to the camera event to control container information. In this way, the display control of the view can be realized by controlling the container information through the functional unit 132 unit corresponding to the event information.
例如,当前拍摄模式为全景拍摄模式时,打开相机事件对应的功能单元132即包括通用的功能单元132和全景拍摄模式对应的功能单元132,从而通过控制容器信息,控制显示屏40显示全景拍摄所需的视图。For example, when the current shooting mode is the panoramic shooting mode, opening the functional unit 132 corresponding to the camera event includes a general functional unit 132 and a functional unit 132 corresponding to the panoramic shooting mode, thereby controlling the container information to control the display screen 40 to display the panoramic shooting location. required view.
2、根据打开相机事件控制摄像头打开。2. Control the opening of the camera according to the opening camera event.
电子设备100还包括一个或多个摄像头,调度单元131还用于处理打开摄像头事件以生成类型信息,并发送类型信息到数据分发单元121(如图2中的箭头3),数据分发单元121转发类型信息到设备控制单元122(如图2中的箭头5),以控制与类型信息对应的摄像头执行打开操作(如图2中的箭头6),例如,类型信息包括打开的摄像头的类型,摄像头的类型包括前置摄像头、后置摄像头、广角摄像头、长焦摄像头等中的至少一个,如当前拍摄模式为前置人像拍摄模式时,会打开前置的广角摄像头;当前拍摄模式为后置全景模式时,会打开后置长焦摄像头。The electronic device 100 also includes one or more cameras. The scheduling unit 131 is also used to process the camera opening event to generate type information, and send the type information to the data distribution unit 121 (arrow 3 in Figure 2). The data distribution unit 121 forwards The type information is sent to the device control unit 122 (arrow 5 in Figure 2) to control the camera corresponding to the type information to perform an opening operation (arrow 6 in Figure 2). For example, the type information includes the type of the camera that is opened, the camera The type includes at least one of front camera, rear camera, wide-angle camera, telephoto camera, etc. If the current shooting mode is front portrait shooting mode, the front wide-angle camera will be turned on; the current shooting mode is rear panorama mode, the rear telephoto camera will be turned on.
可以理解,根据打开相机事件控制摄像头打开和根据打开相机事件控制视图的显示可以同步进行,也可以先根据打开相机事件控制摄像头打开,再根据打开相机事件控制视图的显示,在此不作限制。本申请实施方式中,通过据打开相机事件控制摄像头打开和根据打开相机事件控制视图的显示同步进行,以提高相机应用的运行速度。It can be understood that controlling the opening of the camera according to the opening camera event and controlling the display of the view according to the opening camera event can be performed simultaneously, or the opening of the camera can be controlled first according to the opening camera event, and then the display of the view can be controlled according to the opening camera event. This is not limited here. In the embodiment of the present application, the opening of the camera is controlled based on the camera opening event and the display of the view is controlled synchronously according to the camera opening event, so as to improve the running speed of the camera application.
3、获取摄像头返回的反馈信息。3. Obtain the feedback information returned by the camera.
在执行完打开操作后,设备控制单元122接收摄像头返回的第一反馈信息(如图2中的箭头6),第一反馈信息包括摄像头打开失败或摄像头打开成功;设备控制单元122发送第一反馈信 息到数据分发单元121(如图2中的箭头4),数据分发单元121转发第一反馈信息到视图管理单元111和调度单元131(如图2中的箭头2和3),视图管理单元111根据第一反馈信息控制显示屏40显示摄像头打开成功或失败的信息;调度单元131根据第一反馈信息确定进入预设业务流程或再次发送类型信息到数据分发单元121,以控制与类型信息对应的摄像头再次执行打开操作。After completing the opening operation, the device control unit 122 receives the first feedback information returned by the camera (arrow 6 in Figure 2). The first feedback information includes failure to open the camera or successful opening of the camera; the device control unit 122 sends the first feedback information to the data distribution unit 121 (arrow 4 in Figure 2), the data distribution unit 121 forwards the first feedback information to the view management unit 111 and the scheduling unit 131 ( arrows 2 and 3 in Figure 2), the view management unit 111 The display screen 40 is controlled to display information on the success or failure of camera opening according to the first feedback information; the scheduling unit 131 determines to enter the preset business process according to the first feedback information or sends the type information to the data distribution unit 121 again to control the type information corresponding to the type information. The camera performs the opening operation again.
例如,在第一反馈信息包括摄像头打开失败的情况下,显示屏40显示摄像头打开失败,电子设备100再次控制摄像头执行打开操作,若此时的第一反馈信息仍为摄像头打开失败,则显示屏40显示摄像头异常的信息,以提示用户对摄像头进行维修。在第一反馈信息包括摄像头打开成功的情况下,显示屏40可显示摄像头打开成功的信息,并进入后续预设的业务流程,如在打开相机成功后一般会显示预览图像。For example, when the first feedback information includes a failure to open the camera, the display screen 40 displays a failure to open the camera, and the electronic device 100 controls the camera again to perform the opening operation. If the first feedback information at this time still indicates a failure to open the camera, the display screen 40 displays the failure to open the camera. 40 displays camera abnormality information to prompt the user to repair the camera. In the case where the first feedback information includes that the camera is opened successfully, the display screen 40 may display the information that the camera is opened successfully, and enter the subsequent preset business process. For example, after the camera is opened successfully, a preview image will generally be displayed.
可选地,在视图管理单元111接收到打开摄像头成功的信息前,可控制显示屏40显示的视图对应的容器不响应输入操作。Optionally, before the view management unit 111 receives information that the camera is successfully turned on, the container corresponding to the view displayed on the display screen 40 may be controlled not to respond to the input operation.
可以理解,显示屏40的视图显示一般较快,但由于摄像头未打开成功,显示屏40中的视图的功能实际上是不可用的,此时若接收到用户的输入操作,则可能产生新的事件信息,从而影响打开相机流程或初始化流程,因此,在摄像头打开成功之前,控制视图对应的容器均不响应输入操作,从而保证流程正常运行。It can be understood that the view display on the display screen 40 is generally faster, but because the camera has not been opened successfully, the function of the view on the display screen 40 is actually unavailable. At this time, if the user's input operation is received, a new view may be generated. Event information, thus affecting the process of opening the camera or the process of initialization. Therefore, until the camera is opened successfully, the container corresponding to the control view will not respond to the input operation, thus ensuring the normal operation of the process.
请再次参阅图2,在完成打开相机流程后,即可进入显示预览图像的流程,显示预览图像的流程如下:Please refer to Figure 2 again. After completing the process of opening the camera, you can enter the process of displaying the preview image. The process of displaying the preview image is as follows:
在调度单元131接收到打开摄像头成功(如图2中的箭头3)后,会先创建会话,会话用于存储预览图像数据;在视图管理单元111接收到打开摄像头成功(如图2中的箭头2)后,确定显示屏40的预定区域为预览区域,预览区域显示的图像可根据会话中图像数据确定;设备控制单元122还接收摄像头返回的第二反馈信息并发送到数据分发单元121(如图2中的箭头6和箭头5),数据分发单元121将第二反馈信息转发到调度单元131(如图2中的箭头3),第二反馈信息包括预览图像数据,预览图像数据存储在会话,调度单元131根据预览图像数据在预览区域显示预览图像。After the scheduling unit 131 receives the success of opening the camera (arrow 3 in Figure 2), it will first create a session, which is used to store preview image data; the view management unit 111 receives the success of opening the camera (arrow 3 in Figure 2) 2), the predetermined area of the display screen 40 is determined to be 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 (such as Arrows 6 and 5 in Figure 2), the data distribution unit 121 forwards the second feedback information to the scheduling unit 131 (arrow 3 in Figure 2), the second feedback information includes preview image data, and the preview image data is stored in the session , the scheduling unit 131 displays the preview image in the preview area according to the preview image data.
可选地,功能单元132可对预览图像进行处理,将处理后的预览图像数据再存储到会话中。如用户选择不同的滤镜,从而根据滤镜对应的功能单元132对预览图像数据进行滤镜处理,从而将经过滤镜处理后的预览图像数据存储到会话,调度单元131根据滤镜处理后的预览图像数据在预览区域进行显示,从而显示具有滤镜效果的预览图像。Optionally, the functional unit 132 may process the preview image and store the processed preview image data into the session. If the user selects different filters, the preview image data is filtered according to the functional unit 132 corresponding to the filter, and the filter-processed preview image data is stored in the session. The scheduling unit 131 performs filter processing on the preview image data according to the filter-processed preview image data. The preview image data is displayed in the preview area, thereby displaying a preview image with a filter effect.
请参阅图3,应用处理装置10还包括工具模块15,工具模块15包括视图模块11、数据传输模块12和/或数据处理模块13用于解析事件信息的代码集合。Referring to FIG. 3 , the application processing device 10 further includes a tool module 15 . The tool module 15 includes a view module 11 , a data transmission module 12 and/or a code set used by the data processing module 13 to parse event information.
可以理解,视图模块11、数据传输模块12和数据处理模块13均需要解析事件信息,以获取事件信息相关的信息,通过设置工具模块,并将视图模块11、数据传输模块12和数据处理模块13解析事件信息所需的代码集合均封装到工具模块中,在视图模块11、数据传输模块12和数据处理模块13进行解析时,通过调用工具模块暴露的接口即可,且三者通用的接口可以实现复用,从而降低视图模块11、数据传输模块12和数据处理模块13的代码量的同时,降低整体的代码量。It can be understood that the view module 11, the data transmission module 12 and the data processing module 13 all need to parse the event information to obtain information related to the event information. By setting the tool module, the view module 11, the data transmission module 12 and the data processing module 13 The code set required to parse event information is encapsulated into the tool module. When the view module 11, data transmission module 12 and data processing module 13 perform parsing, it is enough to call the interface exposed by the tool module, and the interface common to the three can Reuse is achieved, thereby reducing the code amount of the view module 11, the data transmission module 12 and the data processing module 13, and at the same time reducing the overall code amount.
另外,工具模块15还可包括更多功能的代码集合,如功能单元132的业务逻辑的代码可封装到工具模块15,在使用时功能单元132调用工具模块15的接口即可。In addition, the tool module 15 can also include a code set with more functions. For example, the business logic code of the functional unit 132 can be encapsulated into the tool module 15, and the functional unit 132 can call the interface of the tool module 15 during use.
请参阅图4和图5,本申请实施方式提供一种控制方法。该控制方法包括步骤:Referring to Figures 4 and 5, an embodiment of the present application provides a control method. The control method includes steps:
011:根据容器信息控制显示屏40显示视图,并发送事件信息;011: Control the display screen 40 to display the view according to the container information, and send event information;
012:转发事件信息;及012: Forward event information; and
013:根据转发的事件信息调用控制视图的接口,以控制容器信息。013: Call the interface of the control view based on the forwarded event information to control the container information.
其中,步骤011的具体描述请参阅视图模块11的描述,步骤012的具体描述请参阅数据传输模块12的描述,步骤013的具体描述请参阅数据处理模块13的描述,在此不再赘述。For the specific description of step 011, please refer to the description of the view module 11. For the specific description of step 012, please refer to the description of the data transmission module 12. For the specific description of step 013, please refer to the description of the data processing module 13, which will not be repeated here.
请参阅图6,在某些实施方式中,容器信息包括视图的状态信息和属性信息,状态信息包括显示或隐藏,属性信息包括视图尺寸、视图位置和视图颜色中至少一个,步骤011包括:Please refer to Figure 6. In some embodiments, the container information includes status information and attribute information of the view. The status information includes showing or hiding, and the attribute information includes at least one of view size, view position and view color. Step 011 includes:
步骤0111:根据状态信息和属性信息控制显示屏40显示视图。Step 0111: Control the display screen 40 to display the view according to the status information and attribute information.
其中,步骤011的具体描述请参阅视图管理单元111的描述,在此不再赘述。For the specific description of step 011, please refer to the description of the view management unit 111, which will not be described again here.
在某些实施方式中,步骤013包括:In some embodiments, step 013 includes:
步骤0131:根据转发的事件信息生成调用信息,并根据调用信息调用控制视图的接口,以控制容器信息。Step 0131: Generate calling information based on the forwarded event information, and call the interface of the control view based on the calling information to control the container information.
步骤0131的具体描述请参阅数据处理模块13的描述,在此不再赘述。Please refer to the description of the data processing module 13 for the specific description of step 0131, which will not be described again here.
请参阅图7,在某些实施方式中,控制方法还包括步骤:Referring to Figure 7, in some embodiments, the control method further includes the steps:
014:处理事件信息以生成的控制信息;014: Process event information to generate control information;
015:根据控制信息控制电子设备100执行对应的操作。015: Control the electronic device 100 to perform corresponding operations according to the control information.
步骤014和步骤015的具体描述请分别参阅数据处理模块13和设备控制单元122的描述,在此不再赘述。For specific descriptions of step 014 and step 015, please refer to the descriptions of the data processing module 13 and the device control unit 122 respectively, and will not be described again here.
在某些实施方式中,控制方法还包括步骤:In some embodiments, the control method further includes the steps of:
016:获取电子设备100执行操作后生成的反馈信息;016: Obtain feedback information generated after the electronic device 100 performs an operation;
017:根据反馈信息,控制显示屏40的显示内容。017: Control the display content of the display screen 40 based on the feedback information.
步骤016和步骤017的具体描述请分别参阅设备控制单元122和数据处理模块13的描述,在此不再赘述。For specific descriptions of step 016 and step 017, please refer to the descriptions of the device control unit 122 and the data processing module 13 respectively, and will not be described again here.
请参阅图8,在某些实施方式中,控制方法还包括步骤:Referring to Figure 8, in some embodiments, the control method further includes the steps:
018:基于预设的功能映射表,确定事件信息对应的配置文件;018: Based on the preset function mapping table, determine the configuration file corresponding to the event information;
步骤0131包括: Step 0131 includes:
01311:根据配置文件调用接口,以控制容器信息;01311: Call the interface according to the configuration file to control container information;
步骤014包括:Step 014 includes:
步骤0141:根据配置文件处理事件信息以生成控制信息;Step 0141: Process event information according to the configuration file to generate control information;
步骤017包括:Step 017 includes:
0171:根据配置文件处理反馈信息,以控制显示内容。0171: Process feedback information according to the configuration file to control the display content.
步骤018的具体描述请参阅调度单元131的描述,步骤01311、步骤0141和步骤0171的具体描述请参阅功能单元132的描述,在此不再赘述。For the specific description of step 018, please refer to the description of the scheduling unit 131. For the specific description of step 01311, step 0141 and step 0171, please refer to the description of the functional unit 132, which will not be described again here.
请参阅图9,在某些实施方式中,事件信息包括初始化信息,控制方法还包括:Refer to Figure 9. In some implementations, the event information includes initialization information, and the control method also includes:
019:控制视图模块11发送初始化信息到数据分发单元121;019: The control view module 11 sends initialization information to the data distribution unit 121;
020:控制数据分发单元121转发第一初始化信息到视图模块11以初始化视图模块11中的通用容器、转发第二初始化信息到数据处理模块13以初始化数据处理模块13中的通用功能单元132、及转发第三初始化信息到设备控制单元122以初始化设备控制单元122的通用配置,通用配置包括选择第一框架模块141或第二框架模块142,第一框架模块141包含的代码集合的功能种类和第二框架模块142中包含的代码集合的功能种类不同。020: Control the data distribution unit 121 to forward the first initialization information to the view module 11 to initialize the general container in the view module 11, forward the second initialization information to the data processing module 13 to initialize the general functional unit 132 in the data processing module 13, and Forward the third initialization information to the device control unit 122 to initialize the general configuration of the device control unit 122. The general configuration includes selecting the first framework module 141 or the second framework module 142, the function type of the code set included in the first framework module 141 and the The code sets included in the two framework modules 142 have different functional types.
步骤019和步骤020的具体描述请分别上述初始化流程的描述,在此不再赘述。For specific descriptions of step 019 and step 020, please refer to the description of the above initialization process respectively, and will not be repeated here.
在某些实施方式中,控制方法还包括:In some embodiments, the control method further includes:
021:控制数据处理模块13发送模式信息到数据分发单元121;021: Control the data processing module 13 to send mode information to the data distribution unit 121;
022:控制数据分发单元121转发模式信息到视图模块11和设备控制单元122,以初始化视图模块11中与模式信息对应的功能单元132,并控制设备控制单元122初始化与模式信息对应的电子元件50。022: Control the data distribution unit 121 to forward the mode information to the view module 11 and the device control unit 122 to initialize the functional unit 132 corresponding to the mode information in the view module 11, and control the device control unit 122 to initialize the electronic component 50 corresponding to the mode information. .
步骤021和步骤022的具体描述请分别上述初始化流程的描述,在此不再赘述。For specific descriptions of step 021 and step 022, please refer to the description of the above initialization process respectively, and will not be repeated here.
请参阅图10,在某些实施方式中,事件信息还包括打开摄像头事件,步骤013还包括:Please refer to Figure 10. In some embodiments, the event information also includes a camera opening event, and step 013 also includes:
0132:调用与打开摄像头事件对应的接口,以控制容器信息。0132: Call the interface corresponding to the camera opening event to control container information.
步骤0132的具体描述请分别上述打开相机流程的描述,在此不再赘述。For a detailed description of step 0132, please refer to the description of the process of opening the camera above, and will not be repeated here.
请参阅图11,在某些实施方式中,电子设备100还包括一个或多个摄像头,控制方法还包括:Referring to Figure 11, in some embodiments, the electronic device 100 further includes one or more cameras, and the control method further includes:
023:处理打开摄像头事件以生成类型信息;023: Process the open camera event to generate type information;
024:根据类型信息控制与类型信息对应的摄像头执行打开操作;024: Control the opening operation of the camera corresponding to the type information according to the type information;
025:接收摄像头执行打开操作后返回的第一反馈信息,第一反馈信息包括摄像头打开失败或摄像头打开成功;025: Receive the first feedback information returned after the camera performs the opening operation. The first feedback information includes failure to open the camera or successful opening of the camera;
026:根据第一反馈信息控制显示屏40显示摄像头打开成功或失败的信息、并确定进入预设业务流程或再次控制与类型信息对应的摄像头执行打开操作。026: According to the first feedback information, control the display screen 40 to display the information of success or failure of camera opening, and determine to enter the preset business process or control the camera corresponding to the type information again to perform the opening operation.
步骤023至步骤026的具体描述请参阅上述打开相机流程的描述,在此不再赘述。For specific descriptions of steps 023 to 026, please refer to the description of the process of opening the camera above, and will not be repeated here.
在某些实施方式中,控制方法还包括:In some embodiments, the control method further includes:
027:在接收到摄像头打开成功之前,控制视图对应的容器不响应输入操作。027: Before receiving the successful opening of the camera, the container corresponding to the control view does not respond to the input operation.
步骤027的具体描述请参阅上述打开相机流程的描述,在此不再赘述。For the specific description of step 027, please refer to the description of the process of opening the camera above, and will not be repeated here.
在某些实施方式中,控制方法还包括:In some embodiments, the control method further includes:
步骤028:在接收到摄像头打开成功后,获取预览图像数据;及Step 028: After receiving the successful opening of the camera, obtain the preview image data; and
步骤029:根据预览图像数据在显示屏40的预定区域显示预览图像。Step 029: Display the preview image in a predetermined area of the display screen 40 according to the preview image data.
步骤028和步骤029的具体描述请参阅上述显示预览图像流程的描述,在此不再赘述。For specific descriptions of step 028 and step 029, please refer to the description of the process of displaying the preview image above, and will not be described again here.
上述所有的技术方案,可以采用任意结合形成本申请的可选实施例,在此不再一一赘述。All the above technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described again one by one.
请再次参阅图5,本申请实施方式还提供一种电子设备100。电子设备100包括处理器20。本申请实施方式的控制方法可应用于电子设备100。处理器20用于执行步骤011、步骤012和步骤013。即,处理器20用于根据容器信息控制显示屏40显示视图,并发送事件信息;转发事件信息;及根据转发的事件信息调用控制视图的接口,以控制容器信息。处理器还可执行前述控制方法中的任一实施例。Please refer to Figure 5 again. An embodiment of the present application also provides an electronic device 100. Electronic device 100 includes processor 20 . The control method of the embodiment of the present application can be applied to the electronic device 100 . The processor 20 is used to execute step 011, step 012 and step 013. That is, the processor 20 is used to control the display screen 40 to display the view according to the container information, and send event information; forward the event information; and call the interface for controlling the view according to the forwarded event information to control the container information. The processor may also execute any embodiment of the foregoing control methods.
其中,电子设备100包括有壳体30。电子设备100可以是手机、平板电脑、显示设备、笔记本电脑、柜员机、闸机、智能手表、头显设备、游戏机等。如图3所示,本申请实施方式以电子设备100是手机为例进行说明,可以理解,电子设备100的具体形式并不限于手机。壳体30还可用于安装电子设备100的显示装置、成像装置、供电装置、通信装置等功能模块,以使壳体30为功能模块提供防尘、防摔、防水等保护。Wherein, the electronic device 100 includes a housing 30 . The electronic device 100 may be a mobile phone, a tablet computer, a display device, a laptop computer, a teller machine, a gate, a smart watch, a head-mounted display device, a game console, etc. As shown in FIG. 3 , the embodiment of the present application is explained by taking 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 casing 30 can also be used to install functional modules such as a display device, imaging device, power supply device, and communication device of the electronic device 100, so that the casing 30 can provide dustproof, anti-fall, waterproof and other protection for the functional modules.
请参阅图12,本申请实施方式还提供一种包含计算机程序201的非易失性计算机可读存储介质200。当计算机程序201被一个或多个处理器20执行时,使得一个或多个处理器20执行上述任一实施方式的控制方法。Referring to Figure 12, an embodiment of the present 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 are caused to execute the control method of any of the above embodiments.
在本说明书的描述中,参考术语“某些实施方式”、“一个例子中”、“示例地”等的描述意指结合实施方式或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施方式或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施方式或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施方式或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, reference to the terms "certain embodiments," "in an example," "exemplarily," etc., means that a specific feature, structure, material, or characteristic described in connection with the embodiment or example is included herein. In at least one embodiment or example. In this specification, schematic representations 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 any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine different embodiments or examples and features of different embodiments or examples described in this specification unless they are inconsistent with each other.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method descriptions in flowcharts or otherwise described herein may be understood to represent modules, segments, or portions of code that include one or more executable instructions for implementing the specified logical functions or steps of the process. , and the scope of the preferred embodiments of the present application includes additional implementations in which functions may be performed out of the order shown or discussed, including in a substantially simultaneous manner or in the reverse order, depending on the functionality involved, which shall It should be understood by those skilled in the technical field to which the embodiments of this application belong.
尽管上面已经示出和描述了本申请的实施方式,可以理解的是,上述实施方式是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施方式进行变化、修改、替换和变型。Although the embodiments of the present application have been shown and described above, it can be understood that the above-mentioned embodiments are exemplary and cannot be construed as limitations of the present application. Those of ordinary skill in the art can make modifications to the above-mentioned embodiments within the scope of the present application. The embodiments are subject to changes, modifications, substitutions and variations.

Claims (28)

  1. 一种应用处理装置,其中,用于电子设备,所述电子设备包括显示屏,所述应用处理装置包括视图模块、数据传输模块和数据处理模块;An application processing device, which is used in an electronic device, the electronic device includes a display screen, and the application processing device includes a view module, a data transmission module and a data processing module;
    所述视图模块用于根据容器信息控制所述显示屏显示视图,并发送事件信息;The view module is used to control the display screen to display the view according to the container information, and 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 configured to call the interface of the view module according to the event information to control the container information.
  2. 根据权利要求1所述的应用处理装置,其中,所述视图模块包括视图管理单元和事件分发单元,所述视图管理单元用于根据所述容器信息控制所述显示屏显示视图,所述容器信息包括视图的状态信息和属性信息,所述状态信息包括显示或隐藏,所述属性信息包括视图尺寸、视图位置和视图颜色中至少一个,所述事件分发单元用于获取所述电子设备产生的所述事件信息,并发送所述事件信息到所述事件分发单元。The application processing device according to claim 1, wherein the view module includes a view management unit and an event distribution unit, the view management unit is used to control the display screen display view according to the container information, the container information Including state information and attribute information of the view, the state information includes display 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 all the information generated by the electronic device. event information and send the event information to the event distribution unit.
  3. 根据权利要求2所述的应用处理装置,其中,所述数据处理模块还用于根据所述事件信息生成调用信息,并根据所述调用信息调用所述视图管理单元的接口,以控制所述容器信息。The application processing device according to claim 2, wherein the data processing module is further configured to generate calling information according to the event information, and call an interface of the view management unit according to the calling information to control the container information.
  4. 根据权利要求2所述的应用处理装置,其中,所述数据传输模块包括数据分发单元和设备控制单元,所述数据分发单元用于转发所述事件信息到所述数据处理模块、接收所述数据处理模块处理所述事件信息后生成的控制信息、及转发所述控制信息到所述设备控制单元,所述设备控制单元用于根据所述控制信息控制所述电子设备执行对应的操作。The application processing device according to claim 2, wherein 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 the data The processing module processes the control information generated after processing the event information, and forwards 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.
  5. 根据权利要求4所述的应用处理装置,其中,所述设备控制单元还用于接收所述电子设备执行所述操作后返回的反馈信息;并发送所述反馈信息到所述数据分发单元;所述数据分发单元转发所述反馈信息到所述数据处理模块;所述数据处理模块还用于处理所述反馈信息,以控制所述显示屏的显示内容。The application processing device according to claim 4, wherein the device control unit is further 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 used to process the feedback information to control the display content of the display screen.
  6. 根据权利要求5所述的应用处理装置,其中,所述数据处理模块包括调度单元和功能单元,所述调度单元用于基于预设的功能映射表,确定所述事件信息对应的功能单元,所述功能单元还用于基于预设的配置文件,执行以下至少一个操作:The application processing device according to claim 5, wherein the data processing module includes a scheduling unit and a functional unit, the scheduling unit is used to determine the functional unit corresponding to the event information based on a preset function mapping table, so The above functional unit is also used to perform at least one of the following operations based on the preset configuration file:
    调用所述视图管理单元的接口,以控制所述容器信息;Call the interface of the view management unit to control the container information;
    处理所述事件信息以生成所述控制信息;和processing the event information to generate the control information; and
    处理所述反馈信息以控制所述显示内容。The feedback information is processed to control the display content.
  7. 根据权利要求6所述的应用处理装置,其中,所述功能单元包括多个,每个所述功能单元至少包括一个所述配置文件,每个拍摄模式对应至少一个所述功能单元。The application processing device according to claim 6, wherein the functional units include a plurality, each of the functional units includes at least one of the configuration files, and each shooting mode corresponds to at least one of the functional units.
  8. 根据权利要求6所述的应用处理装置,其中,所述事件信息包括初始化信息,所述初始化信息包括第一初始化信息、第二初始化信息、和第三初始化信息,所述事件分发单元用于发送所述初始化信息到所述数据分发单元,所述数据分发单元转发所述第一初始化信息到所述视图管理单元以初始化所述视图管理单元的通用容器、转发所述第二初始化信息到所述数据处理模块以初始化所述数据处理模块中的通用的所述功能单元、及转发所述第三初始化信息到所述设备控制单元以初始化所述设备控制单元的通用配置,所述通用配置包括选择第一框架模块或第二框架模块,所述第一框架模块包含的代码集合的功能种类和第二框架模块中包含的代码集合的功能种类不同。The application processing device according to claim 6, wherein the event information includes initialization information, the initialization information includes first initialization information, second initialization information, and third initialization information, and the event distribution unit is configured to send The initialization information is sent 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, and forwards the second initialization information to the view management unit. The data processing module initializes the general functional unit in the data processing module, and forwards the third initialization information to the device control unit to initialize a general configuration of the device control unit, where the general configuration includes selection The first framework module or the second framework module, the functional type of the code set included in the first framework module is different from the functional type of the code set included in the second framework module.
  9. 根据权利要求8所述的应用处理装置,其中,所述电子设备还包括电子元件,所述数据处理模块发送模式信息到所述数据分发单元,所述数据分发单元转发所述模式信息到所述视图管理单元和所述设备控制单元,以初始化所述视图管理单元中与所述模式信息对应的所述功能单元,所述设备控制单元根据所述模式信息初始化与所述模式信息对应的所述电子元件。The application processing device according to claim 8, wherein the electronic device further includes an electronic component, the data processing module sends mode information to the data distribution unit, and the data distribution unit forwards the mode information to the A view management unit and the device control unit to initialize the functional unit corresponding to the mode information in the view management unit, and the device control unit initializes the function unit corresponding to the mode information according to the mode information. Electronic component.
  10. 根据权利要求6所述的应用处理装置,其中,所述事件信息还包括打开摄像头事件,所述数据分发单元转发所述打开摄像头事件到所述数据处理模块,所述调度单元用于基于所述功能映射表,确定所述打开摄像头事件对应的所述功能单元,所述打开摄像头事件对应的所述功能单元用于基于所述配置文件,调用与所述打开摄像头事件对应的所述视图管理单元的接口,以控制所述容器信息。The application processing device according to claim 6, wherein the event information further includes a camera opening event, the data distribution unit forwards the camera opening event to the data processing module, and the scheduling unit is configured to based on the Function mapping table to determine the functional unit corresponding to the camera opening event, and the functional unit corresponding to the camera opening event is used to call the view management unit corresponding to the camera opening event based on the configuration file interface to control the container information.
  11. 根据权利要求10所述的应用处理装置,其中,所述电子设备还包括一个或多个摄像头,所述调度单元还用于处理所述打开摄像头事件以生成类型信息,并发送所述类型信息到所述数据分发单元,所述数据分发单元转发所述类型信息到所述设备控制单元,以控制与所述类型信息对应的所述摄像头执行打开操作;在执行完所述打开操作后,所述设备控制单元接收所述摄像头返回的第一反馈信息,所述第一反馈信息包括摄像头打开失败或摄像头打开成功;所述设备控制单元发送所述第一反馈信息到所述数据分发单元,所述数据分发单元转发所述第一反馈信息到所述视图管理单元和所述调度单元,所述视图管理单元根据所述第一反馈信息控制所述显示屏显示摄像头打开成功或失败的信息,所述调度单元根据所述第一反馈信息确定进入预设业务流程或再次发送所述类型信息到所述数据分发单元,以控制与所述类型信息对应的所述摄像头再次执行打开操作。The application processing device according to claim 10, wherein the electronic device further includes one or more cameras, and the scheduling unit is further configured to process the camera opening event to generate type information, and send the type information to 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 completing the opening operation, the The device control unit receives the first feedback information returned by the camera, the first feedback information includes failure to open the camera or successful opening of the camera; the device control unit sends the first feedback information to the data distribution unit, The data distribution unit forwards the first feedback information to the view management unit and the scheduling unit, and the view management unit controls the display screen to display information about the success or failure of opening the camera according to the first feedback information. The scheduling unit determines to enter a preset business process according to the first feedback information or sends the type information to the data distribution unit again to control the camera corresponding to the type information to perform an opening operation again.
  12. 根据权利要求11所述的应用处理装置,其中,在接收到所述摄像头打开成功之前,所述视图控制单元控制所述视图对应的容器不响应输入操作。The application processing device according to claim 11, wherein before receiving that the camera is successfully opened, the view control unit controls the container corresponding to the view not to respond to the input operation.
  13. 根据权利要求11所述的应用处理装置,其中,在所述调度单元接收到所述打开摄像头成功后,创建会话;在所述视图管理单元接收到所述打开摄像头成功后,确定所述显示屏的预定区域为预览区域;所述设备控制单元还接收所述摄像头返回的第二反馈信息并发送到所述数据分发单元,所述数据分发单元将所述第二反馈信息转发到所述调度单元,所述第二反馈信息包括预览图像数据,所述预览图像数据存储在所述会话,所述调度单元根据所述预览图像数据在所述预览区域显示预览图像。The application processing device according to claim 11, wherein after the scheduling unit receives the success of opening the camera, a session is created; and after the view management unit receives the success of opening the camera, it determines that the display screen The predetermined area is the preview area; the device control unit also receives the second feedback information returned by the camera and sends it to the data distribution unit, and 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, and the scheduling unit displays a preview image in the preview area according to the preview image data.
  14. 根据权利要求1所述的应用处理装置,其中,还包括工具模块,所述工具模块包括所述视图模块、所述数据传输模块和/或所述数据处理模块用于解析所述事件信息的代码集合。The application processing device according to claim 1, further comprising a tool module, the tool module including the view module, the data transmission module and/or the code used by the data processing module to parse the event information. gather.
  15. 一种控制方法,其中,用于电子设备,所述电子设备包括显示屏,所述控制方法包括:A control method, which is used for electronic equipment, the electronic equipment includes a display screen, and the control method includes:
    根据容器信息控制所述显示屏显示视图,并发送事件信息;Control the display screen display view according to the container information and send event information;
    转发所述事件信息;及forward the event information; and
    根据转发的所述事件信息调用控制视图的接口,以控制所述容器信息。The interface of the control view is called according to the forwarded event information to control the container information.
  16. 根据权利要求15所述的控制方法,其中,所述容器信息包括视图的状态信息和属性信息,所述状态信息包括显示或隐藏,所述属性信息包括视图尺寸、视图位置和视图颜色中至少一个,所述根据容器信息控制所述显示屏显示视图,包括:The control method according to claim 15, wherein the container information includes state information and attribute information of a view, the state information includes display or hiding, and the attribute information includes at least one of view size, view position and view color. , the controlling the display screen display view according to the container information includes:
    根据所述状态信息和所述属性信息控制所述显示屏显示视图。Control the display screen to display a view according to the status information and the attribute information.
  17. 根据权利要求15所述的控制方法,其中,所述根据转发的所述事件信息调用控制视图的接口,以控制所述容器信息,包括:The control method according to claim 15, wherein the calling an interface of a control view according to the forwarded event information to control the container information includes:
    根据转发的所述事件信息生成调用信息,并根据所述调用信息调用控制视图的接口,以控制所述容器信息。Generate calling information according to the forwarded event information, and call an interface of the control view according to the calling information to control the container information.
  18. 根据权利要求15所述的控制方法,其中,还包括:The control method according to claim 15, further comprising:
    处理所述事件信息以生成的控制信息;Processing the event information to generate control information;
    根据所述控制信息控制所述电子设备执行对应的操作。Control the electronic device to perform corresponding operations according to the control information.
  19. 根据权利要求18所述的控制方法,其中,还包括:The control method according to claim 18, further comprising:
    获取所述电子设备执行所述操作后生成的反馈信息;Obtain feedback information generated after the electronic device performs the operation;
    根据所述反馈信息,控制所述显示屏的显示内容。According to the feedback information, the display content of the display screen is controlled.
  20. 根据权利要求19所述的控制方法,其中,还包括:The control method according to claim 19, further comprising:
    基于预设的功能映射表,确定所述事件信息对应的配置文件;Based on the preset function mapping table, determine the configuration file corresponding to the event information;
    所述根据转发的所述事件信息调用控制视图的接口,以控制所述容器信息,包括:Calling the interface of the control view according to the forwarded event information to control the container information includes:
    根据所述配置文件调用所述接口,以控制所述容器信息;Call the interface according to the configuration file to control the container information;
    所述处理所述事件信息以生成的控制信息,包括:The control information generated by processing the event information includes:
    根据所述配置文件处理所述事件信息以生成所述控制信息;Process the event information according to the configuration file to generate the control information;
    所述根据所述反馈信息,控制所述显示屏的显示内容,包括:Controlling the display content of the display screen based on the feedback information includes:
    根据所述配置文件处理所述反馈信息,以控制所述显示内容。The feedback information is processed according to the configuration file to control the display content.
  21. 根据权利要求15所述的控制方法,其中,所述电子设备还包括电子元件,所述电子设备 还包括应用处理装置,所述应用处理装置包括视图模块、数据传输模块和数据处理模块,所述数据传输模块包括数据分发单元和设备控制单元,所述事件信息包括初始化信息,所述初始化信息包括第一初始化信息、第二初始化信息、和第三初始化信息,所述控制方法还包括:The control method according to claim 15, wherein the electronic equipment further includes electronic components, the electronic equipment further includes an application processing device, the application processing device includes a view module, a data transmission module and a data processing module, the The data transmission module includes a data distribution unit and a device control unit. The event information includes initialization information. The initialization information includes first initialization information, second initialization information, and third initialization information. The control method also includes:
    控制所述视图模块发送所述初始化信息到所述数据分发单元;Control the view module to send the initialization information to the data distribution unit;
    控制所述数据分发单元转发所述第一初始化信息到所述视图模块以初始化所述视图模块中的通用容器、转发所述第二初始化信息到所述数据处理模块以初始化所述数据处理模块中的通用功能单元、及转发所述第三初始化信息到所述设备控制单元以初始化所述设备控制单元的通用配置,所述通用配置包括选择第一框架模块或第二框架模块,所述第一框架模块包含的代码集合的功能种类和第二框架模块中包含的代码集合的功能种类不同。Control the data distribution unit to forward the first initialization information to the view module to initialize the general container in the view module, and forward the second initialization information to the data processing module to initialize the data processing module. A general functional unit, and forwarding the third initialization information to the device control unit to initialize the general configuration of the device control unit, the general configuration includes selecting the first frame module or the second frame module, the first The functional type of the code set included in the frame module is different from the functional type of the code set included in the second frame module.
  22. 根据权利要求21所述的控制方法,其中,所述控制方法还包括:The control method according to claim 21, wherein the control method further includes:
    控制所述数据处理模块发送模式信息到所述数据分发单元;Control the data processing module to send mode information to the data distribution unit;
    控制所述数据分发单元转发所述模式信息到所述视图模块和所述设备控制单元,以初始化所述视图模块中与所述模式信息对应的所述功能单元,并控制所述设备控制单元初始化与所述模式信息对应的所述电子元件。Control the data distribution unit to forward the mode information to the view module and the device control unit to initialize the functional unit corresponding to the mode information in the view module, and control the device control unit to initialize The electronic component corresponding to the mode information.
  23. 根据权利要求15所述的控制方法,其中,所述事件信息还包括打开摄像头事件,所述根据转发的所述事件信息调用控制视图的接口,以控制所述容器信息,包括:The control method according to claim 15, wherein the event information also includes a camera opening event, and calling an interface of a control view according to the forwarded event information to control the container information includes:
    调用与所述打开摄像头事件对应的接口,以控制所述容器信息。Call the interface corresponding to the camera opening event to control the container information.
  24. 根据权利要求23所述的控制方法,其中,所述电子设备还包括一个或多个摄像头,所述控制方法还包括:The control method according to claim 23, wherein the electronic device further includes one or more cameras, and the control method further includes:
    处理所述打开摄像头事件以生成类型信息;Process the open camera event to generate type information;
    根据所述类型信息控制与所述类型信息对应的所述摄像头执行打开操作;Control the camera corresponding to the type information to perform an opening operation according to the type information;
    接收所述摄像头执行打开操作后返回的第一反馈信息,所述第一反馈信息包括摄像头打开失败或摄像头打开成功;Receive first feedback information returned after the camera performs an opening operation, where the first feedback information includes failure to open the camera or successful opening of the camera;
    根据所述第一反馈信息控制所述显示屏显示摄像头打开成功或失败的信息、并确定进入预设业务流程或再次控制与所述类型信息对应的所述摄像头执行打开操作。According to the first feedback information, the display screen is controlled to display information on the success or failure of camera opening, and it is determined to enter a preset business process or to control the camera corresponding to the type information to perform an opening operation again.
  25. 根据权利要求24所述的控制方法,其中,还包括:The control method according to claim 24, further comprising:
    在接收到所述摄像头打开成功之前,控制所述视图对应的容器不响应输入操作。Before receiving that the camera is successfully opened, the container corresponding to the view is controlled not to respond to the input operation.
  26. 根据权利要求24所述的控制方法,其中,还包括:The control method according to claim 24, further comprising:
    在接收到所述摄像头打开成功后,获取预览图像数据;及After receiving that the camera is successfully opened, obtain preview image data; and
    根据所述预览图像数据在所述显示屏的预定区域显示预览图像。A preview image is displayed in a predetermined area of the display screen according to the preview image data.
  27. 一种电子设备,其中,所述电子设备包括处理器和显示屏,所述处理器用于根据容器信息控制所述显示屏显示视图,并发送事件信息;转发所述事件信息;及根据转发的所述事件信息调用控制视图的接口,以控制所述容器信息。An electronic device, wherein the electronic device includes a processor and a display screen, the processor is configured to control the display screen to display a view according to container information, and send event information; forward the event information; and according to all forwarded The event information calls the interface of the control view to control the container information.
  28. 一种包括计算机程序的非易失性计算机可读存储介质,所述计算机程序被处理器执行时,使得所述处理器执行权利要求15-26任意一项所述的控制方法。A non-volatile computer-readable storage medium including a computer program. When the computer program is executed by a processor, it causes the processor to execute the control method described in any one of claims 15-26.
PCT/CN2022/141953 2022-03-21 2022-12-26 Application-processing apparatus, control method, electronic device, and storage medium WO2023179140A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210281648.5 2022-03-21
CN202210281648.5A CN116820634A (en) 2022-03-21 2022-03-21 Application processing device, control method, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2023179140A1 true WO2023179140A1 (en) 2023-09-28

Family

ID=88099764

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/141953 WO2023179140A1 (en) 2022-03-21 2022-12-26 Application-processing apparatus, control method, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN116820634A (en)
WO (1) WO2023179140A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117955839A (en) * 2024-03-25 2024-04-30 杭州海康威视数字技术股份有限公司 Video recorder resource allocation method and video recorder

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150007128A1 (en) * 2013-06-28 2015-01-01 Successfactors, Inc. Model Framework for Applications
CN105975265A (en) * 2016-04-29 2016-09-28 掌赢信息科技(上海)有限公司 Device based on improved MVP mode
CN108427555A (en) * 2018-01-25 2018-08-21 山东汇贸电子口岸有限公司 A kind of model for distributed storage variable data distribution method and system
CN109144488A (en) * 2018-09-29 2019-01-04 四川长虹电器股份有限公司 A kind of architecture design method based on android system
CN109683875A (en) * 2018-12-10 2019-04-26 四川长虹电器股份有限公司 The application framework and its method of MVC pattern under distributed environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150007128A1 (en) * 2013-06-28 2015-01-01 Successfactors, Inc. Model Framework for Applications
CN105975265A (en) * 2016-04-29 2016-09-28 掌赢信息科技(上海)有限公司 Device based on improved MVP mode
CN108427555A (en) * 2018-01-25 2018-08-21 山东汇贸电子口岸有限公司 A kind of model for distributed storage variable data distribution method and system
CN109144488A (en) * 2018-09-29 2019-01-04 四川长虹电器股份有限公司 A kind of architecture design method based on android system
CN109683875A (en) * 2018-12-10 2019-04-26 四川长虹电器股份有限公司 The application framework and its method of MVC pattern under distributed environment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117955839A (en) * 2024-03-25 2024-04-30 杭州海康威视数字技术股份有限公司 Video recorder resource allocation method and video recorder
CN117955839B (en) * 2024-03-25 2024-05-31 杭州海康威视数字技术股份有限公司 Video recorder resource allocation method and video recorder

Also Published As

Publication number Publication date
CN116820634A (en) 2023-09-29

Similar Documents

Publication Publication Date Title
US10872585B2 (en) Display method and terminal
WO2022206696A1 (en) Photographing interface display method and apparatus, electronic device and medium
WO2022116885A1 (en) Photographic method, apparatus, electronic device, and storage medium
CN112954196B (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN114302214B (en) Virtual reality equipment and anti-jitter screen recording method
WO2022028495A1 (en) Picture photographing method and apparatus, and electronic device
US20210149558A1 (en) Method and apparatus for controlling terminal device, and non-transitory computer-readle storage medium
WO2023179140A1 (en) Application-processing apparatus, control method, electronic device, and storage medium
WO2024051578A1 (en) Image capturing method and apparatus, device, and storage medium
CN112732089A (en) Virtual reality equipment and quick interaction method
WO2022095891A1 (en) Image display method and apparatus, and device
US11310430B2 (en) Method and apparatus for providing video in portable terminal
CN111866379A (en) Image processing method, image processing device, electronic equipment and storage medium
CN111857521B (en) Multi-device management method and device and integrated display control system
WO2022135261A1 (en) Image display method and apparatus, and electronic device
WO2022095878A1 (en) Photographing method and apparatus, and electronic device and readable storage medium
CN116185248A (en) Window display method and related equipment
JPH11261852A (en) Electronic camera having menu function and machine-readable recording medium recorded with program having menu function
WO2024124842A1 (en) Display device and processing method for display device
CN117119297A (en) Camera control device and method, electronic device and storage medium
CN116709004B (en) Image processing method and electronic equipment
CN112732088B (en) Virtual reality equipment and monocular screen capturing method
WO2024139245A1 (en) Display device and split-screen display method
CN116126175A (en) Virtual reality equipment and video content display method
CN112269524A (en) Screen capturing method, screen capturing device and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22933188

Country of ref document: EP

Kind code of ref document: A1