Event bus-based interface customization method, apparatus and device, and medium

By using an event bus-based custom interface approach, a custom view layer file containing event publishing code is generated. Combined with the event handling center and SDK files, this solves the problem of inflexible interface customization, achieves decoupling and flexible customization of the interface and service logic, and ensures the confidentiality of the service logic.

WO2026051172A1PCT designated stage Publication Date: 2026-03-12ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2026-03-12

AI Technical Summary

Technical Problem

Existing interface customization methods are not flexible enough to meet the highly customized interface needs of service providers such as banks and transportation companies. Furthermore, users need to have a deep understanding of API interfaces to achieve interface customization, which leads to compatibility issues.

Method used

A custom interface approach based on an event bus is adopted. By obtaining the page parameter information edited by the user, a custom view layer file is generated, which includes event publishing code. Combined with the event handling center and SDK file, the interface and service logic are decoupled. Users do not need to pay attention to the service logic content and can flexibly customize the interface.

Benefits of technology

It enables flexible customization of the interface, reduces the complexity of interface development, ensures the confidentiality of service processing logic, reduces compatibility issues, and allows users to edit page parameter information according to their needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024128085_12032026_PF_FP_ABST
    Figure CN2024128085_12032026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in embodiments of the present description are an event bus-based interface customization method, apparatus and device, and a medium. The solution comprises: acquiring page parameter information edited by a user; on the basis of the page parameter information, generating a customized view layer file used for rendering and displaying a customized interface corresponding to the page parameter information, wherein the customized view layer file comprises an event publishing code for publishing an event, the code is used for publishing an event on the basis of a preset operation of the user on the customized interface, and the event is used by an event processing center to trigger service processing logic corresponding to the event; and loading the customized view layer file and an SDK file comprising the event processing center and the service processing logic to a terminal, so that the terminal can display the customized interface on the basis of the customized view layer file and can call the service processing logic on the basis of the event processing center to respond to an event triggered by the customized interface.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, equipment and medium for customizing interface based on event bus

[0001] The present application claims priority to the Chinese patent application No. 2024112396658, filed on September 4, 2024, and entitled "Method, device, equipment and medium for customizing interface based on event bus", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the technical field of computer, in particular to a method, device, equipment and medium for customizing interface based on event bus. BACKGROUND

[0003] In today's rapid development of digitalization, banks, transportation, securities companies and other service providers have put forward high customization requirements for face recognition technology, hoping to combine the design of face recognition interface with their own brand or other needs.

[0004] Therefore, how to provide a method for customizing interface is a technical problem to be solved.

[0005] SUMMARY

[0006] The embodiments of the present specification provide a method, device, equipment and medium for customizing interface based on event bus, to solve the problem of inflexibility of existing interface customization methods.

[0007] To solve the above technical problems, the embodiments of the present specification are implemented as follows:

[0008] The method for customizing interface based on event bus provided by the embodiments of the present specification comprises:

[0009] Obtaining page parameter information edited by a user;

[0010] Based on the page parameter information, generating a custom view View layer file for rendering and displaying a customized interface corresponding to the page parameter information; the custom view View layer file contains event publishing code for publishing events; the code is used to publish events based on a preset operation of the user on the customized interface; the events are used to trigger service processing logic corresponding to the events by an event processing center;

[0011] Loading the custom view View layer file and an SDK file containing the event processing center and the service processing logic to a terminal, so that the terminal can display the customized interface based on the custom view View layer file and can call the service processing logic based on the event processing center to respond to events triggered by the customized interface.

[0012] The embodiment of the present specification provides a device for customizing an interface based on an event bus, comprising:

[0013] A parameter editing module is configured to obtain page parameter information edited by a user.

[0014] A file generating module is configured to generate a custom view View layer file for rendering and displaying a custom interface corresponding to the page parameter information based on the page parameter information; the custom view View layer file comprises event publishing code for publishing an event; the code is configured to publish an event based on a preset operation of the custom interface by a user; and the event is configured to trigger service processing logic corresponding to the event by an event processing center.

[0015] A file loading module is configured to load the custom view View layer file and an SDK file comprising the event processing center and the service processing logic to a terminal, so that the terminal can display the custom interface based on the custom view View layer file and can call the service processing logic based on the event processing center to respond to an event triggered by the custom interface.

[0016] The embodiment of the present specification provides a device for customizing an interface based on an event bus, comprising:

[0017] at least one processor; and

[0018] a memory in communication connection with the at least one processor; wherein

[0019] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:

[0020] obtain page parameter information edited by a user.

[0021] generate a custom view View layer file for rendering and displaying a custom interface corresponding to the page parameter information based on the page parameter information; the custom view View layer file comprises event publishing code for publishing an event; and the event is configured to trigger service processing logic corresponding to the event by an event processing center.

[0022] load the custom view View layer file and an SDK file comprising the event processing center and the service processing logic to a terminal, so that the terminal can display the custom interface based on the custom view View layer file and can call the service processing logic based on the event processing center to respond to an event triggered by the custom interface.

[0023] The embodiment of the present specification provides a computer readable medium, which stores computer readable instructions, and the computer readable instructions can be executed by a processor to implement a method for customizing an interface based on an event bus.

[0024] The embodiment of the present specification achieves the following beneficial effects:

[0025] In the embodiment of the present specification, the custom view View layer file is generated based on the page parameter information edited by the user, and the file contains the code for publishing events. The event processing center can trigger the service processing logic corresponding to the event. The terminal with the custom view View layer file and the SDK file containing the event processing center and the service processing logic can display the customized interface based on the custom view View layer file, and can also call the service processing logic based on the event processing center to respond to the event triggered by the customized interface. By introducing the event processing mechanism, the interface and the service processing logic are decoupled. The user can edit the page parameter information according to the demand without paying attention to the specific content of the service processing logic, and the interface customization can be more flexible.

[0026] On the other hand, the SDK file containing the event processing center and the service processing logic and the custom view View layer file can be separate files. The user can edit the View layer file, and the content in the SDK file is in a confused state for the user, which can ensure the confidentiality of the core technology of the service processing logic.

[0027] On the other hand, the custom view View layer file contains the code for publishing events, which simplifies the services related to the interface into the form of publishing events. Through the simplified events, the complexity of the interface customization development can be further reduced, and the compatibility problem caused by the change of the service processing logic can also be reduced. BRIEF DESCRIPTION OF DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only some embodiments described in the present specification, and those skilled in the art can obtain other drawings according to these drawings without paying creative labor.

[0029] Fig. 1 is a flow diagram of a method for customizing an interface based on an event bus provided by the embodiment of the present specification;

[0030] Fig. 2 is an architecture diagram of displaying a customized interface provided by the embodiment of the present specification;

[0031] FIG. 3 is a structural schematic diagram of an apparatus for customizing an interface based on an event bus according to an embodiment of the present specification;

[0032] FIG. 4 is a structural schematic diagram of an apparatus for customizing an interface based on an event bus according to an embodiment of the present specification. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solutions and advantages of one or more embodiments of the present specification clearer, the technical solutions of one or more embodiments of the present specification will be described clearly and completely below in conjunction with specific embodiments of the present specification and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present specification, rather than all the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of one or more embodiments of the present specification.

[0034] In order to make the purpose, technical solutions and advantages of one or more embodiments of the present specification clearer, the technical solutions of one or more embodiments of the present specification will be described clearly and completely below in conjunction with specific embodiments of the present specification and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present specification, rather than all the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of one or more embodiments of the present specification.

[0035] MVVM (Model-View-ViewModel) is a software architecture pattern that separates the data model (Model), user interface (View), and presentation logic (ViewModel) in an application. Model represents the data and business logic of the application, View is the interface for user interaction, and ViewModel acts as an intermediary between View and Model, managing the state and behavior of the view, and is an object that synchronizes View and Model, keeping them decoupled, facilitating independent development and testing.

[0036] Event bus is a message passing system that allows decoupled communication between different software components or objects. Components can publish events through the event bus, and other components can subscribe to these events. When a certain event is published, all components that subscribe to the event will receive a notification. This way achieves loose coupling between components, making the system easier to extend and maintain.

[0037] Publisher, in the event bus system, refers to an object or component that can publish events. When a certain event occurs, the publisher publishes the event to the event bus for subscribers to receive and process.

[0038] Subscriber refers to a component or object that registers to receive a specific event. In the event bus system, the subscriber registers itself as a receiver of a specific event through the event bus and responds when the event occurs.

[0039] Interface customization refers to providing customized user interface capabilities for customers accessing an SDK (Software Development Kit). For a face recognition interface, in this process, the customer does not need to modify the source code of the face recognition SDK or recompile. Instead, the customer can dynamically customize the user interface based on the provided interface template. This customization allows adjusting the layout, theme, and control state, etc. according to specific conditions, such as the brand image of an enterprise, application scenario characteristics, cultural and geographical differences, etc.

[0040] In related technologies of interface customization, only the size, color, etc. of part of the controls in the page can be adjusted, and the user cannot change the interface layout, so the interface customization is not flexible.

[0041] In some related technologies, the provider of service processing logic provides a set of rich API interfaces and a development kit SDK containing service logic, and the user can customize the interface by calling the API interface and the SDK, which requires the user to have a deep understanding of the use method of the API interface, and the requirement for the user is high. The dependence on the API will cause compatibility problems in the future, for example, if the API is updated or changed, the user needs to adjust the used API parameters accordingly, and the user needs to rewrite the code of the display interface to correctly call the service logic.

[0042] The technical solutions provided by the embodiments of the present specification are described in detail below in combination with the accompanying drawings.

[0043] FIG. 1 is a flowchart of a method for customizing an interface based on an event bus provided by an embodiment of the present specification. From a program perspective, the execution subject of the flow can be a program or an application client carried on an application server. From a hardware perspective, the execution subject of the flow can be a terminal device used to edit a customized interface, such as a computer, an operating platform, etc.

[0044] As shown in FIG. 1, the flow can include the following steps.

[0045] Step 102: Obtain page parameter information edited by a user.

[0046] The page parameter information can be parameter information of each component displayed in the customized interface, such as button color information, position information, page layout information, etc.

[0047] Step 104: Based on the page parameter information, generate a customized view View layer file for rendering and displaying a customized interface corresponding to the page parameter information.

[0048] The custom view View layer file contains event publishing code for publishing events; the events are used to trigger service processing logic corresponding to the events by the event processing center.

[0049] The event processing center can receive the events published in the custom view View layer file as a subscriber of the events, and trigger the corresponding service processing logic. The service processing logic can be processing logic required for processing the business of the custom interface representation. For example, if the custom interface is an interface for biometric identification, the corresponding service processing logic can include service logic for starting an information collection component such as a camera to collect biometric images, service logic for identifying the collected images, and the like. Biometrics can include facial features, fingerprints, voiceprints, fingerprints, palmprints, and the like.

[0050] The custom view View layer file can contain configuration information of each display component in the custom page, such as position information, color information, size information, display form information, and the like.

[0051] The code contained in the custom view View layer file is interface display related code, which can be understood as code executed in the View layer in the MVVM architecture. During the entire life cycle of interface display and user interaction, the View layer plays the role of an event publisher, which publishes defined event types to the event bus.

[0052] Step 106: loading the custom view View layer file and the SDK file containing the event processing center and the service processing logic to the terminal.

[0053] The terminal can display the custom interface based on the custom view View layer file and can call the service processing logic based on the event processing center to respond to events triggered by the custom interface.

[0054] The terminal can be a device containing a display screen for displaying a custom page, or a control device or platform for controlling a display device to display a custom interface. The terminal can be one device or multiple associated devices.

[0055] For example, one or more operation terminals containing a display screen can be set up in some service institutions, such as self-service cash register devices, automatic teller machines, bank service handling terminals, and the like. One operation terminal can serve as a terminal, and is deployed with a custom view View layer file and an SDK file containing an event processing center and service processing logic.

[0056] For example, a plurality of display terminals can also be controlled by a control device, where the control device can be deployed as a terminal, and the control device is deployed with a customized view layer file and an SDK file containing an event processing center and service processing logic. Alternatively, the control device and a plurality of display terminals can be deployed as terminals, and the control device is deployed with a customized view layer file and an SDK file containing an event processing center and service processing logic, and the display terminals display the customized page based on the control of the control device. Alternatively, the control device is deployed with an SDK file containing an event processing center and service processing logic, and the display terminal is deployed with a customized view layer file, and the display terminal can display a customized page or send an event, and the event processing center in the control device can obtain the event and trigger the corresponding service processing logic. The specific file deployment manner can be set according to actual needs, and is not specifically limited here.

[0057] The specific service logic contained in the SDK file is secret to the user editing the page parameter information, for example, the user does not have the permission to view the specific content in the file, or the content in the SDK file is obfuscated, and the user cannot distinguish the specific content, so that the specific service processing logic is secret to the user. The terminal application used in the terminal system or terminal can identify the content in the SDK file and execute the corresponding program flow.

[0058] The SDK file can contain the code of the event processing center and the code of each service processing logic. The event processing center is a module for managing pages and corresponding service processing logic pre-constructed according to actual business needs, and is responsible for unified scheduling of different service modules. The event processing center registers on the event bus as a subscriber and is ready to receive events of a specified type at any time. For example, once it listens to the initialization event of the face recognition interface, it activates the permission verification service.

[0059] It should be understood that the order of some steps of the method described in one or more embodiments of the present specification can be exchanged according to actual needs, or some steps can be omitted or deleted.

[0060] For example, in actual application, the terminal for displaying the customized interface can also be a terminal device for editing page parameter information by the user, and the execution subject in the embodiment of the present specification can be a terminal for displaying the customized page. In this case, the customized view View layer file and the SDK file containing the event processing center and the service processing logic do not need to be sent to the terminal in step 206, and the terminal can directly run the loaded file. The user can edit the page parameter information in the terminal, the customized view View layer file can be generated in the terminal, and the SDK file containing the event processing center and the service processing logic can also be obtained from the service logic provider, so as to display the customized page. In actual application, the customized view View layer file and the SDK file containing the event processing center and the service processing logic can be independent files, or can be the same file. For example, the same file can contain multiple subfiles, and the customized view View layer file can be a subfile. The specific file form is not limited here.

[0061] The method in FIG. 1 decouples the interface and the service processing logic by introducing an event processing mechanism and using the event processing center. The user can edit the page parameter information according to the requirement, without paying attention to the specific content of the service processing logic, and can more flexibly customize the interface.

[0062] Meanwhile, the SDK file containing the event processing center and the service processing logic and the customized view View layer file can be independent or separate files. The user can edit the View layer file, and the confidentiality of the core technology of the service processing logic can be ensured.

[0063] In addition, the customized view View layer file contains code for publishing events, and the service related to the interface is simplified into the form of publishing events. Through the simplified events, the complexity of interface customization development can be further reduced, and the compatibility problem caused by the change of the service processing logic can also be reduced.

[0064] Based on the method in FIG. 1, the embodiment of the present specification also provides some specific implementation schemes of the method, which are described below.

[0065] The page parameter information edited by the user in the present specification can be edited based on an interface template. Optionally, the above obtaining the page parameter information edited by the user can specifically include:

[0066] obtaining an initial view View layer file; the file code of the initial view View layer file includes editable view parameter code;

[0067] obtaining the page parameter information edited by the user based on the editing operation of the user on the editable view parameter code.

[0068] The initial view View layer file contains editable view parameter code, which can include the attribute name of the view component. The user can edit the parameter value corresponding to the view component, which can also be understood as the attribute value. The parameter value or attribute value is used to determine the presentation form of the view component in the customized page, such as page layout, component display position, prompt information presentation form, and the like.

[0069] In practical applications, the initial view View layer file can also include default parameter value information of the view component. The user can modify the default parameter value to obtain edited page parameter information. The view parameter code given in the initial view View layer file can also be added or deleted. The above editing operations can include at least one of a deletion operation, an addition operation, and a modification operation.

[0070] The page parameter information in the embodiments of the present specification can include information representing at least one display parameter of a display position, a display form, a display color, a display order, and display content of a page component; wherein the page component includes at least one of a title bar, an operation control, a progress bar, an image acquisition frame, and prompt information.

[0071] The title bar (Title Bar) can be a horizontal bar at the top of an interface or application program, which contains the name of the application program or the title of the currently open file, the interface title, and the like. The title bar can also include some commonly used operation buttons, such as minimize, maximize / restore, and close buttons. The title bar can also display information related to the system state, such as whether face recognition is running, system version, or currently logged-in user information, and the like. By setting the title bar, the recognition and professionalism of the user interface can be improved. For example, the title() function is used to set the window title, or the icon, background, and font color are customized, and the like, to enhance user experience and the beauty of the interface.

[0072] The operation control refers to an interface element in user interface (UI) design that users can directly interact with. These controls allow users to control the behavior of software applications or operating systems through mouse clicks, touches, keyboard inputs, and the like. The operation control can enable users to intuitively operate software to achieve specific functions without needing to understand the underlying technical details.

[0073] Specific operation control types can include: buttons, usually used to perform a specific action such as "save", "cancel", "determine", etc.; text boxes, allowing users to input text information; checkboxes, used to select one or more of multiple options; radio buttons, only one of a group of radio buttons can be selected; list boxes, displaying a series of options for users to choose from; combo boxes, combining the functions of list boxes and text boxes, users can select items from the list or manually input; sliders, allowing users to adjust numerical values or settings by dragging; labels, used to display static text, informing users of the functions of other controls; menus, providing a set of related options, usually in the form of a drop-down list; tab pages, used to switch between different content areas in the same window, etc.

[0074] Progress bars can be used to show the completion of an operation. For example, the progress of face recognition. The progress bar can be a horizontal bar chart, or a circular or other shaped image, which can be used to display the percentage of the task from start to completion, helping users understand the progress and estimated remaining time of the operation. The progress bar can be updated in real time, as the task progresses, the progress bar will gradually fill up until it is completely full, indicating the completion of the task.

[0075] Image capture frame can be a boundary rectangle or circle or other shape of the boundary for positioning and capturing the image collection area. This frame is used to demarcate the part containing the object to be collected in the image or video frame, such as the part of the face to be collected, to facilitate subsequent image processing, such as face detection, feature extraction and recognition processes, etc.

[0076] Prompt information can be displayed throughout the life cycle of the page display or presented in other ways, such as information broadcast through voice broadcast, information displayed through text, animation or arrows to indicate directions, etc.

[0077] The various components to be displayed in the interface and the display form of the components can be set according to actual needs, which are not specifically limited here.

[0078] For example, the initial view View layer file contains code for setting prompt information, as follows:

[0079] Text(this.livenessInfo.showSuggestMsg) represents that the component is used to display the suggestion information of the live body identification, and the text content comes from the this.livenessInfo.showSuggestMsg file. In actual application, the file can also be an editable file of the user, and is also used to set the suggestion information of the live body identification, such as "please blink" and the like. In the code segment, the parameter information of the font size fontSize, the color fontColor, the width width, the top outer margin margin, and the maximum display line maxLines is also set. The component also has an alignRules attribute, which defines the alignment of the component relative to other components or the edge of the container, and ensures the correct layout of the component on the interface. Among them, the component is assigned with the ID of zeta_top_tip, and top:{anchor:"zeta_divider",align:VerticalAlign.Bottom} indicates that the component is located below the divider with the ID of zeta_divider.

[0080] The user can edit the attribute values corresponding to the component, for example, modify the font size from 18 to 20, modify the width from 100% to 80%, and the like. The user can also edit the display position information of the component, for example, the component is originally located below the divider with the ID of zeta_divider, and the display position of the component can be modified to below the component with the ID of zeta_title. The component with the ID of zeta_title is also an editable component included in the initial view View layer file.

[0081] The user does not need to edit the attribute names corresponding to the component, such as the id('zeta_top_tip') in the above example,.fontSize(),.fontColor(),.width(),.margin({top:}),.maxLines(), and the like represent the codes of the attributes, which can not be edited. The user can edit the attribute values corresponding to each attribute, which can also be called parameter values.

[0082] It can be understood that the above is only an explanation of editing the display style of the prompt information. In actual application, the parameters of other components in the page can be edited according to actual needs to meet actual business needs.

[0083] In the embodiments of the present specification, the component ID corresponding to each page component can be set in order to be referenced in other places, such as setting the relative position relationship according to the component ID as described above, or displaying the corresponding component according to the preset execution steps through the component ID.

[0084] In actual application, the displayed page component can also contain information in the form of pictures, voices, etc. The corresponding pictures, voices, etc. can be called through the name or storage location or other identifier of the pictures or voices. These information are also editable information.

[0085] For example, Image($r("app.media.zeta_ball_success")), the image is loaded from the resource package through the $r function. The actual user can also set the information of the displayed image according to actual needs.

[0086] The initial view View layer file provided to the user in the embodiments of the present specification can contain code for publishing events. The user can obtain a customized view View layer file by editing the initial view View layer file. Optionally, the above generating a customized view View layer file for rendering and displaying a customized interface corresponding to the page parameter information based on the page parameter information can specifically include:

[0087] The page parameter information is used to update the editable view parameter code in the initial view View layer file, and the customized view View layer file is obtained. The initial view View layer file can represent a view template file, which can contain information of each component for rendering a view interface. The user can obtain a customized view View layer file by editing the page parameter information. The above updating can mean that the original parameter information is replaced with the newly edited page parameter information of the user. In actual application, the user can first delete the original page parameter information and then input new parameter information, or first input new parameter information and then delete the original parameter information. After editing is completed, the user can save the edited page parameter information through a save or save as operation to obtain the customized view View layer file.

[0088] The editable view parameter code can include code representing at least one display parameter of a display position, a display form, a display color, a display order, and a display content of a page component. The user can edit specific parameter values according to actual needs.

[0089] The initial view View layer file can also contain code for publishing events. When a preset operation occurs in a display interface or page, a corresponding event can be published, so that the event processing center can call a corresponding service processing flow. Thus, the user can edit the initial view View layer file to obtain a customized view View layer file containing code for publishing events.

[0090] For example, the view View layer file can contain the following code for publishing events:

[0091] aboutToAppear() represents an event triggered when the page is about to appear, the zeta_event_on_face_page_liveness_appear event is published through the ZetaEventBusManager, and the livenessInfo is passed as a parameter. onBackPress() represents an event triggered when the user presses the back key, if the current attempt number is less than the maximum retry number, or this is the first display, the zeta_event_on_face_page_back event is published, and a Boolean value indicating whether the retry limit is reached is passed in. The method returns true, which usually indicates that the event has been processed, preventing the default back behavior.

[0092] When the user edits the page parameters, there is no need to edit the code for publishing the event. In actual application, the initial view View layer file can be provided to the user by the management party or the development party of the service logic. The user can represent the service demand party, for example, the management party of the face recognition algorithm provides the processing logic of the algorithm to the institution or organization that needs face recognition, but the institution or organization cannot view the specific service logic content, and can use the service logic for face recognition.

[0093] In actual application, the user who edits the page parameters can be a user with preliminary coding ability, who can understand which contents in the initial view View layer file can be edited and which contents do not need to be edited. The management party or the development party of the service logic can also provide a usage instruction file corresponding to the initial view View layer file to the user. The usage instruction file can include explanation information for the code in the initial view View layer file, or can include indication information for indicating editable contents or non-editable contents. The user can edit the editable code in the initial view View layer file according to the usage instruction file to obtain the customized view View layer file.

[0094] In actual application, the editable view parameter code and the non-editable code in the initial view View layer file can be displayed in different styles, for example, in different font colors, so that the user can better distinguish between the editable code and the non-editable code. The non-editable code in the initial view View layer file can also be displayed in a locked state to the user, and the user cannot edit it. This can also avoid the user from editing the non-editable code content, and can also improve the success rate of page customization.

[0095] It can be understood that the user in the embodiments of the present specification can be a person who customizes the page, or a person who provides the service logic, for example, the person who customizes the page can edit the page parameters, or can entrust the person who provides the service logic to customize the page and edit the page parameters. The specific identity of the user is not limited here, as long as the user can edit the View layer file.

[0096] In the embodiments of the present specification, the initial view View layer file can contain View layer code representing view layout and used for triggering events, and can also contain state variable information representing variables that can be presented in the page, for example, a prompt is edited from text to voice broadcast, the code amount is less, and the efficiency of page customization can also be improved.

[0097] In order to further improve the decoupling of the interface and the service logic, the method for customizing the interface provided in the embodiments of the present specification can be implemented based on the MVVM architecture. Optionally, the SDK file can further include a view data ViewModel layer file; the view data ViewModel layer file is used to save state variables related to the customized interface; and the variable value of the state variable can be updated according to the processing result data of the service processing logic.

[0098] Among them, the view data ViewModel layer file contains state variable information involved in the interface display process, for example, information representing whether the face located in the recognition box is blocked, whether it is straightened, whether it meets the requirements of the prompt, and the like, and information representing image quality, and the like. The View layer file can contain attribute parameters corresponding to the state variables, and the view data ViewModel layer code contained in the view data ViewModel layer file can provide parameter values to the View layer, so that the View layer displays corresponding page components or page effects.

[0099] In actual application, the View layer will take the state variables in the ViewModel as parameters to publish events. After receiving these parameters, the event processing center saves the state variables, so as to modify the corresponding state variables in the future according to the processing of the business logic. The specific parameter values of the state variables in the ViewModel will also be modified accordingly according to the processing of the business logic. The specific transmission process of the state variables can refer to the related technologies of the MVVM architecture, which will not be described in detail here.

[0100] The identification information of the view data View Model layer is contained in the customized view View layer file or the initial view View layer file, changes in the state variable in the View Model layer can be monitored, and corresponding page effects can be displayed according to the state variable. The identification information and related code for obtaining the state variable based on the identification information can be unchanged code, and the user does not need to modify the function, parameter attribute and other contents when editing the page parameters.

[0101] For example, the changes in the state variable in the View Model layer can be monitored through the @Watch function, as shown in the following statement: @Watch('onInfoUpdated') livenessInfo: ZetaLiveness = new ZetaLiveness(). In the statement, livenessInfo represents the identification information of the View Model layer, and onInfoUpdated is a callback function. When any attribute value in livenessInfo changes, the parameter value in the View layer can be updated through the callback function, and the terminal can display the corresponding page according to the updated parameter value. The state variable can be a pre-defined variable related to interface display. For example, if a face is detected, the variable representing the face state can be updated to a parameter value representing the presence of a face, and the View layer can change the prompt from "no face detected" to "wink".

[0102] The terminal used to display the customized interface in the embodiments of the present specification can be equipped with a Harmony system, and the code in the customized view View layer file can be executed based on the routing mechanism of the Harmony system to display the customized interface. Optionally, the customized view View layer file contains a page routing identifier; the terminal is equipped with a Harmony system; and the method further includes:

[0103] The terminal determines, based on the routing mechanism of the Harmony system, according to the page routing identifier, that the customized view View layer file is executed to display the customized interface.

[0104] The page routing identifier can be a string conforming to the routing mechanism of the Harmony system and can be recognized by the Harmony system. For example, @Entry({routeName:'zeta_liveness_face_verify_open'}), where zeta_liveness_face_verify_open can represent the page routing identifier. In actual applications, the specific content of the identifier can be set according to actual needs, which is not limited herein.

[0105] In actual application, the terminal can also load a view layer file for displaying a default form page, and if the user does not edit a customized view layer file, the terminal can display the default form page. The terminal can use the routing mechanism of the Baidu OS to realize that the interface customized by the user is preferentially loaded and displayed; if the user does not perform customization, the system returns to the default loading of the view interface built in the SDK.

[0106] It can be understood that the terminal can also use other operating systems as long as the operating systems can recognize the customized view layer file and the code in the SDK file. For example, an operating system capable of recognizing the contents of the customized view layer file and the SDK file can be built according to the contents, and the customized interface can be displayed by using the built operating system.

[0107] In the embodiments of the present specification, the events that can be published in the customized view layer file in the entire life cycle of the page can include at least one of an interface creation event, an interface background event, an interface foreground event, an interface destruction event, and an interactive event of a control in the interface.

[0108] The event processing center contains service processing logic that needs to be triggered and executed for each event, wherein the service processing logic includes processing logic of at least one of a timing operation service, a permission verification service of a terminal device, a device setting service of the terminal device, and a business data processing service.

[0109] The interface creation event can represent an event triggered when an interface is first loaded or instantiated. The event can be accompanied by resource initialization and layout construction. The customized view layer file can contain related code for resource initialization and layout construction, and the terminal can publish the interface creation event by executing the customized view layer file. The event processing center obtains the initialization state variable, and can also change the state variable according to the processing result data of the service processing logic in the subsequent process.

[0110] The interface background event can represent an event triggered when an interface loses focus or an application program is switched to background running. For example, the user switches to another application or the device screen is locked. After the event processing center obtains the event, it can trigger the related program of the pause service, such as pausing video playing, saving user state, etc., to save system resources.

[0111] The interface foreground event can represent an event triggered when an interface regains focus or returns to the foreground from the background. This indicates that the user starts to interact with the interface again, and the event processing center can trigger the service that was previously paused, such as restarting video playing, updating data display, etc.

[0112] The interface destruction event can represent an event triggered when the interface is no longer needed and is about to be recycled by the system, such as when a user exits the interface. The event processing center can trigger service logic to release occupied resources, such as canceling all registered listeners, to avoid memory leaks and other potential problems.

[0113] The interaction event of the control in the interface can represent an event triggered when a user interacts with a control on the interface. For example, an event triggered by clicking, touching, swiping, or other types of user input. Through the event bus, the event processing center can send a signal to other components or logic layers to inform them of the occurrence of user interaction and execute corresponding service logic.

[0114] The timing operation service can represent timing logic, such as starting a countdown, a positive count, and the like.

[0115] The permission verification service of the terminal device can represent logic for verifying whether the terminal device has enabled required permissions, such as whether the terminal allows an application to use camera permissions, location acquisition permissions, memory access permissions, and the like.

[0116] The device setting service of the terminal device can represent logic for setting device parameters of the terminal device, such as setting the screen brightness, volume size, and the like of the terminal device.

[0117] The business data processing service can represent logic for processing objects to be processed obtained through the customized interface, such as face recognition algorithm logic for recognizing face images obtained through the customized interface, and the like.

[0118] As an implementation manner, the customized interface in the embodiments of the present specification can be an interface for face recognition. The interface can display face recognition frames, recognition progress bars, prompt words or arrow identification information for prompting a user to adjust the direction of the face, and can further include a control for starting the face recognition process, a control for returning to the previous page or exiting the current page, and the like. The interface can further include identification information of a face recognition demander, such as a logo, a name, and the like.

[0119] Optionally, the permission verification service of the terminal device can include a permission verification service for verifying camera permissions; the setting service of the terminal device can include a service for adjusting the screen brightness of the terminal; and the business data processing service can include a service for calling a face verification algorithm to verify a collected face image.

[0120] The event processing center in the embodiments of the present specification is responsible for unified scheduling of different service modules. The event processing center, as a subscriber, is registered on the event bus and is ready to receive events of a specified type at any time. For example, once it listens to the initialization event of the face recognition interface, it activates services such as permission verification. During the entire life cycle of the face recognition interface and user interaction, the View layer plays the role of an event publisher, which publishes defined event types to the event bus, such as interface creation, background, foreground, destruction, and control interaction events. For the interface creation event, the View layer can publish the event with the state variable in the ViewModel as a parameter. After receiving these parameters, the event processing center saves the state variable, so as to modify the corresponding state variable according to the processing of the business logic in the future.

[0121] Optionally, the event described above in the embodiments of the present specification can include an interface creation event; the method in the embodiments of the present specification can further include:

[0122] After the terminal obtains the interface creation instruction, the terminal publishes an interface creation event by executing the event publishing code, with the state variable of the view data ViewModel layer file as a parameter;

[0123] The event processing center receives the interface creation event and triggers execution of service processing logic corresponding to the interface creation event;

[0124] The state variable is updated according to the processing result information of the service processing logic corresponding to the interface creation event, to obtain an updated state variable;

[0125] The view data ViewModel layer file triggers the customized view View layer file to display corresponding page information according to the updated state variable.

[0126] When creating a page, a system callback is performed, such as aboutToAppear function, to publish a page creation event. This event can have a predefined event ID, such as eta_event_on_face_page_liveness_appear. The ViewModel object can also be included in this event and delivered to the event processing center for subsequent modification. The ViewModel object can be understood as a state variable managed by the ViewModel layer. The service processing logic updates and modifies the state variable in the ViewModel after processing each frame of image.

[0127] For example, the ViewModel layer can include the following code:

[0128] It can be seen that the ViewModel layer can include a plurality of state variables. It can be understood that the above is only an example, and in actual applications, the state variables included in the ViewModel layer can be set according to actual needs, which are not specifically limited here.

[0129] In actual applications, after processing the result, the service processing logic or the event processing center can update the state variable in the ViewModel layer according to the processing result, and then the View layer can correspondingly display.

[0130] In actual applications, a user who customizes the interface can not need to modify the content in the ViewModel layer, and the content in the ViewModel layer can be secret to the user.

[0131] The model layer in the MVVM architecture refers to a data model, and generally refers to various business logic processing and data manipulation performed by a backend. The service processing logic triggered by the event processing center in the embodiments of the present specification is equivalent to the model layer. In the embodiments of the present specification, the interface customization can be performed based on the MVVM architecture and the event bus under the Hongmeng OS (operation system). The SDK file and the customized view View layer file can be SDK (Software Development Kit) files. The terminal can execute a program in the SDK file to display a customized interface, perform corresponding business processing, such as face recognition, by using the customized interface.

[0132] To more clearly illustrate the method for customizing an interface based on an event bus provided in the embodiments of the present specification, the face recognition interface is taken as an example and the architecture diagram shown in FIG. 2 is used for illustration. FIG. 2 is an architecture diagram for displaying a customized interface provided in the embodiments of the present specification.

[0133] As shown in FIG. 2, the view View layer 202 can represent a code program included in a customized view View layer file; the event processing center 204 can represent a code program representing an event processing center in an SDK file; the service processing logic 206 can represent a code program for executing corresponding service processing logic in an SDK file, which can also be referred to as a model layer; and the ViewModel layer 208 can represent a code program included in a view data ViewModel layer file. In actual applications, if the state variable managed by the ViewModel layer is irrelevant to a device setting service, a permission verification service, and a timing operation service, the model layer can also be a code program of a data processing service.

[0134] It is assumed that the customization interface is a face recognition interface, and the service processing logic is service processing logic for face recognition. After the page demand side obtains the initial view View layer file, the page parameters are edited according to the actual demand; then the customized view View layer file obtained after editing, the ViewModel layer code file, and the code file containing the event processing center and various service service logic are recorded in the terminal device, for example, the terminal device can be a terminal for handling business. The terminal can determine the customized view View layer file that needs to be executed based on the routing function of the Harmony system.

[0135] The application program for handling business can be run in the terminal device, and the application program can access the structure involved in the embodiments of the present specification through API calling and the like. If the application program needs to start the face recognition function, for example, the user clicks the control for starting face recognition in the application program, it is necessary to create a face recognition interface, and the View layer can publish a page creation event in the system callback method. This event can have a pre-defined event ID, for example, zeta_event_on_face_page_liveness_appear, and the ViewModel object can be included in the event and passed to the event processing center for subsequent modification.

[0136] After the event processing center obtains this page creation event ID, according to the pre-established correspondence between the event and the corresponding service processing logic, the permission verification service can be triggered to judge whether the terminal is authorized to use the camera, and the permission verification result is obtained. This permission verification result can be sent to the event processing center, which can also be understood as the event processing center detecting the permission verification result, and then the event processing center triggering the corresponding service according to the permission verification result. Specifically, if the camera permission has been turned on, the ViewModel object can be modified, which contains a state variable of the state of whether the camera permission is available. The ViewModel layer can synchronize the state variable to the View layer, and then the View layer can display the face brushing component according to the camera permission state of the ViewModel object, for example, a small round box in the page, indicating the area for collecting faces. The event processing center can also start a timing operation service, such as starting a countdown, and can also start a device setting service, such as adjusting the screen brightness to a preset value. If the camera permission is not turned on, the event processing center can trigger a pop-up box to prompt the user to turn on or leave the interface.

[0137] After starting the camera to collect images, the event processing center can also trigger a data processing service, such as calling a face algorithm to judge the quality of the collected face, and can also judge whether the collected face is a face matched with the business.

[0138] If the data processing service detects that the face is not centered, the event processing center modifies the ViewModel object sent when the page is created, and the ViewModel layer determines that the user needs to turn left or right or up or down according to the result and feeds back to the View layer, so that the View layer triggers the display of the text or voice of “Please keep the face centered” or other prompt information.

[0139] During the process of adjusting the posture according to the prompt, the camera can continuously collect user image data and process it using the data processing service. After the data processing service detects the face state, it can also modify the score of the face facing the screen in the ViewModel object sent when the page is created, and then feed back to the View layer, so that the interface also displays the progress accordingly. When facing completely, it can display the progress as 100%. If the face recognition succeeds or fails within a preset time period, the View layer can also display prompt information indicating that the recognition succeeds or fails. The modification of the state variable in the ViewModel layer can be performed by the event processing center or by the service processing logic, such as the data processing service, which is not limited here.

[0140] If the operation user identifies the completion or the user does not continue to identify and clicks the return control in the page, the View layer can publish a page return event such as “zeta_event_on_face_page_back”. After the event processing center obtains the event, it can create a pop-up window to prompt the user whether to try again.

[0141] If the operation user performs an operation such as swiping up or swiping down in the terminal to indicate that the page is backgrounded, the View layer can publish a background event such as “zeta_event_on_face_page_hide”. After the event processing center obtains the background event, it can suspend the service, such as suspending the timing, suspending the data processing service, etc.

[0142] If the operation user displays the background page in the front-end page, the View layer can publish a page foregrounding event. After the event processing center obtains the event, it can restore the service, such as restoring the timing, restoring the data processing service, etc.

[0143] If the operation user identifies the completion and exits the face recognition interface, the View layer can obtain information indicating that the interface is to be destroyed through a system callback, can publish a page destruction event, and the event processing center can release the held resources after obtaining the event, such as closing the timing service, algorithm processing service, canceling event listening, etc.

[0144] In the embodiments of the present specification, the decoupling of the face recognition interface and the service module is achieved by introducing the mechanism of event bus and event processing center. This design makes the communication between the interface and the service more flexible, reduces the complexity of the interface, and improves the scalability of the system. On the other hand, by providing the View layer code containing only view layout, state variable and event trigger timing, the customization demand party can customize the interface layout and control details flexibly according to its own needs, while protecting the confidentiality of the face recognition core technology. On the other hand, the customization demand party does not need to understand the complex internal processing mechanism when customizing the interface, and only needs to focus on the interface appearance design, state management and event sending. Simplified event definitions such as interface creation, activation, transition to background, destruction and control interaction further reduce the complexity of interface customization development, and significantly reduce the compatibility problems caused by service API changes.

[0145] Based on the same idea, the present specification also provides a device corresponding to the above method. FIG. 3 is a structural schematic diagram of a device for customizing an interface based on an event bus according to an embodiment of the present specification. As shown in FIG. 3, the device can include:

[0146] The parameter editing module 302 is configured to obtain page parameter information edited by a user.

[0147] The file generation module 304 is configured to generate a custom view View layer file for rendering and displaying a customized interface corresponding to the page parameter information based on the page parameter information.

[0148] The custom view View layer file includes event publishing code for publishing an event; the event is used to trigger service processing logic corresponding to the event by an event processing center.

[0149] The file loading module 306 is configured to load the custom view View layer file and an SDK file including the event processing center and the service processing logic to a terminal, so that the terminal can display the customized interface based on the custom view View layer file and can call the service processing logic based on the event processing center to respond to an event triggered by the customized interface.

[0150] Based on the device of FIG. 3, the present specification also provides some specific implementation schemes of the device, which are described below.

[0151] Optionally, the parameter editing module can include:

[0152] An initial file obtaining unit is configured to obtain an initial view View layer file; the file code of the initial view View layer file includes editable view parameter code;

[0153] A code editing unit is configured to obtain the page parameter information edited by the user based on an editing operation of the user on the editable view parameter code.

[0154] Optionally, the initial view View layer file contains the code for publishing the event; and the file generation module can be specifically configured to:

[0155] The page parameter information is used to update the editable view parameter code in the initial view View layer file, so as to obtain the customized view View layer file.

[0156] Optionally, the SDK file further includes a view data ViewModel layer file; the view data ViewModel layer file is configured to save a state variable related to the customized interface; and a variable value of the state variable can be updated according to processing result data of the service processing logic.

[0157] Optionally, the page parameter information includes information of at least one display parameter of a display position, a display form, a display color, a display sequence, and display content of a page component; and the page component includes at least one of a title bar, an operation control, a progress bar, an image acquisition frame, and prompt information.

[0158] Optionally, the customized view View layer file contains a page routing identifier; the terminal is provided with a Hongmeng system; and the terminal can determine, based on a routing mechanism of the Hongmeng system, that the customized view View layer file displays the customized interface according to the page routing identifier.

[0159] Optionally, the event includes at least one of an interface creation event, an interface background event, an interface foreground event, an interface destruction event, and an interactive event of a control in the interface.

[0160] Optionally, the service processing logic includes processing logic of at least one of a timing operation service, a permission verification service of a terminal device, a device setting service of the terminal device, and a business data processing service.

[0161] Optionally, the permission verification service of the terminal device includes a permission verification service for verifying a camera permission; the setting service of the terminal device includes a service for adjusting a screen brightness of the terminal; and the business data processing service includes a service for calling a face verification algorithm to verify a collected face image.

[0162] Optionally, the event includes an interface creation event; and the terminal can publish the interface creation event by executing the event publishing code and taking the state variable of the view data ViewModel layer file as a parameter after obtaining an interface creation instruction.

[0163] The event processing center receives the interface creation event, triggers execution of service processing logic corresponding to the interface creation event;

[0164] The state variable is updated according to processing result information of the service processing logic corresponding to the interface creation event, to obtain an updated state variable;

[0165] The view data ViewModel layer file triggers the customized view View layer file to display corresponding page information according to the updated state variable.

[0166] Based on the same idea, the embodiments of the present specification also provide a device corresponding to the above method.

[0167] FIG. 4 is a structural schematic diagram of a device for customizing an interface based on an event bus according to an embodiment of the present specification. As shown in FIG. 4, the device 400 can include:

[0168] at least one processor 410; and

[0169] a memory 430 in communication connection with the at least one processor; wherein

[0170] The memory 430 stores instructions 420 executable by the at least one processor 410, and the instructions are executed by the at least one processor 410 to enable the at least one processor 410 to:

[0171] obtain page parameter information edited by a user;

[0172] generate a customized view View layer file for rendering and displaying a customized interface corresponding to the page parameter information based on the page parameter information; the customized view View layer file includes event publishing code for publishing an event; the event is used for an event processing center to trigger service processing logic corresponding to the event;

[0173] load the customized view View layer file and an SDK file including the event processing center and the service processing logic to a terminal, so that the terminal can display the customized interface based on the customized view View layer file and can call the service processing logic based on the event processing center to respond to an event triggered by the customized interface.

[0174] Based on the same idea, the embodiments of the present specification also provide a computer readable medium corresponding to the above method. The computer readable medium stores computer readable instructions executable by a processor to implement the above method for customizing an interface based on an event bus.

[0175] The various embodiments described in this specification are presented by way of example, and each embodiment is not necessarily composed of all features described with respect to other embodiments. Each embodiment is directed to the differentiating features of that embodiment, and each embodiment can be combined with other embodiments as would be understood by one skilled in the art. For example, the apparatus of Figure 4 is described in relatively less detail because it is substantially similar to the method embodiments. The apparatus embodiment can incorporate any of the features described with respect to the method embodiments.

[0176] In the 1990s, it was quite obvious to distinguish whether an improvement in a technology was in hardware (e.g., improvement in circuit structures of diodes, transistors, switches, etc.) or in software (improvement in method flow). However, as technology has evolved, many improvements in method flow today can be considered as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structures by programming the improved method flow into hardware circuits. Therefore, it cannot be said that an improvement in a method flow cannot be implemented by hardware entity modules. For example, a programmable logic device (PLD) (e.g., a field programmable gate array (FPGA)) is an integrated circuit whose logic function is determined by user programming of the device. A digital system is "integrated" on a PLD by the designer programming it, rather than by asking a chip manufacturer to design and fabricate a custom integrated circuit chip. Moreover, instead of manually fabricating integrated circuit chips, this programming is now mostly implemented by "logic compiler" software, which is similar to software compilers used in program development, and the original code to be compiled is written in a specific programming language, which is called a hardware description language (HDL), and there are many such languages, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., and the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should be aware that, as long as the method flow is logically programmed in the above-mentioned hardware description languages and programmed into an integrated circuit, a hardware circuit implementing the logical method flow can be easily obtained.

[0177] The controller can be implemented in any suitable way, for example, the controller can take the form of a microprocessor or processor and a computer readable medium storing computer readable program code, such as software or firmware, executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that, in addition to being implemented in pure computer readable program code, the controller can also be implemented to perform the same functions in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers and embedded microcontrollers, etc. by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can even be considered as both a software module implementing a method and a structure within a hardware component.

[0178] The systems, apparatuses, modules or units illustrated by the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0179] For the sake of description, the above apparatuses are described in functional division and are described respectively. Of course, the functions of the units can be implemented in the same or multiple software and / or hardware in the implementation of the present application.

[0180] Those skilled in the art will understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.

[0181] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks.

[0182] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks.

[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks.

[0184] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0185] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, for storing, in general, data and / or program instructions. The memory can also include non-volatile memory, such as read-only memory (ROM), electrically programmable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), flash memory, or non-volatile random access memory (NVRAM), for storing, in general, data and / or program instructions. The memory is an example of computer readable media.

[0186] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0187] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but also other elements not explicitly listed or inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0188] Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, system or computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer usable program code.

[0189] The present application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform particular tasks or implement particular abstract data types. The present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including memory storage devices.

[0190] The above merely provides an example of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application should be included in the scope of claims of the present application.

Claims

1. A method for customizing an interface based on an event bus, comprising: obtaining page parameter information edited by a user; generating a custom view View layer file for rendering a custom interface corresponding to the page parameter information based on the page parameter information; the custom view View layer file containing event publishing code for publishing an event; the code being used for publishing an event based on a preset operation of the user on the custom interface; the event being used for triggering service processing logic corresponding to the event by an event processing center; loading the custom view View layer file and an SDK file containing the event processing center and the service processing logic to a terminal, so that the terminal can display the custom interface based on the custom view View layer file and can call the service processing logic based on the event processing center to respond to an event triggered by the custom interface. 2.The method of claim 1, wherein the obtaining of the page parameter information edited by the user specifically comprises: obtaining an initial view View layer file; the file code of the initial view View layer file including editable view parameter code; obtaining the page parameter information edited by the user based on an editing operation of the user on the editable view parameter code. 3.The method of claim 2, wherein the initial view View layer file contains the code for publishing an event; and the generating of the custom view View layer file for rendering a custom interface corresponding to the page parameter information based on the page parameter information specifically comprises: updating the editable view parameter code in the initial view View layer file by using the page parameter information to obtain the custom view View layer file. 4.The method of claim 1, wherein the SDK file further includes a view data ViewModel layer file; the view data ViewModel layer file is used for saving state variables related to the custom interface; and variable values of the state variables can be updated according to processing result data of the service processing logic. 5.The method of claim 1, wherein the page parameter information includes information of at least one display parameter of a display position, a display form, a display color, a display order, and display content of a page component; the page component includes at least one of a title bar, an operation control, a progress bar, an image acquisition frame, and prompt information. 6.The method of claim 1, wherein the custom view View layer file contains a page routing identifier; the terminal is equipped with a Hongmeng system; and the method further comprises: determining, by the terminal based on a routing mechanism of the Hongmeng system, to execute the custom view View layer file to display the custom interface according to the page routing identifier. 7.The method of claim 1, wherein the event includes at least one of an interface creation event, an interface background event, an interface foreground event, an interface destruction event, and an interaction event of a control in an interface. And / or, the service processing logic comprises processing logic of at least one of a timing operation service, a terminal device permission verification service, a terminal device device setting service, and a service data processing service.

8. The method of claim 7, wherein the terminal device permission verification service comprises a permission verification service for verifying a camera permission; the terminal device setting service comprises a service for adjusting terminal screen brightness; and the service data processing service comprises a service for invoking a face verification algorithm to verify a collected face image.

9. The method of claim 4, the event comprising an interface creation event. The method further comprises: After the terminal device obtains the interface creation instruction, the terminal device publishes an interface creation event by executing the event publishing code, taking a state variable of the view data ViewModel layer file as a parameter; The event processing center receives the interface creation event and triggers execution of service processing logic corresponding to the interface creation event; The state variable is updated according to processing result information of the service processing logic corresponding to the interface creation event, to obtain an updated state variable; The view data ViewModel layer file triggers the customized view View layer file to display corresponding page information according to the updated state variable.

10. An apparatus for customizing an interface based on an event bus, comprising: a parameter editing module configured to obtain page parameter information edited by a user; a file generation module configured to generate a customized view View layer file for rendering and displaying a customized interface corresponding to the page parameter information based on the page parameter information; the customized view View layer file comprising event publishing code for publishing an event; the code being configured to publish an event based on a preset operation of the user on the customized interface; the event being configured to trigger service processing logic corresponding to the event by an event processing center; a file loading module configured to load the customized view View layer file and an SDK file comprising the event processing center and the service processing logic to a terminal device, so that the terminal device can display the customized interface based on the customized view View layer file and can invoke the service processing logic based on the event processing center to respond to an event triggered by the customized interface.

11. An apparatus for customizing an interface based on an event bus, comprising: at least one processor; and, a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: obtain page parameter information edited by a user; generate a customized view View layer file for rendering and displaying a customized interface corresponding to the page parameter information based on the page parameter information; the customized view View layer file comprising event publishing code for publishing an event; the event being configured to trigger service processing logic corresponding to the event by an event processing center; loading the customized view View layer file and the SDK file containing the event handling hub and the service processing logic to the terminal so that the terminal can display the customized interface based on the customized view View layer file and can invoke the service processing logic based on the event handling hub to respond to events triggered by the customized interface.

12. A computer readable medium having stored thereon computer readable instructions executable by a processor to implement the method of customizing an interface based on an event bus of any one of claims 1 to 9.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and storage medium

    CN112764746A

  • View generation method, device, electronic equipment and computer storage medium

    CN114090924A

  • Application development framework, method and equipment and storage medium

    CN115756545A

  • Display device and method for drawing operation position in user interface

    CN118331674A

  • User interface and implementation for application service custom logic

    US20230409992A1