CN117724726A - Data processing method and related device - Google Patents

Data processing method and related device Download PDF

Info

Publication number
CN117724726A
CN117724726A CN202410164437.2A CN202410164437A CN117724726A CN 117724726 A CN117724726 A CN 117724726A CN 202410164437 A CN202410164437 A CN 202410164437A CN 117724726 A CN117724726 A CN 117724726A
Authority
CN
China
Prior art keywords
project
compiling
target
engineering
native
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.)
Pending
Application number
CN202410164437.2A
Other languages
Chinese (zh)
Inventor
何冲
李斌
文孝木
郭永智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202410164437.2A priority Critical patent/CN117724726A/en
Publication of CN117724726A publication Critical patent/CN117724726A/en
Pending legal-status Critical Current

Links

Abstract

The application discloses a data processing method and a related device, wherein, firstly, when compiling a primary project, local variables aiming at a target project are obtained, and the primary project and the target project are application data developed under different development environments. When the local variable indicates to compile the target project, acquiring the target project, compiling to obtain a first compiled product, combining the first compiled product with a second compiled product obtained by compiling the original project to obtain an operation package of the mixed project, wherein the mixed project is the original project integrated with the target project; and responding to the local variable to indicate that the target project is not compiled, acquiring a first compiling product obtained through historical compiling, and combining the first compiling product and the second compiling product to obtain a running package of the hybrid project. The method can realize decoupling of the original project and the target project in the compiling stage, and can selectively determine whether to compile the target project when compiling the original project, thereby effectively improving the compiling efficiency.

Description

Data processing method and related device
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a data processing method and related apparatus.
Background
The target engineering developed in the non-native running environment can be accessed into the native engineering developed in the native running environment in a mixed engineering processing mode, and when the application program corresponding to the native engineering runs, a new functional service can be provided for a user through the target engineering.
In order to ensure the quality of service, in the development process of the target engineering and the native engineering, possible problems need to be determined through compiling of the target engineering and the native engineering so as to be adjusted in time.
However, due to the coupling of the target engineering and the native engineering, the debugging cost in development is high and the efficiency is low.
Disclosure of Invention
In order to solve the technical problems, the application provides a data processing method and a related device, which can realize decoupling of a primary project and a target project in a compiling stage, and can selectively determine whether to compile the target project when compiling the primary project, thereby effectively improving compiling efficiency.
The embodiment of the application discloses the following technical scheme:
in one aspect, an embodiment of the present application provides a data processing method, including:
when compiling a native project, acquiring local variables aiming at a target project in the native project, wherein the native project and the target project are application data developed under different development environments, and the target project is used for being integrated into the native project;
Responding to the local variable to instruct compiling the target project, acquiring the target project, compiling to obtain a first compiling product, and combining the first compiling product with a second compiling product obtained by compiling the original project to obtain an operation package of a mixed project, wherein the mixed project is the original project integrated with the target project;
and responding to the local variable to indicate that the target project is not compiled, acquiring the first compiling product obtained through historical compiling, and combining the first compiling product with the second compiling product to obtain the running package of the hybrid project.
In another aspect, an embodiment of the present application provides a data processing apparatus, including: the system comprises an acquisition module, a first compiling module and a second compiling module;
the acquisition module is used for acquiring local variables aiming at a target project in the original project when compiling the original project, wherein the original project and the target project are application data developed under different development environments, and the target project is used for being integrated into the original project;
the first compiling module is configured to obtain a first compiling product by compiling the target project in response to the local variable indication, and combine the first compiling product with a second compiling product obtained by compiling the native project to obtain an operation package of a hybrid project, where the hybrid project is the native project integrated with the target project;
The second compiling module is configured to obtain the first compiling product obtained through historical compiling in response to the local variable indicating that the target project is not compiled, and combine the first compiling product with the second compiling product to obtain an operation package of the hybrid project.
In yet another aspect, embodiments of the present application provide a computer device comprising a processor and a memory:
the memory is used for storing a computer program;
the processor is configured to perform the method according to the above aspect according to a computer program.
In yet another aspect. Embodiments of the present application provide a computer readable storage medium storing a computer program for executing the method described in the above aspect.
In yet another aspect, embodiments of the present application provide a computer program product comprising a computer program which, when run on a computer device, causes the computer device to perform the method of the above aspect.
It can be seen from the above technical solution that, when the hybrid engineering development of the original engineering and the target engineering is performed, a local variable for the target engineering is added to the original engineering, the local variable indicating whether the target engineering is compiled simultaneously when the original engineering is compiled. When the native project and the target project need to be compiled simultaneously to find problems, the local variable can be adjusted to instruct to compile the target project, so that the native project and the target project can be compiled simultaneously to generate a running package of the hybrid project under the instruction of the local variable. When only the native project needs to be compiled to find a problem, the local variable may be adjusted to indicate that the target project is not compiled, so that only the native project may be compiled under the direction of the local variable, and the running package of the hybrid project may be generated in combination with the first compiled product of the target project that has completed compiling. Therefore, the native engineering and the target engineering are decoupled in the compiling stage by adding the local variable in the native engineering and adjusting the indication function of the local variable based on the compiling requirement, and whether the target engineering is compiled or not can be selectively determined in the compiling process of the native engineering, so that the compiling efficiency is effectively improved, the compiling resource consumption is reduced in some scenes, and the debugging cost is greatly reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a method for data processing according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for data processing according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a compiling process of a router project according to an embodiment of the present application;
FIG. 4 is one of the flow charts of a process package for obtaining hybrid engineering according to an embodiment of the present application;
FIG. 5 is a second flowchart of a method for obtaining a hybrid engineering run-time package according to an embodiment of the present application;
FIG. 6 is a third flowchart of a process for obtaining a hybrid engineering run-time package according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a code storage directory according to an embodiment of the present disclosure;
fig. 8 is a schematic diagram of a page route management process according to an embodiment of the present application;
Fig. 9 is a schematic diagram of an implementation process of a communication function according to an embodiment of the present application;
FIG. 10 is a block diagram of a hybrid project of a native project and a router project according to an embodiment of the present disclosure;
FIG. 11 is a schematic diagram of a model determining apparatus according to an embodiment of the present application;
fig. 12 is a block diagram of a terminal device according to an embodiment of the present application;
fig. 13 is a block diagram of a server according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the accompanying drawings.
The target engineering and the native engineering are application data developed under the environment without development, and in the related technology, there is a need to access the target engineering developed under the non-native running environment into the native engineering developed under the native running environment, and when the application program corresponding to the native engineering runs, the new functional service can be provided for the user through the target engineering by means of engineering access. In the process of developing the target engineering and the original engineering, the target engineering and the original engineering need to be compiled, and problems possibly occurring in the development process are determined through the compiling process so as to be adjusted in time. However, in the related art, the target engineering and the native engineering are in a strong coupling relationship, so that the debugging cost is high in the debugging process, and the debugging efficiency is low.
For this purpose, the embodiment of the application provides a data processing method and a related device, and by setting a local variable for a target project, the local variable indicates whether the target project is compiled simultaneously when the native project is compiled. The method can realize decoupling of the original project and the target project in the compiling stage, and can selectively determine whether to compile the target project when compiling the original project, thereby effectively improving the compiling efficiency.
The data processing method provided by the embodiment of the application can be implemented by a computer device, and the computer device can be a terminal device or a server, wherein the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server for providing cloud computing service. Terminal devices include, but are not limited to, cell phones, computers, intelligent voice interaction devices, intelligent home appliances, vehicle terminals, aircraft, and the like. The terminal device and the server may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
Fig. 1 is a schematic diagram of a data processing method according to an embodiment of the present application, where the foregoing computer device is a server.
As shown in fig. 1, the server may integrate the target project with the native project, and may obtain the hybrid project by integrating the target project into the native project, and after the integration, in the operating environment of the native project, may enable the native project to provide the functional service corresponding to the target project by operating the target project.
The application data compiled by the original engineering is added with local variables aiming at the target engineering. The local variable is used for indicating whether the target engineering is compiled or not, and when the local variable indicates that the target engineering is compiled, the target engineering is compiled while the original engineering is compiled to obtain a first compiling product. And then merging the first compiled product with a second compiled product obtained by compiling the original engineering to obtain the operation package of the hybrid engineering. When the local variable indicates that the target engineering is not compiled, the target engineering is not compiled when the original engineering is compiled, a first compiling product obtained through historical compiling is obtained, and then the first compiling product and a second compiling product obtained through compiling the original engineering are combined to obtain the running package of the mixed engineering.
The target engineering and the original engineering can be decoupled in the compiling stage by selecting whether to compile the target engineering according to actual requirements when compiling the original engineering through the indication of the local variables, so that the compiling efficiency is improved.
Fig. 2 is a flowchart of a method for data processing according to an embodiment of the present application, and as shown in fig. 2, the method may be performed by a computer device, which in this embodiment is described by taking a server as an example.
The method comprises the following steps:
s201: and when compiling the original engineering, acquiring local variables aiming at the target engineering in the original engineering.
The native project mentioned in S201 and the target project may be understood as application data developed under different development environments, wherein the target project is application data for integration into the native project to implement addition of corresponding functional services in the native project. The above-mentioned local variables for the target engineering can be set with different variable values, and the compiling of the target engineering can be indicated simultaneously or not when the original engineering is compiled through the different variable values. Compilation refers to the process of compiling code in a target project or a native project for implementing specific application functions.
In the process of developing the original project and the target project by the server, possible problems need to be determined by compiling the target project and the original project so as to be adjusted in time. In this embodiment of the present application, the need for compiling adjustment may be predetermined, and the indication of the local variable may be correspondingly adjusted according to different needs for compiling adjustment. When compiling the original engineering, acquiring a local variable aiming at the target engineering, and determining whether to compile the target engineering according to the indication of the local variable.
S202: and responding to the local variable to instruct compiling the target project, acquiring the target project, compiling to obtain a first compiling product, and combining the first compiling product with a second compiling product obtained by compiling the original project to obtain an operation package of the hybrid project.
The first compiling product and the second compiling product refer to a compiling product obtained by compiling application data of a target project and a compiling product obtained by compiling application data of a primary project respectively. The running package refers to an application package obtained under a development environment corresponding to the original engineering after the first compiling product and the second compiling product are integrated.
The hybrid engineering is a native engineering integrating the target engineering. When the target engineering exists in the original engineering, two scenes exist when the original engineering needs to be debugged, wherein one scene is that both the original engineering and the target engineering need to be debugged, and the other scene is that only the original engineering needs to be debugged. The application scenario corresponding to S202 is that the debugging needs to be performed on both the original engineering and the target engineering.
In the embodiment of the application, when the need of debugging both the original engineering and the target engineering is determined, the two engineering are compiled simultaneously so as to achieve the effect of synchronous debugging. Specifically, when compiling the native project, a local variable for the target project is acquired, and whether to compile the target project is determined according to the indication of the local variable. When the local variable indicates to compile the target project, synchronous debugging of the original project and the target project is proved to be needed, and at the moment, the target project is compiled and a first compiling product is obtained. And compiling the original engineering while compiling the target engineering, and compiling the original engineering to obtain a second compiling product. And then combining the first compiling product and the second compiling product to obtain the running package of the hybrid engineering.
The local variable indicates the condition of compiling the target engineering, and is suitable for the scene of adjusting the original engineering and the target engineering simultaneously. Under the scene, the target engineering is compiled to obtain a first compiling product, and meanwhile, the original engineering is compiled to obtain a second compiling product. And then combining the first compiled product and the second compiled product to obtain the running package of the hybrid engineering.
That is, in the application scenario corresponding to S202, that is, the application scenario in which both the native engineering and the target engineering need to be debugged. At the moment, the original engineering is compiled, meanwhile, the target engineering is required to be compiled, and then the second compiling product corresponding to the original engineering and the first compiling product corresponding to the target engineering are combined to obtain the running package of the hybrid engineering. In the compiling process, the original engineering and the target engineering belong to the dependency relationship on the source code.
Assuming that the target project is a flutter project, fig. 3 is a schematic diagram of a compiling process of the flutter project provided by the embodiment of the present application, in order to implement a cross-platform (i.e. development environment) capability, the flutter uses c++ as a development language to implement a bottom layer function, in order to implement that c++ codes can be embedded into the native project, c++ is compiled into products of each development environment in advance, and is uploaded to a cos file storage platform, for example. The process of compiling a flutter project to obtain an android compiling product and an ios compiling product is shown in the figure, the flutter product is divided into a Dart service Code and a flutter Engine Code, the Dart Code in the figure comprises a service Code written by a developer, and the Engine Code is an Engine Code. The Dart Code obtains app. Dill (Dart Kernel) through the front_server, and one part of Dart Code can be compiled to generate a double-end product, so that the cross-platform capability is realized. After the processing of the compiling tool, a double-end product can be generated, namely an android compiling product and an ios compiling product in the graph, and compiling tools such as front_server, gen_snapshot and ninja are used in the process.
S203: and responding to the local variable to indicate that the target project is not compiled, acquiring the first compiling product obtained through historical compiling, and combining the first compiling product with the second compiling product to obtain the running package of the hybrid project.
The historical compilation refers to compilation of the target engineering, and the first compilation product obtained through the historical compilation refers to a first compilation product which is selected according to requirements from the first compilation products of the compilation of the target engineering, is matched with the original engineering, and is used as a first compilation product which is combined with a second compilation product of the original engineering in the compilation.
The above-mentioned two scenarios exist when debugging the original engineering, and the corresponding application scenario in S203 is that only the original engineering needs to be debugged. In this scenario, the target project does not need to be recompiled, and the first compiling product of the history and the second compiling product of the original project can be used for merging to generate the running package of the mixed project.
Whether the target engineering needs to be compiled or not is determined according to the indication of the local variable, when the local variable indicates that the target engineering is not compiled, the target engineering is compiled only to obtain a second compiling product, the target engineering is not compiled any more, and the compiling product meeting the requirements of the target engineering in historical compiling is selected as the current first compiling product. And combining the first compiling product with a second compiling product obtained by compiling the original engineering to obtain the running package of the mixed engineering.
The local variable indicates the situation that the target project is not compiled, and is applicable to the scene that only needs to be adjusted on the original project. Because the target engineering is integrated in the original engineering, if the setting of the local variable in the embodiment of the application is not performed, when only the compiling adjustment is needed for the original engineering, the target engineering is inevitably compiled due to the strong coupling relationship between the original engineering and the target engineering. Through the setting of the local variable in the embodiment of the application, when the local variable indicates that the target project is not compiled, the compiling product of the target project obtained in the historical compiling is obtained as the first compiling product for the target project, and only the primary project can be compiled to obtain the second compiling product.
That is, only the native engineering needs to be debugged in the application scenario corresponding to S203. Decoupling between the target engineering and the native engineering can be achieved at this time, that is, the native engineering alone compiles to obtain the second compiled product, during which the compiling operation of the target engineering (which can be understood as partial compiling) is not required. Before generating the running package of the hybrid engineering, a compiled product of the target engineering meeting the requirements in historical compilation can be selected as a current first compiled product. And then merging the first compiled product with the second compiled product to obtain the running package of the hybrid engineering. It can be seen that in this scenario the relationship between the target project and the native project is a remote dependency.
From the above detailed description of the application scenarios corresponding to S202 and S203, it can be seen that the indication conditions by the local variables are different, and may correspond to two different compiling processes. The local variable can be adjusted based on the compiling joint debugging requirements, different compiling instructions are carried out according to different compiling joint debugging requirements, and different compiling effects are achieved.
Fig. 4 is one of flowcharts of a method for obtaining a running package of a hybrid engineering according to an embodiment of the present application, as shown in fig. 4, in one possible implementation, the target engineering is flutter, and the native engineering is android engineering. Then when compilation of android engineering is required, it is determined whether synchronized compilation of the flutter is required. The local variable can be expressed as "isBuildFlutter" according to the compiling requirement, and the corresponding local variable can be expressed as true or false (yes or no in the figure). When isbuildflutter=true, the representational need to compile the flutter. The specific process can be as follows: firstly, a gradle (configuration script for android engineering development) is loaded, then, the flutter engineering is compiled and packed to be integrated into aar (aar file is a dependency format in the android engineering and can be understood as a compressed file) to obtain a first compiled product, and then, the first compiled product and the second compiled product are integrated to obtain a running package of the hybrid engineering.
When isbuildfilter=false, the proxy does not need to compile the flutter. The specific process can be as follows: and executing gradle to compile and package the android project to obtain a second compiled product, judging whether to pull the flutter aar, namely, obtaining a first compiled product of the flutter project compiled in history by pulling the flutter aar, and merging and packaging the second compiled product and the first compiled product to obtain an operation package of the hybrid project. If the judgment is not performed, executing the action which is taken according with the judgment condition.
FIG. 5 is a second flowchart of a method for obtaining a running package of a hybrid engineering according to an embodiment of the present application, as shown in FIG. 5, in one possible implementation, the target engineering is flutter, and the native engineering is mac/ios engineering. Then when the mac/ios project needs to be compiled, it is determined whether synchronized compiling of the flutter is required. The local variable can be expressed as "isBuildFlutter" and the corresponding local variable can be true or false (yes or no in the figure) according to the compiling requirement. When isbuildflutter=true ("yes" in the figure), it is necessary to compile the flutter on behalf. The specific process can be as follows: firstly, loading a shell, compiling and integrating a flutter project into a framework (framework for windows project) framework to obtain a first compiling product, and then merging and packaging the first compiling product and a second compiling product obtained by compiling a mac/ios project to obtain a running package of the hybrid project.
When isbuildfilter=false ("no" in the figure), no compilation of the flutter is required on behalf. The specific process can be as follows: and acquiring a first compiling product of the historical compiling of the flutter, judging whether the acquired first compiling product of the historical compiling of the flutter is the latest version, and merging and packaging the first compiling product with a second compiling product obtained by compiling the original engineering when the first compiling product is the latest version. And if the obtained first compiling product is not the latest version, remotely pulling the first compiling product of the corresponding flutter project meeting the compiling requirement of the original project through a conn (dependent items of C and C++ language and a program package manager). And merging and packaging the second compiled product obtained by compiling the original engineering and the pulled first compiled product to obtain the operation package of the hybrid engineering.
Fig. 6 is a third flowchart of a method for obtaining a running package of a hybrid engineering according to an embodiment of the present application, as shown in fig. 6, in one possible implementation, the target engineering is a router, and the native engineering is a windows engineering. Then when the windows project needs to be compiled, it is determined whether synchronized compiling of the flutter project is required. According to the compiling requirement, the value of the local variable is correspondingly adjusted, the local variable can be also expressed as 'isBuildFlutter', and the value of the corresponding local variable can be true or false. When isbuildflutter=true ("yes" in the figure), it is necessary to compile the flutter on behalf. The specific process can be as follows: firstly, loading batch processing, then compiling a router project to obtain a first compiling product, wherein the form of the first compiling product in the windows project is dll form. And merging and packaging the obtained first compiling product and a second compiling product obtained by compiling the windows engineering to obtain the running package of the hybrid engineering.
When isbuildfilter=false ("no" in the figure), no compilation of the flutter is required on behalf. The specific process can be as follows: and acquiring a first compiling product obtained by historical compiling of the flutter, judging whether the acquired first compiling product obtained by the historical compiling of the flutter is the latest version, and merging and packaging the first compiling product with a second compiling product obtained by compiling a native project (i.e. windows project) when the first compiling product is the latest version. And if the acquired first compiling product is not the latest version, remotely pulling the latest version of the first compiling product in the stored historical compiling of the flutter through a git (distributed version control system). And merging and packaging the second compiled product obtained by compiling the original engineering and the pulled first compiled product to obtain the operation package of the hybrid engineering.
According to the data processing method provided by the embodiment of the application, when the mixed engineering development of the original engineering and the target engineering is carried out, the local variable aiming at the target engineering is added into the original engineering, and the local variable indicates whether the target engineering is compiled simultaneously when the original engineering is compiled. When the native project and the target project need to be compiled simultaneously to find problems, the local variable can be adjusted to instruct to compile the target project, so that the native project and the target project can be compiled simultaneously to generate a running package of the hybrid project under the instruction of the local variable. When only the native project needs to be compiled to find a problem, the local variable may be adjusted to indicate that the target project is not compiled, so that only the native project may be compiled under the direction of the local variable, and the running package of the hybrid project may be generated in combination with the first compiled product of the target project that has completed compiling. Therefore, the native engineering and the target engineering are decoupled in the compiling stage by adding the local variable in the native engineering and adjusting the indication function of the local variable based on the compiling requirement, and whether the target engineering is compiled or not can be selectively determined in the compiling process of the native engineering, so that the compiling efficiency is effectively improved, the compiling resource consumption is reduced in some scenes, and the debugging cost is greatly reduced.
In the foregoing description, it was mentioned that it is possible to indicate whether or not the target project is compiled at the same time when the original project is compiled by setting different variable values for the local variables, through the difference of the variable values. In one possible implementation, the variable value of the local variable may include a first value or a second value.
When compiling the native project, it is determined whether to compile the target project at the same time. And acquiring a variable value of the local variable, and indicating whether to compile the target engineering according to the variable value of the local variable. Specifically, when the variable value is the first value, it may be determined that the local variable indicates the compiling target project; when the variable value is the second value, it is determined that the local variable indicates that the target project is not compiled.
Regarding the variable names of the above-mentioned local variables, for example, "isBuildFlutter" may be set. The specific variable names may be freely set by those skilled in the art, and are not limited herein. For the value of the variable, the value of the variable may be a set of values such as "true-false" or a set of values such as "0-1", and any other value of the set of values that can be used for variable distinction may be used, and any value of the above-mentioned set of values may be used as the first value or the second value. Taking a value manner as "true-false" as an example, when the variable name is "isBuildFlutter", when "isbuildflutter=true", the current variable value can be considered as a first value, and then the current variable value is used for indicating the compiling target engineering under the value; meanwhile, when "isbuildflutter=false", the current variable value may be regarded as the second value, which then means that the target project is not compiled under the value. Taking a value mode of 0-1 as an example, when the variable name is "isBuildFlutter", when "isbuildflutter=0", the current variable value can be considered as a first value, and then the current variable value is used for indicating a compiling target project under the value; meanwhile, when "isbuildflutter=1", the current variable value may be regarded as the second value, which then means that the target project is not compiled under the value.
From the foregoing, it is understood that the specific manner of taking the variable values in the embodiments of the present application is not limited. When the variable values are different values, the corresponding operations performed on the target project are different. The variable values include two classes, one of which is used to indicate that the target project is compiled and the other of which is used to indicate that the target project is not compiled. In practical application, whether to compile the target project can be selectively determined when compiling the native project by changing the magnitude according to the adjustment requirement. The setting of the variable value can control the switching of two compiling modes, wherein one compiling mode is to compile the target engineering while compiling the original engineering, and the other compiling mode is to compile only the original engineering.
Through the above-mentioned value mode for the variable value of the local variable, whether compiling the target engineering can be correspondingly determined. Different compiling modes are corresponding to different values, and the values can be understood to correspond to different compiling scenes. The method can selectively determine whether to compile the target engineering or not when compiling the original engineering based on the indication effect of the targeted adjustment of the local variable of the current compiling requirement, thereby effectively improving the compiling efficiency.
In the aforementioned S203, it is mentioned that "the first compilation product obtained by the history compilation is acquired", specifically, when the compilation requirement is to compile only the native project, the target project is not required to be compiled. Although the target project is not compiled, it is also necessary to generate a running package of the hybrid project by compiling the native project and the target project. That is, the compiling product of the target project still needs to be obtained while the compiling of the target project is not performed. Then the compiled product obtained by utilizing the historical compilation of the target project can be combined with the compiled product of the original project to obtain the running package of the mixed project. In one possible implementation manner, the method for obtaining the first compiled product of the target engineering may be: and determining the first compiled product of the target version related to the compiling requirement from the first compiled products of the plurality of compiled versions obtained by historical compiling.
Specifically, before the target project is compiled this time, there may be a plurality of different compiled versions, and the different corresponding compiled versions of the target project are different. The latest compiling version refers to a version corresponding to the first compiling product obtained by compiling according to the latest target project. When only the original project needs to be compiled to find a problem, the target project is not compiled, but the compiled product of the target project still needs to be utilized. At this time, a first compiling product of historical compiling corresponding to the target engineering can be obtained, the first compiling product can be stored in a database, and the first compiling product can be obtained from the database by a server when the target engineering is needed to be used.
When a first compiling product obtained by historical compiling of a target project is obtained, the first compiling product matched with a second compiling product of a native project is required to be selected, so that the requirements of compiling and debugging can be met, and further the compiling efficiency is improved. The specific compiling and debugging requirement may be that when only the original engineering needs to be compiled and debugged, the first compiling product of the target engineering of the latest version needs to be obtained as the first compiling product of the mixed engineering which is combined with the second compiling product of the original engineering. Of course, other compiling requirements may be adopted, and according to different compiling requirements, the obtained first compiling products obtained by historical compiling are different.
For example, assume that a first compilation product resulting from historical compilation of a target project includes: version 1.0 of the first compilation product, version 2.0 of the first compilation product, and version 3.0 of the first compilation product. And determining a second compiling product obtained by the current compiling of the original engineering, wherein the adapted first compiling product is the first compiling product of version 2.0. Then when the target project is not compiled in response to the local variable indication, a version 2.0 of the first compiled product needs to be obtained from the three versions of the first compiled product obtained by the historical compilation as the first compiled product to be combined with the second compiled product of the native project.
By the method for acquiring the first compiled product, the first compiled product of the corresponding target project needs to be determined according to the compiling requirement. Therefore, the obtained first compiling product can be suitable for current compiling and debugging, the compiling efficiency can be improved, and the waste of compiling resources is reduced to a certain extent.
The foregoing description describes by way of example the case where the native project is windows project, mac project, ios project, and android project. The ios engineering and the android engineering are native engineering developed in a mobile terminal environment, and the windows engineering and the mac engineering are native engineering developed in a desktop terminal environment. It can be clear from this that, in the data processing method provided in the embodiment of the present application, the development environment of the native project may be a desktop environment or a mobile environment. In the above examples, the ios engineering and the android engineering are mobile terminals, and the windows engineering and the mac engineering are desktop terminals.
The development environment of the original engineering is expanded from the mobile terminal environment to the desktop terminal environment, so that the application range of the data processing method provided by the embodiment of the application is wider. And meanwhile, the development environment of the original engineering is expanded to the desktop environment, so that the hybrid engineering of the desktop environment and the target engineering can be realized, namely, the target engineering is integrated in the desktop environment.
The foregoing mentions that the native project and the target project are application data developed under different development environments, specifically, the native project is application data under a first development environment, and the target project is application data under a second development environment. In order to realize the hybrid engineering of the original engineering and the target engineering, that is, to integrate the target engineering in the original engineering, the method can be realized by adding a code storage catalog related to the target engineering in the original engineering. When the target project is integrated into the original project, there is a need to implement an interactive function between the target project and the original project. In one possible implementation manner, a specific method for setting the interactive function may be: when compiling the native engineering, acquiring an adaptive target native function code through a code storage catalog; the interactive functions are then encapsulated into a second compiled product by compiling the target native function code.
The above-mentioned target native function code is a code that can be compiled in the first development environment, and is used to implement the interactive function of the target engineering and the native engineering. The target native function code may include function code corresponding to a variety of different development environments, for example, a desktop environment or a mobile environment such as windows/mac/android/ios may be included in the code storage directory. When the original project needs to be compiled, the target original function code adapted to the current original project type can be correspondingly acquired through the code storage catalog, so that the interactive function with the target project can be realized through the target original function code. After the adaptive target native function code is determined, the interactive function can be packaged into a second compiling product corresponding to the native project by compiling the target native function code.
For example, assume that the target project is a router, and the target project router is integrated in the native project. That is, the data of the target project router is configured in the native project. In practical application, the storage position of the data of the target engineering flutter can be stated as flutterdir=/Users/sample/flutter_sample in the configuration file local. Properties of the original engineering, and meanwhile, the local variable is set as isbuildflutter=true, so that the hybrid engineering of the original engineering and the target engineering is realized. The aforementioned "router_sample" is a code storage directory, and fig. 7 is a schematic diagram of a code storage directory provided in the embodiment of the present application, as shown in fig. 7, where the router_sample includes target native function codes corresponding to windows/mac/android/ios. Code that implements the interactive functions between the target project and the native project may be included in the target native function code, and other routing, tool class, etc. code may also be included.
According to the method for realizing the interactive function between the target engineering and the original engineering, the code storage catalog related to the target engineering is added in the original engineering, and when the original engineering is compiled, the code storage catalog is used for acquiring the adaptive target original function code. By compiling the target native function code, it is possible to encapsulate the interactive function into a second compiled product of the native project, so as to enable the native project to interact with the target project based on the interactive function.
As shown in fig. 7, native function codes corresponding to different development environments in different folders in a code storage directory, the native function codes of the different development environments being codes that can be compiled under the corresponding development environments, are shown. In this figure, the filter is a target project, and the code storage directory indicated by the filter_sample includes four storage spaces by way of example: windows, mac (i.e., macos in the figure), android, and ios, respectively correspond to the native function codes of the four development environments in the four storage spaces. In order to implement the interactive function between the native project and the target project, it is required to acquire the adapted target native function code through the code storage directory when compiling the native project. In one possible implementation, the method for acquiring the adapted target native function code through the code storage directory may be: the corresponding memory space is accessed through the code storage directory first, and then target native function code adapted to the first development environment is determined in the memory space.
Specifically, after the native project is determined, the storage space under the code storage directory can be accessed through the code storage directory according to the type of the native project. Target native function code adapted to a first development environment corresponding to the native project is determined in the storage space. For example, when the native project is an android project, the corresponding storage space may be accessed through the code storage directory, and when the storage space includes target native function codes corresponding to various native projects, the native function code adapted to the android project needs to be acquired as the target native function code.
When the target project is the router project and the native project is the mac project, the android project and the like, the interaction between the target project and the native project can be realized through a bridging layer (i.e. a code storage catalog), and native function codes for different native projects can be included in the bridging layer. In the hybrid project formed between the target project and the native project, the native function code in the code storage directory related to the target project needs to be bridged with the corresponding native project through the bridging layer. The interaction between the original engineering and the target engineering is realized by acquiring the target original function code adapted to the first development environment from the code catalog so as to package the interaction function in the target original function code into a second compiled product corresponding to the original engineering through compiling.
The above-mentioned method for obtaining the adapted target native function code accesses a corresponding storage space through the code storage directory, and determines the target native function code adapted to the first development environment in the storage space. The storage space can comprise native function codes corresponding to various development environments, and interaction between a target project and corresponding native projects can be established by determining target native function codes adapted by the first development environment.
The above describes that the storage space pointed by the code storage directory stores the native function codes corresponding to different development environments. In one possible implementation, the storage space pointed to by the code storage directory may include functional scripts for different development environments. That is, the functional script and the storage space have a correspondence relationship, for example, the functional script for the first development environment is used to incorporate the first compilation product into the second compilation product in the first development environment. That is, the function script functions to merge the first compiled product corresponding to the target project into the second compiled product corresponding to the native project.
For example, when the target project is a router project, the storage space of the code storage directory related to the router project may include function scripts of different development environments in addition to the native function codes of the different development environments. The function script can be used for inserting the first compiling product of the target project into the compiling process of the original project, so that the first compiling product and the second compiling product obtained by compiling the original project can be combined, and the running package of the mixed project can be obtained.
The aforementioned development environment may specifically include native function codes corresponding to development environments such as windows, mac, android and ios. Different function scripts corresponding to the development environments are stored in the code storage catalog of the target project, and the first compiling product of the target project can be inserted into the compiling process of the original project of any one development environment (namely the first development environment) of windows, mac, android and ios through the function scripts. This enables the first compilation product to be incorporated into the second compilation product in the first development environment.
Taking the aforementioned objective engineering as the router engineering as an example, it is assumed that the first development environment is a windows environment, and the corresponding native engineering is a windows engineering. The code storage catalog of the router project comprises a storage space corresponding to the windows project, and the storage space comprises a native function code and a function script. The function script is used for combining a first compiling product corresponding to the target project into a second compiling product corresponding to the original project. In practical application, in the router engineering, there are modules corresponding to each development environment (i.e. native engineering), such as: windows, mac, android and ios, which not only contain native engineering code, but also contain compiled functional scripts. The method comprises the steps of calling the compiling flow of the native projects by using a hook (code for processing intercepted function calls, events and messages), inserting a section of function script in the compiling flow, wherein the function script mainly aims at inserting the product of the flutter, and then completing the combination of a first compiling product and a second compiling product by only referring the function script to a corresponding module (native project) in an ided (integrated development environment) to obtain the running package of the hybrid project.
According to the method for storing the function script in the storage space, the compiling process of the target engineering can be invoked in the development environment through the function script, so that the first compiling product obtained by compiling the target engineering is combined into the second compiling product obtained by compiling the original engineering. And combining the first compiling product and the second compiling product to obtain the running package of the hybrid engineering.
In the aforementioned native engineering, a code storage directory related to the target engineering is added, and a native function code for implementing an interactive function between the target engineering and the native engineering is included in the code storage directory. Wherein the interactive function of the target project and the native project may include at least one of a page routing function, a communication function. In order to realize the interactive functions, the native function codes for realizing the corresponding interactive functions need to be correspondingly configured in the code storage catalogue. When compiling the native project, the corresponding interactive function with the target project can be realized based on the native function code.
For example, assuming that the target project is a flutter project, the native project may be any one of windows, mac, android and ios projects. In the foregoing description it was introduced that the interaction between the target project and the native project may be achieved through a bridging layer (i.e. code storage directory) in which native function code for different native projects may be included. It is also introduced that the code storage catalog includes functional scripts for different development environments, that is, the flutter project can use the functional scripts to merge the first compiled product into the second compiled product corresponding to any one of the above-mentioned native projects. When the first compilation product is merged to the second compilation product, it means that the native function code in the code storage directory of the target project is also integrated into the second compilation product of the native project. At this time, the operation package of the hybrid engineering obtained by combining the first compiling product and the second compiling product has the interactive function correspondingly realized by the native function code, and the specific interactive function can comprise a page routing function, a communication function and the like.
The interaction function provided by the method can be used for realizing interaction between the target engineering and the original engineering, and particularly can be used for realizing the corresponding interaction function by utilizing the corresponding original function code in the code storage catalog. The integration of the interactive engineering in the hybrid engineering can be realized through the compiling product merging process, so that the interaction between the target engineering and the original engineering in the hybrid engineering is realized.
After the operation package of the hybrid engineering is obtained, interaction between the target engineering and the original engineering in the hybrid engineering needs to be realized. The interactive functions can be realized by the native function codes stored in the code storage catalog, and the interactive functions which can be realized by the corresponding native function codes include: page routing functions, communication functions, etc. When the first compiling product and the second compiling product are combined to obtain the running package of the hybrid engineering, if the interactive function expected to be realized in the hybrid engineering is a page routing function, in one possible implementation manner, the specific implementation manner may be:
a1: and operating the hybrid engineering through the operation package.
In the foregoing description, a run-time package is introduced, the run-time package refers to an application package obtained under a development environment corresponding to a native project after integration by a first compiled product and a second compiled product, and the hybrid project refers to a native project in which a target project is integrated. Hybrid engineering can be run by a run-time package, which can be understood as a compilation process of the run-time package.
A2: and in the running process of the hybrid engineering, starting a page management process according to the page routing function.
In the process of running and compiling the hybrid engineering, corresponding native function codes in the code storage catalog can realize corresponding interactive functions. When the interactive function correspondingly realized by the original function code is a page routing function, compiling the original function code in the running process of the hybrid engineering, and running the page routing function to start a page management process through the compiling process. The specific page management may include realizing the presentation of the page corresponding to the target project and the native project, and may further include the skip of the page between the target project and the native project.
A3: and storing a first type page opened through the target engineering and a second type page opened through the original engineering in a unified page stack through the page management process.
In this embodiment of the present application, the page management process may be implemented by a page stack, where the page stack may be understood as performing insertion and deletion of a corresponding presentation page at the top of the stack. Insertion of a presentation page refers to a process of entering the presentation page into the page stack, and deletion of the presentation page refers to a process of removing the presentation page from the page stack. In the page stack, a first type of page opened by the target project and a second type of page opened by the native project can be stored. In different processes of the page stack, the page stack can only comprise a first type page opened by the target engineering or a second type page opened by the original engineering, and can also comprise the first type page opened by the target engineering and the second type page opened by the original engineering.
A4: and responding to the display operation of the first target page of the hybrid engineering, and reading the first target page from the page stack to display.
The first target page is a first type page or a second type page. That is, when the page display operation is performed on the hybrid engineering, the corresponding page is read from the page stack to display. According to different display requirement objects corresponding to display operation, the page corresponding to the display requirement is read from the page stack to display. The page object corresponding to the display operation can be a first type page or a second type page, namely a page opened through the target engineering or a page opened through the native engineering.
A5: and deleting the second target page of the hybrid engineering from the page stack in response to a deleting operation of the second target page.
The second target page is a first type page or a second type page. And deleting the second target page to be deleted from the page stack when deleting the second target page. The specific deletion process needs to follow the pop sequence of the stack. The deleted second target page can be a first type page opened by the target engineering, and can also be a second type page opened by the original engineering.
For example, assuming that the target project is a flutter project, when the native project and the flutter project are compiled and generate the running packages corresponding to the hybrid projects, there is a need to perform interaction between the native project and the flutter project. One of the interaction requirements is to implement page jumps corresponding to the native project and the router project. Therefore, a native function code related to the page routing function is required to be set in a code storage catalog related to the flutter project added in the native project so as to realize the page routing interaction function of the flutter project and the native project.
Fig. 8 is a schematic diagram of a page route management process provided in an embodiment of the present application, where the page route management process is specifically shown, and as shown in the drawing, a native page corresponding to a native project and a flutter page corresponding to a flutter project may be included in a page stack at the same time. In the original page stack, there are stored a native page (i.e., a second type page) and a flutter page 1 (i.e., a first type page). Then, a push operation is performed, which can be understood as performing a display operation on a first target page of the hybrid engineering, where the corresponding first target page in the figure refers to a flutter page 2 (i.e. a first type page), and at this time, a native page, a flutter page 1, and a flutter page 2 are stored in a page stack. And then carrying out twice pop operation, and executing the deleting operation of the second target page of one hybrid engineering by the single pop operation. In the figure, the second target page refers to a flutter page 1 and a flutter page 2, the deleting operation on the flutter page 2 is performed in the first pop operation, and the deleting operation on the flutter page 1 is performed in the second pop operation. After the two delete operations are completed, only the native pages are stored in the page stack. Finally, a push operation is executed, and at this time, the native page and the router page 3 are stored in the page stack. The subsequent page management process is similar to the foregoing, and will not be described again here.
In one possible implementation manner, the native function code of the router project for implementing the interactive function can be used as a page carrier for implementing the page routing function through a unified AppContainer. When the actual page is opened, different pages are switched by using the AppContainer according to different page management processes and corresponding display operations aiming at the first target page and the second target page. When the page skip between the target engineering and the original engineering is carried out, a unified scheme route can be adopted, and the page of the original engineering can be skipped in a router channel mode. The jump interface adopted for realizing the page jump between the flutter engineering and the native engineering can be as follows: wkRouter build (url) withParam (param). Navigation ().
By the method for realizing the page interaction function, the page management process is started in the running process of the hybrid engineering, and the second type of pages corresponding to the original engineering and the first type of pages corresponding to the target engineering can be displayed and deleted through the page management process. The page routing function between the target engineering and the original engineering can be realized by utilizing the original function code, the interaction of page management between the target engineering and the original engineering is completed, and the cost of page interaction between the target engineering and the original engineering is reduced.
The aforementioned interactive functions that the native function code correspondence can implement may include: page routing functions, communication functions, etc. When the first compiling product and the second compiling product are combined to obtain the running package of the hybrid engineering, if the interactive function expected to be implemented in the hybrid engineering is a communication function, in one possible implementation manner, a specific implementation manner may be: firstly, running the mixed engineering through the running package, and then constructing a unified communication interface for the target engineering according to the communication function in the running process of the mixed engineering. And finally, establishing a communication channel between the original project and the target project based on the communication interface.
The communication channel is used for carrying out data communication with the native project by adopting a preset data format, and the preset data format is suitable for the native project of different development environments. Specifically, in the embodiment of the application, a unified communication interface is constructed for the target engineering, and a communication channel between the native engineering and the target engineering can be established based on the communication interface. The unified setting of the communication interface can facilitate the communication between the target engineering and the original engineering under different development environments, and the communication efficiency is improved. For example, when the native project is android, the predetermined data format corresponding to the predetermined data format may be apk.
In practical application, the interface of each platform can be unified by using a protobuf (method for serializing structural data), and the capability of generating interface codes of each project by using protoc plug in (plug-in used for generating codes) and then realizing the distribution of a grpc server (remote procedure call service) end and processing requests by each project can be realized. The native engineering is used as a server end only by realizing a corresponding interface.
Specifically, fig. 9 is a schematic diagram of an implementation process of a communication function provided in this embodiment of the present application, as shown in fig. 9, a handover engineering end (dartservices) calls through an interface of a grpc, and only a transport channel required for calling is called in a platform channel manner, in this manner, all channel calling interfaces are collected, and data distribution is performed through a single channel. The above mentioned platform Channel can be understood as constructing a unified communication interface for the target engineering, and the above mentioned communication Channel between the native engineering and the target engineering established based on the communication interface refers to the communication Channel established from platform Channel corresponding to the target engineering to windows, mac, android and Channel Service corresponding to the ios engineering in the figure.
The specific calling mode of the channel interface is as follows:
FinalGovernRpcServiceApiservice=GovernRpcServiceApi(PlatformChannel());
final result = await service.getGovernMyReportListFromServer(req);
by the method for realizing the communication function, a unified communication interface is constructed for the target engineering according to the communication function, and a communication channel between the original engineering and the target engineering can be established based on the communication interface. The unified communication interface and the communication channel can realize unified distribution of data, improve communication efficiency, and simultaneously can facilitate unified management of the communication interface.
In the foregoing, the method for implementing the communication function between the native project and the target project is described, where the target project may be used as a server for data communication and the native project may be used as a client for data communication during the data communication. Referring to fig. 9, in the figure, the router engineering corresponds to dartservices, i.e. a server; in the native engineering, windows engineering corresponds to C++ clients, mac and ios engineering corresponds to ObjectC clients, and android engineering corresponds to Java/Kotlen clients, which are clients.
The reason for taking the target engineering as a server for data communication and the native engineering as a client for data communication is that the server needs to have the capability of processing different network protocols in order to communicate with various clients. The client then needs to follow the protocol accepted by the server to send requests and receive data. In the embodiment of the application, the communication function is realized based on the native function codes in the code storage catalog related to the target engineering, and the native function codes aiming at different development environments are stored in the storage space pointed by the code storage catalog. Therefore, the target engineering has the communication capability with the native engineering under different development environments, and needs to be used as a server in the data communication of the embodiment of the application, and the native engineering is used as a client in the data communication of the embodiment of the application.
By accurately determining the identities of the target engineering and the original engineering in the data communication, the data communication between the target engineering and the original engineering can be smoothly performed.
Fig. 10 is a block diagram of a hybrid engineering of a native engineering and a router engineering according to an embodiment of the present application, as shown in fig. 10, including: fusion engineering, component layer, container, bridging layer and hardware layer. The fusion engineering includes a native engineering and a flutter engineering. The component layer includes various application components, as shown, including a plurality of core components in the component layer, specifically: routing, communication, infrastructure, protobuf (mixed language data standard for structured data storage and RPC systems) and json (syntax for storing and exchanging text information). The container is a flutter SDK, which in the embodiments of the present application can be understood as engineering, i.e. application data in a development environment. The flutter SDK includes: dart SDK (providing the necessary libraries and tools for developing applications), flutter Engine (the core Engine of Flutter, responsible for handling UI rendering and interactions of Flutter applications), skia (a cross-platform 2D graphics library that can be used to develop various applications), embadd (an embedder for embedding Flutter engines into host applications), and json. The bridging layer comprises Gradle (configuration script language for Android development), ruby (object-oriented programming language, which is widely applied in the construction of ios/mac application), batch processing and Dart (programming language for flutter, which can support multiple platforms and can be compiled into machine codes of each platform), and in the embodiment of the application, the bridging layer can realize the interaction function of native engineering and flutter engineering. Hardware and development environments windows, mac, android and ios may be included in the hardware layer.
On the basis of the foregoing embodiments corresponding to fig. 1 to 10, fig. 11 is a schematic device diagram of a model determining device provided in an embodiment of the present application, where the model determining device 1100 includes: an acquisition module 1101, a first compiling module 1102, and a second compiling module 1103;
the obtaining module 1101 is configured to obtain, when compiling a native project, a local variable for a target project in the native project, where the native project and the target project are application data developed under different development environments, and the target project is used for being integrated into the native project;
the first compiling module 1102 is configured to obtain a first compiling product obtained by compiling the target project in response to the local variable indication, and combine the first compiling product with a second compiling product obtained by compiling the native project to obtain an operation package of a hybrid project, where the hybrid project is the native project integrated with the target project;
the second compiling module 1103 is configured to obtain the first compiled product obtained by historical compiling in response to the local variable indicating that the target project is not compiled, and combine the first compiled product with the second compiled product to obtain an operation package of the hybrid project.
In a possible implementation, the variable value of the local variable includes a first value or a second value, and the device is configured to:
acquiring variable values of the local variables when compiling the native engineering;
determining that the local variable indicates compiling the target project when the variable value is the first value;
when the variable value is the second value, determining that the local variable indicates that the target project is not compiled.
In one possible implementation manner, the second compiling module 1103 is configured to:
and determining the first compiling product of the target version related to the compiling requirement from the first compiling products of the plurality of compiling versions obtained through historical compiling.
In one possible implementation manner, the native project is application data developed in a first development environment, and a code storage catalog related to the target project is added in the native project; the device is used for:
when compiling the native project, acquiring an adaptive target native function code through the code storage catalog, wherein the target native function code is a code which can be compiled in the first development environment and is used for realizing the interaction function of the target project and the native project;
And compiling the target native function code, and packaging the interactive function into the second compiling product.
In one possible implementation manner, the storage space pointed by the code storage directory stores native function codes for different development environments, wherein the native function codes of the different development environments are codes which can be compiled under the corresponding development environments; the device is used for:
accessing a corresponding storage space through the code storage catalog;
the target native function code adapted to the first development environment is determined in the storage space.
In one possible implementation, the apparatus is configured to:
the storage space pointed by the code storage catalog stores function scripts for different development environments, and the function scripts for a first development environment are used for merging the first compiling product into the second compiling product in the first development environment.
In one possible implementation, the apparatus is configured to:
the interactive function includes at least one of a page routing function, a communication function.
In a possible implementation manner, when the interactive function includes a page routing function, after obtaining the running package of the hybrid engineering, the apparatus is configured to:
Running the hybrid engineering through the running package;
in the running process of the hybrid engineering, starting a page management process according to the page routing function;
storing a first type page opened through the target engineering and a second type page opened through the original engineering in a unified page stack through the page management process;
responding to display operation of a first target page of the hybrid engineering, and reading the first target page from the page stack to display, wherein the first target page is the first type page or the second type page;
and deleting a second target page of the hybrid engineering from the page stack in response to a deleting operation of the second target page, wherein the second target page is the first type page or the second type page.
In a possible implementation, when the interactive function includes a communication function, after obtaining the running package of the hybrid engineering, the apparatus is configured to:
running the hybrid engineering through the running package;
in the running process of the hybrid engineering, a unified communication interface is built for the target engineering according to the communication function;
And establishing a communication channel between the native project and the target project based on the communication interface, wherein the communication channel is used for carrying out data communication with the native project by adopting a preset data format, and the preset data format is suitable for the native projects of different development environments.
In one possible implementation, the apparatus is configured to:
in the data communication, the target engineering is used as a service end of the data communication, and the native engineering is used as a client end of the data communication.
In one possible implementation, the apparatus is configured to:
the development environment of the original engineering is a desktop environment or a mobile environment.
With the above-provided data processing apparatus, when performing hybrid engineering development of a native engineering and a target engineering, a local variable for the target engineering is added to the native engineering, the local variable indicating whether the target engineering is also compiled at the same time when the native engineering is compiled. When the native project and the target project need to be compiled simultaneously to find problems, the local variable can be adjusted to instruct to compile the target project, so that the native project and the target project can be compiled simultaneously to generate a running package of the hybrid project under the instruction of the local variable. When only the native project needs to be compiled to find a problem, the local variable may be adjusted to indicate that the target project is not compiled, so that only the native project may be compiled under the direction of the local variable, and the running package of the hybrid project may be generated in combination with the first compiled product of the target project that has completed compiling. Therefore, the native engineering and the target engineering are decoupled in the compiling stage by adding the local variable in the native engineering and adjusting the indication function of the local variable based on the compiling requirement, and whether the target engineering is compiled or not can be selectively determined in the compiling process of the native engineering, so that the compiling efficiency is effectively improved, the compiling resource consumption is reduced in some scenes, and the debugging cost is greatly reduced.
The embodiment of the application also provides a computer device, which may include a terminal device or a server, and the foregoing data processing apparatus may be configured in the computer device. The computer device is described below with reference to the accompanying drawings.
If the computer device is a terminal device, please refer to fig. 12, an embodiment of the present application provides a terminal device, taking the terminal device as a mobile phone as an example:
fig. 12 is a block diagram illustrating a part of a structure of a mobile phone according to an embodiment of the present application. Referring to fig. 12, the mobile phone includes: radio Frequency (RF) circuitry 1410, memory 1420, input unit 1430, display unit 1440, sensor 1450, audio circuitry 1460, wireless fidelity (WiFi) module 1470, processor 1480, and power supply 1490. Those skilled in the art will appreciate that the handset configuration shown in fig. 12 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The following describes the components of the mobile phone in detail with reference to fig. 12:
the RF circuit 1410 may be used for receiving and transmitting signals during a message or a call, and particularly, after receiving downlink information of a base station, the downlink information is processed by the processor 1480; in addition, the data of the design uplink is sent to the base station.
The memory 1420 may be used to store software programs and modules, and the processor 1480 performs various functional applications and data processing of the cellular phone by executing the software programs and modules stored in the memory 1420. The memory 1420 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 1420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The input unit 1430 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the handset. In particular, the input unit 1430 may include a touch panel 1431 and other input devices 1432.
The display unit 1440 may be used to display information input by a user or information provided to the user and various menus of the mobile phone. The display unit 1440 may include a display panel 1441.
The handset can also include at least one sensor 1450, such as a light sensor, motion sensor, and other sensors.
Audio circuitry 1460, speaker 1461, microphone 1462 may provide an audio interface between the user and the handset.
WiFi belongs to a short-distance wireless transmission technology, and a mobile phone can help a user to send and receive emails, browse webpages, access streaming media and the like through a WiFi module 1470, so that wireless broadband Internet access is provided for the user.
The processor 1480 is a control center of the handset, connects various parts of the entire handset using various interfaces and lines, performs various functions of the handset and processes data by running or executing software programs and/or modules stored in the memory 1420, and invoking data stored in the memory 1420.
The handset also includes a power supply 1490 (e.g., a battery) that provides power to the various components.
In this embodiment, the processor 1480 included in the terminal apparatus is further configured to perform steps in the methods of the embodiments of the present application.
If the computer device is a server, as shown in fig. 13, fig. 13 is a block diagram of a server 1500 provided in the embodiment of the present application, where the server 1500 may have a relatively large difference due to different configurations or performances, and may include one or more central processing units (Central Processing Units, abbreviated as CPU) 1522 (e.g., one or more processors) and a memory 1532, one or more storage media 1530 (e.g., one or more mass storage devices) storing application programs 1542 or data 1544. Wherein the memory 1532 and the storage medium 1530 may be transitory or persistent storage. The program stored on the storage medium 1530 may include one or more modules (not shown), each of which may include a series of instruction operations on the server. Still further, the central processor 1522 may be configured to communicate with a storage medium 1530 and execute a series of instruction operations on the storage medium 1530 on the server 1500.
The Server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input/output interfaces 1558, and/or one or more operating systems 1541, such as Windows Server TM ,Mac OS X TM ,Unix TM , Linux TM ,FreeBSD TM Etc.
The steps performed by the server in the above embodiments may be based on the server structure shown in fig. 13.
In addition, the embodiment of the application also provides a storage medium for storing a computer program for executing the method provided by the embodiment.
The present application also provides a computer program product comprising a computer program which, when run on a computer device, causes the computer device to perform the method provided by the above embodiments.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, where the above program may be stored in a computer readable storage medium, and when the program is executed, the program performs steps including the above method embodiments; and the aforementioned storage medium may be at least one of the following media: read-only Memory (ROM), RAM, magnetic disk or optical disk, and the like, on which a computer program can be stored.
In the present embodiment, the term "module" or "unit" refers to a computer program or a part of a computer program having a predetermined function, and works together with other relevant parts to achieve a predetermined object, and may be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Also, a processor (or multiple processors or memories) may be used to implement one or more modules or units. Furthermore, each module or unit may be part of an overall module or unit that incorporates the functionality of the module or unit.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment is mainly described in a different point from other embodiments. In particular, for the apparatus and system embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, with reference to the description of the method embodiments in part. The apparatus and system embodiments described above are merely illustrative, in which elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing is merely one specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered in the protection scope of the present application. Further combinations of the implementations provided in the above aspects may be made to provide further implementations. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A method of data processing, the method comprising:
when compiling a native project, acquiring local variables aiming at a target project in the native project, wherein the native project and the target project are application data developed under different development environments, and the target project is used for being integrated into the native project;
responding to the local variable to instruct compiling the target project, acquiring the target project, compiling to obtain a first compiling product, and combining the first compiling product with a second compiling product obtained by compiling the original project to obtain an operation package of a mixed project, wherein the mixed project is the original project integrated with the target project;
And responding to the local variable to indicate that the target project is not compiled, acquiring the first compiling product obtained through historical compiling, and combining the first compiling product with the second compiling product to obtain the running package of the hybrid project.
2. The method of claim 1, wherein the variable value of the local variable comprises a first value or a second value, the method further comprising:
acquiring variable values of the local variables when compiling the native engineering;
determining that the local variable indicates compiling the target project when the variable value is the first value;
when the variable value is the second value, determining that the local variable indicates that the target project is not compiled.
3. The method of claim 1, wherein the obtaining the first compiled product obtained by historical compilation comprises:
and determining the first compiling product of the target version related to the compiling requirement from the first compiling products of the plurality of compiling versions obtained through historical compiling.
4. The method of claim 1, wherein the native project is application data developed in a first development environment, the native project having a code storage directory associated with the target project added thereto; the method further comprises the steps of:
When compiling the native project, acquiring an adaptive target native function code through the code storage catalog, wherein the target native function code is a code which can be compiled in the first development environment and is used for realizing the interaction function of the target project and the native project;
and compiling the target native function code, and packaging the interactive function into the second compiling product.
5. The method of claim 4, wherein the code storage directory points to a storage space in which native function codes for different development environments are stored, the native function codes for the different development environments being code that is compilable under the corresponding development environments;
the obtaining the adapted target native function code through the code storage directory includes:
accessing a corresponding storage space through the code storage catalog;
the target native function code adapted to the first development environment is determined in the storage space.
6. The method of claim 4, wherein the code storage directory points to a storage space storing functional scripts for different development environments, the functional scripts for a first development environment being used to incorporate the first compilation product into the second compilation product in the first development environment.
7. The method of claim 4, wherein the interactive function comprises at least one of a page routing function, a communication function.
8. The method of claim 7, wherein when the interactive function comprises a page routing function, after obtaining the running package of the hybrid project, the method further comprises:
running the hybrid engineering through the running package;
in the running process of the hybrid engineering, starting a page management process according to the page routing function;
storing a first type page opened through the target engineering and a second type page opened through the original engineering in a unified page stack through the page management process;
responding to display operation of a first target page of the hybrid engineering, and reading the first target page from the page stack to display, wherein the first target page is the first type page or the second type page;
and deleting a second target page of the hybrid engineering from the page stack in response to a deleting operation of the second target page, wherein the second target page is the first type page or the second type page.
9. The method of claim 7, wherein when the interactive function comprises a communication function, after obtaining the running package of the hybrid engineering, the method further comprises:
running the hybrid engineering through the running package;
in the running process of the hybrid engineering, a unified communication interface is built for the target engineering according to the communication function;
and establishing a communication channel between the native project and the target project based on the communication interface, wherein the communication channel is used for carrying out data communication with the native project by adopting a preset data format, and the preset data format is suitable for the native projects of different development environments.
10. The method of claim 9, wherein in the data communication, the target project is a server side of the data communication and the native project is a client side of the data communication.
11. The method of any one of claims 1-10, wherein the development environment of the native project is a desktop environment or a mobile environment.
12. A data processing apparatus, the apparatus comprising: the system comprises an acquisition module, a first compiling module and a second compiling module;
The acquisition module is used for acquiring local variables aiming at a target project in the original project when compiling the original project, wherein the original project and the target project are application data developed under different development environments, and the target project is used for being integrated into the original project;
the first compiling module is configured to obtain a first compiling product by compiling the target project in response to the local variable indication, and combine the first compiling product with a second compiling product obtained by compiling the native project to obtain an operation package of a hybrid project, where the hybrid project is the native project integrated with the target project;
the second compiling module is configured to obtain the first compiling product obtained through historical compiling in response to the local variable indicating that the target project is not compiled, and combine the first compiling product with the second compiling product to obtain an operation package of the hybrid project.
13. A computer device, the computer device comprising a processor and a memory:
the memory is used for storing a computer program;
The processor is configured to perform the method of any of claims 1-11 according to the computer program.
14. A computer readable storage medium for storing a computer program which, when executed by a computer device, implements the method of any one of claims 1-11.
15. A computer program product comprising a computer program which, when run on a computer device, causes the computer device to perform the method of any of claims 1-11.
CN202410164437.2A 2024-02-05 2024-02-05 Data processing method and related device Pending CN117724726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410164437.2A CN117724726A (en) 2024-02-05 2024-02-05 Data processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410164437.2A CN117724726A (en) 2024-02-05 2024-02-05 Data processing method and related device

Publications (1)

Publication Number Publication Date
CN117724726A true CN117724726A (en) 2024-03-19

Family

ID=90200077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410164437.2A Pending CN117724726A (en) 2024-02-05 2024-02-05 Data processing method and related device

Country Status (1)

Country Link
CN (1) CN117724726A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120284696A1 (en) * 2009-12-21 2012-11-08 Nokia Corporation Method, Apparatuses and a System for Compilation
CN110750288A (en) * 2019-10-23 2020-02-04 广州华多网络科技有限公司 Native engineering configuration method and device, electronic equipment and storage medium
CN111694564A (en) * 2020-06-05 2020-09-22 百度在线网络技术(北京)有限公司 Compiling method, device, equipment and medium for Flutter mixed mode
CN111966396A (en) * 2019-05-20 2020-11-20 北京京东尚科信息技术有限公司 Data processing method and device, computer system and computer readable storage medium
CN112417337A (en) * 2020-11-27 2021-02-26 贝壳技术有限公司 Page jump implementation method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120284696A1 (en) * 2009-12-21 2012-11-08 Nokia Corporation Method, Apparatuses and a System for Compilation
CN111966396A (en) * 2019-05-20 2020-11-20 北京京东尚科信息技术有限公司 Data processing method and device, computer system and computer readable storage medium
CN110750288A (en) * 2019-10-23 2020-02-04 广州华多网络科技有限公司 Native engineering configuration method and device, electronic equipment and storage medium
CN111694564A (en) * 2020-06-05 2020-09-22 百度在线网络技术(北京)有限公司 Compiling method, device, equipment and medium for Flutter mixed mode
CN112417337A (en) * 2020-11-27 2021-02-26 贝壳技术有限公司 Page jump implementation method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
XIANGZHIHONG8: "Flutter混合开发的路由栈管理", pages 1 - 6, Retrieved from the Internet <URL:https://blog.csdn.net/xiangzhihong8/article/details/104092670> *

Similar Documents

Publication Publication Date Title
CN110032512B (en) Debugging method of small program, related equipment and terminal
KR20180137554A (en) PATCH UPGRADE BASED FILE PROCESSING METHOD AND DEVICE, TERMINAL,
CN107222326B (en) Access method, configuration method and device for service between devices
CN109933381B (en) Kernel loading method and device
CN111722885B (en) Program running method and device and electronic equipment
CN111399840B (en) Module development method and device
CN110968331B (en) Method and device for running application program
CN114168460A (en) Remote debugging method, device and storage medium for front-end code in hybrid development
CN112068903A (en) Application loading method, application loading device, medium and equipment
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN114222003A (en) Service calling method, system, device, equipment and storage medium
JP2005228183A (en) Program execution method and computer system for executing the program
CN106775916B (en) Method and device for reducing application installation packages and electronic equipment
CN113138768A (en) Application package generation method and device, electronic equipment and readable storage medium
WO2023083071A1 (en) View interaction method and apparatus, electronic device, and computer readable medium
CN117724726A (en) Data processing method and related device
CN114090070A (en) Application program installation package file processing method and electronic equipment
CN114595065A (en) Data acquisition method and device, storage medium and electronic equipment
CN110502251B (en) Application installation method and device
US11071151B2 (en) Methods and apparatuses for connecting a wireless access point through an application in a user equipment
CN112612460A (en) Interface packaging and calling method, electronic device and storage medium
CN110333914B (en) Method and device for executing target operation
CN113296781A (en) Application program installation package file compiling and constructing method and device and electronic equipment
CN111683005A (en) Internet of things intelligent gateway equipment and construction method thereof
CN111290746A (en) Object access method, device, 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