WO2018072626A1 - 组件调用的方法和装置、组件数据处理的方法和装置 - Google Patents

组件调用的方法和装置、组件数据处理的方法和装置 Download PDF

Info

Publication number
WO2018072626A1
WO2018072626A1 PCT/CN2017/105662 CN2017105662W WO2018072626A1 WO 2018072626 A1 WO2018072626 A1 WO 2018072626A1 CN 2017105662 W CN2017105662 W CN 2017105662W WO 2018072626 A1 WO2018072626 A1 WO 2018072626A1
Authority
WO
WIPO (PCT)
Prior art keywords
component
data
system platform
parent application
native
Prior art date
Application number
PCT/CN2017/105662
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 WO2018072626A1 publication Critical patent/WO2018072626A1/zh
Priority to US16/208,132 priority Critical patent/US10740114B2/en

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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • 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
    • G06F9/544Buffers; Shared memory; Pipes
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • 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
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications
    • 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
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
    • 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
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and apparatus for component call, and a method and apparatus for component data processing.
  • the operating system types of the terminal are various, including Android Android operating system, Symbian Symbian operating system, Windows mobile operating system, Apple iPhone OS operating system, and Windows operating system.
  • Components are self-contained, reusable, and functional units with a specific function.
  • a complete application often needs to call different components to perform the corresponding functions.
  • Existing applications generate components and call components by using development tools and language supported by different operating system platforms.
  • Each application needs to form a complete set of code data corresponding to the system, which occupies a large storage space and is difficult to develop.
  • Embodiments of the present invention provide a method and device for component call, a method and device for component data processing, and a non-transitory computer readable storage medium, which realize sharing of component call data for different system platforms, and reduce storage space occupation. Improve development efficiency.
  • the embodiment of the invention provides a method for calling a component, which is applied to a terminal, and the method includes:
  • the native layer invokes a first native component of the parent application corresponding to the current system platform according to the component call data, and the component identifier is used to identify the first native component and the same function running on other system platforms. Second native component.
  • Embodiments of the present invention provide a component call device, the device including one or more processors and one or more non-volatile storage media, the one or more non-volatile storage media storing one or more Computer readable instructions configured to be executed by the one or more processors; the one or more computer readable instructions comprising:
  • An acquiring module configured to acquire component calling data corresponding to the sub-application, where the component calling data includes a component identifier
  • a delivery module configured to transfer the component call data to a primary layer corresponding to the parent application through a communication pipeline corresponding to the current system platform;
  • a module configured by the native layer to invoke a first native component corresponding to the current system platform in the parent application according to the component calling data, where the component identifier is used to identify the first native component and run on another system platform A second native component with the same functionality.
  • Embodiments of the present invention provide a non-transitory computer readable storage medium storing computer readable instructions that enable at least one processor to perform a method of component invocation as described above.
  • the method and device invoked by the above component by acquiring the component calling data corresponding to the sub-application, the component calling data includes the component identifier, and the component calling data is transmitted to the original layer corresponding to the parent application through the communication pipeline corresponding to the current system platform, and the original layer is according to the original layer.
  • Component call data call a first native component corresponding to the current system platform in the parent application
  • the component identifier is used to identify the first native component and the second native component having the same function running on other system platforms
  • the child application can invoke the parent application by calling the data of the component Native components, which eliminates the need to rewrite native components for each sub-application, saving storage space, and because the same component identifier can identify different native components with the same functionality on different system platforms, so only one component call data is needed
  • Different system platforms respectively call different native components with the same function to realize the cross-platform of component calls. Developers only need to write a component call data, which improves the development efficiency.
  • An embodiment of the present invention provides a method for component data processing, which is applied to a server, and the method includes:
  • first parent application data packet corresponding to the first system platform and a second parent application data packet corresponding to the second system platform
  • first parent application data package includes a first native component
  • second parent application data packet includes a second native component having the same function as the first native component, the first native component being the same as the component identifier of the second native component, the first parent application data packet being sent to the first system platform a terminal, the second parent application data packet is sent to the second system platform terminal;
  • Embodiments of the present invention provide an apparatus for component data processing, the apparatus including one or more processors and one or more non-volatile storage media, the one or more non-volatile storage media storing one or a plurality of computer readable instructions configured to be executed by the one or more processors; the one or more computer readable instructions comprising:
  • a first acquiring module configured to acquire a first parent application data packet corresponding to the first system platform, and a second parent application data packet corresponding to the second system platform, the first parent application data package includes a first native component, and the second parent application data packet includes a second native component having the same function as the first native component a component, the first native component is the same as the component identifier of the second native component, the first parent application data packet is sent to a first system platform terminal, and the second parent application data packet is sent to Second system platform terminal;
  • a second acquiring module configured to acquire component calling data of a sub-application corresponding to the parent application, where the component calling data includes the component identifier, where the component calling data is sent to the first system platform terminal and the first Two system platform terminals.
  • Embodiments of the present invention provide a non-transitory computer readable storage medium storing computer readable instructions that enable at least one processor to perform the method of component data processing as described above.
  • the second parent application data package includes a second native component having the same function as the first native component, the first native component is the same as the component identifier of the second native component, and the first parent application data packet is sent to the first a system platform terminal, the second parent application data packet is sent to the second system platform terminal, and the component call data of the sub-application corresponding to the parent application is obtained, where the component call data includes the component identifier, and the component call data is sent to the
  • the parent application includes a native component called by the sub-application, so that the original component is not rewritten without each sub-application, saving storage space, and the same component identifier can be identified
  • Different system platforms have different native components with the same function, so only one component call data is needed.
  • Different system platforms are call different native components having the same function
  • FIG. 1 is an application environment diagram of a method for calling a component and a method for processing component data in an embodiment
  • FIG. 2 is an internal structural diagram of the first terminal 110 or the second terminal 130 in FIG. 1 in an embodiment
  • FIG. 3 is an internal structural diagram of the server 120 of FIG. 1 in an embodiment
  • FIG. 4 is a flow chart of a method of component invocation in an embodiment
  • FIG. 5 is a schematic diagram of terminal component invocation of different system platforms in an embodiment
  • FIG. 6 is a flow chart of a method of component data processing in an embodiment
  • FIG. 7 is a structural block diagram of an apparatus called by a component in an embodiment
  • Figure 8 is a block diagram showing the structure of an apparatus called by a component in another embodiment
  • Figure 9 is a block diagram showing the structure of an apparatus called by a component in still another embodiment.
  • Figure 10 is a block diagram showing the structure of an apparatus for processing component data in an embodiment
  • FIG. 11 is a structural block diagram of a second acquisition module in an embodiment
  • Figure 12 is a block diagram showing the structure of an apparatus for processing component data in another embodiment
  • Figure 13 is a block diagram showing the structure of an apparatus for processing component data in still another embodiment.
  • FIG. 1 is an application environment diagram of a method for calling a component and a method for processing a component data in an embodiment.
  • the application environment includes a first terminal 110, a server 120, a second terminal 130, and a third terminal 140, wherein the first terminal 110, the server 120, the second terminal 130, and the third terminal 140 communicate through a network.
  • the number of each terminal and server is not limited, and the server 120 can also be a server cluster.
  • the first terminal 110, the second terminal 130, and the third terminal 140 may be smart phones, tablets, notebook computers, desktop computers, etc., but are not limited thereto.
  • the first terminal 110, the second terminal 130, and the third terminal 140 may be The request is sent to the server 120 over the network, and the server 120 can return the corresponding data in response to the request.
  • the first terminal 110 runs the first operating system
  • the second terminal 130 runs the second operating system
  • the third terminal 140 is configured to edit the code data corresponding to the sub-application and the parent application, and implement the first system platform corresponding to the first terminal 110.
  • the first parent application data packet and the second parent application data packet corresponding to the second system platform of the second terminal 130, and the component calling data shared by the multiple system platforms, and the first parent application data packet and the second parent application data
  • the package and component call data is sent to the server 120, which may include a plurality of different terminals.
  • the server 120 receives the download request of the first terminal 110 and the second terminal 130, sends the first parent application data packet and component call data to the first terminal 110, and sends the second parent application data packet and component call data to the second terminal. 130.
  • the first terminal 110 transfers the component call data to the native layer through the first communication pipeline to invoke the first native component in the first parent application data packet, and the second terminal 130 transmits the component call data to the native layer through the second communication pipeline.
  • Calling the second native component in the second parent application data packet, calling the data with the same component can call different native components on different system platforms, using a set of development data to publish the sub-application to different platforms, reducing the resources of the terminal Occupied, simple and convenient, and improved development efficiency.
  • the internal structure of the first terminal 110 or the second terminal 130 in FIG. 1 is as shown in FIG. 2, and the first terminal 110 or the second terminal 130 includes a processor and a graphics processing unit connected through a system bus. , storage media, memory, network interfaces, display screens, and input devices.
  • the storage medium of the first terminal 110 or the second terminal 130 stores an operating system, and further includes a device called by the component, and the device is used to implement a method for component calling of the terminal.
  • the processor is configured to provide computing and control capabilities to support operation of the entire first terminal 110 or the second terminal 130.
  • the graphics processing unit in the first terminal 110 or the second terminal 130 is configured to provide at least a rendering capability of the display interface, such as a page drawing component of the sub-application, the memory provides an environment for the operation of the device invoked by the component in the storage medium, and the network Interface for The server 120 performs network communication, such as sending a download request to the server 120, receiving component call data, and the like.
  • the display screen is used to display an application interface or the like, and the input device is used to receive commands or data input by the user.
  • the display screen and the input device may be touch screens. The structure shown in FIG.
  • the specific terminal may include more than the figure or Fewer parts, or some parts, or different parts.
  • FIG. 3 the internal structure of server 120 in FIG. 1 is illustrated in FIG. 3, which includes a processor, storage medium, memory, and network interface connected by a system bus.
  • the storage medium of the server 120 stores an operating system, a database, and a device for processing data of components.
  • the database is used for storing data, such as a parent application data package, component call data, etc., and the device is used to implement a server. 120 component data processing method.
  • the processor of the server 120 is used to provide computing and control capabilities to support the operation of the entire server 120.
  • the memory of the server 120 provides an environment for the operation of the devices for service testing in the storage medium.
  • the network interface of the server 120 is configured to communicate with the first terminal 110, the second terminal 130, and the third terminal 140 through a network connection, such as sending component call data to the first terminal 110 and the second terminal 130.
  • the structure shown in FIG. 3 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied.
  • the specific server may include more or as shown in the figure. Fewer parts, or some parts, or different parts.
  • FIG. 4 is a flowchart of a method for invoking a component in an embodiment. This embodiment is mainly applied to the first terminal 110 in FIG. 1 by using the method. The method includes the following steps:
  • Step S210 Acquire component calling data corresponding to the sub-application, and the component calling data includes a component identifier.
  • the sub-application is an application that is attached to the parent application, and can download, start, run, and close the sub-application through the parent application.
  • the parent application can be a social application, a dedicated application that specifically supports the sub-application, a file management application, a mail application, or a game application.
  • Social applications include instant messaging applications, SNS (Social Network Service) applications, or live applications.
  • the sub-application is an application that can be implemented in an environment provided by the parent application, and the sub-application may specifically be a social application, a file management application, a mail application, or a game application.
  • the sub-application can call the native component of the parent application through the component call data, so that the native component can be rewritten without each sub-application, and the native component of the parent application can be conveniently called only by acquiring the component call data.
  • the native component refers to a component written in the native language that can be directly run on the operating system.
  • the selection and configuration of the native component of the parent application can form each page in the sub-application with different components, which can be easily and conveniently completed. Sub-application design and implementation. In one embodiment, if there are multiple sub-applications, multiple sub-applications can share the native components of the parent application, further reducing the storage space of the sub-applications.
  • the component call data refers to the data required to call the native component of the parent application, and may include a set of tags and component interfaces, including the component identifier, the properties of the component, etc.
  • the parent application provides a unified label and component interface for the child application developer to write the component. Call the data.
  • Step S220 The component call data is transmitted to the primary layer corresponding to the parent application through a communication pipeline corresponding to the current system platform.
  • the communication pipeline can be a custom communication rule that enables component call data to communicate with the native layer to communicate with each other.
  • the communication rule includes a module that converts component call data from other languages to JavaScript language data.
  • the communication pipeline can also provide the communication pipeline provided by the system platform, and the communication pipelines corresponding to different operating systems are different.
  • the native layer refers to an application written in a native language.
  • the native language is a system platform, such as iOS or Android-specific languages.
  • the iOS system platform supports Xcode and Objective-C (an extended C object-oriented programming language), Android.
  • the system platform supports Eclipse and Java, and native applications run best when they run.
  • the communication pipeline calls the data, the communication pipeline can first convert the component call data into a preset format and then transmit it.
  • the component call data of the preset layer received by the original layer can be decoded first to obtain the actual component call data.
  • the communication pipeline provides communication rules for the system platform to specify that the JavaScript scripting language data interacts with the native layer.
  • the communication pipeline provided by the system platform can be directly used to conveniently call the functions provided by the native layer through the JavaScript script language data. Just convert the component call data into JavaScript scripting language data, and the native layer can be identified through the communication pipeline, without custom communication rules.
  • the communication pipeline provided by the system platform is javascripCore.
  • the communication pipeline provided by the system platform is webview.
  • Step S230 the native layer invokes a first native component corresponding to the current system platform in the parent application according to the component call data, and the component identifier is used to identify the first native component and the second native component having the same function running on other system platforms.
  • the component call data specifically describes the components and components of the component to be called
  • the data may be obtained by the native layer according to the component identifier, and the first native component corresponding to the current system platform is obtained according to the component identifier, and the first native component is drawn on the page of the child application according to the attribute data of the component to complete the calling of the first native component.
  • the component identifier is not only used to identify the first native component corresponding to the current system platform, but also used to identify the second native component of the other system platform having the same function. As shown in FIG. 5, the second system terminal is the same as the current system terminal.
  • the component call data can call the second native component.
  • the first system terminal transmits the component call data to the first native layer corresponding to the first parent application of the first system terminal by using the first communication pipeline corresponding to the first system platform, and the second system terminal passes the second corresponding to the second system platform
  • the communication pipeline transfers the component call data to the second native layer corresponding to the second parent application of the second system terminal, and because the component call data is the same, the second system platform corresponding to the second native platform has the same function as the first native component.
  • Native components It can be understood that the first parent application and the second parent application can be parent applications that implement the same or different functions. Since the same component identifier can identify different native components with different functions of different system platforms, only one component call data is needed to call different native components with the same function on different system platforms, and one component can call data. On the parent application of different system terminals, the sub-applications with the same function on the same page are run, and the cross-platform of the component call is realized. The developer only needs to write a component call data, which improves the development efficiency.
  • the component calling data includes the component identifier, and the component calling data is transmitted to the original layer corresponding to the parent application through the communication pipeline corresponding to the current system platform, and the original layer calls the data according to the component.
  • the first native component corresponding to the current system platform in the parent application is invoked, and the component identifier is used to identify the first native component and the second native component having the same function running on other system platforms, and the child application can invoke the data calling component through the component
  • the native components of the application so that the native components are not rewritten without each sub-application, saving storage space, and since the same component identification can identify different native components with different functions of different system platforms, only one component call data is needed.
  • Different system platforms respectively call different native components with the same function to realize the cross-platform of component calls. Developers only need to write a component call data, which improves the development efficiency.
  • the component call data is script language data generated by the initial component call data compilation corresponding to the tag language.
  • the tag language is a combination of text and other information related to the text, showing the text coding about the structure of the document and the details of the data processing.
  • the tag language syntax is simple and easy to understand.
  • the developer only needs to write
  • the initial component call data corresponding to the tag language is compiled by the compiler placed in the terminal or the server to generate initial script component data corresponding to the tag language to generate script language data.
  • a scripting language is a programming language used to control software applications, such as the JavaScript scripting language. Since the native layer corresponding to the parent application can only communicate with the script language data, it is ensured that the acquired component calling data is already compiled script language data, and the component calling data corresponding to the sub-application is not required to be compiled, thereby further improving. The efficiency of component calls.
  • the method before step S210, further includes: downloading a first parent application data packet corresponding to the current system platform, where the first parent application data packet includes a first native component, and the first parent application exists on the other system platform.
  • the data packet has a second parent application data packet of the same function, and the second parent application data packet includes the second native component.
  • the parent application data package refers to the complete data that supports the parent application running, including various native components for the parent application and the child application to call.
  • different versions of the parent application data package such as the first parent application data packet and the second parent application data package, are provided, and the first parent application data packet and the second parent application data packet can achieve the same Features.
  • the parent application data packets corresponding to different operating system platforms include native components running on different platforms with the same identity to perform the same function. Terminals of different operating systems only need to install the parent application data package corresponding to their system platform to obtain the corresponding native components.
  • the native components implement multiple functions, including multimedia functions, form functions, and life service functions. Calling with the sub-applications provides powerful functional support for the implementation of the sub-application.
  • the method before step S210, further includes: downloading, in the page of the parent application, a data packet corresponding to the child application, where the data packet includes component call data.
  • the data packet corresponding to the sub-application refers to complete data supporting the operation of the sub-application, including page configuration data, event data, and the like.
  • the component is the basic unit of page formation.
  • the page configuration data includes component call data. By configuring different component call data, different native components are drawn on the page to form different pages.
  • the download page of the sub-application can be provided in the page of the parent application, and the search box can be provided for the user to search for the sub-applications of interest, and provide information such as the sub-application's classified search and function summary description.
  • the component call data can be associated with the page code of the child application, so that the component that matches the page code is called for different sub-application pages, and the component call is made in an orderly manner.
  • step S220 includes: serializing the component call data into a JSON string and transmitting to the native layer corresponding to the parent application by the communication pipeline corresponding to the current system platform.
  • JSON JavaScript Object Notation
  • JSON JavaScript Object Notation
  • JSON can convert a set of data represented in a JavaScript object into a string, and then easily pass the string between functions.
  • JSON is a JavaScript native format. It does not require any special API (Application Programming Interface) or toolkit to process JSON data in JavaScript. Serialize component call data into JSON strings for easy transfer to the native application. Floor.
  • Step S230 includes: the native layer deserializes the JSON string into component call information, obtains the component call location and the component identifier according to the component call information, obtains the first native component corresponding to the component identifier, and draws the page of the child application according to the component call location.
  • the first native component deserializes the JSON string into component call information, obtains the component call location and the component identifier according to the component call information, obtains the first native component corresponding to the component identifier, and draws the page of the child application according to the component call location.
  • the first native component is the native layer deserializes the JSON string into component call information, obtains the component call location and the component identifier according to the component call information, obtains the first native component corresponding to the component identifier, and draws the page of the child application according to the component call location. The first native component.
  • the native layer deserializes the JSON string to obtain the component call information, and parses the component call information, obtains the component call location and the component identifier, and also includes the component attribute information, such as the display size, the display color, and the like, and obtains the component identifier.
  • the first native component is drawn on the page of the child application based on the component call location and component property information. If the component call information includes multiple component identifiers, the native layer respectively obtains corresponding multiple original components according to the component identifiers, and draws the original components on the pages of the child application according to the specific information of the respective native components, and each of the native components constitutes a layout of the page. Generate a page for the entire sub-application. A one-time call can be made to generate a sub-application page, or multiple sub-application pages can be generated.
  • the first native component includes at least one of a multimedia component, a drawing component, and a map component.
  • the multimedia component includes an audio and video playing component, configured to draw a window for playing audio and video, and receive audio and video data for playing, and the drawing component can receive the drawing data and draw the drawing data into a line, a function, and a time varying by an algorithm. Curves, etc.
  • the map component can draw a map, receive location information, etc., for mapping icons related to location, etc.
  • the multimedia component, the drawing component, and the map component are all provided by the parent application, and the developers who do not need the sub-application are developed by themselves, which greatly improves the development efficiency, reduces the development cycle, and reduces the storage space occupied by each sub-application.
  • the various components provided by the parent application can be called on multiple different system platforms by only calling the same component to further improve the convenience.
  • the parent application is a social software application
  • the child application is a stock selection service application
  • the component application data of the child application invokes a drawing component in the parent application, and receives real-time changed stock data, and the stock curve is drawn.
  • Sub-application page The server only needs to store a component selection service application component call data to be sent to different operating system terminals, and complete the same stock curve drawing on different operating systems, which greatly facilitates the stock selection service generation service page.
  • the convenience has increased the enthusiasm of enterprises to build service applications.
  • a method for processing component data is provided.
  • the method is mainly applied to the server 120 in FIG. 1 , and the method includes the following steps:
  • Step S310 acquiring a first parent application data packet corresponding to the first system platform and a second parent application data packet corresponding to the second system platform, where the first parent application data packet includes a first native component, and the second parent application data packet includes The first native component has a second native component of the same function, the first native component is the same as the component identifier of the second native component, and the first parent application data packet is sent to the first system platform terminal, the second female The application data packet is used for sending to the second system platform terminal.
  • the parent application data package refers to the complete data that supports the parent application running, including various native components for the parent application and the child application to call. Different versions of the parent application package are available for different operating system platforms. However, the parent application data packets corresponding to different operating system platforms include native components running on different platforms with the same identity to perform the same function. If the first parent application data package includes a first native component, the second parent application data package includes a second native component having the same functionality as the first native component, the first native component being the same as the component identifier of the second native component. The first system platform terminal can download the first parent application data package from the server and install and run the parent application, and the second system platform terminal can download the second parent application data package from the server and install and run the parent application.
  • first parent application data packet and the second application data packet may be application data packets that perform the same function in different operating systems, or application data packets that perform different functions in different operating systems.
  • Terminals of different operating systems only need to install the parent application data packet corresponding to their system platform to obtain the corresponding native components.
  • the native components implement various functions, including multimedia functions, form functions, and life service functions, etc., for the parent application.
  • the sub-application is called to provide powerful functional support for the implementation of the sub-application.
  • the server can receive and save the parent application data package uploaded by the parent application development terminal.
  • Step S320 acquiring component call data of the sub-application corresponding to the parent application, the component call data includes a component identifier, and the component call data is used for sending to the first system platform terminal and the second system platform terminal.
  • the sub-application is an application that is attached to the parent application and can be executed by the parent application.
  • the sub-application can call the native component of the parent application through the component call data, so that the native component can be rewritten without each sub-application, and the native component of the parent application can be conveniently called only by acquiring the component call data.
  • the design and implementation of the sub-application can be completed simply and conveniently by selecting and configuring the native components of the parent application to form each page in the sub-application with different components.
  • the component call data can match the application identifier of the child application. For a child application with multiple pages, the component call data can also match the page identifier of the child application, and different sub-application pages can match different component call data.
  • the first system platform terminal and the second system platform terminal may run a parent application that implements different or the same function, and runs a sub-application that implements the same or different functions, but may call the same component to call data in the same or different parent application and Draw the same components on the sub-application.
  • the specific storage form of the component call data can be customized as needed.
  • the server may receive the data called by the enterprise or individual of each development sub-application according to the component uploaded by the different terminal according to the specific implementation of the sub-application.
  • the first parent application data package includes a first primary component
  • the second parent application data The package includes a second native component having the same function as the first native component, the first native component being the same as the component identifier of the second native component, and the first parent application data packet is sent to the first system platform terminal
  • the second parent application data packet is sent to the second system platform terminal to obtain component call data of the child application corresponding to the parent application, the component call data includes the component identifier, and the component call data is sent to the first system platform.
  • the terminal and the second system platform terminal, the parent application includes a native component called by the sub-application, so that the original component is not rewritten without each sub-application, saving storage space, and the same component identifier can identify different system platforms.
  • Different native components of the same function so that only one component call data can be divided on different system platforms
  • the step of acquiring component call data of the sub-application corresponding to the parent application in step S320 includes: receiving initial component call data written by the tag language corresponding to the sub-application, and compiling the initial component call data to generate script language data. Get the target component call data.
  • the tag language is a combination of text and other information related to the text, and displays a text code about the structure of the document and the details of the data processing.
  • the tag language syntax is simple and easy to understand.
  • the server receives the developer through the tag.
  • the corresponding initial component of the language writes the data, and compiles the initial component call data corresponding to the tag language to generate the script language data.
  • a scripting language is a programming language used to control software applications, such as the JavaScript scripting language. Since the native layer corresponding to the parent application can only communicate with the script language data, compiling on the server ensures that the acquired component call data is already compiled script language data, and the terminal does not need to obtain the component call data corresponding to the sub-application. Compiling to further improve the efficiency of component calls.
  • the method further includes: receiving a first parent application download request sent by the first system platform terminal, and sending the first parent application data packet corresponding to the first system platform to the first system platform terminal, so that the first The system platform terminal installs the first parent application data packet to run the first parent application, and/or receives the second parent application download request sent by the second system platform terminal, and sends the second parent application data packet corresponding to the second system platform to The second system platform terminal is such that the second system platform terminal installs the second parent application data packet to run the second parent application.
  • the first system platform terminal and the second system platform terminal respectively install the first parent application data package and the second parent application data package to complete the acquisition of the original components of the different system platforms, and provide an environment for the operation of the sub-applications. and support. If the first parent application data packet and the second parent application data packet perform the same function, the running first parent application and the second parent application are parent applications running the same function on different system platforms. If the first parent application packet and The second parent application data packet performs different functions, and the first native component and the second native component of the same function can also be completed by the first parent application and the second parent application that complete the different functions.
  • the method further includes: receiving a component call data download first request sent by the first system platform terminal, and sending the component call data to the first system platform terminal, so that the first system platform terminal passes the component call data. Transmitting, by the first communication pipeline, to the first native layer corresponding to the first parent application running by the first system platform terminal, the first native layer invoking the first native component according to the component calling data; and/or receiving the second system platform
  • the component sent by the terminal invokes the data download second request, and sends the component call data to the second system platform terminal, so that the second system platform terminal transmits the component call data to the second system platform terminal through the second communication pipeline.
  • the second parent application corresponds to the second native layer, and the second native layer invokes the second native component according to the component call data.
  • the component may send a component call data download request to download the corresponding component call data, and invoke the parent application according to the component call data.
  • Component call data refers to the data needed to call the native component of the parent application, and can include a set of tags and component interfaces, including component identifiers, component properties, and so on.
  • the first system platform terminal and the second system platform terminal respectively transmit component call data to different original layers through different communication pipes, respectively, to respectively call different original components with the same identifier that implement the same function. .
  • the communication pipeline is used to interact between the component call data and the native layer. Since the native layer can only recognize data written in the JavaScript language, if the component calls data to other language data, You need to convert to JS scripting language data first. Different operating systems have different communication pipes and are provided by the system platform.
  • the native layer refers to an application written in a native language.
  • the native language is a system platform, such as iOS or Android-specific languages. For example, the iOS system platform supports Xcode and Objective-C, and the Android platform supports Eclipse and Java. Native applications. The program runs best when it runs.
  • the communication pipeline calls the data, the communication pipeline can first convert the component call data into a preset format and then transmit it.
  • the component call data of the preset layer received by the original layer can be decoded first to obtain the actual component call data.
  • the first native layer may acquire the first native component corresponding to the first system platform according to the component identifier
  • the second native layer may acquire and the second component according to the component identifier.
  • first native component and the second native component of the same component identifier have the same function, only one component call data is needed, and different native components having the same function can be respectively called on different system platforms, and one component is used to call data.
  • the sub-applications with the same functions on the same page can be run on the parent application of different system terminals, and the cross-platform of the component call is realized.
  • the developer only needs to write a component call data, which improves the development efficiency.
  • an apparatus for calling a component including:
  • the obtaining module 410 is configured to obtain component calling data corresponding to the sub-application, where the component calling data includes a component identifier.
  • the delivery module 420 is configured to pass the component call data to the native layer corresponding to the parent application through a communication pipeline corresponding to the current system platform.
  • the calling module 430 is configured to: the native layer invokes a first native component corresponding to the current system platform in the parent application according to the component calling data, where the component identifier is used to identify the first native component.
  • a second native component that has the same functionality as other system platforms.
  • the component call data is script language data generated by the initial component call data compilation corresponding to the tag language.
  • the device further includes:
  • the first downloading module 440 is configured to download a first parent application data packet corresponding to the current system platform, where the first parent application data packet includes the first native component, and the first parent application data packet exists on the other system platform.
  • the device further includes:
  • the second downloading module 450 is configured to download a data packet corresponding to the sub-application in the page of the parent application, where the data packet includes component calling data.
  • the delivery module 420 is further configured to serialize the component call data into a JSON string and transmit the data to the native layer corresponding to the parent application by using a communication pipeline corresponding to the current system platform;
  • the calling module 430 is further configured to: the native layer deserializes the JSON string into component call information, obtains a component call location and a component identifier according to the component call information, and obtains a first native component corresponding to the component identifier, according to the component call location.
  • the page of the application draws the first native component.
  • the first native component includes at least one of a multimedia component, a drawing component, and a map component.
  • the communication conduit is a communication rule provided by the system platform for specifying that JavaScript scripting language data interacts with the native layer.
  • the storage medium of the first terminal 110 may be a non-transitory computer readable storage medium for storing one or more computer readable storages. Instructions, including the get module, the transfer module, and the call module. In another embodiment, the computer readable instructions further comprise a first download module. In another embodiment, the computer readable instructions further comprise a second download module.
  • the processor of the first terminal 110 is configured to read computer readable instructions stored in the storage medium to implement the steps of the method called by the component in the above embodiment and the functions of the modules in the device called by the component.
  • an apparatus for component data processing including:
  • the first acquiring module 510 is configured to obtain a first parent application data packet corresponding to the first system platform and a second parent application data packet corresponding to the second system platform, where the first parent application data packet includes a first native component, and the second female
  • the application data package includes a second native component having the same function as the first native component, the first native component is the same as the component identifier of the second native component, and the first parent application data packet is sent to the first system platform terminal.
  • the second parent application data packet is for transmission to the second system platform terminal.
  • the second obtaining module 520 is configured to obtain component calling data of the sub-application corresponding to the parent application, where the component calling data includes a component identifier, and the component calling data is sent to the first system platform terminal and the second system platform terminal.
  • the second obtaining module 520 includes:
  • a component data obtaining unit 521 configured to receive initial component call data written in a label language corresponding to the sub-application
  • the compiling unit 522 is configured to compile the initial component call data to generate script language data to obtain target component call data.
  • the device further includes:
  • the parent application download response module 530 is configured to receive a first parent application download request sent by the first system platform terminal, and send the first parent application data packet corresponding to the first system platform to the first system platform terminal, so that the first A system platform terminal installs the first parent application data packet to operate And the second parent application downloading request sent by the second system platform terminal, and sending the second parent application data packet corresponding to the second system platform to the second system platform terminal, so that the first The second system platform terminal installs the second parent application data packet to run the second parent application.
  • the device further includes:
  • the component call data download response module 540 is configured to receive a component call data download first request sent by the first system platform terminal, and send component call data to the first system platform terminal, so that the first system platform terminal invokes the component Data is transmitted to the first native layer corresponding to the first parent application running by the first system platform terminal through the first communication pipeline, and the first native layer invokes the first native component according to the component call data; and/or is configured to receive the second The component sent by the system platform terminal invokes the data download second request, and sends the component call data to the second system platform terminal, so that the second system platform terminal transmits the component call data to the second system platform terminal through the second communication pipeline.
  • the second parent application corresponding to the second native layer, the second native layer calls the second native component according to the component call data.
  • the storage medium of the server 120 may be a non-transitory computer readable storage medium for storing one or more computer readable instructions, including An acquisition module and a second acquisition module.
  • the computer readable instructions further comprise a parent application download response module.
  • the computer readable instructions further comprise a component call data download response module.
  • the processor of the server 120 is for reading computer readable instructions stored in the storage medium to implement the steps of the method of component data processing in the above embodiments and the functions of the modules in the apparatus for component data processing.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Telephonic Communication Services (AREA)
  • Stored Programmes (AREA)

Abstract

一种组件调用的方法和装置,组件数据处理的方法和装置。组件调用的方法包括:获取子应用对应的组件调用数据,所述组件调用数据包括组件标识(S210);将所述组件调用数据通过与当前系统平台对应的通信管道传递至母应用对应的原生层(S220);所述组件调用数据调用母应用中的与当前系统平台对应的第一原生组件,所述组件标识用于标识所述第一原生组件和运行于其它系统平台的具备相同功能的第二原生组件(S230)。

Description

组件调用的方法和装置、组件数据处理的方法和装置
本申请要求于2016年10月18日提交中国专利局、申请号为201610912893.6、发明名称为“组件调用的方法和装置、组件数据处理的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机技术领域,特别是涉及一种组件调用的方法和装置、组件数据处理的方法和装置。
发明背景
随着计算机技术和终端的发展,基于各类终端的应用需求也逐渐增加。终端的操作系统类型多种多样,包括Android安卓操作系统、Symbian塞班操作系统、Windows mobile操作系统、苹果iPhone OS操作系统、以及Windows操作系统等。
组件是自包含、可重用的、具有特定功能的编程单元,一个完整的应用往往需要调用不同的组件完成相应的功能。现有的应用通过使用不同的操作系统平台相应支持的开发工具和语言生成组件和调用组件,每个应用都需要形成一套与系统对应的完整的代码数据,占用存储空间大,开发难度大。
发明内容
本发明实施例提供一种组件调用的方法和装置、组件数据处理的方法和装置及非易失性计算机可读存储介质,对于不同的系统平台实现组件调用数据的共享,减少存储空间的占用,提高开发效率。
本发明实施例提供一种组件调用的方法,应用于终端,所述方法包括:
获取子应用对应的组件调用数据,所述组件调用数据包括组件标识;
将所述组件调用数据通过与当前系统平台对应的通信管道传递至母应用对应的原生层;
所述原生层根据所述组件调用数据调用母应用中的与当前系统平台对应的第一原生组件,所述组件标识用于标识所述第一原生组件和运行于其它系统平台的具备相同功能的第二原生组件。
本发明实施例提供一种组件调用的装置,所述装置包括一个或一个以上处理器和一个或一个以上非易失性存储介质,所述一个或一个以上非易失性存储介质存储一个或多个计算机可读指令,经配置由所述一个或者一个以上处理器执行;所述一个或一个以上计算机可读指令包括:
获取模块,用于获取子应用对应的组件调用数据,所述组件调用数据包括组件标识;
传递模块,用于将所述组件调用数据通过与当前系统平台对应的通信管道传递至母应用对应的原生层;
调用模块,用于所述原生层根据所述组件调用数据调用母应用中的与当前系统平台对应的第一原生组件,所述组件标识用于标识所述第一原生组件和运行于其它系统平台的具备相同功能的第二原生组件。
本发明实施例提供一种非易失性计算机可读存储介质,存储有计算机可读指令,所述计算机可读指令能够使至少一个处理器执行如上所述的组件调用的方法。
上述组件调用的方法和装置,通过获取子应用对应的组件调用数据,组件调用数据包括组件标识,将组件调用数据通过与当前系统平台对应的通信管道传递至母应用对应的原生层,原生层根据组件调用数据调用 母应用中的与当前系统平台对应的第一原生组件,组件标识用于标识第一原生组件和运行于其它系统平台的具备相同功能的第二原生组件,子应用可以通过组件调用数据调用母应用的原生组件,从而不用每个子应用都重新编写原生组件,节省了存储空间,且由于同一组件标识可标识不同系统平台具有相同的功能的不同原生组件,从而只需要一份组件调用数据就可在不同的系统平台分别调用具有相同功能的不同原生组件,实现组件调用的跨平台,开发人员只需要编写一份组件调用数据,提高了开发的效率。
本发明实施例提供一种组件数据处理的方法,应用于服务器,所述方法包括:
获取第一系统平台对应的第一母应用数据包和第二系统平台对应的第二母应用数据包,所述第一母应用数据包包括第一原生组件,所述第二母应用数据包包括与所述第一原生组件具有相同功能的第二原生组件,所述第一原生组件与所述第二原生组件的组件标识相同,所述第一母应用数据包用于发送至第一系统平台终端,所述第二母应用数据包用于发送至第二系统平台终端;
获取母应用对应的子应用的组件调用数据,所述组件调用数据包括所述组件标识,所述组件调用数据用于发送至所述第一系统平台终端和所述第二系统平台终端。
本发明实施例提供一种组件数据处理的装置,所述装置包括一个或一个以上处理器和一个或一个以上非易失性存储介质,所述一个或一个以上非易失性存储介质存储一个或多个计算机可读指令,经配置由所述一个或者一个以上处理器执行;所述一个或一个以上计算机可读指令包括:
第一获取模块,用于获取第一系统平台对应的第一母应用数据包和 第二系统平台对应的第二母应用数据包,所述第一母应用数据包包括第一原生组件,所述第二母应用数据包包括与所述第一原生组件具有相同功能的第二原生组件,所述第一原生组件与所述第二原生组件的组件标识相同,所述第一母应用数据包用于发送至第一系统平台终端,所述第二母应用数据包用于发送至第二系统平台终端;
第二获取模块,用于获取母应用对应的子应用的组件调用数据,所述组件调用数据包括所述组件标识,所述组件调用数据用于发送至所述第一系统平台终端和所述第二系统平台终端。
本发明实施例提供一种非易失性计算机可读存储介质,存储有计算机可读指令,所述计算机可读指令能够使至少一个处理器执行如上所述的组件数据处理的方法。
上述组件数据处理的方法和装置,通过获取第一系统平台对应的第一母应用数据包和第二系统平台对应的第二母应用数据包,第一母应用数据包包括第一原生组件,第二母应用数据包包括与所述第一原生组件具有相同功能的第二原生组件,第一原生组件与所述第二原生组件的组件标识相同,第一母应用数据包用于发送至第一系统平台终端,第二母应用数据包用于发送至第二系统平台终端,获取母应用对应的子应用的组件调用数据,组件调用数据包括所述组件标识,组件调用数据用于发送至所述第一系统平台终端和所述第二系统平台终端,母应用中包括了供子应用调用的原生组件,从而不用每个子应用都重新编写原生组件,节省了存储空间,且由于同一组件标识可标识不同系统平台具有相同的功能的不同原生组件,从而只需要一份组件调用数据就可在不同的系统平台分别调用具有相同功能的不同原生组件,实现组件调用的跨平台,开发人员只需要编写一份组件调用数据,提高了开发的效率。
附图简要说明
图1为一个实施例中组件调用的方法、组件数据处理的方法的应用环境图;
图2为一个实施例中图1中的第一终端110或第二终端130的内部结构图;
图3为一个实施例中图1中的服务器120的内部结构图;
图4为一个实施例中组件调用的方法的流程图;
图5为一个实施例中不同系统平台的终端组件调用的示意图;
图6为一个实施例中组件数据处理的方法的流程图;
图7为一个实施例中组件调用的装置的结构框图;
图8为另一个实施例中组件调用的装置的结构框图;
图9为再一个实施例中组件调用的装置的结构框图;
图10为一个实施例中组件数据处理的装置的结构框图;
图11为一个实施例中第二获取模块的结构框图;
图12为另一个实施例中组件数据处理的装置的结构框图;
图13为再一个实施例中组件数据处理的装置的结构框图。
实施本发明的方式
图1为一个实施例中组件调用的方法、组件数据处理的方法运行的应用环境图。如图1所示,该应用环境包括第一终端110、服务器120、第二终端130、第三终端140,其中第一终端110、服务器120、第二终端130、第三终端140通过网络进行通信,其中各个终端和服务器的个数不限,服务器120也可为服务器集群。第一终端110、第二终端130和第三终端140,可为智能手机、平板电脑、笔记本电脑、台式计算机等,但并不局限于此。第一终端110、第二终端130、第三终端140可 通过网络向服务器120发送请求,服务器120可以响应请求返回对应的数据。
其中第一终端110运行第一操作系统,第二终端130运行第二操作系统,第三终端140用于编辑子应用和母应用对应的代码数据,实现第一终端110的第一系统平台对应的第一母应用数据包和第二终端130的第二系统平台对应的第二母应用数据包,以及多个系统平台共用的组件调用数据,并将第一母应用数据包、第二母应用数据包和组件调用数据发送至服务器120,第三终端140可包括多个不同的终端。服务器120接收第一终端110和第二终端130的下载请求,将第一母应用数据包和组件调用数据发送至第一终端110,将第二母应用数据包和组件调用数据发送至第二终端130,第一终端110通过第一通信管道传递组件调用数据至原生层以调用第一母应用数据包中的第一原生组件,第二终端130通过第二通信管道传递组件调用数据至原生层以调用第二母应用数据包中的第二原生组件,达到采用同一组件调用数据可在不同的系统平台调用不同的原生组件,使用一套开发数据将子应用发布到不同的平台,减少终端的资源占用,且简单方便,提高了开发效率。
在一个实施例中,图1中的第一终端110或第二终端130的内部结构如图2所示,该第一终端110或第二终端130包括通过系统总线连接的处理器、图形处理单元、存储介质、内存、网络接口、显示屏幕和输入设备。其中,第一终端110或第二终端130的存储介质存储有操作系统,还包括组件调用的装置,该装置用于实现一种适用于终端的组件调用的方法。该处理器用于提供计算和控制能力,支撑整个第一终端110或第二终端130的运行。第一终端110或第二终端130中的图形处理单元用于至少提供显示界面的绘制能力,如在子应用的页面绘制组件等,内存为存储介质中的组件调用的装置的运行提供环境,网络接口用于与 服务器120进行网络通信,如向服务器120发送下载请求、接收组件调用数据等。显示屏幕用于显示应用界面等,输入设备用于接收用户输入的命令或数据等。对于带触摸屏的第一终端110或第二终端130,显示屏幕和输入设备可为触摸屏。图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的终端的限定,具体的终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,图1中的服务器120的内部结构如图3所示,该服务器120包括通过系统总线连接的处理器、存储介质、内存和网络接口。其中,该服务器120的存储介质存储有操作系统、数据库和一种组件数据处理的装置,数据库用于存储数据,如母应用数据包、组件调用数据等,该装置用于实现一种适用于服务器120的组件数据处理的方法。该服务器120的处理器用于提供计算和控制能力,支撑整个服务器120的运行。该服务器120的内存为存储介质中的业务测试的装置的运行提供环境。该服务器120的网络接口用于与第一终端110、第二终端130、第三终端140通过网络连接通信,比如向第一终端110、第二终端130发送组件调用数据等。图3中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务器的限定,具体的服务器可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
图4为一个实施例中组件调用的方法的流程图,本实施例主要以该方法应用于上述图1中的第一终端110进行举例说明,该方法具体包括如下步骤:
步骤S210,获取子应用对应的组件调用数据,组件调用数据包括组件标识。
具体的,子应用是依附于母应用运行的应用程序,可通过母应用下载、启动、运行、关闭子应用。母应用可以是社交应用、专门支持子应用的专用应用、文件管理应用、邮件应用或者游戏应用等。社交应用包括即时通信应用、SNS(Social Network Service,社交网站)应用或者直播应用等。子应用则是可在母应用提供的环境中实现的应用,子应用具体可以是社交应用、文件管理应用、邮件应用或者游戏应用等。子应用可以通过组件调用数据调用母应用的原生组件,从而不用每个子应用都重新编写原生组件,只需要获取组件调用数据就能方便得调用母应用的原生组件。原生组件是指可直接运行于操作系统的采用原生语言编写完成的组件,可通过对母应用的原生组件的选取、配置形成具有绘制了不同组件的子应用中的各个页面,能简单方便的完成子应用的设计和具体实现。在一个实施例中,子应用为多个,则多个子应用可共享母应用的原生组件,进一步减小了子应用的存储空间。组件调用数据是指调用母应用的原生组件所需要的数据,可包括一组标签和组件接口,包括组件标识、组件的属性等,母应用提供统一的标签和组件接口供子应用开发者编写组件调用数据。如一个具体的实施例中,组件调用数据为“<canvas style="width:300px;height:200px;"canvas-id="firstCanvas"></canvas>”可用于调用组件标识canvas-id为firstCanvas的宽300PX像素,高200PX像素的画布,其中组件标识用于唯一标识一个组件,通过组件标识可在母应用的原生组件中找到对应的目标组件。
步骤S220,将组件调用数据通过与当前系统平台对应的通信管道传递至母应用对应的原生层。
具体的,由于组件调用数据与原生层往往通过不同的语言实现,为了实现不同语言间的通信,需要通过通信管道进行组件调用数据与原生层之间的交互,通信管道用于将组件调用数据解析为原生层可识别的数 据,为组件调用数据提供执行环境。由于原生层只能识别JavaScript语言编写的数据,如果组件调用数据为其它语言数据,则需要先转换为JavaScript脚本语言数据。通信管道可以为自定义的使得组件调用数据与原生层能相互识别进行通信的通信规则,如通信规则中包括了将组件调用数据从其它语言转化为JavaScript语言数据的模块。为了扩大通信管道对不同语言编写的组件调用数据的适用范围,通信管道也可为系统平台提供的通信管道,不同的操作系统对应的通信管道不同。原生层是指采用原生语言编写的应用程序,原生语言是某一个系统平台,比如iOS或安卓所特有的语言,比如iOS系统平台支持Xcode和Objective-C(扩充C的面向对象编程语言),安卓系统平台支持Eclipse和Java,原生应用程序运行时性能最佳。通信管道在传递组件调用数据时,可先将组件调用数据编码转换为预设格式再进行传递,原生层接收到预设格式的组件调用数据可先进行解码得到实际组件调用数据。
在一个实施例中,通信管道为系统平台提供的用于规定JavaScript脚本语言数据与原生层进行交互的通信规则。
具体的,直接使用系统平台提供的通信管道,可方便的通过JavaScript脚本语言数据调用原生层提供的功能。只需要将组件调用数据转化为JavaScript脚本语言数据,就可通过通信管道使得原生层识别,不需要自定义通信规则。对于iOS操作系统,系统平台提供的通信管道为javascripCore,对于android安桌操作系统,系统平台提供的通信管道为webview。
步骤S230,原生层根据组件调用数据调用母应用中的与当前系统平台对应的第一原生组件,组件标识用于标识第一原生组件和运行于其它系统平台的具备相同功能的第二原生组件。
具体的,由于组件调用数据具体描述了需要调用的组件和组件的属 性数据,原生层可根据组件标识获取与当前系统平台对应的第一原生组件,并根据组件的属性数据在子应用的页面绘制第一原生组件从而完成对第一原生组件的调用。且组件标识不仅用于标识当前系统平台对应的第一原生组件,还用于标识其它系统平台具备相同功能的第二原生组件,结合图5所示,如第二系统终端通过与当前系统终端相同的组件调用数据可调用第二原生组件。第一系统终端通过第一系统平台对应的第一通信管道将组件调用数据传递至第一系统终端的第一母应用对应的第一原生层,第二系统终端通过第二系统平台对应的第二通信管道将组件调用数据传递至第二系统终端的第二母应用对应的第二原生层,由于组件调用数据相同,从而可调用第二系统平台对应的与第一原生组件具备相同功能的第二原生组件。可以理解的是,第一母应用和第二母应用可以是实现相同或不同功能的母应用。由于同一组件标识可标识不同系统平台具有相同的功能的不同原生组件,从而只需要一份组件调用数据就可在不同的系统平台分别调用具有相同功能的不同原生组件,使用一份组件调用数据可在不同的系统终端的母应用上运行相同页面具有相同功能的子应用,实现组件调用的跨平台,开发人员只需要编写一份组件调用数据,提高了开发的效率。
本实施例中,通过获取子应用对应的组件调用数据,组件调用数据包括组件标识,将组件调用数据通过与当前系统平台对应的通信管道传递至母应用对应的原生层,原生层根据组件调用数据调用母应用中的与当前系统平台对应的第一原生组件,组件标识用于标识第一原生组件和运行于其它系统平台的具备相同功能的第二原生组件,子应用可以通过组件调用数据调用母应用的原生组件,从而不用每个子应用都重新编写原生组件,节省了存储空间,且由于同一组件标识可标识不同系统平台具有相同的功能的不同原生组件,从而只需要一份组件调用数据就可在 不同的系统平台分别调用具有相同功能的不同原生组件,实现组件调用的跨平台,开发人员只需要编写一份组件调用数据,提高了开发的效率。
在一个实施例中,组件调用数据为通过标签语言对应的初始组件调用数据编译生成的脚本语言数据。
具体的,标签语言是一种将文本以及文本相关的其他信息结合起来,展现出关于文档结构和数据处理细节的文字编码,标签语言语法简单,通俗易懂,本实施例中开发人员只需要编写标签语言对应的初始组件调用数据,由置于终端或服务器的编译器将标签语言对应的初始组件调用数据编译生成脚本语言数据。脚本语言是一种编程语言,用来控制软件应用程序,如JavaScript脚本语言。由于母应用对应的原生层只能与脚本语言数据进行通信,保证获取的组件调用数据已经是编译好的脚本语言数据,不需要再获取子应用对应的组件调用数据后再进行编译,进一步提高了组件调用的效率。
在一个实施例中,步骤S210之前,还包括:下载与当前系统平台对应的第一母应用数据包,第一母应用数据包中包括第一原生组件,在其它系统平台存在与第一母应用数据包具备相同功能的第二母应用数据包,第二母应用数据包包括所述第二原生组件。
具体的,母应用数据包是指支持母应用运行的完整数据,包括供母应用和子应用调用的各种原生组件等。对于不同的操作系统平台,提供了不同版本的母应用数据包,如第一母应用数据包和第二母应用数据包,且第一母应用数据包和第二母应用数据包可实现相同的功能。不同操作系统平台对应的母应用数据包中包括具有相同标识完成相同功能的在不同平台运行的原生组件。不同操作系统的终端只需要安装与其系统平台对应的母应用数据包就能获得对应的原生组件,原生组件实现了多种功能,包括多媒体功能、表单功能、生活服务类功能等,可供母应 用上的子应用进行调用,为子应用的实现提供了强大的功能支持。
在一个实施例中,步骤S210之前,还包括:在母应用的页面中下载子应用对应的数据包,所述数据包包括组件调用数据。
具体的,子应用对应的数据包是指支持子应用运行的完整数据,包括页面配置数据、事件数据等。组件是页面形成的基本单元,页面配置数据中包括了组件调用数据,通过配置不同的组件调用数据在页面上绘制不同的原生组件从而形成不同的页面。可在母应用的页面中提供子应用的下载页面,可提供搜索框供用户搜索感兴趣的子应用,提供子应用的分类搜索与功能摘要说明等信息。组件调用数据可与子应用的页面编码相关联,从而对于不同的子应用页面调用与页面编码匹配的组件,有序的进行组件调用。
在一个实施例中,步骤S220包括:与当前系统平台对应的通信管道将组件调用数据序列化为JSON字符串传递至母应用对应的原生层。
具体的,JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,JSON可以将JavaScript对象中表示的一组数据转换为字符串,然后就可以在函数之间轻松地传递这个字符串。JSON是JavaScript原生格式,在JavaScript中处理JSON数据不需要任何特殊的API(Application Programming Interface,应用程序编程接口)或工具包,将组件调用数据序列化为JSON字符串便于传递至母应用对应的原生层。
步骤S230包括:原生层将JSON字符串反序列化为组件调用信息,根据组件调用信息获取组件调用位置和组件标识,获取组件标识对应的第一原生组件,根据组件调用位置在子应用的页面绘制第一原生组件。
具体的,原生层将JSON字符串反序列化后得到组件调用信息,并解析组件调用信息,获取组件调用位置和组件标识,还包括组件属性信息,如显示大小、显示颜色等信息,获取组件标识对应的第一原生组件, 根据组件调用位置和组件属性信息在子应用的页面绘制第一原生组件。如果组件调用信息包括多个组件标识,则原生层根据组件标识分别获取对应的多个原生组件,并根据各个原生组件的具体信息在子应用的页面绘制原生组件,各个原生组件构成页面的布局,生成整个子应用的页面。一次性可调用原生组件生成一个子应用页面,也可生成多个子应用页面。
在一个实施例中,第一原生组件包括多媒体组件、绘图组件、地图组件中的至少一种。
具体的,多媒体组件包括音视频播放组件,用于绘制音视频播放的窗口,并接收音视频数据进行播放,绘图组件可接收绘图数据并将绘图数据通过算法绘制成线条、函数、随时间变化的曲线等。地图组件可绘制地图,并接收位置信息等,用于在地图绘制与位置相关的图标等。多媒体组件、绘图组件、地图组件都由母应用提供,不需要子应用的开发者自行开发,极大得提高了开发效率,减少了开发周期并减少了各个子应用占用终端的存储空间。且母应用提供的各种组件只需要同一份组件调用数据就可在多个不同的系统平台进行调用,进一步提高了便利性。如在一个具体的实施中,母应用为社交软件应用,子应用为股票选择服务应用,子应用的组件调用数据调用母应用中的绘图组件,并接收实时变化的股票数据,将股票曲线绘制在子应用页面。服务器中只需要存储一份股票选择服务应用的组件调用数据就可下发至不同的操作系统终端,在不同的操作系统上完成相同的股票曲线绘制,极大的方便了股票选择服务生成服务页面的便利性,提高了企业构建服务应用的积极性。
在一个实施例中,如图6所示,提供了一种组件数据处理的方法,本实施例主要以该方法应用于上述图1中的服务器120进行举例说明,该方法具体包括如下步骤:
步骤S310,获取第一系统平台对应的第一母应用数据包和第二系统平台对应的第二母应用数据包,第一母应用数据包包括第一原生组件,第二母应用数据包包括与所述第一原生组件具有相同功能的第二原生组件,第一原生组件与所述第二原生组件的组件标识相同,第一母应用数据包用于发送至第一系统平台终端,第二母应用数据包用于发送至第二系统平台终端。
具体的,母应用数据包是指支持母应用运行的完整数据,包括供母应用和子应用调用的各种原生组件等。对于不同的操作系统平台,提供了不同版本的母应用数据包。但不同操作系统平台对应的母应用数据包中包括具有相同标识完成相同功能的在不同平台运行的原生组件。如第一母应用数据包包括第一原生组件,第二母应用数据包包括与第一原生组件具有相同功能的第二原生组件,第一原生组件与第二原生组件的组件标识相同。第一系统平台终端可从服务器下载第一母应用数据包并安装和运行母应用,第二系统平台终端可从服务器下载第二母应用数据包并安装和运行母应用。可以理解的是,第一母应用数据包与第二应用数据包可为在不同操作系统完成相同功能的应用数据包,也可为在不同操作系统完成不同功能的应用数据包。不同操作系统的终端只需要安装与其系统平台对应的母应用数据包就能获得对应的原生组件,原生组件实现了多种功能,包括多媒体功能、表单功能、生活服务类功能等,可供母应用上的子应用进行调用,为子应用的实现提供了强大的功能支持。服务器可接收由母应用开发终端上传的母应用数据包并保存。
步骤S320,获取母应用对应的子应用的组件调用数据,组件调用数据包括组件标识,组件调用数据用于发送至第一系统平台终端和第二系统平台终端。
具体的,子应用是依附于母应用运行的应用程序,可通过母应用下 载、启动、运行、关闭子应用。子应用可以通过组件调用数据调用母应用的原生组件,从而不用每个子应用都重新编写原生组件,只需要获取组件调用数据就能方便得调用母应用的原生组件。可通过对母应用的原生组件的选取、配置形成具有绘制了不同组件的子应用中的各个页面,能简单方便的完成子应用的设计和具体实现。组件调用数据可以与子应用的应用标识匹配,对于有多个页面的子应用,组件调用数据还可与子应用的页面标识匹配,不同的子应用页面可匹配不同的组件调用数据。第一系统平台终端与第二系统平台终端上,可运行实现不同或相同功能的母应用,运行实现相同或不同功能的子应用,但是可调用相同的组件调用数据在相同或不同的母应用以及子应用上绘制相同的组件。组件调用数据的具体存储形式可根据需要自定义。服务器可接收由各个开发子应用的企业或个人根据子应用的具体实现通过不同的终端上传的组件调用数据。
本实施例中,通过获取第一系统平台对应的第一母应用数据包和第二系统平台对应的第二母应用数据包,第一母应用数据包包括第一原生组件,第二母应用数据包包括与所述第一原生组件具有相同功能的第二原生组件,第一原生组件与所述第二原生组件的组件标识相同,第一母应用数据包用于发送至第一系统平台终端,第二母应用数据包用于发送至第二系统平台终端,获取母应用对应的子应用的组件调用数据,组件调用数据包括所述组件标识,组件调用数据用于发送至所述第一系统平台终端和所述第二系统平台终端,母应用中包括了供子应用调用的原生组件,从而不用每个子应用都重新编写原生组件,节省了存储空间,且由于同一组件标识可标识不同系统平台具有相同的功能的不同原生组件,从而只需要一份组件调用数据就可在不同的系统平台分别调用具有相同功能的不同原生组件,实现组件调用的跨平台,开发人员只需要编 写一份组件调用数据,提高了开发的效率。
在一个实施例中,步骤S320中获取母应用对应的子应用的组件调用数据的步骤包括:接收与子应用对应的通过标签语言编写的初始组件调用数据,将初始组件调用数据编译生成脚本语言数据得到目标组件调用数据。
具体的,标签语言是一种将文本以及文本相关的其他信息结合起来,展现出关于文档结构和数据处理细节的文字编码,标签语言语法简单,通俗易懂,本实施例服务器接收开发人员通过标签语言编写的对应的初始组件调用数据,并将标签语言对应的初始组件调用数据编译生成脚本语言数据。脚本语言是一种编程语言,用来控制软件应用程序,如JavaScript脚本语言。由于母应用对应的原生层只能与脚本语言数据进行通信,在服务器上进行编译,保证获取的组件调用数据已经是编译好的脚本语言数据,不需要终端获取子应用对应的组件调用数据后再进行编译,进一步提高了组件调用的效率。
在一个实施例中,方法还包括:接收第一系统平台终端发送的第一母应用下载请求,将第一系统平台对应的第一母应用数据包发送至第一系统平台终端,以使第一系统平台终端安装第一母应用数据包以运行第一母应用,和/或接收第二系统平台终端发送的第二母应用下载请求,将第二系统平台对应的第二母应用数据包发送至第二系统平台终端,以使第二系统平台终端安装第二母应用数据包以运行第二母应用。
具体的,第一系统平台终端和第二系统平台终端分别安装第一母应用数据包和第二母应用数据包,以完成各个不同的系统平台的原生组件的获取,为子应用的运行提供环境和支持。如果第一母应用数据包和第二母应用数据包完成相同的功能,则运行的第一母应用和第二母应用为运行在不同系统平台完成相同功能的母应用。如果第一母应用数据包和 第二母应用数据包完成不同的功能,则也可通过完成不同功能的第一母应用和第二母应用调用完成相同功能的第一原生组件和第二原生组件。
在一个实施例中,方法还包括:接收第一系统平台终端发送的组件调用数据下载第一请求,将组件调用数据发送至第一系统平台终端,以使第一系统平台终端将组件调用数据通过第一通信管道传递至第一系统平台终端运行的第一母应用对应的第一原生层,第一原生层根据所述组件调用数据调用所述第一原生组件;和/或接收第二系统平台终端发送的组件调用数据下载第二请求,将组件调用数据发送至所述第二系统平台终端,以使第二系统平台终端将组件调用数据通过第二通信管道传递至第二系统平台终端运行的第二母应用对应的第二原生层,第二原生层根据组件调用数据调用第二原生组件。
具体的,当终端需要生成一个新的子应用或生成子应用的一个新的页面时,可向服务器发送组件调用数据下载请求,以下载对应的组件调用数据,根据组件调用数据调用母应用中的原生组件并在页面上显示组件。组件调用数据是指调用母应用的原生组件所需要的数据,可包括一组标签和组件接口,包括组件标识、组件的属性等。如一个具体的实施例中,组件调用数据为“<canvas style="width:300px;height:200px;"canvas-id="firstCanvas"></canvas>”可用于调用组件标识canvas-id为firstCanvas的宽300PX,高200PX的画布,其中组件标识用于唯一标识一个组件,通过组件标识可在母应用的原生组件中找到对应的目标组件。第一系统平台终端和第二系统平台终端分别获取相同的组件调用数据后,分别通过不同的通信管道传递组件调用数据至不同的原生层,以分别调用实现相同功能的具有相同标识的不同原生组件。
通信管道用于组件调用数据与原生层之间进行交互,由于原生层只能识别JavaScript语言编写的数据,如果组件调用数据为其它语言数据, 则需要先转换为JS脚本语言数据。不同的操作系统对应的通信管道不同,由系统平台提供。原生层是指采用原生语言编写的应用程序,原生语言是某一个系统平台,比如iOS或安卓所特有的语言,比如iOS系统平台支持Xcode和Objective-C,安卓系统平台支持Eclipse和Java,原生应用程序运行时性能最佳。通信管道在传递组件调用数据时,可先将组件调用数据编码转换为预设格式再进行传递,原生层接收到预设格式的组件调用数据可先进行解码得到实际组件调用数据。
由于组件调用数据具体描述了需要调用的组件和组件的属性数据,第一原生层可根据组件标识获取与第一系统平台对应的第一原生组件,第二原生层可根据组件标识获取与第二系统平台对应的第二原生组件,并根据组件的属性数据在第一系统平台终端运行的子应用的页面绘制第一原生组件从而完成对第一原生组件的调用,在第二系统平台终端运行的子应用的页面绘制第二原生组件从而完成对第二原生组件的调用。由于同一组件标识标识的第一原生组件和第二原生组件具备相同功能,从而只需要一份组件调用数据就可在不同的系统平台分别调用具有相同功能的不同原生组件,使用一份组件调用数据可在不同的系统终端的母应用上运行相同页面具有相同功能的子应用,实现组件调用的跨平台,开发人员只需要编写一份组件调用数据,提高了开发的效率。
在一个实施例中,如图7所示,提供了一种组件调用的装置,包括:
获取模块410,用于获取子应用对应的组件调用数据,组件调用数据包括组件标识。
传递模块420,用于将组件调用数据通过与当前系统平台对应的通信管道传递至母应用对应的原生层。
调用模块430,用于原生层根据所述组件调用数据调用母应用中的与当前系统平台对应的第一原生组件,组件标识用于标识第一原生组件 和运行于其它系统平台的具备相同功能的第二原生组件。
在一个实施例中,组件调用数据为通过标签语言对应的初始组件调用数据编译生成的脚本语言数据。
在一个实施例中,如图8所示,装置还包括:
第一下载模块440,用于下载与当前系统平台对应的第一母应用数据包,第一母应用数据包中包括所述第一原生组件,在其它系统平台存在与第一母应用数据包具备相同功能的第二母应用数据包,第二母应用数据包包括所述第二原生组件。
在一个实施例中,如图9所示,装置还包括:
第二下载模块450,用于在母应用的页面中下载子应用对应的数据包,数据包包括组件调用数据。
在一个实施例中,传递模块420还用于与当前系统平台对应的通信管道将所述组件调用数据序列化为JSON字符串传递至母应用对应的原生层;
调用模块430还用于原生层将所述JSON字符串反序列化为组件调用信息,根据组件调用信息获取组件调用位置和组件标识,获取组件标识对应的第一原生组件,根据组件调用位置在子应用的页面绘制第一原生组件。
在一个实施例中,第一原生组件包括多媒体组件、绘图组件、地图组件中的至少一种。
在一个实施例中,所述通信管道为系统平台提供的用于规定JavaScript脚本语言数据与原生层进行交互的通信规则。
结合图2所示的第一终端110的内部结构图,在一个实施例中,第一终端110的存储介质可以为非易失性计算机可读存储介质,用于存储一个或多个计算机可读指令,包括获取模块、传递模块和调用模块。在 另一个实施例中,该计算机可读指令还包括第一下载模块。在另一个实施例中,该计算机可读指令还包括第二下载模块。
第一终端110的处理器用于读取存储介质中存储的计算机可读指令,以实现上述实施例中组件调用的方法的步骤以及组件调用的装置中各模块的功能。
在一个实施例中,如图10所示,提供了一种组件数据处理的装置,包括:
第一获取模块510,用于获取第一系统平台对应的第一母应用数据包和第二系统平台对应的第二母应用数据包,第一母应用数据包包括第一原生组件,第二母应用数据包包括与第一原生组件具有相同功能的第二原生组件,第一原生组件与所述第二原生组件的组件标识相同,第一母应用数据包用于发送至第一系统平台终端,第二母应用数据包用于发送至第二系统平台终端。
第二获取模块520,用于获取母应用对应的子应用的组件调用数据,组件调用数据包括组件标识,组件调用数据用于发送至第一系统平台终端和第二系统平台终端。
在一个实施例中,如图11所示,第二获取模块520包括:
组件数据获取单元521,用于接收与所述子应用对应的通过标签语言编写的初始组件调用数据;
编译单元522,用于将初始组件调用数据编译生成脚本语言数据得到目标组件调用数据。
在一个实施例中,如图12所示,装置还包括:
母应用下载响应模块530,用于接收第一系统平台终端发送的第一母应用下载请求,将第一系统平台对应的第一母应用数据包发送至第一系统平台终端,以使所述第一系统平台终端安装第一母应用数据包以运 行第一母应用;和/或用于接收第二系统平台终端发送的第二母应用下载请求,将第二系统平台对应的第二母应用数据包发送至第二系统平台终端,以使第二系统平台终端安装第二母应用数据包以运行第二母应用。
在一个实施例中,如图13所示,装置还包括:
组件调用数据下载响应模块540,用于接收第一系统平台终端发送的组件调用数据下载第一请求,将组件调用数据发送至所述第一系统平台终端,以使第一系统平台终端将组件调用数据通过第一通信管道传递至第一系统平台终端运行的第一母应用对应的第一原生层,第一原生层根据组件调用数据调用所述第一原生组件;和/或用于接收第二系统平台终端发送的组件调用数据下载第二请求,将组件调用数据发送至所述第二系统平台终端,以使第二系统平台终端将组件调用数据通过第二通信管道传递至第二系统平台终端运行的第二母应用对应的第二原生层,第二原生层根据组件调用数据调用第二原生组件。
结合图3所示的服务器120的内部结构图,在一个实施例中,服务器120的存储介质可以为非易失性计算机可读存储介质,用于存储一个或多个计算机可读指令,包括第一获取模块和第二获取模块。在另一个实施例中,该计算机可读指令还包括母应用下载响应模块。在另一个实施例中,该计算机可读指令还包括组件调用数据下载响应模块。
服务器120的处理器用于读取存储介质中存储的计算机可读指令,以实现上述实施例中组件数据处理的方法的步骤以及组件数据处理的装置中各模块的功能。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述程序可存储于一计算机可读取存储介质中,如本发明实施例中,该程序可存储于计算机系统的存储介质中,并被该计算机系统中的至少一个处理器执 行,以实现包括如上述各方法的实施例的流程。其中,所述存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (24)

  1. 一种组件调用的方法,应用于终端,所述方法包括:
    获取子应用对应的组件调用数据,所述组件调用数据包括组件标识;
    将所述组件调用数据通过与当前系统平台对应的通信管道传递至母应用对应的原生层;
    所述原生层根据所述组件调用数据调用母应用中的与当前系统平台对应的第一原生组件,所述组件标识用于标识所述第一原生组件和运行于其它系统平台的具备相同功能的第二原生组件。
  2. 根据权利要求1所述的方法,其中,所述组件调用数据为通过标签语言对应的初始组件调用数据编译生成的脚本语言数据。
  3. 根据权利要求1所述的方法,其中,所述获取子应用对应的组件调用数据之前,还包括:
    下载与当前系统平台对应的第一母应用数据包,所述第一母应用数据包中包括所述第一原生组件,在其它系统平台存在与所述第一母应用数据包具备相同功能的第二母应用数据包,所述第二母应用数据包包括所述第二原生组件。
  4. 根据权利要求1所述的方法,其中,所述获取子应用对应的组件调用数据之前,还包括:
    在所述母应用的页面中下载所述子应用对应的数据包,所述数据包包括所述组件调用数据。
  5. 根据权利要求1所述的方法,其中,所述将所述组件调用数据通过与当前系统平台对应的通信管道传递至母应用对应的原生层包括:
    与当前系统平台对应的通信管道将所述组件调用数据序列化为JSON字符串传递至母应用对应的原生层;
    所述原生层根据所述组件调用数据调用母应用中的与当前系统平台 对应的第一原生组件包括:
    所述原生层将所述JSON字符串反序列化为组件调用信息,根据所述组件调用信息获取组件调用位置和组件标识,获取所述组件标识对应的第一原生组件,根据所述组件调用位置在所述子应用的页面绘制所述第一原生组件。
  6. 根据权利要求1所述的方法,其中,所述第一原生组件包括多媒体组件、绘图组件、地图组件中的至少一种。
  7. 根据权利要求1所述的方法,其中,所述通信管道为系统平台提供的用于规定JavaScript脚本语言数据与原生层进行交互的通信规则。
  8. 一种组件数据处理的方法,应用于服务器,所述方法包括:
    获取第一系统平台对应的第一母应用数据包和第二系统平台对应的第二母应用数据包,所述第一母应用数据包包括第一原生组件,所述第二母应用数据包包括与所述第一原生组件具有相同功能的第二原生组件,所述第一原生组件与所述第二原生组件的组件标识相同,所述第一母应用数据包用于发送至第一系统平台终端,所述第二母应用数据包用于发送至第二系统平台终端;
    获取母应用对应的子应用的组件调用数据,所述组件调用数据包括所述组件标识,所述组件调用数据用于发送至所述第一系统平台终端和所述第二系统平台终端。
  9. 根据权利要求8所述的方法,其中,所述获取母应用对应的子应用的组件调用数据包括:
    接收与所述子应用对应的通过标签语言编写的初始组件调用数据;
    将所述初始组件调用数据编译生成脚本语言数据得到目标组件调用数据。
  10. 根据权利要求8所述的方法,其中,所述方法还包括:
    接收第一系统平台终端发送的第一母应用下载请求,将所述第一系统平台对应的第一母应用数据包发送至第一系统平台终端,以使所述第一系统平台终端安装所述第一母应用数据包以运行第一母应用;和/或
    接收第二系统平台终端发送的第二母应用下载请求,将所述第二系统平台对应的第二母应用数据包发送至第二系统平台终端,以使所述第二系统平台终端安装所述第二母应用数据包以运行第二母应用。
  11. 根据权利要求10所述的方法,其中,所述方法还包括:
    接收第一系统平台终端发送的组件调用数据下载第一请求,将所述组件调用数据发送至所述第一系统平台终端,以使所述第一系统平台终端将所述组件调用数据通过第一通信管道传递至第一系统平台终端运行的第一母应用对应的第一原生层,第一原生层根据所述组件调用数据调用所述第一原生组件;和/或
    接收第二系统平台终端发送的组件调用数据下载第二请求,将所述组件调用数据发送至所述第二系统平台终端,以使所述第二系统平台终端将所述组件调用数据通过第二通信管道传递至第二系统平台终端运行的第二母应用对应的第二原生层,第二原生层根据所述组件调用数据调用所述第二原生组件。
  12. 一种组件调用的装置,所述装置包括一个或一个以上处理器和一个或一个以上非易失性存储介质,所述一个或一个以上非易失性存储介质存储一个或多个计算机可读指令,经配置由所述一个或者一个以上处理器执行;所述一个或一个以上计算机可读指令包括:
    获取模块,用于获取子应用对应的组件调用数据,所述组件调用数据包括组件标识;
    传递模块,用于将所述组件调用数据通过与当前系统平台对应的通信管道传递至母应用对应的原生层;
    调用模块,用于所述原生层根据所述组件调用数据调用母应用中的与当前系统平台对应的第一原生组件,所述组件标识用于标识所述第一原生组件和运行于其它系统平台的具备相同功能的第二原生组件。
  13. 根据权利要求12所述的装置,其中,所述组件调用数据为通过标签语言对应的初始组件调用数据编译生成的脚本语言数据。
  14. 根据权利要求12所述的装置,其中,所述一个或一个以上计算机可读指令还包括:
    第一下载模块,用于下载与当前系统平台对应的第一母应用数据包,所述第一母应用数据包中包括所述第一原生组件,在其它系统平台存在与所述第一母应用数据包具备相同功能的第二母应用数据包,所述第二母应用数据包包括所述第二原生组件。
  15. 根据权利要求12所述的装置,其中,所述一个或一个以上计算机可读指令还包括:
    第二下载模块,用于在所述母应用的页面中下载所述子应用对应的数据包,所述数据包包括所述组件调用数据。
  16. 根据权利要求12所述的装置,其中,所述传递模块还用于与当前系统平台对应的通信管道将所述组件调用数据序列化为JSON字符串传递至母应用对应的原生层;
    所述调用模块还用于所述原生层将所述JSON字符串反序列化为组件调用信息,根据所述组件调用信息获取组件调用位置和组件标识,获取所述组件标识对应的第一原生组件,根据所述组件调用位置在所述子应用的页面绘制所述第一原生组件。
  17. 根据权利要求12所述的装置,其中,所述第一原生组件包括多媒体组件、绘图组件、地图组件中的至少一种。
  18. 根据权利要求12所述的装置,其中,所述通信管道为系统平台 提供的用于规定JavaScript脚本语言数据与原生层进行交互的通信规则。
  19. 一种组件数据处理的装置,所述装置包括一个或一个以上处理器和一个或一个以上非易失性存储介质,所述一个或一个以上非易失性存储介质存储一个或多个计算机可读指令,经配置由所述一个或者一个以上处理器执行;所述一个或一个以上计算机可读指令包括:
    第一获取模块,用于获取第一系统平台对应的第一母应用数据包和第二系统平台对应的第二母应用数据包,所述第一母应用数据包包括第一原生组件,所述第二母应用数据包包括与所述第一原生组件具有相同功能的第二原生组件,所述第一原生组件与所述第二原生组件的组件标识相同,所述第一母应用数据包用于发送至第一系统平台终端,所述第二母应用数据包用于发送至第二系统平台终端;
    第二获取模块,用于获取母应用对应的子应用的组件调用数据,所述组件调用数据包括所述组件标识,所述组件调用数据用于发送至所述第一系统平台终端和所述第二系统平台终端。
  20. 根据权利要求19所述的装置,其中,所述第二获取模块包括:
    组件数据获取单元,用于接收与所述子应用对应的通过标签语言编写的初始组件调用数据;
    编译单元,用于将所述初始组件调用数据编译生成脚本语言数据得到目标组件调用数据。
  21. 根据权利要求19所述的装置,其中,所述一个或一个以上计算机可读指令还包括:
    母应用下载响应模块,用于接收第一系统平台终端发送的第一母应用下载请求,将所述第一系统平台对应的第一母应用数据包发送至第一系统平台终端,以使所述第一系统平台终端安装所述第一母应用数据包以运行第一母应用;和/或用于接收第二系统平台终端发送的第二母应用 下载请求,将所述第二系统平台对应的第二母应用数据包发送至第二系统平台终端,以使所述第二系统平台终端安装所述第二母应用数据包以运行第二母应用。
  22. 根据权利要求21所述的装置,其中,所述一个或一个以上计算机可读指令还包括:
    组件调用数据下载响应模块,用于接收第一系统平台终端发送的组件调用数据下载第一请求,将所述组件调用数据发送至所述第一系统平台终端,以使所述第一系统平台终端将所述组件调用数据通过第一通信管道传递至第一系统平台终端运行的第一母应用对应的第一原生层,第一原生层根据所述组件调用数据调用所述第一原生组件;和/或用于接收第二系统平台终端发送的组件调用数据下载第二请求,将所述组件调用数据发送至所述第二系统平台终端,以使所述第二系统平台终端将所述组件调用数据通过第二通信管道传递至第二系统平台终端运行的第二母应用对应的第二原生层,第二原生层根据所述组件调用数据调用所述第二原生组件。
  23. 一种非易失性计算机可读存储介质,存储有计算机可读指令,所述计算机可读指令能够使至少一个处理器执行如权利要求1-7任一项所述的方法。
  24. 一种非易失性计算机可读存储介质,存储有计算机可读指令,所述计算机可读指令能够使至少一个处理器执行如权利要求8-11任一项所述的方法。
PCT/CN2017/105662 2016-10-18 2017-10-11 组件调用的方法和装置、组件数据处理的方法和装置 WO2018072626A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/208,132 US10740114B2 (en) 2016-10-18 2018-12-03 Component invoking method and apparatus, and component data processing method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610912893.6A CN107957911B (zh) 2016-10-18 2016-10-18 组件调用的方法和装置、组件数据处理的方法和装置
CN201610912893.6 2016-10-18

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/208,132 Continuation US10740114B2 (en) 2016-10-18 2018-12-03 Component invoking method and apparatus, and component data processing method and apparatus

Publications (1)

Publication Number Publication Date
WO2018072626A1 true WO2018072626A1 (zh) 2018-04-26

Family

ID=61954439

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105662 WO2018072626A1 (zh) 2016-10-18 2017-10-11 组件调用的方法和装置、组件数据处理的方法和装置

Country Status (3)

Country Link
US (1) US10740114B2 (zh)
CN (1) CN107957911B (zh)
WO (1) WO2018072626A1 (zh)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108196930B (zh) * 2018-01-18 2020-04-03 腾讯科技(深圳)有限公司 应用程序处理方法、装置、存储介质和计算机设备
JP7069969B2 (ja) * 2018-03-29 2022-05-18 株式会社リコー 情報処理装置、情報処理方法及び情報処理プログラム
US10572279B2 (en) * 2018-04-10 2020-02-25 Microsoft Technology Licensing, Llc Cross-process interface for non-compatible frameworks
CN108984174B (zh) * 2018-07-03 2022-04-12 百度在线网络技术(北京)有限公司 跨平台的应用创建方法、装置、服务器和存储介质
CN109144615B (zh) * 2018-09-29 2022-05-10 北京城市网邻信息技术有限公司 一种信息发布方法、装置、设备及存储介质
CN111796799B (zh) 2019-04-09 2021-09-07 广州腾讯科技有限公司 子应用开发方法、装置、计算机设备及存储介质
CN110515678B (zh) * 2019-08-23 2021-03-19 上海连尚网络科技有限公司 一种信息处理方法、设备和计算机存储介质
CN110908704A (zh) * 2019-11-14 2020-03-24 亚信科技(中国)有限公司 一种移动端跨平台原生功能的调用方法及装置
CN114461291A (zh) * 2020-10-22 2022-05-10 北京国双科技有限公司 应用程序组件调用方法、装置、电子设备及存储介质
CN112416335A (zh) * 2020-11-11 2021-02-26 上海非码网络科技有限公司 实现前端页面自动化布局的方法和装置
CN112559069B (zh) * 2020-12-08 2022-04-12 腾讯科技(深圳)有限公司 子应用的运行控制方法、装置、存储介质和电子设备
CN113190362B (zh) * 2021-04-22 2022-12-27 北京达佳互联信息技术有限公司 服务调用方法、装置、计算机设备及存储介质
CN113626787B (zh) * 2021-08-27 2024-01-30 京东方科技集团股份有限公司 设备指纹生成方法及相关设备
CN114090135B (zh) * 2021-11-24 2024-05-24 北京金堤科技有限公司 具有纠错功能且支持跨平台调用组件的方法和装置
CN116719481B (zh) * 2023-08-08 2024-01-26 腾讯科技(深圳)有限公司 配置数据处理方法、装置及相关设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309660A (zh) * 2013-05-27 2013-09-18 北京尚友通达信息技术有限公司 移动应用跨平台开发方法
CN103618699A (zh) * 2013-11-12 2014-03-05 吴晓军 一种调用组件的方法及装置
CN104239071A (zh) * 2014-10-13 2014-12-24 浪潮通信信息系统有限公司 一种基于通用组件和中转服务的跨平台移动应用开发框架系统
CN105468369A (zh) * 2015-11-19 2016-04-06 深圳联友科技有限公司 移动平台上JavaScript调用原生功能的方法以及系统

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5613090A (en) * 1993-10-05 1997-03-18 Compaq Computer Corporation Computer system for disparate windowing environments which translates requests and replies between the disparate environments
US20040045007A1 (en) * 2002-08-30 2004-03-04 Bae Systems Information Electronic Systems Integration, Inc. Object oriented component and framework architecture for signal processing
US8752006B1 (en) * 2007-07-02 2014-06-10 Cisco Technology, Inc. System and method and apparatus for automatically generating computer code for remote procedure calls
US7890597B2 (en) * 2007-07-27 2011-02-15 International Business Machines Corporation Direct memory access transfer completion notification
US7805485B2 (en) * 2008-01-28 2010-09-28 Sharp Laboratories Of America, Inc. Web services interface extension channel
US8296786B2 (en) * 2010-09-22 2012-10-23 Microsoft Corporation Agent-based remote function execution
US8695021B2 (en) * 2011-08-31 2014-04-08 Microsoft Corporation Projecting native application programming interfaces of an operating system into other programming languages
US9092235B2 (en) * 2012-05-25 2015-07-28 Microsoft Technology Licensing, Llc Virtualizing integrated calls to provide access to resources in a virtual namespace
CN104426967B (zh) * 2013-08-30 2019-02-15 中国石油天然气股份有限公司 一种跨平台和跨设备的移动应用开发系统
CN105607895B (zh) * 2014-11-21 2021-03-02 阿里巴巴集团控股有限公司 一种基于应用程序编程接口的应用程序的运行方法和装置
US10476782B2 (en) * 2015-08-03 2019-11-12 Nexmo, Inc. Systems and methods for adaptive routing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309660A (zh) * 2013-05-27 2013-09-18 北京尚友通达信息技术有限公司 移动应用跨平台开发方法
CN103618699A (zh) * 2013-11-12 2014-03-05 吴晓军 一种调用组件的方法及装置
CN104239071A (zh) * 2014-10-13 2014-12-24 浪潮通信信息系统有限公司 一种基于通用组件和中转服务的跨平台移动应用开发框架系统
CN105468369A (zh) * 2015-11-19 2016-04-06 深圳联友科技有限公司 移动平台上JavaScript调用原生功能的方法以及系统

Also Published As

Publication number Publication date
US20190102201A1 (en) 2019-04-04
CN107957911B (zh) 2019-07-05
CN107957911A (zh) 2018-04-24
US10740114B2 (en) 2020-08-11

Similar Documents

Publication Publication Date Title
WO2018072626A1 (zh) 组件调用的方法和装置、组件数据处理的方法和装置
US10026041B2 (en) Interoperable machine learning platform
EP3191942B1 (en) Interactive web application editor
US11706331B2 (en) Information processing method and apparatus, storage medium, and electronic device
KR20200043467A (ko) 웹페이지 콘텐츠를 추출하기 위한 방법 및 단말 장치
CN109062563B (zh) 用于生成页面的方法和装置
US20210208854A1 (en) System and method for enhancing component based development models with auto-wiring
TW201707416A (zh) 針對伺服器的遠程操作系統、方法及裝置
US11966795B2 (en) Method and device for loading minus-one screen, terminal, and computer readable storage medium
CN111740948B (zh) 数据包发布方法、动态更新方法、装置、设备及介质
CN113126990B (zh) 一种页面开发方法、装置、设备及存储介质
CN105743955A (zh) 一种扩展JavaScript对象方法
US11537367B1 (en) Source code conversion from application program interface to policy document
CA2846581A1 (en) Data infrastructure for providing interconnectivity between platforms, devices and operating systems
CN108804100B (zh) 创建界面元素的方法、装置、存储介质及移动终端
CN108170430B (zh) 一种界面展示的方法及系统
CN102693238A (zh) Widget应用方法、系统及多媒体终端
US10944824B2 (en) Method and apparatus for processing media type in rest software architecture
CN110851211A (zh) 用于显示应用信息的方法、装置、电子设备和介质
KR101907660B1 (ko) 웹 기반의 운영체제를 탑재한 단말 장치 및 이를 이용한 서비스 제공 방법
CN113448650A (zh) 直播功能插件加载方法、装置、设备及存储介质
CN113220339A (zh) 一种页面生成方法和装置
CN113761871A (zh) 富文本渲染方法、装置、电子设备以及存储介质
CN111767498A (zh) 一种实现文件信息共享的方法和装置
CN115934093A (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: 17863056

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

Country of ref document: EP

Kind code of ref document: A1