CN116400925A - Data processing method and device, electronic equipment and storage medium - Google Patents

Data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116400925A
CN116400925A CN202310244171.8A CN202310244171A CN116400925A CN 116400925 A CN116400925 A CN 116400925A CN 202310244171 A CN202310244171 A CN 202310244171A CN 116400925 A CN116400925 A CN 116400925A
Authority
CN
China
Prior art keywords
file
component
path
header
headermap
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
CN202310244171.8A
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.)
58tongcheng Information Technology Co ltd
Original Assignee
58tongcheng Information Technology 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 58tongcheng Information Technology Co ltd filed Critical 58tongcheng Information Technology Co ltd
Priority to CN202310244171.8A priority Critical patent/CN116400925A/en
Publication of CN116400925A publication Critical patent/CN116400925A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a data processing method, a data processing device, electronic equipment and a storage medium. According to the method and the device, in the scene that new source files are added in the first component in the integrated development project and the source files in the second component in the development project need to call the new source files in the first component, the second component can search the header file addresses of the header files of the new source files in the first component, coding errors can be avoided, in addition, the header file addresses of the header files of the new source files in the first component can be searched by the second component without re-integrating the development project, time can be saved, and the efficiency of updating an application program can be improved.

Description

Data processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data processing method, a data processing device, an electronic device, and a storage medium.
Background
In a scenario of developing an application, a development project for the application may be created in a development environment, and then the application may be developed in the development project.
In many cases, the functions of an application program are complicated, so that in the scenario of developing the application program, it is required to create multiple components (such as Pod) in a development project, create source files of the components in the components respectively, then generate executable files of the application program according to the development project, for example, integrate the components in the development project to obtain an integrated development project, and for any one component, for example, the search catalog of the integrated development project has an association relationship (such as a dependency relationship, etc., the dependency relationship includes a dependency relationship of source files in the component on source files in other components, etc.), compile the components in the project according to the search catalog of the components (the search catalog of the components is required to be used in the compiling process), and then issue the executable files of the application program to the outside for downloading by a wide user.
Disclosure of Invention
The application discloses a data processing method, a data processing device, electronic equipment and a storage medium.
In a first aspect, the present application shows a data processing method applied to an electronic device, where the electronic device has a development environment, a development project is created in the development environment, the development project includes a plurality of components, and each component in the development project is in an integrated state, and the method includes:
adding a new source file in a first component in a development project, and acquiring a new HeaderMap file of the first component when the source file depends on the dependency information of the new source file in the first component in a second component in the development project, wherein the new HeaderMap file comprises: a corresponding relation between a header file identification of a header file of a source file in the first component and a header file address of the header file of the source file in the first component;
before compiling a development project, setting at least a new path in Header Search Path in the second component, wherein the new path at least comprises a path of the new HeaderMap file in the development project;
in the process of compiling the development project, calling the scene of the new source file in the first component aiming at the source file in the second component, acquiring the head file identification of the head file of the new source file, and searching the new path in Header Search Path in the second component; and positioning the new HeaderMap file according to the new path, searching a header file address of the header file of the new source file in the corresponding relation in the new HeaderMap file according to the header file identification of the header file of the new source file, and calling the new source file in the first component according to the header file address of the header file of the new source file.
In an alternative implementation, the setting at least a new path in Header Search Path in the second component includes:
generating a global HeaderMap file in the development project, wherein the global HeaderMap file comprises: the new HeaderMap file and HeaderMap files of all components except the first component in the development project;
and setting a path of the global HeaderMap file in a development project in Header Search Path in the second component.
In an optional implementation manner, the generating the global HeaderMap file in the development project includes:
combining the new HeaderMap file with the HeaderMap files of all components except the first component in the development project under the condition that the global HeaderMap file does not exist in the development project, so as to obtain the global HeaderMap file, and deploying the global HeaderMap file in the development project;
or alternatively, the process may be performed,
and adding the corresponding table item in the global HeadERMap file to obtain the global HeadERMap file when the corresponding table item does not exist in the global HeaderMap file for each corresponding table item in the corresponding relation under the condition that the global HeaderMap file exists in the development project.
In an alternative implementation, the content of the record in Header Search Path in the second component has a seek order;
setting a path of the global HeaderMap file in a development project in Header Search Path in the second component comprises the following steps:
in Header Search Path in the second component, setting a path of the global HeaderMap file in the development project at a position before a position of an old path, where the old path includes a path of the old HeaderMap file of the first component to which the new source file is not added in the development project, so that a search order of the path of the global HeaderMap file in the development project is located before a search order of the old path.
In an optional implementation manner, setting a path of the global HeaderMap file in the development project in Header Search Path in the second component includes:
in Header Search Path in the second component, the path in the development project of the global HeadMap file is used to replace the old path, which includes the path in the development project of the old HeadMap file of the first component to which the new source file is not added.
In an alternative implementation, the content of the record in Header Search Path of the second component has a lookup order, and the old path of the old HeaderMap file of each component in the development project is recorded in Header Search Path of the second component;
said setting at least a new path in Header Search Path in said second component comprises:
in Header Search Path in the second component, a new path is set at a position before a position where an old path is located, where the old path includes a path in a development project of an old HeaderMap file of the first component to which the new source file is not added, so that a search order of the new path is located before a search order of the old path.
In an alternative implementation, the second component Header Search Path records the old path of the old HeaderMap file of each component in the development project;
said setting at least a new path in Header Search Path in said second component comprises:
in Header Search Path in the second component, the old path is replaced with the new path, the old path including the path of the old HeaderMap file of the first component to which the new source file is not added in the development project.
In a second aspect, the present application shows a data processing apparatus applied to an electronic device, the electronic device having a development environment therein, a development project being created in the development environment, the development project including a plurality of components, and each component in the development project having been in an integrated state, the apparatus comprising:
the generating module is configured to add a new source file in a first component in a development project, and obtain a new HeaderMap file of the first component when there is dependency information that the source file depends on the new source file in the first component in a second component in the development project, where the new HeaderMap file includes: a corresponding relation between a header file identification of a header file of a source file in the first component and a header file address of the header file of the source file in the first component;
the setting module is used for setting at least a new path in Header Search Path in the second component before compiling the development project, wherein the new path at least comprises a path of the new HeaderMap file in the development project;
a calling module, configured to, in a process of compiling a development project, call a scene of the new source file in the first component for the source file in the second component, obtain a header file identifier of a header file of the new source file, and find the new path in Header Search Path in the second component; and positioning the new HeaderMap file according to the new path, searching a header file address of the header file of the new source file in the corresponding relation in the new HeaderMap file according to the header file identification of the header file of the new source file, and calling the new source file in the first component according to the header file address of the header file of the new source file.
In an alternative implementation, the setting module includes:
the generating unit is configured to generate a global HeaderMap file in the development project, where the global HeaderMap file includes: the new HeaderMap file and HeaderMap files of all components except the first component in the development project;
and the setting unit is used for setting the path of the global HeaderMap file in the development project in Header Search Path in the second component.
In an alternative implementation, the generating unit includes:
a combining subunit, configured to combine, when a global HeaderMap file does not exist in the development project, the new HeaderMap file and HeaderMap files of each component in the development project except for the first component, to obtain the global HeaderMap file, and deploy the global HeaderMap file in the development project;
or alternatively, the process may be performed,
and an adding subunit, configured to, when a global HeaderMap file already exists in the development project, add, for each corresponding table entry in the correspondence, the corresponding table entry in the global HeaderMap file when the corresponding table entry does not exist in the global HeaderMap file, so as to obtain the global HeaderMap file.
In an alternative implementation, the content of the record in Header Search Path in the second component has a seek order;
the setting unit is specifically configured to: in Header Search Path in the second component, setting a path of the global HeaderMap file in the development project at a position before a position of an old path, where the old path includes a path of the old HeaderMap file of the first component to which the new source file is not added in the development project, so that a search order of the path of the global HeaderMap file in the development project is located before a search order of the old path.
In an alternative implementation, the setting unit is specifically configured to: in Header Search Path in the second component, the path in the development project of the global HeadMap file is used to replace the old path, which includes the path in the development project of the old HeadMap file of the first component to which the new source file is not added.
In an alternative implementation, the content of the record in Header Search Path of the second component has a lookup order, and the old path of the old HeaderMap file of each component in the development project is recorded in Header Search Path of the second component;
The setting module is specifically configured to: in Header Search Path in the second component, a new path is set at a position before a position where an old path is located, where the old path includes a path in a development project of an old HeaderMap file of the first component to which the new source file is not added, so that a search order of the new path is located before a search order of the old path.
In an alternative implementation, the second component Header Search Path records the old path of the old HeaderMap file of each component in the development project;
the setting module is specifically configured to: in Header Search Path in the second component, the old path is replaced with the new path, the old path including the path of the old HeaderMap file of the first component to which the new source file is not added in the development project.
In a third aspect, the present application shows an electronic device comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the method of any of the above aspects.
In a fourth aspect, the present application shows a non-transitory computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of any of the above aspects.
In a fifth aspect, the present application shows a computer program product, which, when executed by a processor of an electronic device, enables the electronic device to perform the method of any one of the above aspects.
The technical scheme that this application provided can include following beneficial effect:
in the application, a new source file is added in a first component in a development project, and in the case that there is dependency information that the source file depends on the new source file in the first component in a second component in the development project, a new HeaderMap file of the first component is acquired, where the new HeaderMap file includes: the header file identification of the header file of the source file in the first component and the header file address of the header file of the source file in the first component. Before compiling the development project, at least a new path is set in Header Search Path in the second component, and the new path at least comprises a path of the new HeaderMap file in the development project. In the process of compiling the development project, calling a scene of a new source file in the first component aiming at the source file in the second component, acquiring a header file identification of a header file of the new source file, and searching a new path in Header Search Path in the second component; locating a new HeaderMap file according to the new path, searching a header file address of the header file of the new source file in the corresponding relation in the new HeaderMap file according to the header file identification of the header file of the new source file, and calling the new source file in the first component according to the header file address of the header file of the new source file.
According to the method and the device for updating the application program, in the scene that a new source file is added in a first component in an integrated development project and the source file in a second component in the development project needs to call the new source file in the first component, the second component can search the header file address of the header file of the new source file in the first component, coding errors can be avoided, and in addition, the second component can search the header file address of the header file of the new source file in the first component without re-integrating the development project, so that time can be saved, and the updating efficiency of the application program can be improved.
Drawings
FIG. 1 is a flow chart of steps of a data processing method of the present application.
FIG. 2 is a flow chart of steps of a data processing method of the present application.
Fig. 3 is a block diagram of a data processing apparatus of the present application.
Fig. 4 is a block diagram of an electronic device of the present application.
Fig. 5 is a block diagram of an electronic device of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Sometimes, as the business progresses, the functions of the application program need to be updated, for example, a new source file needs to be added in a certain component in the integrated development project, and a source file in another component in the application program calls the new source file in the certain component (for example, a source file writing another component in another component calls the computer program code of the new source file in the certain component, etc.), and then each component in the development project is compiled according to the search catalog of each component, but in practical terms, errors are reported in the compiling process.
The components may be understood as any component of the present solution for forming a development project, for example, an engineering in an integrated development project, and/or a reusable component for constructing a different development project (for example, an application program), for example, a payment component, a communication component, an audio/video playing component, a database component, and the like, and may, of course, also include a component customized for a certain development project, which is not limited to the embodiments of the present application. The division mode of the components can also be set according to actual requirements, for example, the components can be divided according to functions, and the attributes can be divided according to service attributes. In the requirement scene of the componentized development project, at least one component pool can be preset, at least one reusable component is stored in the component pool, and in the development project process, the components in the component pool can be utilized according to requirements to construct different projects.
The inventor analyzes the error reporting condition in the compiling process according to the log file and discovers that: because one source file in another component cannot be called to a new source file in that component during compilation, resulting in a misstatement.
The inventors have also analyzed the cause of "one source file in another component cannot be called to a new source file in that component during compilation" and found that: after a new source file is added to a certain component in the integrated development project, a search path for the new source file does not exist in a search directory of another component, so that one source file in the other component cannot search for the new source file in the certain component, and further, one source file in the other component cannot call the new source file in the certain component.
The inventors have also analyzed the cause of "after adding a new source file in one component in an integrated development project, there is no search path for the new source file in the search directory of another component", and found that: the new source file is added in the component after compiling each component in the development project, and the search directory of the other component is generated before adding the new source file in the component, thereby resulting in no search path for the new source file in the search directory of the other component after adding the new source file in the component in the integrated development project.
In view of this, in order to enable one of the source files in the other component to call a new source file in the one component, in one manner, after adding a new source file in the one component in the integrated development project, each component in the development project may be re-integrated to re-generate a search directory for each component separately, and since one source file in the other component in the application program needs to call a new source file in the one component (e.g., a computer program code or the like having a source file in the other component call a new source file in the one component in the other component), the re-generated search directory of the other component has a search path for the new source file, so that the source file in the other component may search for the new source file in the one component, and thus the source file in the other component may call the new source file in the one component.
However, the inventors found that in the above manner, the process of re-integrating the development project takes a long time, reducing the efficiency of application update.
In view of this, there is a need to increase the efficiency of application update in a scenario where a new source file is added in a certain component in an integrated development project and one source file in another component in the development project needs to call the new source file in the certain component.
In order to improve the efficiency of application program updating in a scene that a new source file is added in a certain component in an integrated development project and one source file in another component in the development project needs to call the new source file in the certain component, the scheme of the application program updating method is provided.
Prior to introducing aspects of the present application, the specific terminology that may be involved in the present application is explained.
In this application, a compiler is a program that translates "one language (typically a high-level language)" into "another language (typically a low-level language)". The main workflow of the compiler is: source code (source code), preprocessor (processor), compiler, assembler, object code, linker, executable, and the like.
The compiler includes LLVM (Low Level Virtual Machine, low-level virtual machine) and the like, and can be based on a front-end compiler of the C language/C++ language/extended C object-oriented programming language Objective-C of the LLVM, such as front-end Clang and the like.
Front-end Clang is the front-end compiler of the object-oriented programming language Objective-C based on LLVM's C language/C++ language/extended C.
The compiler may also include Xcode or the like. Xcode is an integrated development tool (IDE, integrated Development Environment) running on the operating system Mac OS X, developed by Apple Inc.
Xcode is the most rapid way to develop macOS and iOS applications. Xcode has a unified user interface design, and encoding, testing, and debugging are all completed in a simple window.
HeaderMap: is a scheme for improving the searching speed of the header file. During compiling, the head file lookup is converted from the IO path lookup of Header Search Path into the Key-Value lookup of the memory on the HashMap form. For example, the real address of the header file of the source file in the component is scanned, then a Key-Value pair (Key-Value format file) is generated, when the preprocessor encounters an instruction for introducing the header file, the header file search is converted from the original IO (Input/Output) disk search of Header Search Path to the Key-Value search of the memory in the HashMap form, so that the compiling efficiency can be remarkably improved. The mapping table comprising the header files and the file paths in the component is in a < key, > format, the key is in the form of a #import header file, and the value is the detailed address of the file and is used for searching the file when the code is compiled. In the Build Setting of xcode, default Header Map search may be started by using Header Map, and the search file path of the Header Map may be seen by adding-v parameter after compiling command.
File delta compiling: after the components are integrated, the compiler needs to compile the newly added file and the file calling the newly added file, namely incremental compiling. After the assembly is integrated, the indexes of all files are written into assembly configuration files, such as project. Pbxproj files in ios assembly, and search paths of all code files in compiling are set in the assembly configuration. Meanwhile, the component can search the needed code file through the component configuration during compiling. When a file is added in the sub-component, the newly added file cannot appear in the search path, so that the compiling is wrong, and the newly added file cannot be found.
Referring to fig. 1, a flowchart of steps of a data processing method of the present application is shown, and the method is applied to an electronic device, where the electronic device has a development environment, a development project is created in the development environment, the development project includes a plurality of components, and each component in the development project is in an integrated state.
The method specifically comprises the following steps:
in step S101, a new source file is added to a first component in a development project, and in a case where there is dependency information of the source file dependent on the new source file in the first component in a second component in the development project, a new HeaderMap file of the first component is acquired, where the new HeaderMap file includes: the header file identification of the header file of the source file in the first component and the header file address of the header file of the source file in the first component.
The dependency information of the source file in the second component dependent on the new source file in the first component may include: the source file in the second component depends on the computer program code of the new source file in the first component, etc., e.g. the source file in the second component invokes the computer program code of the new source file in the first component, etc.
The adding operation of adding a new source file in the first component in the development project may be performed by a developer, and the setting operation of setting, in the second component in the development project, dependency information of the source file in the second component on the new source file in the first component may also be performed by the developer, so that in the case where the electronic device detects the adding operation and the setting operation input by the developer in the development project, it may be determined that the new source file has been added in the first component in the development project and the dependency information of the source file in the second component on the new source file in the first component (for example, the dependency information of the source file in the second component on the new source file in the first component exists), and then a new headmap file of the first component (to which the new source file has been added) may be generated.
Wherein, for any source file in the first component, the corresponding relation includes: the header file of the source file identifies a corresponding entry made up of the header file address of the header file of the source file, and the same is true for each of the other source files in the first component.
It should be noted that, a corresponding table entry formed by the header identifier of the header file of the new source file in the first component and the header address of the header file of the new source file in the first component is also located in the corresponding relationship.
Header identifiers of header files of different source files are different, and header file addresses of header files of different source files are different.
The first component and the second component may be different components.
In the application, the development project comprises a plurality of components, each component comprises at least one source file, each source file is provided with a header file, and the header file addresses of different header files are different.
The developer can control the compiler to compile the development project, and the developer can respectively open the user Header Map for each component in the development project.
In one possible scenario of the present application, in the case where each component in the development project is developed, each component in the development project may be integrated, in the case where the headmap file of each component in the development project is generated (may be compiled for the integrated development project or may not be compiled for the integrated development project), sometimes the developer may add a new source file in the development project (for example, a new source file may be added in an existing component in the development project, at this time, an existing component may be regarded as a first component, or a new component may be created in the development project, and a new source file may be added in a new component, at this time, a new component may be regarded as a first component), and in a second component in the development project, the source file in the second component is set to rely on the dependency information of the new source file in the first component, but at this time, the headmap file in the second component does not have a header file of the new source file, so that the first source file cannot be searched for in the first component when the integrated development project has been compiled into the new source file.
In order to avoid the above, a new source file is added in a first component in the development project, and in the case that there is dependency information of the source file depending on the new source file in the first component in a second component in the development project, a new HeaderMap file of the first component may be acquired.
For example, a HeaderMap file may be regenerated in the development project and used as a new HeaderMap file, where the new HeaderMap file is a HeaderMap file of the first component to which the new source file has been added, or a header identifier of a header file of the new source file in the first component and a header file address of the header file of the new source file in the first component may be added in a correspondence relationship of an old HeaderMap file of the first component, so as to obtain the new HeaderMap file of the first component.
Step S102 may be performed first after the new HeaderMap file of the first component is acquired and before the development project is compiled.
In step S102, at least a new path is set in Header Search Path in the second component before compiling the development project, the new path including at least a path of the new HeaderMap file in the development project.
In the application, when a new source file is added to a first component and dependency information of the source file dependent on the new source file in the first component exists in a second component in a development project, a new HeaderMap file of the first component can be acquired, then in order to enable the new source file to function in an application program, recompilation of the development project is required, and since the source file in the second component depends on the new source file in the first component, in the process of recompilation of the development project, a compiler needs to be enabled to search a header file address of a header file of the new source file in the first component dependent on the source file in the second component, so that the effect of 'the source file dependent on the new source file in the first component in the second component' can be achieved.
Wherein, in order to enable the source file in the second component to search for the header file address of the header file of the new source file in the first component in the process of recompiling the development project, at least a new path is set in Header Search Path in the second component before compiling the development project, and then recompiling the development project is possible.
The specific setting procedure of setting at least a new path in the second component Header Search Path can be referred to later embodiments, and will not be described in detail herein.
In step S103, in the process of compiling the development project, invoking a scene of a new source file in the first component for the source file in the second component, acquiring a header file identifier of a header file of the new source file, and searching a new path in Header Search Path in the second component; locating a new HeaderMap file according to the new path, searching a header file address of the header file of the new source file in the corresponding relation in the new HeaderMap file according to the header file identification of the header file of the new source file, and calling the new source file in the first component according to the header file address of the header file of the new source file.
According to the new path, a new HeaderMap file can be found in the development project, then the corresponding relation between the header identification of the header of the source file in the first component and the header address of the header of the source file in the first component can be obtained in the new HeaderMap file, and in the corresponding relation between the header identification of the header of the source file in the first component and the header address of the header of the source file in the first component, the header address of the header of the new source file corresponding to the header identification of the header of the new source file can be found, and then the new source file in the first component can be called according to the header address of the header of the new source file in the first component.
In the application, a new source file is added in a first component in a development project, and when dependency information of the source file dependent on the new source file in the first component exists in a second component in the development project, a new HeaderMap file of the first component is acquired, wherein the new HeaderMap file comprises: the header file identification of the header file of the source file in the first component and the header file address of the header file of the source file in the first component. Before compiling the development project, at least a new path is set in Header Search Path in the second component, and the new path at least comprises a path of the new HeaderMap file in the development project. In the process of compiling the development project, calling a scene of a new source file in the first component aiming at the source file in the second component, acquiring a header file identification of a header file of the new source file, and searching a new path in Header Search Path in the second component; locating a new HeaderMap file according to the new path, searching a header file address of the header file of the new source file in the corresponding relation in the new HeaderMap file according to the header file identification of the header file of the new source file, and calling the new source file in the first component according to the header file address of the header file of the new source file.
According to the method and the device for updating the application program, in the scene that a new source file is added in a first component in an integrated development project and the source file in a second component in the development project needs to call the new source file in the first component, the second component can search the header file address of the header file of the new source file in the first component, coding errors can be avoided, and in addition, the second component can search the header file address of the header file of the new source file in the first component without re-integrating the development project, so that time can be saved, and the updating efficiency of the application program can be improved.
In one embodiment of the present application, referring to fig. 2, step S102 may be implemented by the following procedure, including:
in step S201, a global HeaderMap file is generated in the development project, where the global HeaderMap file includes: the new HeaderMap file and HeaderMap files of the respective components in the development project except the first component.
In one embodiment of the present application, the global HeaderMap file does not exist in the development project before the global HeaderMap file is generated in the development project. This can be understood as: after integrating each component in the development project, the 1 st time updates the component in the development project, for example, the 1 st time adds a new source file in the component in the development project.
In the case that the global HeadERMap file does not exist in the development project, the new HeadERMap file and the HeadERMap files of the components except the first component in the development project can be combined to obtain the global HeadERMap file, and the global HeadERMap file is set (e.g. stored) in the development project.
Alternatively, in another embodiment of the present application, the global HeaderMap file already exists in the development project before the development project generates the global HeaderMap file. This can be understood as: after integrating the components in the development project, the nth update the components in the development project, e.g., the nth add a new source file to the components in the development project, N being a positive integer greater than or equal to 2. The existing global HeaderMap file is generated after integration of the various components in the development project and after the N-1 th update of the components in the development project.
In the case where a global HeaderMap file already exists in the development project, the global HeaderMap file may be set (e.g., stored, etc.) in the development project. The global HeaderMap file includes: the new HeaderMap file and HeaderMap files of the respective components in the development project except the first component.
The HeaderMap files of the components except the first component in the development project already exist in the global HeaderMap file, so in order to save the occupied space of the development project, the HeaderMap files of the components except the first component in the development project may not be repeatedly stored in the development project.
For example, the new HeaderMap file includes a correspondence between a header file identification of a header file of a source file in the first component to which the new source file has been added and a header file address of a header file of a source file in the first component to which the new source file has been added. The partial corresponding table entries in the corresponding relation already exist in the global HeaderMap file, so in order to save the occupied space of the development project, the partial corresponding table entries need not be repeatedly stored in the development project, and the corresponding table entries except the partial corresponding table entries in the corresponding relation can be stored in the development project.
For example, for any corresponding table item in the corresponding relation, if the corresponding table item does not exist in the global HeaderMap file, the corresponding table item is added in the global HeaderMap file, or if the corresponding table item exists in the global HeaderMap file, the corresponding table item does not need to be added in the global HeaderMap file, and for each other corresponding table item in the corresponding relation, the same is true, so that the global HeaderMap file with the new HeaderMap file is obtained.
In step S202, the path of the global HeaderMap file in the development project is set in Header Search Path in the second component.
In the embodiment of the present application, for the second component, in the compiled scenario, the order of searching the header file of the source file for the second component includes: searching the header address of the header of the source file in the header file of the second component, searching the header address of the header of the source file in Header Search Path of the second component if the header address of the header of the source file is not searched, searching the header address of the header of the source file in the frame if the header address of the header of the source file is not searched, and searching the header address of the header of the source file in the system library if the header address of the header of the source file is not searched.
The header file of the second component includes a header address of a header file of each source file in the second component, for example, the header file of the second component includes: the header file identification of the header file of the source file in the second component and the header file address of the header file of the source file in the second component.
However, the HeaderMap file of the second component is generated in the scenario of integrating the components in the development project, and the new source file in the first component is added in the first component after integrating the components in the development project, so that in the case that the second component needs to search for the header address of the header file of the new source file in the first component, the HeaderMap file of the second component does not have the header address of the header file of the new source file in the first component, and in this way, the HeaderMap file of the second component is not searched for the header address of the header file of the new source file in the first component.
The header address of the header of the new source file in the first component is then searched for in Header Search Path in the second component.
However, in one case, the old path of the old HeaderMap file of each component in the development project is recorded in Header Search Path of the second component (wherein the HeaderMap file can be found from the path of the HeaderMap file). The old HeaderMap file of each component is generated in the scenario of integrating each component in the development project, the new source file in the first component is added in the first component after integrating each component in the development project, so that the header address of the header file of the new source file in the first component does not exist in the old HeaderMap file of each component in the development project corresponding to each path recorded in Header Search Path of the second component, and so that the header address of the header file of the new source file in the first component is not searched in the old HeaderMap file of each component in the development project corresponding to each old path recorded in Header Search Path of the second component when the second component needs to search the header address of the header file of the new source file in the first component.
In the present application, when a new source file is added to the first component in the development project, if a new HeaderMap file of the first component to which the new source file has been added is generated and a global HeaderMap file is generated in the development project, a path of the global HeaderMap file in the development project may be set in Header Search Path in the second component.
Therefore, a new HeaderMap file can be searched according to the path of the global HeaderMap file in Header Search Path in the second component in the development project, and the header file address of the header file of the new source file in the first component can be searched in the new HeaderMap file.
However, in the scenario of searching for the header address of the header file of the new source file in the first component according to Header Search Path in the second component, if the header addresses of the header files of the new source file in the first component are searched for in the old header files of the new source file in the development project corresponding to each old path recorded in Header Search Path in the second component, respectively (the header addresses of the header files of the new source file in the first component are not actually searched for), then the header addresses of the header files of the new source file in the first component are searched for in the global header map file corresponding to the path in the development project according to Header Search Path in the second component, and then the header addresses of the header files of the new source file in the first component can be searched for eventually, but the header addresses of the header files of the new source file in the old header file in the development project corresponding to each old path recorded in Header Search Path in the second component can be slow, resulting in low efficiency of the process of updating the header file.
Thus, to increase the efficiency of application updates, in one embodiment of the present application, the recorded content in Header Search Path in the second component has a seek order, e.g., the earlier the content in Header Search Path in the second component is in the seek order, the later the content in Header Search Path in the second component is in the seek order.
Therefore, in the scenario of searching for the header address of the header file of the new source file in the first component according to Header Search Path in the second component, the header address of the header file of the new source file in the first component (the header address of the header file of the new source file in the first component can be eventually searched for) is searched for in the new header file in the global header file corresponding to the path in the development project according to the global header file in Header Search Path in the second component, instead of searching for the header address of the header file of the new source file in the first component (the header address of the header file of the new source file in the first component is not actually searched for) in the old header file of each component in the development project corresponding to each old path recorded in Header Search Path in the second component.
For this, when setting the path of the global HeaderMap file in the development project in Header Search Path in the second component, the path of the global HeaderMap file in the development project may be set in Header Search Path in the second component at a position before the position of the old path including the path of the old HeaderMap file of the first component to which the new source file is not added, so that the search order of the path of the global HeaderMap file in the development project is located before the search order of the old path.
In this way, in the scenario of searching for the header address of the header file of the new source file in the first component according to Header Search Path in the second component, the header address of the header file of the new source file in the first component is searched for in the new header file in the global header file corresponding to the path in the development project according to the global header file in Header Search Path in the second component, and the header address of the header file of the new source file in the first component can be searched for in the new header file, and once the header address of the header file of the new source file in the first component is searched for, the header address of the header file of the new source file in the first component is not searched for in the old header file of each component in the development project corresponding to each old path recorded in Header Search Path in the second component.
Therefore, by the method and the device, the process of executing the process of searching the head file address of the head file of the new source file in the first component in the old HeaderMap file of each component in the development project corresponding to each old path recorded in the Header Search Path of the second component can be avoided, so that the time consumed in the process of searching the head file address of the head file of the new source file in the first component in the old HeaderMap file of each component in the development project corresponding to each old path recorded in the Header Search Path of the second component can be saved, the speed of searching the head file address of the head file of the new source file in the first component can be improved, the efficiency is high, and the updating efficiency of an application program can be improved.
However, in the above-described embodiment, the inventors found that since the process of "searching for the header address of the header file of the new source file in the first component in the old header file of each component in the development project to which each old path recorded in Header Search Path of the second component corresponds respectively" is not performed, the old path of the old header file of the first component recorded in Header Search Path of the second component (from which the old path of the old header file of the first component can be searched) is no longer functional, and the old path of the old header file of the useless first component is located in Header Search Path of the second component, resulting in a high occupation space of the development project.
For this reason, to reduce the space occupied by the development project, the old path of the old HeaderMap file of the first component recorded in Header Search Path of the second component may not be recorded in Header Search Path of the second component. It should be noted that, the old paths of the components other than the first component in the development project may need to be used, so that the old paths of the components other than the first component in the development project may determine whether to continue to be retained in Header Search Path of the second component according to the actual situation.
For this reason, when setting the path of the global HeadMap file in the development project in Header Search Path in the second component, the path of the global HeadMap file in the development project may be used to replace the old path including the path of the old HeadMap file in the development project of the first component to which the new source file is not added in Header Search Path in the second component.
In this way, the old path of the old HeaderMap file of the first component in the development project does not exist in the Header Search Path of the second component, and no useless path exists, so that the occupied space of the development project can be reduced.
In this way, in the scenario of searching for the header address of the header file of the new source file in the first component according to Header Search Path in the second component, the header address of the header file of the new source file in the first component can be searched for in the new header file according to the global header file in Header Search Path in the second component in the new header file in the global header file corresponding to the path in the development project.
In the embodiment of the present application, for the second component, in the compiled scenario, the order of searching the header file of the source file for the second component includes: searching the header address of the header of the source file in the header file of the second component, searching the header address of the header of the source file in Header Search Path of the second component if the header address of the header of the source file is not searched, searching the header address of the header of the source file in the frame if the header address of the header of the source file is not searched, and searching the header address of the header of the source file in the system library if the header address of the header of the source file is not searched.
The header file of the second component includes a header address of a header file of each source file in the second component, for example, the header file of the second component includes: the header file identification of the header file of the source file in the second component and the header file address of the header file of the source file in the second component.
However, the HeaderMap file of the second component is generated in the scenario of integrating the components in the development project, and the new source file in the first component is added in the first component after integrating the components in the development project, so that in the case that the second component needs to search for the header address of the header file of the new source file in the first component, the HeaderMap file of the second component does not have the header address of the header file of the new source file in the first component, and in this way, the HeaderMap file of the second component is not searched for the header address of the header file of the new source file in the first component.
The header address of the header of the new source file in the first component is then searched for in Header Search Path in the second component.
However, in one case, the old path of the old HeaderMap file of each component in the development project is recorded in Header Search Path of the second component (wherein the HeaderMap file can be found from the path of the HeaderMap file). The old HeaderMap file of each component is generated in the scenario of integrating each component in the development project, the new source file in the first component is added in the first component after integrating each component in the development project, so that the header address of the header file of the new source file in the first component does not exist in the old HeaderMap file of each component in the development project corresponding to each path recorded in Header Search Path of the second component, and so that the header address of the header file of the new source file in the first component is not searched in the old HeaderMap file of each component in the development project corresponding to each old path recorded in Header Search Path of the second component when the second component needs to search the header address of the header file of the new source file in the first component.
In this application, when a new header map file of a first component to which a new source file has been added is generated in a case where a new source file is added to a first component in a development project, at least a new path may be set in Header Search Path in a second component in the development project, where the new path includes at least a path of the new header map file in the development project, and the new header map file includes: the header file of the source file in the first component to which the new source file has been added identifies a correspondence between header file addresses of header files of the source file in the first component to which the new source file has been added.
Thus, a new HeaderMap file can be searched according to the new path in Header Search Path in the second component, and the header file address of the header file of the new source file in the first component can be searched in the new HeaderMap file.
However, in the scenario of searching for the header address of the header file of the new source file in the first component according to Header Search Path in the second component, if the header address of the header file of the new source file in the first component is searched for in the old header file of each component in the development project corresponding to each old path recorded in Header Search Path in the second component (the header address of the header file of the new source file in the first component is not actually searched for), then the header address of the header file of the new source file in the first component is searched for in the new header file corresponding to the new path recorded in Header Search Path in the second component, although the header address of the header file of the new source file in the first component can be finally searched for, the process of searching for the header address of the header file of the new source file in the first component in the old header file of each component in the development project corresponding to each old path recorded in Header Search Path in the second component consumes time, and thus the header file of the new source file corresponding to the first component is slow to update the header file, resulting in low program efficiency.
Thus, to increase the efficiency of application updates, in one embodiment of the present application, the recorded content in Header Search Path in the second component has a seek order, e.g., the earlier the content in Header Search Path in the second component is in the seek order, the later the content in Header Search Path in the second component is in the seek order.
Thus, in the scenario of searching for the header address of the header file of the new source file in the first component according to Header Search Path in the second component, the header address of the header file of the new source file in the first component is searched for in the new header file corresponding to the new path in Header Search Path in the second component (the header address of the header file of the new source file in the first component can be finally searched for), instead of searching for the header address of the header file of the new source file in the first component according to the old header file of each component in the development project corresponding to each old path recorded in Header Search Path in the second component, respectively (the header address of the header file of the new source file in the first component cannot be actually searched for).
For this purpose, when at least a new path is set in Header Search Path in the second component in the development project, the new path may be set in Header Search Path in the second component at a position before the position where the old path including the path of the old HeaderMap file of the first component to which the new source file is not added in the development project so that the search order of the new path is located before the search order of the old path.
In this way, in the scenario of searching for the header address of the header file of the new source file in the first component according to Header Search Path in the second component, the header address of the header file of the new source file in the first component is searched for in the new header map file corresponding to the new path in Header Search Path in the second component, and the header address of the header file of the new source file in the first component can be searched for in the new header map file, once the header address of the header file of the new source file in the first component is searched for, the header address of the header file of the new source file in the first component is not searched for in the old header file of each component in the development project corresponding to each old path recorded in Header Search Path in the second component.
Therefore, by the method and the device, the process of executing the process of searching the head file address of the head file of the new source file in the first component in the old HeaderMap file of each component in the development project corresponding to each old path recorded in the Header Search Path of the second component can be avoided, so that the time consumed in the process of searching the head file address of the head file of the new source file in the first component in the old HeaderMap file of each component in the development project corresponding to each old path recorded in the Header Search Path of the second component can be saved, the speed of searching the head file address of the head file of the new source file in the first component can be improved, the efficiency is high, and the updating efficiency of an application program can be improved.
However, in the above-described embodiment, the inventors found that since the process of "searching for the header address of the header file of the new source file in the first component in the old header file of each component in the development project to which each old path recorded in Header Search Path of the second component corresponds respectively" is not performed, the old path of the old header file of the first component recorded in Header Search Path of the second component (from which the old path of the old header file of the first component can be searched) is no longer functional, and the old path of the old header file of the useless first component is located in Header Search Path of the second component, resulting in a high occupation space of the development project.
For this reason, to reduce the space occupied by the development project, the old path of the old HeaderMap file of the first component recorded in Header Search Path of the second component may not be recorded in Header Search Path of the second component. It should be noted that, the old paths of the components other than the first component in the development project may need to be used, so that the old paths of the components other than the first component in the development project may determine whether to continue to be retained in Header Search Path of the second component according to the actual situation.
To this end, when at least a new path is set in Header Search Path in the second component in the development project, the old path including the path of the old HeaderMap file of the first component to which the new source file is not added in the development project may be replaced with the new path in Header Search Path in the second component.
In this way, the old path of the old HeaderMap file of the first component in the development project does not exist in the Header Search Path of the second component, and no useless path exists, so that the occupied space of the development project can be reduced.
Thus, in the scenario of searching for the header address of the header file of the new source file in the first component according to Header Search Path in the second component, the header address of the header file of the new source file in the first component may be searched for in the new header map file corresponding to the new path in Header Search Path in the second component, and the header address of the header file of the new source file in the first component may be searched for in the new header map file.
It should be noted that, for the sake of simplicity of description, the method embodiments are all described as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may take place in other order or simultaneously in accordance with the present application. Further, those skilled in the art will appreciate that the embodiments described in the specification are all alternative embodiments, and that the acts referred to are not necessarily required for the present application.
Referring to fig. 3, there is shown a block diagram of a data processing apparatus of the present application, applied to an electronic device having a development environment in which a development project is created, the development project including a plurality of components, and each component in the development project having been in an integrated state, the apparatus comprising:
a generating module 11, configured to add a new source file in a first component in a development project, and obtain a new HeaderMap file of the first component when there is dependency information of the source file dependent on the new source file in the first component in a second component in the development project, where the new HeaderMap file includes: a corresponding relation between a header file identification of a header file of a source file in the first component and a header file address of the header file of the source file in the first component;
A setting module 12, configured to set at least a new path in Header Search Path in the second component before compiling a development project, where the new path includes at least a path of the new HeaderMap file in the development project;
a calling module 13, configured to, in a process of compiling an opening item, call a scene of the new source file in the first component for the source file in the second component, obtain a header file identifier of a header file of the new source file, and find the new path in Header Search Path in the second component; and positioning the new HeaderMap file according to the new path, searching a header file address of the header file of the new source file in the corresponding relation in the new HeaderMap file according to the header file identification of the header file of the new source file, and calling the new source file in the first component according to the header file address of the header file of the new source file.
In an alternative implementation, the setting module includes:
the generating unit is configured to generate a global HeaderMap file in the development project, where the global HeaderMap file includes: the new HeaderMap file and HeaderMap files of all components except the first component in the development project;
And the setting unit is used for setting the path of the global HeaderMap file in the development project in Header Search Path in the second component.
In an alternative implementation, the generating unit includes:
a combining subunit, configured to combine, when a global HeaderMap file does not exist in the development project, the new HeaderMap file and HeaderMap files of each component in the development project except for the first component, to obtain the global HeaderMap file, and deploy the global HeaderMap file in the development project;
or alternatively, the process may be performed,
and an adding subunit, configured to, when a global HeaderMap file already exists in the development project, add, for each corresponding table entry in the correspondence, the corresponding table entry in the global HeaderMap file when the corresponding table entry does not exist in the global HeaderMap file, so as to obtain the global HeaderMap file.
In an alternative implementation, the content of the record in Header Search Path in the second component has a seek order;
the setting unit is specifically configured to: in Header Search Path in the second component, setting a path of the global HeaderMap file in the development project at a position before a position of an old path, where the old path includes a path of the old HeaderMap file of the first component to which the new source file is not added in the development project, so that a search order of the path of the global HeaderMap file in the development project is located before a search order of the old path.
In an alternative implementation, the setting unit is specifically configured to: in Header Search Path in the second component, the path in the development project of the global HeadMap file is used to replace the old path, which includes the path in the development project of the old HeadMap file of the first component to which the new source file is not added.
In an alternative implementation, the content of the record in Header Search Path of the second component has a lookup order, and the old path of the old HeaderMap file of each component in the development project is recorded in Header Search Path of the second component;
the setting module is specifically configured to: in Header Search Path in the second component, a new path is set at a position before a position where an old path is located, where the old path includes a path in a development project of an old HeaderMap file of the first component to which the new source file is not added, so that a search order of the new path is located before a search order of the old path.
In an alternative implementation, the second component Header Search Path records the old path of the old HeaderMap file of each component in the development project;
The setting module is specifically configured to: in Header Search Path in the second component, the old path is replaced with the new path, the old path including the path of the old HeaderMap file of the first component to which the new source file is not added in the development project.
In the application, a new source file is added in a first component in a development project, and when dependency information of the source file dependent on the new source file in the first component exists in a second component in the development project, a new HeaderMap file of the first component is acquired, wherein the new HeaderMap file comprises: the header file identification of the header file of the source file in the first component and the header file address of the header file of the source file in the first component. Before compiling the development project, at least a new path is set in Header Search Path in the second component, and the new path at least comprises a path of the new HeaderMap file in the development project. In the process of compiling the development project, calling a scene of a new source file in the first component aiming at the source file in the second component, acquiring a header file identification of a header file of the new source file, and searching a new path in Header Search Path in the second component; locating a new HeaderMap file according to the new path, searching a header file address of the header file of the new source file in the corresponding relation in the new HeaderMap file according to the header file identification of the header file of the new source file, and calling the new source file in the first component according to the header file address of the header file of the new source file.
According to the method and the device for updating the application program, in the scene that a new source file is added in a first component in an integrated development project and the source file in a second component in the development project needs to call the new source file in the first component, the second component can search the header file address of the header file of the new source file in the first component, coding errors can be avoided, and in addition, the second component can search the header file address of the header file of the new source file in the first component without re-integrating the development project, so that time can be saved, and the updating efficiency of the application program can be improved.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
Optionally, an embodiment of the present application further provides an electronic device, including: the processor, the memory, the computer program stored in the memory and capable of running on the processor, the computer program realizes each process of the above method embodiment when being executed by the processor, and can achieve the same technical effect, and for avoiding repetition, the description is omitted here.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the processes of the above method embodiment, and can achieve the same technical effects, so that repetition is avoided, and no further description is given here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
Fig. 4 is a block diagram of an electronic device 800 shown in the present application. For example, electronic device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 4, the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, images, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen between the electronic device 800 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the electronic device 800. For example, the sensor assembly 814 may detect an on/off state of the device 800, a relative positioning of the components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of a user's contact with the electronic device 800, an orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices, either wired or wireless. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, an operator network (e.g., 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast operation information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including instructions executable by processor 820 of electronic device 800 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Fig. 5 is a block diagram of an electronic device 1900 shown in the present application. For example, electronic device 1900 may be provided as a server.
Referring to FIG. 5, electronic device 1900 includes a processing component 1922 that further includes one or more processors and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by processing component 1922. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. Further, processing component 1922 is configured to execute instructions to perform the methods described above.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including several instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. A data processing method, applied to an electronic device, the electronic device having a development environment in which a development project is created, the development project including a plurality of components, and each component in the development project having been in an integrated state, the method comprising:
adding a new source file in a first component in a development project, and acquiring a new HeaderMap file of the first component when the source file depends on the dependency information of the new source file in the first component in a second component in the development project, wherein the new HeaderMap file comprises: a corresponding relation between a header file identification of a header file of a source file in the first component and a header file address of the header file of the source file in the first component;
Before compiling the development project, setting at least a new path in Header Search Path in the second component, wherein the new path at least comprises a path of the new HeaderMap file in the development project;
in the process of compiling the development project, calling the scene of the new source file in the first component aiming at the source file in the second component, acquiring the head file identification of the head file of the new source file, and searching the new path in Header Search Path in the second component; and positioning the new HeaderMap file according to the new path, searching a header file address of the header file of the new source file in the corresponding relation in the new HeaderMap file according to the header file identification of the header file of the new source file, and calling the new source file in the first component according to the header file address of the header file of the new source file.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises, said setting at least a new path in Header Search Path in said second component comprises:
generating a global HeaderMap file in the development project, wherein the global HeaderMap file comprises: the new HeaderMap file and HeaderMap files of all components except the first component in the development project;
And setting a path of the global HeaderMap file in a development project in Header Search Path in the second component.
3. The method of claim 2, wherein generating a global HeaderMap file in a development project comprises:
combining the new HeaderMap file with the HeaderMap files of all components except the first component in the development project under the condition that the global HeaderMap file does not exist in the development project, so as to obtain the global HeaderMap file, and deploying the global HeaderMap file in the development project;
or alternatively, the process may be performed,
and adding the corresponding table item in the global HeadERMap file to obtain the global HeadERMap file when the corresponding table item does not exist in the global HeaderMap file for each corresponding table item in the corresponding relation under the condition that the global HeaderMap file exists in the development project.
4. The method of claim 2, wherein the recorded content in Header Search Path in the second component has a seek order;
setting a path of the global HeaderMap file in a development project in Header Search Path in the second component comprises the following steps:
In Header Search Path in the second component, setting a path of the global HeaderMap file in the development project at a position before a position of an old path, where the old path includes a path of the old HeaderMap file of the first component to which the new source file is not added in the development project, so that a search order of the path of the global HeaderMap file in the development project is located before a search order of the old path.
5. The method of claim 2, wherein setting a path of a global headmap file in a development project in Header Search Path in the second component comprises:
in Header Search Path in the second component, the path in the development project of the global HeadMap file is used to replace the old path, which includes the path in the development project of the old HeadMap file of the first component to which the new source file is not added.
6. The method of claim 1, wherein the recorded content in Header Search Path of the second component has a lookup order, and wherein the old path of the old headmap file of each component of the development project is recorded in Header Search Path of the second component;
Said setting at least a new path in Header Search Path in said second component comprises:
in Header Search Path in the second component, a new path is set at a position before a position where an old path is located, where the old path includes a path in a development project of an old HeaderMap file of the first component to which the new source file is not added, so that a search order of the new path is located before a search order of the old path.
7. The method of claim 1, wherein the second component Header Search Path records old paths of old HeaderMap files for respective components in a development project;
said setting at least a new path in Header Search Path in said second component comprises:
in Header Search Path in the second component, the old path is replaced with the new path, the old path including the path of the old HeaderMap file of the first component to which the new source file is not added in the development project.
8. A data processing apparatus, characterized in that it is applied to an electronic device having a development environment therein, in which a development project is created, in which a plurality of components are included, and in which each component in the development project is already in an integrated state, the apparatus comprising:
The generating module is configured to add a new source file in a first component in a development project, and obtain a new HeaderMap file of the first component when there is dependency information that the source file depends on the new source file in the first component in a second component in the development project, where the new HeaderMap file includes: a corresponding relation between a header file identification of a header file of a source file in the first component and a header file address of the header file of the source file in the first component;
the setting module is used for setting at least a new path in Header Search Path in the second component before compiling the development project, wherein the new path at least comprises a path of the new HeaderMap file in the development project;
a calling module, configured to, in a process of compiling a development project, call a scene of the new source file in the first component for the source file in the second component, obtain a header file identifier of a header file of the new source file, and find the new path in Header Search Path in the second component; and positioning the new HeaderMap file according to the new path, searching a header file address of the header file of the new source file in the corresponding relation in the new HeaderMap file according to the header file identification of the header file of the new source file, and calling the new source file in the first component according to the header file address of the header file of the new source file.
9. The apparatus of claim 8, wherein the setup module comprises:
the generating unit is configured to generate a global HeaderMap file in the development project, where the global HeaderMap file includes: the new HeaderMap file and HeaderMap files of all components except the first component in the development project;
and the setting unit is used for setting the path of the global HeaderMap file in the development project in Header Search Path in the second component.
10. The apparatus of claim 9, wherein the generating unit comprises:
a combining subunit, configured to combine, when a global HeaderMap file does not exist in the development project, the new HeaderMap file and HeaderMap files of each component in the development project except for the first component, to obtain the global HeaderMap file, and deploy the global HeaderMap file in the development project;
or alternatively, the process may be performed,
and an adding subunit, configured to, when a global HeaderMap file already exists in the development project, add, for each corresponding table entry in the correspondence, the corresponding table entry in the global HeaderMap file when the corresponding table entry does not exist in the global HeaderMap file, so as to obtain the global HeaderMap file.
11. The apparatus of claim 9, wherein the recorded content in Header Search Path in the second component has a seek order;
the setting unit is specifically configured to: in Header Search Path in the second component, setting a path of the global HeaderMap file in the development project at a position before a position of an old path, where the old path includes a path of the old HeaderMap file of the first component to which the new source file is not added in the development project, so that a search order of the path of the global HeaderMap file in the development project is located before a search order of the old path.
12. The device according to claim 9, wherein the setting unit is specifically configured to: in Header Search Path in the second component, the path in the development project of the global HeadMap file is used to replace the old path, which includes the path in the development project of the old HeadMap file of the first component to which the new source file is not added.
13. The apparatus of claim 8, wherein the recorded content in Header Search Path of the second component has a lookup order, and wherein an old path of an old headmap file of each component of the development project is recorded in Header Search Path of the second component;
The setting module is specifically configured to: in Header Search Path in the second component, a new path is set at a position before a position where an old path is located, where the old path includes a path in a development project of an old HeaderMap file of the first component to which the new source file is not added, so that a search order of the new path is located before a search order of the old path.
14. The apparatus of claim 8, wherein an old path of an old headmap file for each component in a development project is recorded in Header Search Path of the second component;
the setting module is specifically configured to: in Header Search Path in the second component, the old path is replaced with the new path, the old path including the path of the old HeaderMap file of the first component to which the new source file is not added in the development project.
15. An electronic device, comprising: a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the method of any one of claims 1 to 7.
16. A computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the method according to any of claims 1 to 7.
CN202310244171.8A 2023-03-14 2023-03-14 Data processing method and device, electronic equipment and storage medium Pending CN116400925A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310244171.8A CN116400925A (en) 2023-03-14 2023-03-14 Data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310244171.8A CN116400925A (en) 2023-03-14 2023-03-14 Data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116400925A true CN116400925A (en) 2023-07-07

Family

ID=87013299

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310244171.8A Pending CN116400925A (en) 2023-03-14 2023-03-14 Data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116400925A (en)

Similar Documents

Publication Publication Date Title
CN111736916A (en) Dynamic expansion method and device based on Java language, electronic equipment and storage medium
CN107463372B (en) Data-driven page updating method and device
CN108563487B (en) User interface updating method and device
CN113590091A (en) Data processing method and device, electronic equipment and storage medium
CN116400925A (en) Data processing method and device, electronic equipment and storage medium
CN111045701B (en) Version switching method and device for version switching
CN108427568B (en) User interface updating method and device
CN108549570B (en) User interface updating method and device
CN114020694B (en) Header file address acquisition method and device, electronic equipment and storage medium
CN109933357B (en) Application program upgrading method and device
CN114020693B (en) Header file address acquisition method and device, electronic equipment and storage medium
CN113778440B (en) Data processing method and device, electronic equipment and storage medium
CN111596949B (en) Method and device for developing application program
CN111273910B (en) Method, device and storage medium for acquiring resource number identifier
CN113590128A (en) Method and device for acquiring intermediate file, electronic equipment and storage medium
CN113835751B (en) Code testing method, device, electronic equipment and storage medium
CN110795444B (en) DOM data updating method, page updating method and device
CN109726118B (en) Application program development method and device, electronic equipment and storage medium
CN114115862A (en) Data processing method and device, electronic equipment and storage medium
CN117033042A (en) Fault restoration method and device for application program and electronic equipment
CN115809054A (en) Data processing method and device, electronic equipment and storage medium
CN114661338A (en) Program package processing method and device, electronic equipment and storage medium
CN113885938A (en) Code modification method and device, electronic equipment and storage medium
CN114416085A (en) Data processing method and device, electronic equipment and storage medium
CN115357277A (en) Hot update method, device, electronic apparatus, storage medium and program product

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