CN114416084B - Data processing method and device, electronic equipment and storage medium - Google Patents
Data processing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114416084B CN114416084B CN202111676600.6A CN202111676600A CN114416084B CN 114416084 B CN114416084 B CN 114416084B CN 202111676600 A CN202111676600 A CN 202111676600A CN 114416084 B CN114416084 B CN 114416084B
- Authority
- CN
- China
- Prior art keywords
- middleware
- control
- application program
- media control
- new
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4482—Procedural
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a data processing method, a data processing device, electronic equipment and a storage medium. Under the condition that a target media control in a plurality of media controls in an application program needs to be called based on a page control, control parameters of the target media control are obtained based on the page control. And the control parameters are transferred to the middleware through the first API based on the page control. And under the condition that the middleware obtains the control parameters, determining the open second API of the target media control according to the control parameters in the open second APIs of different media controls based on the middleware. And calling the target media control through a second API opened by the target media control based on the middleware. Through the application, in a scene that a developer develops a page comprising a plurality of different media controls in an application program, the developer only needs to be familiar with a uniform API without being familiar with a second API opened by each media control, so that the technical requirement can be reduced, the development difficulty can be reduced, and the labor cost can be indirectly reduced.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data processing method and apparatus, an electronic device, and a storage medium.
Background
Currently, applications are widely used, and in order to enrich the functions of the applications so that the applications can better provide services for users, the applications often include multiple pages, and each page includes different contents.
Some pages in an application are long pages, requiring the user to slide the page by entering a slide operation on the screen so that the application can display different content in the page.
In one approach, a sliding list control may be used to carry content in a long page.
In order to enrich the content in the page to better serve the user, a plurality of media controls, such as still image controls, dynamic image controls, video controls, voice controls, and link controls, are often included in the page in the application.
Disclosure of Invention
The application discloses a data processing method, a data processing device, electronic equipment and a storage medium.
In a first aspect, the present application shows a data processing method, which is applied to a terminal, where an application program is installed in the terminal, the application program includes multiple media controls, a middleware, and a page control of a page, and the middleware has a first API; the method comprises the following steps:
under the condition that a target media control in the multiple media controls in the application program needs to be called based on the page control, acquiring a control parameter of the target media control based on the page control;
passing the control parameters to the middleware through the first API based on the page control;
under the condition that the middleware obtains the control parameters, determining a second API which is opened by the target media control and needs to be called according to the control parameters in second APIs which are respectively opened by different media controls based on the middleware;
and calling the target media control through a second API opened by the target media control based on the middleware.
In an optional implementation, the method further includes:
receiving an update instruction for updating the middleware in the application program, wherein the update instruction carries new middleware, the new middleware-compatible media controls comprise current middleware-compatible media controls in the application program, and the new middleware-compatible media controls are more than the current middleware-compatible media controls in the application program;
replacing current middleware in the application with the new middleware.
In an optional implementation, the method further includes:
under the condition that a page needs to be rendered in the application program, detecting whether the page control needs to call a new media control incompatible with the current middleware in the application program;
downloading a new middleware in a server corresponding to the application program under the condition that the page control needs to call a new media control incompatible with the current middleware in the application program, wherein the new media control compatible with the middleware comprises a media control compatible with the current middleware in the application program, and the new media control compatible with the middleware is more than the media control compatible with the current middleware in the application program; wherein the new middleware is compatible with a new media control;
replacing current middleware in the application with the new middleware.
In an optional implementation, the method further includes:
receiving an update instruction for updating the middleware in the application program, wherein the update instruction carries a new middleware; the current middleware compatible media control in the application program comprises the new middleware compatible media control, and more current middleware compatible media controls in the application program than the new middleware compatible media control; wherein the new middleware is not compatible with at least one of the current middleware compatible media controls in the application;
replacing current middleware in the application with the new middleware.
In a second aspect, the present application shows a data processing apparatus, which is applied to a terminal, where an application program is installed in the terminal, the application program includes multiple media controls, a middleware, and a page control of a page, and the middleware has a first API opened; the device comprises:
the obtaining module is used for obtaining the control parameters of the target media control based on the page control under the condition that the target media control in the multiple media controls in the application program needs to be called based on the page control;
the transfer module is used for transferring the control parameters to the middleware through the first API based on the page control;
the determining module is used for determining a second API which is opened by the target media control and needs to be called according to the control parameters in second APIs which are respectively opened by different media controls based on the middleware under the condition that the control parameters are obtained by the middleware;
and the calling module is used for calling the target media control through a second API opened by the target media control based on the middleware.
In an optional implementation, the apparatus further comprises:
a first receiving module, configured to receive an update instruction for updating a middleware in the application program, where the update instruction carries a new middleware, and the new middleware-compatible media control includes a current middleware-compatible media control in the application program, and the new middleware-compatible media control is more than the current middleware-compatible media control in the application program;
a first replacement module to replace current middleware in the application with the new middleware.
In an optional implementation manner, the apparatus further includes:
the detection module is used for detecting whether the page control needs to call a new media control incompatible with the current middleware in the application program or not under the condition that the page needs to be rendered in the application program;
the downloading module is used for downloading a new middleware in a server corresponding to the application program under the condition that the page control needs to invoke a new media control incompatible with the current middleware in the application program, wherein the new media control compatible with the middleware comprises a media control compatible with the current middleware in the application program, and the new media control compatible with the middleware is more than the media control compatible with the current middleware in the application program; wherein the new middleware is compatible with a new media control;
a second replacement module for replacing current middleware in the application program with the new middleware.
In an optional implementation manner, the apparatus further includes:
a second receiving module, configured to receive an update instruction for updating the middleware in the application program, where the update instruction carries a new middleware; the current middleware compatible media control in the application program comprises the new middleware compatible media control, and more current middleware compatible media controls in the application program than the new middleware compatible media control; wherein the new middleware is not compatible with at least one of the current middleware compatible media controls in the application;
a third replacing module for replacing the current middleware in the application program with the new middleware.
In a third aspect, the present application shows an electronic device comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the data processing method of the first aspect.
In a fourth aspect, the present application shows a non-transitory computer readable storage medium having instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method of the first aspect.
In a fifth aspect, the present application shows a computer program product, in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method according to the first aspect.
The technical scheme provided by the application can comprise the following beneficial effects:
in the application, under the condition that a target media control in a plurality of media controls in an application program needs to be called based on a page control, a control parameter of the target media control is obtained based on the page control. And the control parameters are transferred to the middleware through the first API based on the page control. And under the condition that the middleware obtains the control parameters, determining the second API opened by the target media control according to the control parameters in the second APIs respectively opened by different media controls based on the middleware. And calling the target media control through a second API opened by the target media control based on the middleware.
According to the application, the operations of determining the second API which is opened by the target media control and needs to be called according to the control parameter in the second APIs which are respectively opened by different media controls and calling the target media control through the second API which is opened by the target media control can be executed by the middleware, the middleware can be configured in the application program in advance by a developer, the middleware opens the first API on one hand to call the middleware for the page control of the page in the application program, and the middleware adapts the second APIs which are respectively opened by the media controls in the application program on the other hand.
The developer can multiplex the middleware in each page in the application program by developing the middleware once, so that the page control of each page of the application program has the capability of executing the operation of ' determining the second API which is opened by the target media control and needs to be called in the second APIs which are respectively opened by different media controls according to the control parameters and executing the operation of ' calling the target media control through the second API which is opened by the target media control '.
Because the middleware is opened with the uniform first API, in a scenario where a developer develops a page including a plurality of different types of media controls in an application program, only the uniform API (for example, a uniform API name and uniform input parameters that need to be provided to the uniform API) may be concerned, and only the uniform API needs to be used in a computer program code of the page to implement a function of calling different media controls. For example, only a uniform first API opened by the middleware may be introduced into the computer program code for developing the page, so that the complexity of the computer program code for the page is reduced, and the later maintenance is facilitated.
In addition, developers do not need to be familiar with the second APIs respectively opened by various media controls, and can write computer program codes for calling the media controls to be called according to the unified API, so that the developers only need to be familiar with the unified API, and do not need to be familiar with the second APIs opened by various media controls, thereby reducing technical requirements, reducing development difficulty and indirectly reducing labor cost.
Drawings
FIG. 1 is a flow chart of the steps of a data processing method of the present application.
Fig. 2 is a block diagram of a data processing apparatus according to the present application.
Fig. 3 is a block diagram of an electronic device of the present application.
Fig. 4 is a block diagram of an electronic device of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
In the process of developing the application program in advance, a developer needs to develop a page in the application program and a media control which needs to be called in the page.
The media control may have been developed in advance. Each media control is respectively developed with a second API (Application Programming Interface) for opening the media control.
In the process of developing the computer program code of the page of the application program, a developer needs to set a media control at which position on the page, and then needs to write the computer program code of the page, which calls the media control through a second API for calling the media control to be open.
However, in many cases, each media control is often developed by a different development team, and because each development team has a respective development habit, the second APIs opened by different media controls are often different, for example, names of the second APIs opened by different media controls are different, and input parameters provided by the second APIs opened by each media control are different.
This results in that, under the condition that a developer develops a page of an application program, if the types and the number of media controls that need to be set in the page are large, when programming the computer program code of the page in the application program, it is often necessary to write computer program codes for calling the media controls by calling the second APIs that are opened by each media control in the computer program code of a new service, respectively.
However, because the types and the number of the media controls to be set in the page are various, the second APIs opened by different media controls are often different, and therefore, a developer is required to be familiar with the second APIs opened by the respective media controls (for example, familiar with the names of the second APIs opened by the respective media controls and input parameters provided by the second APIs opened by the respective media controls), so as to complete the development of the page.
Therefore, in the above situation, the technical requirements on the developers are high, which results in great development difficulty and indirectly increases labor cost.
Therefore, the requirements of reducing technical requirements, reducing development difficulty and indirectly reducing labor cost in the scene that a developer develops a page including a plurality of different types of media controls in an application program are provided.
In order to achieve the purposes of reducing technical requirements, reducing development difficulty and indirectly reducing labor cost in a scene that a developer develops a page including a plurality of different types of media controls in an application program, the inventor analyzes the current development situation and discovers:
because the second APIs opened by different media controls are often different, for example, the names of the second APIs opened by different media controls are different, and the input parameters provided by the second APIs opened to different media controls are different, so that in a scenario where a developer develops a page in an application program, the developer writes a computer program code of the page in the application program, and when the developer writes the computer program code of the page in the application program, the developer often writes computer program codes for calling different media controls, respectively, for the names of the second APIs opened to different media controls and the input parameters provided by the second APIs opened to different media controls, so that the developer has high technical requirements, which results in high development difficulty, and indirectly increases labor cost.
Therefore, in order to achieve the purposes of reducing technical requirements, reducing development difficulty and indirectly reducing labor cost in a scenario where a developer develops a page of an application program, the page including a plurality of heterogeneous media controls, in one embodiment, the developer may write computer program codes for calling different media controls respectively for names of second APIs that are open for the heterogeneous media controls and input parameters provided by the second APIs for opening the heterogeneous media controls, without being in computer program codes of the page, in a scenario where the developer develops a page of an application program, the page including a plurality of heterogeneous media controls.
For example, in a scenario where a developer develops a page including a plurality of heterogeneous media controls in an application, if only one unified API (e.g., a name of the unified API and a unified input parameter that needs to be provided to the unified API) can be concerned, only the unified API needs to be used in the computer program code of the page to achieve the purpose of retrieving the different media controls.
That is, the developer does not need to be familiar with the open second APIs of various media controls, and can call the media control to be called according to the unified API, so that the developer only needs to be familiar with the unified API, and does not need to be familiar with the open second APIs of various media controls, thereby reducing the technical requirements, reducing the development difficulty, and indirectly reducing the labor cost.
In one aspect, the inventors contemplate that middleware is provided between a page control of a page and each media control, the middleware may be deployed in the application, and the middleware may serve as a bridge between the page control and the media control of the page.
The middleware opens a unified API (e.g., the middleware opens an API, so that the name of the API and the parameters that need to be provided to the API are unified).
The page control of the page can call the middleware based on the unified API opened by the middleware so as to call the needed media control through the middleware.
Specifically, referring to fig. 1, a flowchart of steps of a data processing method according to the present application is shown, and is applied to a terminal, where an application is installed in the terminal, the application includes a plurality of media controls, middleware, and page controls of a page, and the page controls include a sliding list control (recycle view) and the like. The middleware is opened with a first API; the method specifically comprises the following steps:
in step S101, when a target media control of a plurality of media controls in an application needs to be called based on a page control, a control parameter of the target media control is obtained based on the page control.
In the present application, a plurality of media controls, such as still image controls, dynamic image controls, video controls, voice controls, and link controls, are often included in the application.
The control parameters of different media controls are different, and the control parameters may include control identifiers of the media controls, and the like, so that the media controls may be uniquely indexed by the control parameters, and the control parameters may further include logic identifiers of execution logic for executing operations on the media controls, so as to determine the execution logic and the like that need to execute the operations on the media controls by the logic identifiers.
In order to enable the page control to display the page data based on the multiple media controls, the page control needs to respectively call the multiple media controls and display the page data based on the called multiple media controls, so that the user can browse the page data and the like on the page.
In the case that the page control needs to call a plurality of media controls respectively, the plurality of media controls in the application program can be called by means of the middleware in the application program.
In one example, in the case that the page control needs to respectively call a target media control of the multiple media controls in the application, the target media control in the application is called by means of middleware in the application.
In step S102, the control parameters are passed to the middleware through the first API based on the page control.
In step S103, when the middleware obtains the control parameter, based on the middleware, in the second APIs respectively opened by the different media controls, the second API opened by the target media control to be called is determined according to the control parameter.
Therefore, under the condition that the middleware obtains the control parameters, the control identification of the target media control needing to be called can be obtained according to the control parameters, and the control identifications of different media controls are different. And then acquiring a second API opened by the target media control according to the control identification of the target media control.
For example, the middleware stores a correspondence between the control identifier of the media control and the open second API of the media control, and the open second APIs correspond to different identifiers of the media control in the correspondence, so that the second API corresponding to the control identifier of the target media control can be searched in the correspondence between the control identifier of the media control and the open second API of the media control, and used as the open second API of the target media control.
In step S104, the target media control is called through a second API opened by the target media control based on the middleware.
Input parameters (the input parameters and other formats are uniform) which need to be input to the open second API of the target media control can be obtained according to the control parameters.
And then converting the input parameters which need to be input to the second API opened by the target media control into the input parameters supported by the second API.
For example, when the second API developed by different media controls needs to be adapted, the unified input parameters need to be converted into input parameters that can be supported (for example, format support and the like) by the second API developed by the media controls.
For example, the middleware stores the corresponding relationship among the unified input parameter, the control identifier of the media control and the input parameter supported by the second API with the opened media control, so that the unified input parameter and the supported input parameter corresponding to the control identifier of the second API with the opened target media control, which are required to be input to the target media control, can be searched in the corresponding relationship among the unified input parameter, the control identifier of the media control and the input parameter supported by the second API with the opened media control, which is obtained according to the control parameter, and the unified input parameter and the supported input parameter corresponding to the control identifier of the target media control can be used as the input parameter supported by the second API with the opened target media control.
For any one corresponding table entry in the corresponding relationship, the unified input parameter in the corresponding table entry is different from the input parameter supported by the second API opened by the media control in format or form, but the purpose of calling the media control and the execution logic of the media control for executing the operation are the same.
For example, the middleware transfers the input parameters supported by the second API opened by the target media control to the service layer of the application (the transfer process may be via the communication layer of the application, and the like, where the communication layer includes javascript core, wbrctbridge manager, router, and the like) through the second API, so that the service layer obtains the target media control according to the input parameters supported by the second API opened by the target media control, and returns the target media control to the page control through the middleware, so that the page control realizes calling the target media control.
In the application, under the condition that a target media control in a plurality of media controls in an application program needs to be called based on a page control, a control parameter of the target media control is obtained based on the page control. And the control parameters are transferred to the middleware through the first API based on the page control. And under the condition that the middleware obtains the control parameters, determining the second API opened by the target media control according to the control parameters in the second APIs respectively opened by different media controls based on the middleware. And calling the target media control through a second API opened by the target media control based on the middleware.
According to the application, the operations of determining the second API which is opened by the target media control and needs to be called according to the control parameter in the second APIs which are respectively opened by different media controls and calling the target media control through the second API which is opened by the target media control can be executed by the middleware, the middleware can be configured in the application program in advance by a developer, the middleware opens the first API on one hand to call the middleware for the page control of the page in the application program, and the middleware adapts the second APIs which are respectively opened by the media controls in the application program on the other hand.
The developer can multiplex the middleware in each page in the application program by developing the middleware once, so that the page control of each page of the application program has the capability of executing the operation of ' determining the second API which is opened by the target media control and needs to be called in the second APIs which are respectively opened by different media controls according to the control parameters and executing the operation of ' calling the target media control through the second API which is opened by the target media control '.
Because the middleware is opened with the uniform first API, in a scenario where a developer develops a page including a plurality of different types of media controls in an application program, only the uniform API (for example, a uniform API name and uniform input parameters that need to be provided to the uniform API) may be concerned, and only the uniform API needs to be used in a computer program code of the page to implement a function of calling different media controls. For example, only a uniform first API opened by the middleware may be introduced into the computer program code for developing the page, so that the complexity of the computer program code for the page is reduced, and the later maintenance is facilitated.
In addition, developers do not need to be familiar with the second APIs respectively opened by various media controls, and can write computer program codes for calling the media controls to be called according to the unified API, so that the developers only need to be familiar with the unified API, and do not need to be familiar with the second APIs opened by various media controls, thereby reducing technical requirements, reducing development difficulty and indirectly reducing labor cost.
In another embodiment of the present application, sometimes a developer may develop a new media control that opens a second API. The developer may deploy a new media control in the server to implement publishing of the new media control, so that the application program installed on the terminal of the vast users may dynamically update the new media control, for example, dynamically load the new media control in the installed application program, so that the application program has a function of displaying page data based on the new media control, for example, when the page control in the application program needs to display the page data, the page data may be displayed based on the new media control.
However, the current middleware in the installed application does not support the new media control, for example, the second API opened by the new media control is not adapted, so that the current middleware in the application is not compatible with the new media control, and further the current middleware in the application cannot serve as a bridge between the page control and the new media control.
Therefore, the current middleware in the application needs to be updated so that the middleware can serve as a bridge between the page control and the new media control.
In order to make the middleware a bridge between the page control and the new media control, the middleware needs to be compatible with the new media control.
In order to make the middleware compatible with the new media control, a second API that enables the middleware to adapt to the opening of the new media control is required.
For example, in one embodiment, a developer may update the current middleware in the server to obtain a new middleware, and then issue the new middleware, for example, send an update instruction for updating the middleware in the application to each terminal installed with the application through the server, where the update instruction carries the new middleware. The new middleware compatible media control comprises a current middleware compatible media control in the application program, and the number of the new middleware compatible media control is more than that of the current middleware compatible media control in the application program; wherein the new middleware is compatible with the new media control, e.g., the new middleware adapts the second API opened by the new media control.
For the terminal, an update instruction for updating the middleware in the application program is received, the update instruction carries new middleware, and then the current middleware in the application program can be replaced by the new middleware.
Alternatively, in another embodiment, in the event that a page needs to be rendered in an application, it is detected whether the page control needs to invoke a new media control that is incompatible with the current middleware in the application.
Under the condition that a page control needs to call a new media control incompatible with the current middleware in an application program, a terminal downloads the new middleware in a server corresponding to the application program, wherein the new media control compatible with the middleware comprises the media control compatible with the current middleware in the application program, and the number of the new media control compatible with the middleware is more than that of the media control compatible with the current middleware in the application program; wherein the new middleware is compatible with the new media control, e.g., the new middleware adapts the second API opened by the new media control. The current middleware in the application can then be replaced with the new middleware.
In another embodiment, when a developer develops a page of an application program, the page control of the page needs to display data by using some media controls, but then the page control of the page may no longer need to display data by using the media controls due to some requirements, so that the middleware in the application program may no longer be compatible with the media controls, for example, the second API opened by the media controls may no longer be matched.
Therefore, in order to simplify the middleware, the middleware can be updated to reduce the complexity of the middleware, and further reduce the space occupied by the middleware to save the system resources of the terminal.
For example, in one embodiment, a developer may update the current middleware in the server to obtain a new middleware, and then issue the new middleware, for example, send an update instruction for updating the middleware in the application to each terminal installed with the application through the server, where the update instruction carries the new middleware.
The current middleware compatible media control in the application program comprises a new middleware compatible media control, and more current middleware compatible media controls in the application program than new middleware compatible media controls; wherein the new middleware is not compatible with at least one of the current middleware compatible media controls in the application, for example, the new middleware does not adapt at least one of the second APIs opened by the media controls adapted by the current middleware.
For the terminal, an update instruction for updating the middleware in the application program is received, the update instruction carries new middleware, and then the current middleware in the application program can be replaced by the new middleware.
It is noted that, for simplicity of explanation, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will appreciate that the present application is not limited by the order of acts, as some steps may, in accordance with the present application, occur in other orders and concurrently. Further, those of skill in the art will also appreciate that the embodiments described in the specification are exemplary of alternative embodiments and that the acts involved are not necessarily required of the application.
Referring to fig. 2, a block diagram of a data processing apparatus according to the present application is shown, and is applied to a terminal, where an application program is installed in the terminal, the application program includes multiple media controls, middleware, and a page control of a page, and the middleware is opened with a first API; the device comprises:
an obtaining module 11, configured to obtain, based on the page control, a control parameter of a target media control in the multiple media controls in the application program when the target media control needs to be called based on the page control;
a transfer module 12, configured to transfer the control parameter to the middleware through the first API based on the page control;
a determining module 13, configured to determine, based on the middleware, second APIs that are respectively opened for different media controls and are opened for the target media control to be called according to the control parameters when the control parameters are obtained by the middleware;
and the invoking module 14 is configured to invoke the target media control through a second API opened by the target media control based on the middleware.
In an optional implementation, the apparatus further comprises:
a first receiving module, configured to receive an update instruction for updating a middleware in the application program, where the update instruction carries a new middleware, and the new middleware-compatible media control includes a current middleware-compatible media control in the application program, and the new middleware-compatible media control is more than the current middleware-compatible media control in the application program;
a first replacement module to replace current middleware in the application with the new middleware.
In an optional implementation, the apparatus further comprises:
the detection module is used for detecting whether the page control needs to call a new media control incompatible with the current middleware in the application program or not under the condition that the page needs to be rendered in the application program;
the downloading module is used for downloading a new middleware in a server corresponding to the application program under the condition that the page control needs to invoke a new media control incompatible with the current middleware in the application program, wherein the new media control compatible with the middleware comprises a media control compatible with the current middleware in the application program, and the new media control compatible with the middleware is more than the media control compatible with the current middleware in the application program; wherein the new middleware is compatible with a new media control;
a second replacement module for replacing current middleware in the application program with the new middleware.
In an optional implementation, the apparatus further comprises:
a second receiving module, configured to receive an update instruction for updating the middleware in the application program, where the update instruction carries a new middleware; the current middleware compatible media control in the application program comprises the new middleware compatible media control, and more current middleware compatible media controls in the application program than the new middleware compatible media control; wherein the new middleware is not compatible with at least one of the current middleware compatible media controls in the application;
a third replacing module for replacing the current middleware in the application program with the new middleware.
In the application, under the condition that a target media control in a plurality of media controls in an application program needs to be called based on a page control, a control parameter of the target media control is obtained based on the page control. And the control parameters are transferred to the middleware through the first API based on the page control. And under the condition that the middleware obtains the control parameters, determining the open second API of the target media control according to the control parameters in the open second APIs of different media controls based on the middleware. And calling the target media control through a second API opened by the target media control based on the middleware.
According to the application, the operations of determining the second API which is opened by the target media control and needs to be called according to the control parameter in the second APIs which are respectively opened by different media controls and calling the target media control through the second API which is opened by the target media control can be executed by the middleware, the middleware can be configured in the application program in advance by a developer, the middleware opens the first API on one hand to call the middleware for the page control of the page in the application program, and the middleware adapts the second APIs which are respectively opened by the media controls in the application program on the other hand.
The developer can multiplex the middleware in each page in the application program by developing the middleware once, so that the page control of each page of the application program has the capability of executing the operation of ' determining the second API which is opened by the target media control and needs to be called in the second APIs which are respectively opened by different media controls according to the control parameters and executing the operation of ' calling the target media control through the second API which is opened by the target media control '.
Because the middleware is opened with the uniform first API, in a scenario where a developer develops a page including a plurality of different types of media controls in an application program, only the uniform API (for example, a uniform API name and uniform input parameters that need to be provided to the uniform API) may be concerned, and only the uniform API needs to be used in a computer program code of the page to implement a function of calling different media controls. For example, only a uniform first API opened by the middleware can be introduced into the computer program code for developing the page, so that the complexity of the computer program code for the page is reduced, and the later maintenance is facilitated.
In addition, developers do not need to be familiar with the second APIs respectively opened by various media controls, and can write computer program codes for calling the media controls to be called according to the unified API, so that the developers only need to be familiar with the unified API, and do not need to be familiar with the second APIs opened by various media controls, thereby reducing technical requirements, reducing development difficulty and indirectly reducing labor cost.
For the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
Optionally, an embodiment of the present invention further provides an electronic device, including: the processor, the memory, and the computer program stored in the memory and capable of running on the processor, when executed by the processor, implement the processes of the data processing method embodiments described above, and can achieve the same technical effects, and in order to avoid repetition, details are not described here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements each process of the data processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Fig. 3 is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 3, electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, images, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the electronic device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 4 is a block diagram of one type of electronic device 1900 shown in the present application. For example, electronic device 1900 may be provided as a server.
Referring to fig. 4, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, that are executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the methods described above.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, mac OSXTM, unixTM, linuxTM, freeBSDTM, or the like.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the particular illustrative embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, but is intended to cover various modifications, equivalent arrangements, and equivalents thereof, which may be made by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A data processing method is characterized in that the method is applied to a terminal, an application program is installed in the terminal, the application program comprises a plurality of media controls, middleware and page controls of pages, and the middleware is provided with a first Application Program Interface (API) for calling the middleware from the page controls of the pages in the application program; the middleware is also used for adapting a second API which is respectively opened by each media control in the application program, and the method comprises the following steps:
under the condition that a target media control in the multiple media controls in the application program needs to be called based on the page control, acquiring a control parameter of the target media control based on the page control;
transmitting the control parameter to the middleware through the first Application Program Interface (API) based on the page control;
under the condition that the middleware obtains the control parameters, based on the middleware, obtaining a control identifier of a target media control to be called according to the control parameters, obtaining a second API opened by the target media control according to the control identifier of the target media control, and determining the second API opened by the target media control to be called according to the control parameters in the second APIs respectively opened by different media controls, wherein the middleware stores the corresponding relation between the control identifier of the media control and the second API opened by the media control;
and calling the target media control through a second API opened by the target media control based on the middleware.
2. The method of claim 1, further comprising:
receiving an update instruction for updating the middleware in the application program, wherein the update instruction carries a new middleware, the new middleware-compatible media control comprises a current middleware-compatible media control in the application program, and the new middleware-compatible media control is more than the current middleware-compatible media control in the application program;
replacing current middleware in the application with the new middleware.
3. The method of claim 1, further comprising:
under the condition that a page needs to be rendered in the application program, detecting whether the page control needs to call a new media control incompatible with the current middleware in the application program;
downloading a new middleware in a server corresponding to the application program under the condition that the page control needs to call a new media control incompatible with the current middleware in the application program, wherein the new media control compatible with the middleware comprises a media control compatible with the current middleware in the application program, and the number of the new media control compatible with the middleware is more than that of the media control compatible with the current middleware in the application program; wherein the new middleware is compatible with a new media control;
replacing current middleware in the application with the new middleware.
4. The method of claim 1, further comprising:
receiving an updating instruction for updating the middleware in the application program, wherein the updating instruction carries a new middleware; the current middleware compatible media control in the application program comprises the new middleware compatible media control, and more current middleware compatible media controls in the application program than the new middleware compatible media control; wherein the new middleware is not compatible with at least one of the current middleware compatible media controls in the application;
replacing current middleware in the application with the new middleware.
5. The data processing device is applied to a terminal, an application program is installed in the terminal, the application program comprises a plurality of media controls, middleware and page controls of pages, and the middleware is provided with a first Application Program Interface (API) for calling the middleware from the page controls of the pages in the application program; the middleware is also used for adapting to second APIs which are respectively opened by each media control in the application program; the device comprises:
the obtaining module is used for obtaining the control parameters of the target media control based on the page control under the condition that the target media control in the multiple media controls in the application program needs to be called based on the page control;
the transfer module is used for transferring the control parameters to the middleware through the first application program interface API based on the page control;
the determining module is used for acquiring a control identifier of a target media control to be called according to the control parameter based on the middleware under the condition that the middleware obtains the control parameter, acquiring a second API opened by the target media control according to the control identifier of the target media control, and determining the second API opened by the target media control to be called according to the control parameter in the second APIs respectively opened by different media controls, wherein the middleware stores the corresponding relation between the control identifier of the media control and the second API opened by the media control;
and the calling module is used for calling the target media control through a second API opened by the target media control based on the middleware.
6. The apparatus of claim 5, further comprising:
a first receiving module, configured to receive an update instruction for updating a middleware in the application program, where the update instruction carries a new middleware, and the new middleware-compatible media control includes a current middleware-compatible media control in the application program, and the new middleware-compatible media control is more than the current middleware-compatible media control in the application program;
a first replacement module to replace current middleware in the application with the new middleware.
7. The apparatus of claim 5, further comprising:
the detection module is used for detecting whether the page control needs to call a new media control incompatible with the current middleware in the application program or not under the condition that the page needs to be rendered in the application program;
the downloading module is used for downloading a new middleware in a server corresponding to the application program under the condition that the page control needs to call a new media control incompatible with the current middleware in the application program, wherein the new media control compatible with the middleware comprises a media control compatible with the current middleware in the application program, and more media controls compatible with the new middleware are than the media control compatible with the current middleware in the application program; wherein the new middleware is compatible with a new media control;
a second replacement module for replacing current middleware in the application program with the new middleware.
8. The apparatus of claim 5, further comprising:
a second receiving module, configured to receive an update instruction for updating the middleware in the application program, where the update instruction carries a new middleware; the current middleware compatible media control in the application program comprises the new middleware compatible media control, and more current middleware compatible media controls in the application program than the new middleware compatible media control; wherein the new middleware is not compatible with at least one of the current middleware compatible media controls in the application;
a third replacing module for replacing the current middleware in the application program with the new middleware.
9. An electronic device, comprising: processor, memory and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the data processing method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the data processing method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111676600.6A CN114416084B (en) | 2021-12-31 | 2021-12-31 | Data processing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111676600.6A CN114416084B (en) | 2021-12-31 | 2021-12-31 | Data processing method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114416084A CN114416084A (en) | 2022-04-29 |
CN114416084B true CN114416084B (en) | 2023-04-07 |
Family
ID=81271123
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111676600.6A Active CN114416084B (en) | 2021-12-31 | 2021-12-31 | Data processing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114416084B (en) |
Family Cites Families (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102087597B (en) * | 2011-02-14 | 2014-08-20 | 浪潮通信信息系统有限公司 | J2EE and component set-based visualized development platform |
CN104573287B (en) * | 2015-02-06 | 2017-09-26 | 成都能通科技有限公司 | The Digital Simulation frame design method of unified model is bound based on interface |
CN105824611A (en) * | 2015-10-20 | 2016-08-03 | 广东亿迅科技有限公司 | Rapid development system based on Android intelligent operation platform |
CN107203373B (en) * | 2016-03-18 | 2020-10-20 | 阿里巴巴集团控股有限公司 | Interface control acquiring method, interface control testing method, interface control acquiring device and interface control testing device |
CN108282683B (en) * | 2017-01-05 | 2020-07-14 | 腾讯科技(深圳)有限公司 | Video interface display method and device |
US10620974B2 (en) * | 2017-02-13 | 2020-04-14 | Microsoft Technology Licensing, Llc | Gallery control with dynamically determined control template replica sizes |
CN107766043B (en) * | 2017-11-08 | 2021-01-15 | 广东亿迅科技有限公司 | Large-screen data visualization based realization method and system |
CN112395098B (en) * | 2019-08-19 | 2024-03-15 | 网易(杭州)网络有限公司 | Application program interface calling method and device, storage medium and electronic equipment |
CN110780853A (en) * | 2019-09-28 | 2020-02-11 | 同程网络科技股份有限公司 | Front end framework, development method, storage medium and electronic device |
CN112631699A (en) * | 2020-12-21 | 2021-04-09 | 平安普惠企业管理有限公司 | Application program display method, device, equipment and computer storage medium |
CN112732243B (en) * | 2021-01-11 | 2024-06-18 | 京东科技控股股份有限公司 | Data processing method and device for generating functional components |
CN112905172A (en) * | 2021-03-16 | 2021-06-04 | 深圳市欢太科技有限公司 | Component management method and device of application development framework, storage medium and electronic equipment |
CN113312052A (en) * | 2021-06-29 | 2021-08-27 | 未鲲(上海)科技服务有限公司 | Component calling method and device, electronic equipment and storage medium |
CN113656109B (en) * | 2021-09-01 | 2023-07-04 | 中国农业银行股份有限公司 | Security control calling method, device, equipment and storage medium |
-
2021
- 2021-12-31 CN CN202111676600.6A patent/CN114416084B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN114416084A (en) | 2022-04-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109032606B (en) | Native application compiling method and device and terminal | |
EP2998899A1 (en) | Method and apparatus for running application program | |
US9870239B2 (en) | Method and device for running application program | |
CN105808305B (en) | Static resource loading method and device | |
US20170068527A1 (en) | Device control method and apparatus | |
CN109117144B (en) | Page processing method, device, terminal and storage medium | |
CN107463372B (en) | Data-driven page updating method and device | |
CN111695064B (en) | Buried point loading method and device | |
CN105376318A (en) | File transmission method, device and system | |
CN114416084B (en) | Data processing method and device, electronic equipment and storage medium | |
CN115357277A (en) | Hot update method, device, electronic apparatus, storage medium and program product | |
CN110457084B (en) | Loading method and device | |
CN114546436A (en) | Micro front-end service updating method and device, electronic equipment and storage medium | |
CN114416247A (en) | Data processing method and device, electronic equipment and storage medium | |
CN107463414B (en) | Application installation method and device | |
CN114416218B (en) | Data processing method and device, electronic equipment and storage medium | |
CN107257384B (en) | Service state monitoring method and device | |
CN110995767A (en) | Request processing method and device | |
CN113934452B (en) | Data processing method and device, electronic equipment and storage medium | |
CN116126320B (en) | Data processing method and device, electronic equipment and storage medium | |
CN112506628B (en) | Agent program management method, device, computer equipment and storage medium | |
CN115098200B (en) | Language switching method and device, electronic equipment and storage medium | |
CN114416085B (en) | Data processing method and device, electronic equipment and storage medium | |
CN110311968B (en) | Method and device for loading file in streaming mode and intelligent equipment | |
CN114416033A (en) | Data processing method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |