WO2021057925A1 - 智能设备的控制方法、装置以及智能设备、存储介质 - Google Patents

智能设备的控制方法、装置以及智能设备、存储介质 Download PDF

Info

Publication number
WO2021057925A1
WO2021057925A1 PCT/CN2020/117897 CN2020117897W WO2021057925A1 WO 2021057925 A1 WO2021057925 A1 WO 2021057925A1 CN 2020117897 W CN2020117897 W CN 2020117897W WO 2021057925 A1 WO2021057925 A1 WO 2021057925A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
page
proxy object
proxy
information
Prior art date
Application number
PCT/CN2020/117897
Other languages
English (en)
French (fr)
Inventor
张浩林
耿磊
Original Assignee
北京猎户星空科技有限公司
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 北京猎户星空科技有限公司 filed Critical 北京猎户星空科技有限公司
Publication of WO2021057925A1 publication Critical patent/WO2021057925A1/zh

Links

Images

Classifications

    • 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
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication

Definitions

  • the present disclosure relates to the field of data processing technology, and in particular to a method and device for controlling smart devices, smart devices, and storage media.
  • intelligent robots are widely used in various fields of social life, such as: intelligent office counters in banks, intelligent diagnosis robots in hospitals, shopping guide robots in shopping malls, etc. Through the application of intelligent robots, people's Life is more convenient.
  • MVP mode Model-View-Presenter mode
  • Model provides data
  • View is responsible for display
  • Presenter is responsible for logic processing
  • Model business layer and View are realized through the Presenter layer.
  • Data interaction at the page layer is not suitable for the data interaction between the robot's multi-business logic and the page, and the business logic and the page cannot communicate effectively.
  • the embodiments of the present disclosure provide a method and device for controlling a smart device, a smart device, and a storage medium, so as to solve the problem that the business logic of the smart device cannot directly drive the page in the prior art.
  • embodiments of the present disclosure provide a method for controlling a smart device, the method including:
  • the business logic of the specified service is executed according to the instruction, and when the page needs to be rendered in the process of executing the business logic, the information of the proxy object used to render the page is obtained according to the global context; wherein, the business logic is executed
  • the thread is different from the thread that renders the page.
  • the global context is the context shared by the thread that executes business logic and the thread that renders the page;
  • the information of the proxy object is sent to the page service manager through the cross-thread communication method in the global context, and based on the page service manager calling the registered service object corresponding to the information of the proxy object to render the page.
  • the instruction of the designated service is triggered through a non-interface interaction manner.
  • the obtaining the information of the proxy object used to render the page according to the global context includes:
  • the information of the proxy object is obtained.
  • obtaining the information of the proxy object includes:
  • the method also includes:
  • registering the proxy object in the business service manager based on the acquired information of the service object includes:
  • the method further includes:
  • the logout method of the specified service object is obtained from the global context through the corresponding context; where the corresponding context when the specified service object is a page service is the page context, and when the proxy object is specified as a business logic service, the corresponding context is corresponding The context of is the business context;
  • unregistering the proxy object corresponding to the designated service object in the service manager registered with the proxy object corresponding to the designated service object includes:
  • the proxy object corresponding to the specified service object is unregistered in the service manager where the proxy object is located.
  • the method before creating a service object based on the instance of the page service to be registered, the method further includes:
  • the method further includes:
  • embodiments of the present disclosure provide a control device for a smart device, the device including:
  • the receiving module is used to receive instructions for executing specified services
  • the execution module is configured to execute the business logic of the specified service according to the instruction, and when the page needs to be rendered in the process of executing the business logic, obtain the information of the proxy object used to render the page according to the global context; wherein , The thread that executes business logic is different from the thread that renders the page.
  • the global context is the context shared by the thread that executes the business logic and the thread that renders the page;
  • the sending module is configured to send the information of the proxy object to the page service manager through the cross-thread communication method in the global context, and call the registered information corresponding to the proxy object based on the page service manager
  • the server object renders the page.
  • the instruction of the designated service is triggered through a non-interface interaction manner.
  • the execution module is specifically configured to: obtain an obtaining method of the proxy object used for rendering the page from the global context; and obtain the information of the proxy object according to the obtaining method.
  • the execution module is specifically used to: obtain the information of the proxy object in the business service manager;
  • the device further includes:
  • the registration module is used to create a service object based on the instance of the page service to be registered; obtain the method of registering the service object from the global context; register the service object in the page service manager by using the method of registering the service object; obtain the registered service Object information; based on the obtained service object information, the proxy object is registered in the business service manager.
  • the registration module is specifically configured to: create a proxy service according to the information of the service object; generate a proxy object according to the proxy service; and register the proxy object with the business service manager.
  • the device further includes:
  • the logout module is used to obtain the logout method of the specified service object from the global context through the corresponding context when logging out the specified service object; wherein, when the specified service object is a page service, the corresponding context is the page context, and the designated proxy object is the business For logical services, the corresponding context is the business context; the designated service object is registered in the corresponding service manager based on the obtained logout method; the designated service object is unregistered in the service manager where the proxy object corresponding to the designated service object is located The corresponding proxy object.
  • the logout module is specifically configured to: send the information of the service object that is logged out to the service manager where the proxy object is located, so that the service manager where the proxy object is located notify the corresponding thread to logout through the Handler Proxy object; in response to the service manager where the proxy object is located notifying the operation of the corresponding thread through the Handler, the proxy object corresponding to the specified service object is unregistered in the service manager where the proxy object is located.
  • the registration module creates a service object based on the instance of the page service to be registered, it is also used to: determine the page called by the business logic, determine the service in the page as the page service to be registered; The logic establishes a binding relationship with the called page service to be registered;
  • the registration module After the registration module registers the proxy object in the business service manager based on the acquired information of the service object, it is also used to notify the bound business logic of a message that the registration of the proxy object is completed.
  • an embodiment of the present invention also provides a smart device, including:
  • Memory used to store program instructions
  • the processor is configured to call the program instructions stored in the memory, and execute any smart device control method in the first aspect according to the obtained program instructions.
  • an embodiment of the present invention also provides a computer storage medium, wherein the computer storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by the processor of the smart device, the smart device can Perform any smart device control method in the first aspect.
  • embodiments of the present invention also provide a computer program product, which when invoked and executed by a smart device, enables the smart device to execute any smart device control method in the first aspect.
  • Embodiments of the present disclosure provide a smart device control method, device, smart device, and storage medium, which can realize cross-thread information interaction between business logic and pages, and can drive pages through business logic.
  • FIG. 1 is a schematic flowchart of a method for controlling a smart device according to an embodiment of the present disclosure
  • FIG. 2 is a timing diagram of rendering a page provided by an embodiment of the disclosure
  • FIG. 3 is a schematic diagram of a process of registering a proxy object with a page service management module provided by an embodiment of the present disclosure
  • FIG. 4 is a sequence diagram of registering a proxy object with a page service management module provided by an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of a process of unregistering objects from a page service management module provided by an embodiment of the present disclosure
  • FIG. 6 is a sequence diagram of deregistering objects from the page service management module provided by an embodiment of the disclosure.
  • FIG. 7 is a schematic structural diagram of a control device for a smart device provided by an embodiment of the disclosure.
  • FIG. 8 is a schematic structural diagram of a smart device provided by an embodiment of the disclosure.
  • the smart device is a device with data processing capabilities, including but not limited to: robots, banks to handle credit card business The super counter and so on.
  • robots for example, at a super counter that handles credit card business at a bank, when you enter the user's identity information on the initial interface of the super counter and click Confirm, the initial interface will jump to the card selection interface.
  • page jumps are usually implemented by page-driven background business logic, so corresponding services are completed by driving different pages.
  • control method of the above smart device is limited by the need to have a page first, and the page must drive the entire business.
  • the way of pure page interaction to drive the business is limited in many usage scenarios, and it is difficult to communicate between business logic and pages. Communication, based on this, the present disclosure provides a smart device control method.
  • Words can include:
  • Global context WholeContext, which runs through the entire application, is equivalent to a bridge between business logic and page interaction.
  • the global context includes: proxy object acquisition method, page and business logic calling method, page and The method of unregistering between business logic, etc., and in order to adapt to future expansion requirements, the global context can also include storage of system resources and various other abstract methods defined, such as: obtaining system services, sending broadcasts, etc.
  • Page context FragmentContext, each page corresponds to a page context, where page information and global context handle information are stored in the page context, so that the page can call system resources and indirectly realize the interaction with business logic.
  • Business context ModuleContext, each business logic corresponds to a business context, where business logic information and global context handle information are stored in the business context, so that the business logic can call system resources and indirectly realize the interaction between pages.
  • ActivityContext Used to intercept user-based click events on the page and start the page in the activity (Activity).
  • an embodiment of the present disclosure provides a method for controlling a smart device, and the method specifically includes:
  • Step 101 Receive an instruction to execute a specified service.
  • the instruction of the designated service may be, but not limited to, triggered through a non-interface interaction manner.
  • an instruction to execute a specified service can be triggered by voice, by collecting human body movement information, by capturing human eye movement information, and so on. Take the voice trigger command as an example to illustrate. For example, for a super counter where a bank handles credit card business, the user only needs to tell the super counter that I want to handle a credit card to trigger the super counter to handle credit card business. No specific limitation is made here, and all methods of triggering business instructions through non-interface interaction are applicable to the present disclosure.
  • Step 102 Execute the business logic of the specified service according to the instruction.
  • the page needs to be rendered during the execution of the business logic, obtain the information of the proxy object used to render the page according to the global context; among them, the thread that executes the business logic and the page rendering Different threads, the global context is a context shared by the thread that executes business logic and the thread that renders the page.
  • the business logic calls the proxy object in the auxiliary thread, and the page calls the proxy object in the main thread. Since the business logic and the page are not in the same thread, it is impossible to directly call the functions provided by the other party and related information of the other party.
  • the communication between the page and the business logic is achieved through the use of the global context as a bridge.
  • obtaining the information of the proxy object used to render the page according to the global context includes: obtaining the method of obtaining the proxy object used to render the page from the global context; and obtaining the proxy according to the obtaining method Information about the object.
  • the acquisition method of the proxy object can be obtained from the global context, and information of the proxy object can be obtained based on the acquisition method, and the page can be rendered through the proxy object.
  • Step 103 Send the information of the proxy object to the page service manager through the cross-thread communication method in the global context, and call the registered service object corresponding to the information of the proxy object to render the page based on the page service manager.
  • the page may be rendered in the manner shown in FIG. 2 specifically, where Module is the business logic of the page to be rendered, ModuleContext is the business context corresponding to the business logic of the page to be rendered, WholeContext is the global context, and ModuleServiceManager It is the business service manager, ServiceProxy serves the proxy object, MethodPackageinfo is the message encapsulation class of the proxy object, ModuleHander is mainly used to solve cross-thread problems, FragmentServiceManager is the page service manager, and IService is the page service. The meanings of the same names in the following are the same, and will not be repeated hereafter.
  • Step S1 Notify the business context to pre-acquire the service of rendering the page.
  • Step S2 A method for obtaining the service object from the global context through the handle based on the service of pre-obtaining the rendered page.
  • Step S3 Obtain the information of the service object based on the method of obtaining the service object.
  • Step S4 Send the pre-registered proxy object information to the proxy service based on the known service object information.
  • Step S5 Cache the calling function of the proxy object.
  • Step S6 Package the calling function.
  • Step S7 Pass the calling function to ModuleHander.
  • Step S8 Transform the thread through the ModuleHander and send the proxy object information to the page service manager.
  • Step S9 Render the corresponding page by calling the function.
  • the page can be driven by business logic.
  • the pages corresponding to the business logic will be displayed in sequence, thereby realizing the communication between the business logic and the pages.
  • the proxy object information is obtained in the business service manager.
  • the embodiment of the present disclosure further includes a method of registering the proxy object with the page service management module, as shown in FIG. 3, including:
  • Step 301 Create a service object based on the instance of the page service to be registered.
  • the page called by the business logic is determined, and the service in the page is determined as the page service to be registered; the business logic and the called page service to be registered are established in a binding relationship.
  • Step 302 Obtain a method for registering the service object from the global context.
  • Step 303 Register the service object in the page service manager by using the method of registering the service object.
  • Step 304 Obtain the information of the registered service object.
  • Step 305 Register the proxy object in the business service manager based on the acquired information of the service object.
  • the proxy object in the business service manager after registering the proxy object in the business service manager based on the acquired information of the service object, it further includes: notifying the bound business logic of a message that the proxy object has been registered.
  • step 305 may include: first creating a proxy service based on the information of the service object, then generating a proxy object based on the proxy service, and finally registering the proxy object to the business service manager.
  • the proxy object registration can be through the method shown in Figure 4, where Service is the business logic service, ServiceInfo is the packaging class of the registered service, ServiceProxy is the proxy object service, ServiceHander is mainly used to solve cross-thread problems, and Fragment is the page .
  • Step A1 Inform the business context that the service object will be registered on the page.
  • Step A2 The business context queries whether there is a page rendering service in the business logic; if so, execute step A3, if not, stop the operation of creating a service object.
  • Step A3 Create a service object.
  • Step A4 Obtain the method of registering the service object from the global context.
  • Step A5 Call the method of registering the service object to register the service object.
  • Step A6 Obtain the service object.
  • Step A7 Inform the page service manager to pre-register the proxy object.
  • Step A8 Obtain the proxy object.
  • Step A9 Send the information of the proxy object to ServiceHander.
  • Step A10 Register the proxy object to the page service manager.
  • Step A11 Inform the page that the proxy object has been successfully registered.
  • the embodiment of the present disclosure further includes a method for deregistering the proxy object from the page service management module, as shown in FIG. 5, including:
  • Step 501 When logging out the specified service object, obtain the logout method of the specified service object from the global context through the corresponding context; wherein, when the specified service object is a page service, the corresponding context is the page context, and when the designated proxy object is a service of business logic The corresponding context is the business context.
  • Step 502 Register the designated service object in the corresponding service manager based on the obtained logout method.
  • Step 503 Deregister the proxy object corresponding to the designated service object in the service manager where the proxy object corresponding to the designated service object is located.
  • deregistering the proxy object corresponding to the designated service object includes: sending the information of the deregistered service object to the service manager where the proxy object is located, In order to make the service manager where the proxy object is located notify the corresponding thread to cancel the proxy object through the Handler; in response to the service manager where the proxy object is notified of the operation of the corresponding thread through the Handler, the designated service object is canceled in the service manager where the proxy object is located The corresponding proxy object.
  • the proxy object can be unregistered through the method shown in Figure 6, where the ServiceHander is mainly used to solve the cross-thread problem.
  • Step B1 Load the service of the logout page.
  • Step B2 Inform the business context to pre-unbind the business logic.
  • Step B3 Obtain a method for unregistering the service object from the global context.
  • Step B4 Log off the service object according to the method of logging off the service object.
  • Step B5 Inform the page service manager to pre-register the proxy object.
  • Step B6 Invoke the method of deregistering the proxy object.
  • Step B7 Deregister the proxy object.
  • Step B8 Inform the page proxy object to log out.
  • the proxy object is unregistered to facilitate the later business logic to drive the page.
  • the present disclosure may also include at least one of registering the proxy object with the business service management module, deregistering the proxy object with the business service management module, and invoking the proxy object from the business service management module.
  • the present disclosure may also include at least one of registering the proxy object with the business service management module, deregistering the proxy object with the business service management module, and invoking the proxy object from the business service management module.
  • FIG. 7 for a control device of a smart device provided by an embodiment of the present disclosure, including: a receiving module 71, an executing module 72, and a sending module 73, wherein:
  • the receiving module 71 is used to receive instructions for executing specified services.
  • the execution module 72 is configured to execute the business logic of the specified service according to the instruction, and when the page needs to be rendered during the execution of the business logic, obtain the information of the proxy object used to render the page according to the global context; Among them, the thread that executes the business logic is different from the thread that renders the page, and the global context is a context shared by the thread that executes the business logic and the thread that renders the page.
  • the sending module 73 is configured to send the information of the proxy object to the page service manager through the cross-thread communication method in the global context, and call the registered information corresponding to the proxy object based on the page service manager.
  • the server object renders the page.
  • the instruction of the designated service is triggered through a non-interface interaction manner.
  • the execution module is specifically configured to: obtain an obtaining method of the proxy object used for rendering the page from the global context; and obtain the information of the proxy object according to the obtaining method.
  • the execution module is specifically used to: obtain the information of the proxy object in the business service manager;
  • the device further includes:
  • the registration module is used to create a service object based on the instance of the page service to be registered; obtain the method of registering the service object from the global context; register the service object in the page service manager by using the method of registering the service object; obtain the registered service Object information; based on the obtained service object information, the proxy object is registered in the business service manager.
  • the registration module is specifically configured to: create a proxy service according to the information of the service object; generate a proxy object according to the proxy service; and register the proxy object with the business service manager.
  • the device further includes:
  • the logout module is used to obtain the logout method of the specified service object from the global context through the corresponding context when logging out the specified service object; wherein, when the specified service object is a page service, the corresponding context is the page context, and the designated proxy object is the business For logical services, the corresponding context is the business context; the designated service object is registered in the corresponding service manager based on the obtained logout method; the designated service object is unregistered in the service manager where the proxy object corresponding to the designated service object is located The corresponding proxy object.
  • the logout module is specifically configured to: send the information of the service object that is logged out to the service manager where the proxy object is located, so that the service manager where the proxy object is located notify the corresponding thread to logout through the Handler Proxy object; in response to the service manager where the proxy object is located notifying the operation of the corresponding thread through the Handler, the proxy object corresponding to the specified service object is unregistered in the service manager where the proxy object is located.
  • the registration module creates a service object based on the instance of the page service to be registered, it is also used to: determine the page called by the business logic, determine the service in the page as the page service to be registered; The logic establishes a binding relationship with the called page service to be registered;
  • the registration module After the registration module registers the proxy object in the business service manager based on the acquired information of the service object, it is also used to notify the bound business logic of a message that the registration of the proxy object is completed.
  • the smart device can be, but is not limited to, a robot.
  • the smart device may at least include at least one processor and at least one memory.
  • the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps in the smart device control method according to various exemplary embodiments of the present disclosure described above in this specification.
  • the processor may execute step 101 to step 103 as shown in FIG. 1.
  • the smart device 130 according to this embodiment of the present disclosure will be described below with reference to FIG. 8.
  • the smart device 130 shown in FIG. 8 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • the smart device 130 is represented in the form of a general-purpose computing device.
  • the components of the smart device 130 may include, but are not limited to: the aforementioned at least one processor 131, the aforementioned at least one memory 132, and a bus 133 connecting different system components (including the memory 132 and the processor 131).
  • the bus 133 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a processor, or a local bus using any bus structure among multiple bus structures.
  • the memory 132 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1321 and/or a cache memory 1322, and may further include a read-only memory (ROM). 1323.
  • RAM random access memory
  • ROM read-only memory
  • the memory 132 may also include a program/utility tool 1325 having a set (at least one) program module 1324.
  • program module 1324 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data. Each of the examples or some combination may include the realization of a network environment.
  • the smart device 130 can also communicate with one or more external devices 134 (such as keyboards, pointing devices, etc.), and/or with any device that enables the smart device 130 to communicate with one or more other computing devices (such as routers, Modem, etc.) communication. This communication can be performed through an input/output (Input/Output, I/O) interface 135.
  • the smart device 130 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 136. As shown in the figure, the network adapter 136 communicates with other modules for the smart device 130 through the bus 133.
  • LAN local area network
  • WAN wide area network
  • public network such as the Internet
  • various aspects of the smart terminal control method provided in the present disclosure can also be implemented in the form of a program product, which includes a computer program.
  • the program product runs on a computer device
  • the computer program is used for
  • the computer device is caused to execute the steps in the smart device control method according to various exemplary embodiments of the present disclosure described above in this specification.
  • the computer device may execute step 101 to step 103 as shown in FIG. 1.
  • the program product can adopt any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, RAM, ROM, Erasable Programmable Read-Only Only Memory, EPROM or flash memory), optical fiber, compact Disc Read-Only Memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • CD-ROM compact Disc Read-Only Memory
  • the program product for the control of the smart terminal of the embodiment of the present disclosure may adopt a CD-ROM and include a computer program, and may be run on a computing device.
  • the program product of the present disclosure is not limited thereto.
  • the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device, or device.
  • the readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, in which a readable computer program is carried. This propagated data signal can take many forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device.
  • the computer program contained on the readable medium can be transmitted by any suitable medium, including, but not limited to, wireless, wired, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
  • any suitable medium including, but not limited to, wireless, wired, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
  • the computer program for performing the operations of the present disclosure can be written in any combination of one or more programming languages.
  • the programming language includes object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural programming. Language-such as "C" language or similar programming language.
  • the computer program can be executed entirely on the target computing device, partly executed on the target device, executed as an independent software package, partly executed on the target computing device and partly executed on the remote computing device, or completely executed on the remote computing device Execute on the device or server.
  • the remote computing device can be connected to the target computing device through any kind of network-LAN or WAN, or it can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet) ).
  • the embodiments of the present disclosure can be provided as a method, a system, or a computer program product. Therefore, the present disclosure may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable computer programs.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种智能设备的控制方法、装置以及智能设备、存储介质,涉及数据处理技术领域,该方法包括:接收执行指定业务的指令(101);根据所述指令执行所述指定业务的业务逻辑,在执行所述业务逻辑的过程中需要渲染页面时,根据全局上下文,获取用于渲染所述页面的代理对象的信息;其中,执行业务逻辑的线程与渲染页面的线程不同,全局上下文为执行业务逻辑的线程和渲染页面的线程共享的上下文(102);将所述代理对象的信息通过所述全局上下文中的跨线程通信方法发送给页面服务管理器,并基于所述页面服务管理器调用注册的与所述代理对象的信息对应的服务对象渲染所述页面(103)。该方式可以实现业务逻辑和页面的跨线程信息交互,且可以通过业务逻辑驱动页面。

Description

智能设备的控制方法、装置以及智能设备、存储介质
相关申请的交叉引用
本公开要求在2019年09月27日提交中国专利局、申请号为201910923817.9、申请名称为“智能设备的控制方法、装置以及智能设备、存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开涉及数据处理技术领域,尤其涉及一种智能设备的控制方法、装置以及智能设备、存储介质。
背景技术
随着人工智能的发展,智能机器人被广泛应用在社会生活中的各个领域,如:银行的智能办公柜台、医院的智能导诊机器人、商场的导购机器人等,通过智能机器人的应用,使得人们的生活更加便利。
现有的智能机器人的数据调用大多是采用MVP模式(Model-View-Presenter mode,MVP mode),其中,Model提供数据,View负责显示,Presenter负责逻辑的处理,通过Presenter层实现Model业务层和View页面层的数据交互,然而,MVP模式并不适用于机器人多业务逻辑和页面的数据交互,业务逻辑和页面不能进行有效的通信。
发明内容
本公开实施例提供一种智能设备的控制方法、装置以及智能设备、存储介质,用以解决现有技术中智能设备的业务逻辑无法直接驱动页面的问题。
第一方面本公开实施例提供一种智能设备的控制方法,所述方法包括:
接收执行指定业务的指令;
根据所述指令执行所述指定业务的业务逻辑,在执行所述业务逻辑的过 程中需要渲染页面时,根据全局上下文,获取用于渲染所述页面的代理对象的信息;其中,执行业务逻辑的线程与渲染页面的线程不同,全局上下文为执行业务逻辑的线程和渲染页面的线程共享的上下文;
将所述代理对象的信息通过所述全局上下文中的跨线程通信方法发送给页面服务管理器,并基于所述页面服务管理器调用注册的与所述代理对象的信息对应的服务对象渲染所述页面。
可选的,所述指定业务的指令为通过非界面交互方式触发的。
可选的,所述根据全局上下文,获取用于渲染所述页面的代理对象的信息,包括:
从全局上下文中获取用于渲染所述页面的代理对象的获取方法;
根据所述获取方法,获取所述代理对象的信息。
可选的,获取所述代理对象的信息,包括:
在业务服务管理器中获取代理对象的信息;
所述方法还包括:
基于待注册页面服务的实例创建服务对象;
从所述全局上下文中获取注册服务对象的方法;
利用所述注册服务对象的方法在页面服务管理器注册服务对象;
获取注册的服务对象的信息;
基于获取的服务对象的信息在业务服务管理器中注册代理对象。
可选的,基于获取的服务对象的信息在业务服务管理器中注册代理对象,包括:
根据服务对象的信息创建代理服务;
根据所述代理服务生成代理对象;
将代理对象注册到业务服务管理器。
可选的,所述方法还包括:
注销指定服务对象时,通过相应的上下文从全局上下文中获取所述指定服务对象的注销方法;其中,指定服务对象为页面服务时相应的上下文为页 面上下文,指定代理对象为业务逻辑的服务时相应的上下文为业务上下文;
基于获取的注销方法在对应的服务管理器中注册所述指定服务对象;
在指定服务对象对应的代理对象所在的服务管理器中注销所述指定服务对象对应的代理对象。
可选的,在注册有所述指定服务对象对应的代理对象的服务管理器中注销所述指定服务对象对应的代理对象,包括:
将注销的服务对象的信息发送给所述代理对象所在的服务管理器,以使所述代理对象所在的服务管理器通过Handler通知相应的线程注销代理对象;
响应于所述代理对象所在的服务管理器通过Handler通知相应的线程的操作,在所述代理对象所在的服务管理器中注销所述指定服务对象对应的代理对象。
可选的,基于待注册页面服务的实例创建服务对象之前,所述方法还包括:
确定业务逻辑调用的页面,将该页面中的服务确定为所述待注册页面服务;
将所述业务逻辑和被调用的待注册页面服务建立绑定关系;
所述基于获取的服务对象的信息在业务服务管理器中注册代理对象之后,所述方法还包括:
将代理对象注册完成的消息通知给绑定的业务逻辑。
第二方面本公开实施例提供一种智能设备的控制装置,所述装置包括:
接收模块,用于接收执行指定业务的指令;
执行模块,用于根据所述指令执行所述指定业务的业务逻辑,在执行所述业务逻辑的过程中需要渲染页面时,根据全局上下文,获取用于渲染所述页面的代理对象的信息;其中,执行业务逻辑的线程与渲染页面的线程不同,全局上下文为执行业务逻辑的线程和渲染页面的线程共享的上下文;
发送模块,用于将所述代理对象的信息通过所述全局上下文中的跨线程通信方法发送给页面服务管理器,并基于所述页面服务管理器调用注册的与 所述代理对象的信息对应的服务对象渲染所述页面。
可选的,所述指定业务的指令为通过非界面交互方式触发的。
可选的,所述执行模块,具体用于:从全局上下文中获取用于渲染所述页面的代理对象的获取方法;根据所述获取方法,获取所述代理对象的信息。
可选的,所述执行模块,具体用于:在业务服务管理器中获取代理对象的信息;
所述装置,还包括:
注册模块,用于基于待注册页面服务的实例创建服务对象;从所述全局上下文中获取注册服务对象的方法;利用所述注册服务对象的方法在页面服务管理器注册服务对象;获取注册的服务对象的信息;基于获取的服务对象的信息在业务服务管理器中注册代理对象。
可选的,所述注册模块,具体用于:根据服务对象的信息创建代理服务;根据所述代理服务生成代理对象;将代理对象注册到业务服务管理器。
可选的,所述装置还包括:
注销模块,用于注销指定服务对象时,通过相应的上下文从全局上下文中获取所述指定服务对象的注销方法;其中,指定服务对象为页面服务时相应的上下文为页面上下文,指定代理对象为业务逻辑的服务时相应的上下文为业务上下文;基于获取的注销方法在对应的服务管理器中注册所述指定服务对象;在指定服务对象对应的代理对象所在的服务管理器中注销所述指定服务对象对应的代理对象。
可选的,所述注销模块,具体用于:将注销的服务对象的信息发送给所述代理对象所在的服务管理器,以使所述代理对象所在的服务管理器通过Handler通知相应的线程注销代理对象;响应于所述代理对象所在的服务管理器通过Handler通知相应的线程的操作,在所述代理对象所在的服务管理器中注销所述指定服务对象对应的代理对象。
可选的,所述注册模块基于待注册页面服务的实例创建服务对象之前,还用于:确定业务逻辑调用的页面,将该页面中的服务确定为所述待注册页 面服务;将所述业务逻辑和被调用的待注册页面服务建立绑定关系;
所述注册模块基于获取的服务对象的信息在业务服务管理器中注册代理对象之后,还用于:将代理对象注册完成的消息通知给绑定的业务逻辑。
第三方面,本发明实施例还提供一种智能设备,包括:
存储器以及处理器;
存储器,用于存储程序指令;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序指令执行第一方面中的任一智能设备的控制方法。
第四方面,本发明实施例还提供一种计算机存储介质,其中,所述计算机存储介质存储有计算机可执行指令,所述计算机可执行指令由智能设备的处理器执行时,所述智能设备能够执行第一方面中的任一智能设备的控制方法。
第五方面,本发明实施例还提供一种计算机程序产品,所述计算机程序产品在被智能设备调用执行时,可使所述智能设备执行第一方面中的任一智能设备的控制方法。
本公开实施例提供的一种智能设备的控制方法、装置以及智能设备、存储介质,该方式可以实现业务逻辑和页面的跨线程信息交互,且可以通过业务逻辑驱动页面。
本公开的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本公开而了解。本公开的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍,显而易见地,下面所介绍的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的 前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的一种智能设备的控制方法的流程示意图;
图2为本公开实施例提供的渲染页面的时序图;
图3为本公开实施例提供的向页面服务管理模块注册代理对象的流程示意图;
图4为本公开实施例提供的向页面服务管理模块注册代理对象的时序图;
图5为本公开实施例提供的向页面服务管理模块注销对象流程示意图;
图6为本公开实施例提供的向页面服务管理模块注销对象的时序图;
图7为本公开实施例提供的一种智能设备的控制装置的结构示意图;
图8为本公开实施例提供的智能设备的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
现有技术中,智能设备在启动后,通常是用户通过在页面操作后不断地调用后台的业务逻辑,其中,智能设备是具有数据处理能力的设备,包括但不限于:机器人、银行办理信用卡业务的超级柜台等。如:在银行办理信用卡业务的超级柜台,当在超级柜台的初始界面输入用户的身份信息,点击确认后,初始界面则跳转至选卡界面。现有技术通常是通过页面驱动后台的业务逻辑实现页面的跳转的,故而通过驱动不同的页面完成相应的业务。
然而,上述智能设备的控制方法受限于必须首先具备页面,必须由页面驱动整个业务的进行,而单纯页面交互的方式驱动业务在很多使用场景下受限,而由于业务逻辑和页面之间难于通信,基于此本公开提供一种智能设备控制方法。
为便于理解,这里先对本公开涉及的一些关键词进行说明,需要说明的是,这里关键词的定义仅是用于举例说明其可能包含的含义,并不用于限定 本公开实施例,涉及的关键词可包括:
全局上下文:即WholeContext,贯穿整个应用中,相当于业务逻辑和页面之间进行交互的桥梁,在本公开中全局上下文中包括:代理对象的获取方法、页面和业务逻辑相互调用的方法、页面和业务逻辑之间注销的方法等,且为了适应以后的扩展需求,全局上下文中还可包括存储有系统资源,以及定义的其他各种抽象的方法,如包括:获取系统服务,发送广播等。
页面上下文:即FragmentContext,每个页面对应一个页面上下文,其中,页面上下文中保存有页面的信息以及全局上下文的句柄信息,以便于页面调用系统资源以及间接实现和业务逻辑间的交互。
业务上下文:即ModuleContext,每个业务逻辑对应一个业务上下文,其中,业务上下文中保存有业务逻辑的信息以及全局上下文的句柄信息,以便于业务逻辑调用系统资源以及间接实现和页面间的交互。
活动上下文:即ActivityContext,用以截获用户基于页面的点击事件并在活动(Activity)中启动页面。
参阅图1,本公开实施例提供一种智能设备的控制方法,该方法具体包括:
步骤101:接收执行指定业务的指令。
在一个实施例中,所述指定业务的指令可以但不限于为通过非界面交互方式触发的。
例如,执行指定业务的指令可通过语音触发、通过采集人体肢体动作信息触发、通过捕获人体眼球转动信息触发等。以语音触发指令为例进行说明,如:对银行办理信用卡业务的超级柜台,用户只需对着超级柜台说出我要办理信用卡,即可触发超级柜台办理信用卡的业务。在此不做具体限定,通过非界面交互的方式触发业务指令的方式均适用于本公开。
步骤102:根据指令执行指定业务的业务逻辑,在执行业务逻辑的过程中需要渲染页面时,根据全局上下文,获取用于渲染页面的代理对象的信息;其中,执行业务逻辑的线程与渲染页面的线程不同,全局上下文为执行业务逻辑的线程和渲染页面的线程共享的上下文。
在一个实施例中,业务逻辑在辅线程进行代理对象的调用,页面在主线程进行代理对象的调用,由于业务逻辑与页面不在同一线程因此无法直接调用对方提供的功能及对方的相关信息,本公开中,页面和业务逻辑之间借助全局上下文这个桥梁实现两者间的通信。
在一个实施中,根据全局上下文,获取用于渲染所述页面的代理对象的信息,包括:从全局上下文中获取用于渲染所述页面的代理对象的获取方法;根据获取方法,获取所述代理对象的信息。
通过该方式可以从全局上下文中获取代理对象的获取方法,并基于该获取方法获取代理对象的信息,并通过该代理对象渲染页面。
步骤103:将代理对象的信息通过全局上下文中的跨线程通信方法发送给页面服务管理器,并基于页面服务管理器调用注册的与代理对象的信息对应的服务对象渲染页面。
在一个实施例中,具体可以通过图2所示的方式渲染页面,其中,Module为待渲染页面的业务逻辑,ModuleContext为与待渲染页面的业务逻辑相对应的业务上下文,WholeContext为全局上下文,ModuleServiceManager为业务服务管理器,ServiceProxy为代理对象服务,MethodPackageinfo为代理对象的消息封装类,ModuleHander主要用于解决跨线程问题,FragmentServiceManager为页面服务管理器,IService为页面服务。下文中相同名称所表达的含义相同,后文不再赘述。
步骤S1:通知业务上下文预获取渲染页面的服务。
步骤S2:基于预获取渲染页面的服务通过句柄从全局上下文中获取服务对象的获取方法。
步骤S3:基于服务对象的获取方法获取服务对象的信息。
步骤S4:基于已知的服务对象信息向代理服务发送预注册代理对象的信息。
步骤S5:缓存代理对象的调用函数。
步骤S6:将调用函数封装打包。
步骤S7:将调用函数传递至ModuleHander。
步骤S8:通过ModuleHander转换线程并将代理对象的信息发送至页面服务管理器。
步骤S9:通过调用函数渲染对应的页面。
通过该方式可以通过业务逻辑驱动页面,在确定一个业务逻辑后,与该业务逻辑对应的页面也会依序展示,进而实现了业务逻辑和页面间的通信。
在一个实施例中,代理对象的信息是在业务服务管理器中获取的,本公开实施例还包括向页面服务管理模块注册代理对象的方法,如图3所示,包括:
步骤301:基于待注册页面服务的实例创建服务对象。
在一个实施例中,确定业务逻辑调用的页面,将该页面中的服务确定为所述待注册页面服务;将所述业务逻辑和被调用的待注册页面服务建立绑定关系。
步骤302:从全局上下文中获取注册服务对象的方法。
步骤303:利用注册服务对象的方法在页面服务管理器注册服务对象。
步骤304:获取注册的服务对象的信息。
步骤305:基于获取的服务对象的信息在业务服务管理器中注册代理对象。
在一个实施例中,基于获取的服务对象的信息在业务服务管理器中注册代理对象之后,还包括:将代理对象注册完成的消息通知给绑定的业务逻辑。
在一个实施例中,步骤305在具体实施可包括:首先根据服务对象的信息创建代理服务,然后根据代理服务生成代理对象,最后将代理对象注册到业务服务管理器。
具体的,代理对象注册可通过如图4所示的方法,其中,Service为业务逻辑服务,ServiceInfo为注册服务的包装类,ServiceProxy为代理对象服务,ServiceHander主要用于解决跨线程问题,Fragment为页面。
步骤A1:告知业务上下文将要在页面注册服务对象。
步骤A2:业务上下文查询业务逻辑中是否具有渲染页面的服务;若有, 执行步骤A3,若没有,则停止创建服务对象的操作。
步骤A3:创建服务对象。
步骤A4:从全局上下文获取注册服务对象的方法。
步骤A5:调用注册服务对象的方法注册服务对象。
步骤A6:获取服务对象。
步骤A7:告知页面服务管理器预注册代理对象。
步骤A8:获取代理对象。
步骤A9:发送代理对象的信息到ServiceHander。
步骤A10:注册代理对象至页面服务管理器。
步骤A11:告知页面代理对象已经注册成功。
通过该方式注册代理对象,以便于后期业务逻辑驱动页面。
在一个实施例中,本公开实施例还包括向页面服务管理模块注销代理对象的方法,如图5所示,包括:
步骤501:注销指定服务对象时,通过相应的上下文从全局上下文中获取指定服务对象的注销方法;其中,指定服务对象为页面服务时相应的上下文为页面上下文,指定代理对象为业务逻辑的服务时相应的上下文为业务上下文。
步骤502:基于获取的注销方法在对应的服务管理器中注册指定服务对象。
步骤503:在指定服务对象对应的代理对象所在的服务管理器中注销指定服务对象对应的代理对象。
需要说明的是,在注册有指定服务对象对应的代理对象的服务管理器中注销所述指定服务对象对应的代理对象,包括:将注销的服务对象的信息发送给代理对象所在的服务管理器,以使代理对象所在的服务管理器通过Handler通知相应的线程注销代理对象;响应于代理对象所在的服务管理器通过Handler通知相应的线程的操作,在代理对象所在的服务管理器中注销指定服务对象对应的代理对象。
具体的,代理对象注销可通过如图6所示的方法,其中,ServiceHander 主要用于解决跨线程问题。
步骤B1:加载注销页面的服务。
步骤B2:告知业务上下文预解绑业务逻辑。
步骤B3:从全局上下文中获取注销服务对象的方法。
步骤B4:根据注销服务对象的方法注销服务对象。
步骤B5:告知页面服务管理器预注销代理对象。
步骤B6:调用注销代理对象的方法。
步骤B7:注销代理对象。
步骤B8:告知页面代理对象注销的消息。
通过该方式注销代理对象,以便于后期业务逻辑驱动页面。
基于同样的构思和原理,本公开还可以包括:向业务服务管理模块注册代理对象、向业务服务管理模块注销代理对象以及向业务服务管理模块调用代理对象中的至少一种,在此不再一一赘述。
参阅图7为本公开实施例提供的一种智能设备的控制装置,包括:接收模块71、执行模块72以及发送模块73,其中:
接收模块71,用于接收执行指定业务的指令。
执行模块72,用于根据所述指令执行所述指定业务的业务逻辑,在执行所述业务逻辑的过程中需要渲染页面时,根据全局上下文,获取用于渲染所述页面的代理对象的信息;其中,执行业务逻辑的线程与渲染页面的线程不同,全局上下文为执行业务逻辑的线程和渲染页面的线程共享的上下文。
发送模块73,用于将所述代理对象的信息通过所述全局上下文中的跨线程通信方法发送给页面服务管理器,并基于所述页面服务管理器调用注册的与所述代理对象的信息对应的服务对象渲染所述页面。
可选的,所述指定业务的指令为通过非界面交互方式触发的。
可选的,所述执行模块,具体用于:从全局上下文中获取用于渲染所述页面的代理对象的获取方法;根据所述获取方法,获取所述代理对象的信息。
可选的,所述执行模块,具体用于:在业务服务管理器中获取代理对象 的信息;
所述装置,还包括:
注册模块,用于基于待注册页面服务的实例创建服务对象;从所述全局上下文中获取注册服务对象的方法;利用所述注册服务对象的方法在页面服务管理器注册服务对象;获取注册的服务对象的信息;基于获取的服务对象的信息在业务服务管理器中注册代理对象。
可选的,所述注册模块,具体用于:根据服务对象的信息创建代理服务;根据所述代理服务生成代理对象;将代理对象注册到业务服务管理器。
可选的,所述装置还包括:
注销模块,用于注销指定服务对象时,通过相应的上下文从全局上下文中获取所述指定服务对象的注销方法;其中,指定服务对象为页面服务时相应的上下文为页面上下文,指定代理对象为业务逻辑的服务时相应的上下文为业务上下文;基于获取的注销方法在对应的服务管理器中注册所述指定服务对象;在指定服务对象对应的代理对象所在的服务管理器中注销所述指定服务对象对应的代理对象。
可选的,所述注销模块,具体用于:将注销的服务对象的信息发送给所述代理对象所在的服务管理器,以使所述代理对象所在的服务管理器通过Handler通知相应的线程注销代理对象;响应于所述代理对象所在的服务管理器通过Handler通知相应的线程的操作,在所述代理对象所在的服务管理器中注销所述指定服务对象对应的代理对象。
可选的,所述注册模块基于待注册页面服务的实例创建服务对象之前,还用于:确定业务逻辑调用的页面,将该页面中的服务确定为所述待注册页面服务;将所述业务逻辑和被调用的待注册页面服务建立绑定关系;
所述注册模块基于获取的服务对象的信息在业务服务管理器中注册代理对象之后,还用于:将代理对象注册完成的消息通知给绑定的业务逻辑。
本公开实施例提供的智能设备的控制装置中各模块的具体实现可以参见前述方法实施例,在此不再赘述。
在介绍了本公开示例性实施方式中的智能设备的控制方法和装置之后,接下来,介绍本公开的另一示例性实施方式的智能设备。该智能设备可以但不限于为机器人。
所属技术领域的技术人员能够理解,本公开的各个方面可以实现为系统、方法或程序产品。因此,本公开的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。
在一些可能的实施方式中,根据本公开的智能设备可以至少包括至少一个处理器、以及至少一个存储器。其中,存储器存储有计算机程序,当计算机程序被处理器执行时,使得处理器执行本说明书上述描述的根据本公开各种示例性实施方式的智能设备的控制方法中的步骤。例如,处理器可以执行如图1中所示的步骤101-步骤103。
下面参照图8来描述根据本公开的这种实施方式的智能设备130。图8显示的智能设备130仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图8所示,智能设备130以通用计算装置的形式表现。智能设备130的组件可以包括但不限于:上述至少一个处理器131、上述至少一个存储器132、连接不同系统组件(包括存储器132和处理器131)的总线133。
总线133表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器、外围总线、处理器或者使用多种总线结构中的任意总线结构的局域总线。
存储器132可以包括易失性存储器形式的可读介质,例如随机存取存储器(Random Access Memory,RAM)1321和/或高速缓存存储器1322,还可以进一步包括只读存储器(Read-Only Memory,ROM)1323。
存储器132还可以包括具有一组(至少一个)程序模块1324的程序/实用工具1325,这样的程序模块1324包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可 能包括网络环境的实现。
智能设备130也可以与一个或多个外部设备134(例如键盘、指向设备等)通信,和/或与使得该智能设备130能与一个或多个其它计算装置进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(Input/Output,I/O)接口135进行。并且,智能设备130还可以通过网络适配器136与一个或者多个网络(例如局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器136通过总线133与用于智能设备130的其它模块通信。应当理解,尽管图中未示出,可以结合智能设备130使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理器、外部磁盘驱动阵列、磁盘阵列(Redundant Arrays of Independent Disks,RAID)系统、磁带驱动器以及数据备份存储系统等。
在一些可能的实施方式中,本公开提供的智能终端的控制方法的各个方面还可以实现为一种程序产品的形式,其包括计算机程序,当程序产品在计算机设备上运行时,计算机程序用于使计算机设备执行本说明书上述描述的根据本公开各种示例性实施方式的智能设备的控制方法中的步骤,例如,计算机设备可以执行如图1中所示的步骤101-步骤103。
程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、RAM、ROM、可擦式可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM或闪存)、光纤、便携式紧凑盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
本公开的实施方式的用于智能终端的控制的程序产品可以采用CD-ROM并包括计算机程序,并可以在计算装置上运行。然而,本公开的程序产品不 限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读计算机程序。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
可读介质上包含的计算机程序可以用任何适当的介质传输,包括——但不限于——无线、有线、光缆、无线射频(Radio Frequency,RF)等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的计算机程序,程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。计算机程序可以完全地在目标对象计算装置上执行、部分地在目标对象设备上执行、作为一个独立的软件包执行、部分在目标对象计算装置上部分在远程计算装置上执行、或者完全在远程计算装置或服务器上执行。在涉及远程计算装置的情形中,远程计算装置可以通过任意种类的网络——LAN或WAN—连接到目标对象计算装置,或者,可以连接到外部计算装置(例如利用因特网服务提供商来通过因特网连接)。
应当注意,尽管在上文详细描述中提及了装置的若干单元或子单元,但是这种划分仅仅是示例性的并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多单元的特征和功能可以在一个单元中具体化。反之,上文描述的一个单元的特征和功能可以进一步划分为由多个单元来具体化。
此外,尽管在附图中以特定顺序描述了本公开方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用计算机程序的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本公开的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本公开范围的所有变更和修改。
显然,本领域的技术人员可以对本公开进行各种改动和变型而不脱离本公开的精神和范围。这样,倘若本公开的这些修改和变型属于本公开权利要求及其等同技术的范围之内,则本公开也意图包含这些改动和变型在内。

Claims (12)

  1. 一种智能设备的控制方法,其特征在于,包括:
    接收执行指定业务的指令;
    根据所述指令执行所述指定业务的业务逻辑,在执行所述业务逻辑的过程中需要渲染页面时,根据全局上下文,获取用于渲染所述页面的代理对象的信息;其中,执行业务逻辑的线程与渲染页面的线程不同,全局上下文为执行业务逻辑的线程和渲染页面的线程共享的上下文;
    将所述代理对象的信息通过所述全局上下文中的跨线程通信方法发送给页面服务管理器,并基于所述页面服务管理器调用注册的与所述代理对象的信息对应的服务对象渲染所述页面。
  2. 根据权利要求1所述的方法,其特征在于,所述指定业务的指令为通过非界面交互方式触发的。
  3. 根据权利要求1所述的方法,其特征在于,所述根据全局上下文,获取用于渲染所述页面的代理对象的信息,包括:
    从全局上下文中获取用于渲染所述页面的代理对象的获取方法;
    根据所述获取方法,获取所述代理对象的信息。
  4. 根据权利要求1-3任一所述的方法,其特征在于,获取所述代理对象的信息,包括:
    在业务服务管理器中获取代理对象的信息;
    所述方法还包括:
    基于待注册页面服务的实例创建服务对象;
    从所述全局上下文中获取注册服务对象的方法;
    利用所述注册服务对象的方法在页面服务管理器注册服务对象;
    获取注册的服务对象的信息;
    基于获取的服务对象的信息在业务服务管理器中注册代理对象。
  5. 根据权利要求4所述的方法,其特征在于,基于获取的服务对象的信 息在业务服务管理器中注册代理对象,包括:
    根据服务对象的信息创建代理服务;
    根据所述代理服务生成代理对象;
    将代理对象注册到业务服务管理器。
  6. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    注销指定服务对象时,通过相应的上下文从全局上下文中获取所述指定服务对象的注销方法;其中,指定服务对象为页面服务时相应的上下文为页面上下文,指定代理对象为业务逻辑的服务时相应的上下文为业务上下文;
    基于获取的注销方法在对应的服务管理器中注册所述指定服务对象;
    在指定服务对象对应的代理对象所在的服务管理器中注销所述指定服务对象对应的代理对象。
  7. 根据权利要求6所述的方法,其特征在于,在注册有所述指定服务对象对应的代理对象的服务管理器中注销所述指定服务对象对应的代理对象,包括:
    将注销的服务对象的信息发送给所述代理对象所在的服务管理器,以使所述代理对象所在的服务管理器通过Handler通知相应的线程注销代理对象;
    响应于所述代理对象所在的服务管理器通过Handler通知相应的线程的操作,在所述代理对象所在的服务管理器中注销所述指定服务对象对应的代理对象。
  8. 根据权利要求4所述的方法,其特征在于,基于待注册页面服务的实例创建服务对象之前,所述方法还包括:
    确定业务逻辑调用的页面,将该页面中的服务确定为所述待注册页面服务;
    将所述业务逻辑和被调用的待注册页面服务建立绑定关系;
    所述基于获取的服务对象的信息在业务服务管理器中注册代理对象之后,所述方法还包括:
    将代理对象注册完成的消息通知给绑定的业务逻辑。
  9. 一种智能设备的控制装置,其特征在于,包括:
    接收模块,用于接收执行指定业务的指令;
    执行模块,用于根据所述指令执行所述指定业务的业务逻辑,在执行所述业务逻辑的过程中需要渲染页面时,根据全局上下文,获取用于渲染所述页面的代理对象的信息;其中,执行业务逻辑的线程与渲染页面的线程不同,全局上下文为执行业务逻辑的线程和渲染页面的线程共享的上下文;
    发送模块,用于将所述代理对象的信息通过所述全局上下文中的跨线程通信方法发送给页面服务管理器,并基于所述页面服务管理器调用注册的与所述代理对象的信息对应的服务对象渲染所述页面。
  10. 一种智能设备,其特征在于,包括:存储器以及处理器;
    存储器,用于存储程序指令;
    处理器,用于调用所述存储器中存储的程序指令,按照获得的程序指令执行权利要求1-8任一项所述的方法。
  11. 一种计算机存储介质,存储有计算机可执行指令,其特征在于,所述计算机可执行指令由智能设备的处理器执行时,所述智能设备能够执行权利要求1-8中任一项所述的方法。
  12. 一种计算机程序产品,其特征在于,所述计算机程序产品在被智能设备调用执行时,可使所述智能设备执行权利要求1至8任一项所述的方法。
PCT/CN2020/117897 2019-09-27 2020-09-25 智能设备的控制方法、装置以及智能设备、存储介质 WO2021057925A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910923817.9A CN110673918B (zh) 2019-09-27 2019-09-27 智能设备的控制方法、装置以及智能设备、存储介质
CN201910923817.9 2019-09-27

Publications (1)

Publication Number Publication Date
WO2021057925A1 true WO2021057925A1 (zh) 2021-04-01

Family

ID=69079906

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/117897 WO2021057925A1 (zh) 2019-09-27 2020-09-25 智能设备的控制方法、装置以及智能设备、存储介质

Country Status (2)

Country Link
CN (1) CN110673918B (zh)
WO (1) WO2021057925A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535132A (zh) * 2021-07-26 2021-10-22 中移(杭州)信息技术有限公司 设备接入方法、装置、终端设备以及存储介质
CN117436180A (zh) * 2023-12-14 2024-01-23 中建三局集团有限公司 基于中心数据库的智能设备生产驱动方法、系统及介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110673918B (zh) * 2019-09-27 2021-10-01 北京猎户星空科技有限公司 智能设备的控制方法、装置以及智能设备、存储介质
CN111338775B (zh) * 2020-02-21 2022-06-07 南京领行科技股份有限公司 一种执行定时任务的方法及设备
CN111414152B (zh) * 2020-03-25 2023-04-21 北京字节跳动网络技术有限公司 业务逻辑的实现方法、系统、可读介质和电子设备
CN112286410B (zh) * 2020-09-25 2022-09-09 长沙市到家悠享网络科技有限公司 数据处理方法、装置、电子设备及计算机可读介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1202172A1 (en) * 2000-10-31 2002-05-02 Universiteit Gent Topological, on-the-fly classification of objects into a global set and local sets
US20110145304A1 (en) * 2009-12-15 2011-06-16 Microsoft Corporation Efficient garbage collection and exception handling in a hardware accelerated transactional memory system
CN103353750A (zh) * 2013-07-24 2013-10-16 昆明理工大学 一种基于多总线的微波冶金控制系统及方法
CN109726023A (zh) * 2018-12-12 2019-05-07 中国航空工业集团公司西安航空计算技术研究所 一种支持多线程多上下文的图形任务同步管理方法
CN110673918A (zh) * 2019-09-27 2020-01-10 北京猎户星空科技有限公司 智能设备的控制方法、装置以及智能设备、存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932390B (zh) * 2011-08-11 2015-07-08 阿里巴巴集团控股有限公司 一种网络请求的处理方法和系统、网络服务提供装置
US10270671B2 (en) * 2015-09-22 2019-04-23 Microsoft Technology Licensing, Llc External process user interface isolation and monitoring
US11106274B2 (en) * 2017-04-10 2021-08-31 Intel Corporation Adjusting graphics rendering based on facial expression
US10346166B2 (en) * 2017-04-28 2019-07-09 Intel Corporation Intelligent thread dispatch and vectorization of atomic operations
US10817347B2 (en) * 2017-08-31 2020-10-27 TidalScale, Inc. Entanglement of pages and guest threads
CN109739505B (zh) * 2019-01-08 2019-11-29 网易(杭州)网络有限公司 一种用户界面的处理方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1202172A1 (en) * 2000-10-31 2002-05-02 Universiteit Gent Topological, on-the-fly classification of objects into a global set and local sets
US20110145304A1 (en) * 2009-12-15 2011-06-16 Microsoft Corporation Efficient garbage collection and exception handling in a hardware accelerated transactional memory system
CN103353750A (zh) * 2013-07-24 2013-10-16 昆明理工大学 一种基于多总线的微波冶金控制系统及方法
CN109726023A (zh) * 2018-12-12 2019-05-07 中国航空工业集团公司西安航空计算技术研究所 一种支持多线程多上下文的图形任务同步管理方法
CN110673918A (zh) * 2019-09-27 2020-01-10 北京猎户星空科技有限公司 智能设备的控制方法、装置以及智能设备、存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535132A (zh) * 2021-07-26 2021-10-22 中移(杭州)信息技术有限公司 设备接入方法、装置、终端设备以及存储介质
CN113535132B (zh) * 2021-07-26 2024-05-07 中移(杭州)信息技术有限公司 设备接入方法、装置、终端设备以及存储介质
CN117436180A (zh) * 2023-12-14 2024-01-23 中建三局集团有限公司 基于中心数据库的智能设备生产驱动方法、系统及介质
CN117436180B (zh) * 2023-12-14 2024-03-19 中建三局集团有限公司 基于中心数据库的智能设备生产驱动方法、系统及介质

Also Published As

Publication number Publication date
CN110673918A (zh) 2020-01-10
CN110673918B (zh) 2021-10-01

Similar Documents

Publication Publication Date Title
WO2021057925A1 (zh) 智能设备的控制方法、装置以及智能设备、存储介质
US9176772B2 (en) Suspending and resuming of sessions
US20230236585A1 (en) Zero footprint robotic process automation system
US8321594B2 (en) Achieving low latencies on network events in a non-real time platform
CN108595316B (zh) 分布式应用的生命周期管理方法、管理器、设备和介质
US20050038849A1 (en) Extensible framework for transferring session state
CN110716748A (zh) 业务处理方法、装置、计算机可读介质及电子设备
CN111176626A (zh) 跨编程语言的代码调用方法及装置、介质、设备
WO2020182096A1 (zh) 一种用于生成救援指令的方法与设备
US11321090B2 (en) Serializing and/or deserializing programs with serializable state
CN114610404B (zh) 基于应用框架的组件调用方法、装置和计算机设备
US20240264804A1 (en) Cloud code development system, method, apparatus, device and storage medium
US20220293085A1 (en) Method for text to speech, electronic device and storage medium
CN113784049A (zh) 安卓系统虚拟机的摄像头调用方法、电子设备和存储介质
US9208058B2 (en) Providing directional debugging breakpoints
CN113656102A (zh) 数据埋点方法及装置、存储介质、电子设备
CN111339194B (zh) 数据库接入层中间件的自动调度方法和装置
CN115600676A (zh) 深度学习模型推理方法、装置、设备及存储介质
US9386010B2 (en) Abstracted authenticated client connectivity application programming interface (API)
CN114490126A (zh) 页面处理方法、装置、电子设备和存储介质
CN113849449A (zh) 一种通信系统和信息交互方法、设备和介质
CN112988289B (zh) 调用接口的方法及系统
CN111061259A (zh) 行走机器人的事件化驱动方法、系统、设备及存储介质
US11210205B2 (en) Application debugging
CN115250276A (zh) 分布式系统及数据处理的方法和装置

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: 20870191

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20870191

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 14/10/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20870191

Country of ref document: EP

Kind code of ref document: A1