[go: up one dir, main page]

CN110941443B - Method and device for modifying file name in SDK (software development kit) and electronic equipment - Google Patents

Method and device for modifying file name in SDK (software development kit) and electronic equipment Download PDF

Info

Publication number
CN110941443B
CN110941443B CN201911273604.2A CN201911273604A CN110941443B CN 110941443 B CN110941443 B CN 110941443B CN 201911273604 A CN201911273604 A CN 201911273604A CN 110941443 B CN110941443 B CN 110941443B
Authority
CN
China
Prior art keywords
file
sdk
file name
resource
conflict
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911273604.2A
Other languages
Chinese (zh)
Other versions
CN110941443A (en
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.)
AlipayCom Co ltd
Original Assignee
AlipayCom 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 AlipayCom Co ltd filed Critical AlipayCom Co ltd
Priority to CN201911273604.2A priority Critical patent/CN110941443B/en
Publication of CN110941443A publication Critical patent/CN110941443A/en
Application granted granted Critical
Publication of CN110941443B publication Critical patent/CN110941443B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation
    • G06F16/166File name conversion

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the specification discloses a method and a device for modifying a file name in an SDK and electronic equipment. The scheme comprises the following steps: acquiring first file name information; the first file name information is used for representing the file name of a file in a first SDK which needs to be sent to a program access end; acquiring second file name information; the second file name information is used for representing the file name of a file in a second SDK stored by the program access end; determining a conflicting file in the first SDK based on the first file name information and the second file name information; the file name of the conflict file is the same as the file name of the file in the second SDK; and modifying the file name of the conflict file.

Description

修改SDK中文件名的方法、装置及电子设备Method, device and electronic equipment for modifying file name in SDK

技术领域technical field

本申请涉及计算机技术领域,尤其涉及一种修改SDK中文件名的方法、装置及电子设备。The present application relates to the field of computer technology, in particular to a method, device and electronic equipment for modifying file names in SDK.

背景技术Background technique

现有技术中,程序接入方有时候会多次接入服务输出方的一个软件开发工具包(Software Development Kit,SDK),另外,为了更好的服务,会不断的优化SDK,因此同一个SDK会有多个不同的版本。因此,当服务输出方在输出每个SDK时,都需要查看服务接入方是否已经接入该SDK,并确定已接入的版本是否与待接入的SDK相同。如果版本不同,则需要解决不同版本之间进行兼容的问题。In the prior art, the program access party sometimes accesses a software development kit (Software Development Kit, SDK) of the service output party multiple times. In addition, for better service, the SDK will be continuously optimized, so the same There will be several different versions of the SDK. Therefore, when the service exporter is exporting each SDK, it needs to check whether the service receiver has already connected to the SDK, and determine whether the connected version is the same as the SDK to be connected. If the versions are different, you need to solve the problem of compatibility between different versions.

需要提供更快速的对于同一SDK的版本不兼容的解决方案。Need to provide a faster solution for incompatible versions of the same SDK.

发明内容Contents of the invention

有鉴于此,本申请实施例提供了一种修改SDK中文件名的方法、装置及电子设备,用于提高程序接入的处理效率。In view of this, the embodiments of the present application provide a method, device, and electronic device for modifying file names in the SDK, so as to improve the processing efficiency of program access.

为解决上述技术问题,本说明书实施例是这样实现的:In order to solve the above-mentioned technical problems, the embodiments of this specification are implemented as follows:

本说明书实施例提供的一种修改SDK中文件名的方法,包括:A method for modifying the file name in the SDK provided by the embodiment of this specification includes:

获取第一文件名信息;所述第一文件名信息用于表示需要发送给程序接入端的第一SDK中的文件的文件名;Obtain first file name information; the first file name information is used to indicate the file name of the file in the first SDK that needs to be sent to the program access terminal;

获取第二文件名信息;所述第二文件名信息用于表示所述程序接入端已存储的第二SDK中的文件的文件名;Obtaining second file name information; the second file name information is used to indicate the file name of the file in the second SDK stored by the program access terminal;

基于所述第一文件名信息与所述第二文件名信息,确定所述第一SDK中的冲突文件;所述冲突文件的文件名与所述第二SDK中的文件的文件名相同;Determine the conflicting file in the first SDK based on the first file name information and the second file name information; the file name of the conflicting file is the same as the file name of the file in the second SDK;

修改所述冲突文件的文件名。Modify the filename of the conflicting file.

本说明书实施例提供的一种修改SDK中文件名的装置,包括:The device for modifying the file name in the SDK provided by the embodiment of this specification includes:

第一获取模块,用于获取第一文件名信息;所述第一文件名信息用于表示需要发送给程序接入端的第一SDK中的文件的文件名;The first obtaining module is used to obtain the first file name information; the first file name information is used to represent the file name of the file in the first SDK that needs to be sent to the program access terminal;

第二获取模块,用于获取第二文件名信息;所述第二文件名信息用于表示所述程序接入端已存储的第二SDK中的文件的文件名;The second obtaining module is used to obtain the second file name information; the second file name information is used to indicate the file name of the file in the second SDK stored by the program access terminal;

冲突文件确定模块,用于基于所述第一文件名信息与所述第二文件名信息,确定所述第一SDK中的冲突文件;所述冲突文件的文件名与所述第二SDK中的文件的文件名相同;A conflicting file determination module, configured to determine a conflicting file in the first SDK based on the first file name information and the second file name information; the file name of the conflicting file is the same as that in the second SDK The files have the same filename;

文件名修改模块,用于修改所述冲突文件的文件名。The file name modification module is used to modify the file name of the conflicting file.

本说明书实施例提供的一种电子设备,包括:An electronic device provided in an embodiment of this specification includes:

至少一个处理器;以及,at least one processor; and,

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:The memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to:

获取第一文件名信息;所述第一文件名信息用于表示需要发送给程序接入端的第一SDK中的文件的文件名;Obtain first file name information; the first file name information is used to indicate the file name of the file in the first SDK that needs to be sent to the program access terminal;

获取第二文件名信息;所述第二文件名信息用于表示所述程序接入端已存储的第二SDK中的文件的文件名;Obtaining second file name information; the second file name information is used to indicate the file name of the file in the second SDK stored by the program access terminal;

基于所述第一文件名信息与所述第二文件名信息,确定所述第一SDK中的冲突文件;所述冲突文件的文件名与所述第二SDK中的文件的文件名相同;Determine the conflicting file in the first SDK based on the first file name information and the second file name information; the file name of the conflicting file is the same as the file name of the file in the second SDK;

修改所述冲突文件的文件名。Modify the filename of the conflicting file.

本说明书实施例提供的一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现上述修改SDK中文件名的方法。The embodiment of this specification provides a computer-readable medium, on which computer-readable instructions are stored, and the computer-readable instructions can be executed by a processor to implement the above-mentioned method for modifying a file name in the SDK.

本说明书实施例采用的上述至少一个技术方案能够达到以下有益效果:在将第一SDK发送至程序接入端之前,首先获取程序接入端存储的第二SDK,第一SDK框和第二SDK的包名相同,然后对比第一SDK和第二SDK的中的文件的文件名是否相同。如果相同,就修改第一SDK的文件名,从而避免第一SDK在程序接入端中进行编译的时候,与第二SDK发生冲突的问题出现。上述方法可以有效的解决同一机器中存在两个不同版本的SDK,而发生版本冲突不兼容的问题,与现有技术中通过人为的升级软件低版本的解决方法相比,提高了程序接入的处理效率。The above-mentioned at least one technical solution adopted in the embodiment of this specification can achieve the following beneficial effects: before sending the first SDK to the program access terminal, first obtain the second SDK stored in the program access terminal, the first SDK frame and the second SDK The package names are the same, and then compare whether the file names of the files in the first SDK and the second SDK are the same. If they are the same, modify the file name of the first SDK, so as to avoid the conflict between the first SDK and the second SDK when compiling in the program access terminal. The above method can effectively solve the problem that there are two different versions of SDK in the same machine, and the problem of version conflict and incompatibility occurs. Processing efficiency.

附图说明Description of drawings

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The schematic embodiments and descriptions of the application are used to explain the application and do not constitute an improper limitation to the application. In the attached picture:

图1为本说明书实施例提供的一种修改SDK中文件名的方法的流程示意图;Fig. 1 is a schematic flow chart of a method for modifying a file name in SDK provided by an embodiment of this specification;

图2为本说明书实施例提供的对应于图1的一种修改SDK中文件名的装置的结构示意图;FIG. 2 is a schematic structural diagram of a device for modifying file names in the SDK corresponding to FIG. 1 provided by the embodiment of this specification;

图3为本说明书实施例提供的对应于图1的一种电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device corresponding to FIG. 1 provided by the embodiment of this specification.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and corresponding drawings. Apparently, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

当一个应用APP(程序接入方)需要接入另一个应用(服务输出方)的某项服务(如付款码服务)时,例如某个购物APP需要接入微信、支付宝等支付平台的支付码服务的时候,就需要调用服务输出方(微信、支付宝)提供的付款码服务的SDK,接入方的开发人员通过对付款码SDK进行解压后,学习该SDK的逻辑之后,就可以实现该SDK的功能。这项服务发生在应用的开发阶段,只有程序接入方成功接入了该项服务,程序接入方对应的应用APP才能够上线,并应用APP的注册用户使用。When an application APP (program accessor) needs to access a certain service (such as payment code service) of another application (service output party), for example, a shopping APP needs to access payment codes of payment platforms such as WeChat and Alipay When serving, it is necessary to call the payment code service SDK provided by the service exporter (WeChat, Alipay). The developer of the receiving party can realize the SDK after decompressing the payment code SDK and learning the logic of the SDK function. This service occurs in the development stage of the application. Only when the program access party successfully accesses the service, the corresponding application APP of the program access party can be launched and used by registered users of the APP.

但是,在一些情况下,服务输出方的开发平台的功能比较多,为了方便开发人员的编程,会把一些经常用到的实现基础功能的程序进行封装,生成基础SDK。开发人员在开发某项服务时,需要实现某项功能时只需调用这些基础SDK来实现即可,无需再重新进行编程。因此,一些服务除了主程序之后,还包括调用的多个基础SDK。随着发展,为了应对需求的改变,经常会对基础SDK进程升级。因此,在不同的时间段内,服务输出方输出的基础SDK的版本是不相同的。因此,在服务输出方在向程序接入方输出某项服务之前,假设该项服务包括登录SDK,假设程序接入方已经接入过登录SDK,而且,程序接入方已经接入的登录SDK是一个低版本,而服务输出方将要输出给程序接入方的登录SDK是高版本。如果直接将高版本的登录SDK直接输出至程序接入方,那么在编译的时候,就会出现不同版本不兼容的问题。However, in some cases, the development platform of the service exporter has more functions. In order to facilitate the programming of developers, some frequently used programs that implement basic functions will be packaged to generate a basic SDK. When developing a certain service, developers only need to call these basic SDKs to realize a certain function without reprogramming. Therefore, in addition to the main program, some services also include multiple basic SDKs called. With development, in order to cope with changes in requirements, the basic SDK process is often upgraded. Therefore, in different time periods, the version of the basic SDK output by the service exporter is different. Therefore, before the service exporter exports a certain service to the program accesser, it is assumed that the service includes the login SDK, and the program accesser has already accessed the login SDK, and the login SDK that the program accessor has accessed is a lower version, and the login SDK that the service exporter will export to the program accesser is a higher version. If a higher version of the login SDK is directly output to the program access party, then when compiling, different versions will be incompatible.

为了解决不同版本不兼容的问题,可以采用程序接入方和服务输出方的开发人员线下沟通的方法,将服务输出方的低版本升级到高版本之后,服务输出方再进行服务输出。这样操作的话,依赖于线下操作,过程繁琐,接入效率低下。In order to solve the problem of incompatibility of different versions, the developer of the program access party and the service exporter can communicate offline. After upgrading the lower version of the service exporter to a higher version, the service exporter can then export the service. In this way, it depends on offline operation, the process is cumbersome, and the access efficiency is low.

为了解决上述不同版本的SDK不兼容的问题,提高接入效率,本说明书实施例在将第一SDK发送至程序接入端之前,首先获取程序接入端存储的第二SDK,第一SDK和第二SDK的包名相同,然后对比第一SDK和第二SDK的中的文件的文件名是否相同。如果相同,就修改第一SDK文件中的文件名,从而避免第一SDK在程序接入端中进行编译的时候,与第二SDK发生冲突的问题出现。上述方法可以有效的解决同一机器中存在两个不同版本的SDK,而发生版本冲突不兼容的问题,与现有技术中通过人为的升级软件低版本的解决方法相比,提高了处理效率。In order to solve the above problem of incompatibility of different versions of the SDK and improve the access efficiency, the embodiment of this specification first obtains the second SDK stored in the program access terminal, the first SDK and the first SDK before sending the first SDK to the program access terminal. The package names of the second SDK are the same, and then compare whether the file names of the files in the first SDK and the second SDK are the same. If they are the same, modify the file name in the first SDK file, so as to avoid the conflict between the first SDK and the second SDK when compiling in the program access terminal. The above method can effectively solve the problem that there are two different versions of SDK in the same machine, and the problem of version conflict and incompatibility occurs. Compared with the solution of artificially upgrading the lower version of the software in the prior art, the processing efficiency is improved.

以下结合附图,详细说明本申请各实施例提供的技术方案。The technical solutions provided by various embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.

图1为本说明书实施例提供的一种修改SDK中文件名的方法的流程示意图。从程序角度而言,流程的执行主体可以为搭载于应用服务器的程序或应用客户端。该方案的执行主体是服务输出方的设备,可以是开发服务器也可以任意一个开发客户端。FIG. 1 is a schematic flowchart of a method for modifying a file name in an SDK provided by an embodiment of this specification. From a program point of view, the subject of execution of the process can be a program or an application client installed on an application server. The execution subject of this solution is the device of the service exporter, which can be a development server or any development client.

如图1所示,该流程可以包括以下步骤:As shown in Figure 1, the process may include the following steps:

步骤102:获取第一文件名信息;所述第一文件名信息用于表示需要发送给程序接入端的第一SDK中的文件的文件名。Step 102: Obtain first file name information; the first file name information is used to indicate the file name of the file in the first SDK that needs to be sent to the program access terminal.

SDK一般是一些软件工程师为特定的软件包、软件框架、硬件平台、操作系统等建立应用软件时的开发工具的集合。因此一个具有特殊功能的SDK中会包括很多文件,而这些文件可以是调用的开发软件中的模块,如Java中的类库。SDK is generally a collection of development tools used by some software engineers to create application software for specific software packages, software frameworks, hardware platforms, operating systems, etc. Therefore, an SDK with special functions will include many files, and these files may be modules in the development software called, such as class libraries in Java.

Java官方为开发者提供了很多功能强大的类,这些类被分别放在各个包中,随JDK一起发布,称为Java类库或Java API。API(Application Programming Interface,应用程序编程接口)是一个通用概念。Java officially provides developers with many powerful classes, which are placed in various packages and released together with the JDK, called Java class libraries or Java APIs. API (Application Programming Interface, Application Programming Interface) is a general concept.

Java中的类库是开发人员已经开发好的模块,可以被其他开发者调用。从字面上理解,类库就像是一个仓库,仓库里有许多个已经开发好的类。因此,在某项服务时,经常会用到这些类。A class library in Java is a module that a developer has developed and can be called by other developers. Literally understood, a class library is like a warehouse, and there are many developed classes in the warehouse. Therefore, these classes are often used in a certain service.

第一文件名信息用于表示需要发送给程序接入端的第一SDK中的文件的文件名,这些文件名信息可以通过调用第一SDK来获取,也可以只调取与第一SDK中的文件的文件名相关的文件。假设,第一文件名信息存在于第一SDK的某个文件中,那么只需要获取该文件里的内容就可以。The first file name information is used to indicate the file name of the file in the first SDK that needs to be sent to the program access terminal. These file name information can be obtained by calling the first SDK, or only the files in the first SDK can be called The filename of the associated file. Assuming that the first file name information exists in a certain file of the first SDK, it is only necessary to obtain the content in the file.

在这个方案中,第一SDK可以是单独发送给程序接入端,也可以是与其他SDK共同发送给程序接入端,还可以是第一SDK与其他SDK进行打包后再发送给程序接入端。In this solution, the first SDK can be sent to the program access terminal alone, or it can be sent to the program access terminal together with other SDKs, or the first SDK can be packaged with other SDKs and then sent to the program access terminal. end.

需要说明的是,“第一文件名信息”中的“第一”和“第一SDK”中的“第一”只是用来进行区分,不具有实际的含义。It should be noted that the "first" in the "first file name information" and the "first" in the "first SDK" are only used for distinction and have no actual meaning.

步骤104:获取第二文件名信息;所述第二文件名信息用于表示所述程序接入端已存储的第二SDK中的文件的文件名。Step 104: Obtain second file name information; the second file name information is used to indicate the file name of the file stored in the second SDK at the program access terminal.

在确定需要发送至程序接入端的第一SDK之后,就需要确定程序接入端是否已经接入与第一SDK的包名相同的第二SDK。如果程序接入端已经接入了第二SDK,就需要判断第一SDK和第二SDK是否冲突。第一SDK和第二SDK的包名相同,即表示第一SDK和第二SDK实现的功能是相同或相近的。After determining the first SDK that needs to be sent to the program access terminal, it is necessary to determine whether the program access terminal has access to the second SDK with the same package name as the first SDK. If the program access terminal has already connected to the second SDK, it needs to determine whether the first SDK and the second SDK conflict. The package names of the first SDK and the second SDK are the same, which means that the functions implemented by the first SDK and the second SDK are the same or similar.

第二文件名信息的获取方式可以是获取从程序接入端接入的第二SDK,然后从第二SDK中获取第二文件信息;还可以只根据第二SDK的包名和版本号从服务输出方,从服务输出方存储的第二SDK中的获取第二文件名信息,这样可以无需调用程序接入端的第二SDK,简化的操作。The way to obtain the second file name information can be to obtain the second SDK accessed from the program access terminal, and then obtain the second file information from the second SDK; it can also be output from the service only according to the package name and version number of the second SDK The party obtains the second file name information from the second SDK stored by the service output party, so that the operation can be simplified without calling the second SDK at the program access end.

步骤106:基于所述第一文件名信息与所述第二文件名信息,确定所述第一SDK中的冲突文件;所述冲突文件的文件名与所述第二SDK中的文件的文件名相同。Step 106: Determine the conflicting file in the first SDK based on the first file name information and the second file name information; the file name of the conflicting file and the file name of the file in the second SDK same.

由于是要修改第一SDK中的文件名,以避免存在与第二SDK相同的文件名,因此需要确定第一SDK中的冲突文件。冲突文件可以理解为如果第一SDK中的某个文件的文件名也同样存在与第二SDK中,那么该文件就可以称为冲突文件。Since it is necessary to modify the file name in the first SDK to avoid having the same file name as that in the second SDK, it is necessary to determine the conflicting file in the first SDK. The conflict file can be understood as if the file name of a file in the first SDK also exists in the second SDK, then the file can be called a conflict file.

具体的筛选方法可以是将第一文件名信息对应的文件名和第二文件名信息对应的文件名一一进行比对,筛选出文件名相同的文件的文件名。比如,以第一文件名信息中的文件名作为比较的对象,对于文件名A,如果第二文件名信息中存在所述文件名A,那么文件名A对应的第一SDK中的文件即为冲突文件;如果第二文件名信息中不存在所述文件名A,那么文件名A对应的第一SDK中的文件就不是冲突文件。A specific screening method may be to compare the file names corresponding to the first file name information and the file names corresponding to the second file name information one by one, and filter out the file names of the files with the same file name. For example, taking the file name in the first file name information as the object of comparison, for file name A, if the file name A exists in the second file name information, then the file in the first SDK corresponding to file name A is A conflict file; if the file name A does not exist in the second file name information, then the file in the first SDK corresponding to the file name A is not a conflict file.

步骤108:修改所述冲突文件的文件名。Step 108: Modify the file name of the conflicting file.

确定了冲突文件,就需要将冲突文件的文件名进行修改,以使修改后的文件名与第二SDK的文件的文件名不存在相同的,以避免冲突。After determining the conflicting file, it is necessary to modify the file name of the conflicting file, so that the modified file name is not the same as the file name of the second SDK file, so as to avoid conflicts.

为了与第二SDK中的文件进行区别,只需修改第一SDK中的文件名。对于文件名的修改,可以增加一些字符或字符串,加以区别。这些字符和字符串可以是随机生成的,也可是根据某些规则生成的。可以是没有实际意义的,也可是代表特殊含义的,可以根据文件名中的这些字符和字符串来获得一些特殊的信息。In order to distinguish it from the file in the second SDK, just modify the file name in the first SDK. For the modification of the file name, some characters or character strings can be added to make a distinction. These characters and strings can be generated randomly or according to certain rules. It can be meaningless, or it can represent special meaning, and some special information can be obtained according to these characters and strings in the file name.

图1中的方法,在将第一SDK发送至程序接入端之前,首先获取程序接入端存储的第二SDK,第一SDK框和第二SDK的包名相同,然后对比第一SDK和第二SDK的中的文件的文件名是否相同。如果相同,就修改第一SDK的文件名,从而避免第一SDK在程序接入端中进行编译的时候,与第二SDK发生冲突的问题出现。上述方法可以有效的解决同一机器中存在两个不同版本的SDK,而发生版本冲突不兼容的问题,与现有技术中通过人为的升级软件低版本的解决方法相比,提高了程序接入的处理效率。The method in Figure 1, before sending the first SDK to the program access terminal, first obtain the second SDK stored in the program access terminal, the package names of the first SDK box and the second SDK are the same, and then compare the first SDK and Whether the file name of the file in the second SDK is the same. If they are the same, modify the file name of the first SDK, so as to avoid the conflict between the first SDK and the second SDK when compiling in the program access terminal. The above method can effectively solve the problem that there are two different versions of SDK in the same machine, and the problem of version conflict and incompatibility occurs. Processing efficiency.

基于图1的方法,本说明书实施例还提供了该方法的一些具体实施方式,下面进行说明。Based on the method in FIG. 1 , the embodiment of this specification also provides some specific implementations of the method, which will be described below.

在一些具体的场景中,在步骤102:获取第一文件名信息之前,还包括:In some specific scenarios, before step 102: before obtaining the first file name information, it also includes:

获取第一SDK的第一版本号信息;Obtain the first version number information of the first SDK;

根据所述第一SDK的包名确定所述第二SDK,所述第二SDK的包名与所述第一SDK的包名相同;Determine the second SDK according to the package name of the first SDK, the package name of the second SDK is the same as the package name of the first SDK;

获取所述第二SDK的第二版本号信息;Obtain the second version number information of the second SDK;

基于所述第一版本号信息和所述第二版本号信息,判断所述第一SDK和所述第二SDK的版本是否相同,得到判断结果;Based on the first version number information and the second version number information, judge whether the versions of the first SDK and the second SDK are the same, and obtain a judgment result;

所述获取第一文件名信息,具体包括:The acquisition of the first file name information specifically includes:

当所述判断结果表示当所述第一SDK和所述第二SDK的版本不同时,获取所述第一文件名信息。When the judgment result indicates that the versions of the first SDK and the second SDK are different, the first file name information is acquired.

在本实施例中,某个服务的实现往往会需要调用多个基础SDK,由于基础SDK一直在更新,每个服务的输出时间不同,导致选择的基础SDK的版本可能也不相同。因此,发生冲突的两个SDK有可能是一个SDK的两个不同版本。In this embodiment, the implementation of a certain service often needs to call multiple basic SDKs. Since the basic SDKs are always being updated, the output time of each service is different, resulting in different versions of the selected basic SDKs. Therefore, it is possible that the two conflicting SDKs are two different versions of one SDK.

因此,在确定了要输出的第一SDK之后,首先需要确定程序接入端是否已经接入与第一SDK的包名相同的SDK。确定的方法可以是由程序接入端主动提供的,或者在服务输出端会存在一张表格,记录每次发送至程序接入端的SDK的名字和版本号。如果程序接入端没有存储与第一SDK的包名相同的SDK,那么第一SDK发送至程序接入端之后,编译的时候不会发生冲突。如果确定程序接入端已经存储了与第一SDK的包名相同的第二SDK,就需要判断第一SDK和第二SDK的版本号是否相同。获取所述第二SDK的第二版本号信息可以由程序接入端提供,也可以从服务输出端存储的数据表里获取。Therefore, after determining the first SDK to be exported, it is first necessary to determine whether the program access terminal has accessed the SDK with the same package name as the first SDK. The determination method can be provided by the program access terminal actively, or there will be a table at the service output terminal, recording the name and version number of the SDK sent to the program access terminal each time. If the program access terminal does not store an SDK with the same package name as the first SDK, after the first SDK is sent to the program access terminal, there will be no conflict during compilation. If it is determined that the program access terminal has stored the second SDK with the same package name as the first SDK, it needs to determine whether the version numbers of the first SDK and the second SDK are the same. Obtaining the second version number information of the second SDK may be provided by the program access terminal, or may be obtained from a data table stored in the service output terminal.

如果第一SDK的版本号和第二SDK的版本号相同,就说明程序接入端已经存储的第二SDK与第一SDK完全相同,编译的时候不会造成冲突。如果第一SDK的版本号和第二SDK的版本号不相同,就需要对会与第二SDK发生冲突的第一SDK中的文件进行修改。为了简化操作,只需要修改第二SDK中的文件的文件名即可,因此,只需获取第一SDK和第二SDK的文件名信息进行比对就可以找出发生冲突的文件。If the version number of the first SDK is the same as the version number of the second SDK, it means that the second SDK stored in the program access terminal is exactly the same as the first SDK, and there will be no conflict during compilation. If the version number of the first SDK is different from that of the second SDK, it is necessary to modify the files in the first SDK that will conflict with the second SDK. In order to simplify the operation, it is only necessary to modify the file name of the file in the second SDK. Therefore, it is only necessary to obtain the file name information of the first SDK and the second SDK for comparison to find out the conflicting file.

为了与第二SDK中的文件进行区别,只需修改第一SDK中的文件名。对于文件名的修改,可以增加一些字符或字符串,加以区别。具体的,为了提高修改效率,所述修改所述冲突文件的文件名,具体包括:In order to distinguish it from the file in the second SDK, just modify the file name in the first SDK. For the modification of the file name, some characters or character strings can be added to make a distinction. Specifically, in order to improve modification efficiency, the modification of the file name of the conflicting file specifically includes:

在所述冲突文件原有的文件名中增加特定字符串,其中,当所述冲突文件为多个时,多个所述冲突文件的文件名增加的特定字符串相同。Adding a specific character string to the original file name of the conflicting file, wherein, when there are multiple conflicting files, the specific character string added to the file names of the multiple conflicting files is the same.

Java类库中有很多包:There are many packages in the Java class library:

以java.*开头的是Java的核心包,所有程序都会使用这些包中的类;Starting with java.* is the core package of Java, and all programs will use the classes in these packages;

以javax.*开头的是扩展包,x是extension的意思,也就是扩展。虽然javax.*是对java.*的优化和扩展,但是由于javax.*使用的越来越多,很多程序都依赖于javax.*,所以javax.*也是核心的一部分了,也随JDK一起发布。The extension package starts with javax.*, and x means extension, that is, extension. Although javax.* is an optimization and extension of java.*, because javax.* is used more and more, many programs depend on javax.*, so javax.* is also a part of the core, and it is also released with JDK .

以org.*开头的是各个机构或组织发布的包,因为这些组织很有影响力,它们的代码质量很高,所以也将它们开发的部分常用的类随JDK一起发布。Packages starting with org.* are packages released by various institutions or organizations. Because these organizations are very influential and their code quality is high, some commonly used classes developed by them are also released together with the JDK.

假设发生冲突的文件名为okio.A,其中,okio为工具包名(不能修改),A为类名。修改冲突文件的文件名,就是设置一个类映射关系,将okio.A映射到修改后的文件名,比如okio.custom.A,其中,custom为增加的字符串。Assume that the conflicting file name is okio.A, where okio is the toolkit name (cannot be modified), and A is the class name. To modify the file name of the conflicting file is to set a class mapping relationship to map okio.A to the modified file name, such as okio.custom.A, where custom is an added string.

假设还有一个冲突文件的文件名为java.util.Date,其中,java.util为工具包名,Date为类名,那么修改后的文件名为java.util.custom.Date。因此,就做到了将所有冲突文件都加入一个特定的字符串,提高了修改效率。Assuming that there is another conflicting file named java.util.Date, where java.util is the toolkit name and Date is the class name, then the modified file name is java.util.custom.Date. Therefore, it is possible to add all conflicting files to a specific character string, which improves the modification efficiency.

为了准确对文件进行调用,在所述修改所述冲突文件的文件名之后,还包括:In order to call the file accurately, after the modification of the file name of the conflicting file, it also includes:

根据修改后的所述冲突文件的文件名,修改对于所述冲突文件进行引用的程序语句。According to the modified file name of the conflict file, the program statement that refers to the conflict file is modified.

在具体应用的时候,修改了文件名就是修改了文件名与文件的对应关系,因此,在对该文件调用的时候,对应的还要修改代码中对该文件进行调用的程序语句。具体操作是遍历所有class(代码)文件,替换类名和import引用。import只能导入包所包含的类,而不能导入包。In a specific application, modifying the file name means modifying the corresponding relationship between the file name and the file. Therefore, when the file is called, the corresponding program statement in the code that calls the file needs to be modified. The specific operation is to traverse all class (code) files, replace the class name and import reference. import can only import the classes contained in the package, not the package.

例如,原引用语句为:import java.util.Date;//导入java.util包下的Date;For example, the original quote statement is: import java.util.Date; //import Date under the java.util package;

修改后的应用语句为:import java.util.custom.Date;//导入java.util包下的custom.Date。The modified application statement is: import java.util.custom.Date; //Import custom.Date under the java.util package.

在一些具体的场景中,一个服务往往会需要多个基础SDK共同完成,因此,会发生多个基础SDK均发生冲突的情况,因此,需要对每一个基础SDK都进行确定是否与程序接入端存储的SDK发生冲突,然后一一对发生冲突的SDK的文件进行修改。然后再将多个SDK分别发送至程序接入端。In some specific scenarios, a service often requires multiple basic SDKs to be completed together. Therefore, conflicts between multiple basic SDKs may occur. Therefore, it is necessary to determine whether each basic SDK is compatible with the program access terminal. The stored SDK conflicts, and then modify the files of the conflicting SDK one by one. Then send multiple SDKs to the program access terminal respectively.

由于,多个SDK是分别输出的,程序接入端的开发人员在接收到多个SDK之后,就需要分别学习多个SDK的编程语言和编程逻辑。这无形中增加了接入方的接入成本,降低了接入效率。为了提高接入效率,本说明书实施例将对个SDK进行打包后,再进行输出,程序接入端的开发人员只需对打包后的SDK统一进行学习就可以了。Because multiple SDKs are output separately, after receiving multiple SDKs, developers at the program access end need to learn the programming languages and programming logics of multiple SDKs respectively. This virtually increases the access cost of the access party and reduces the access efficiency. In order to improve the access efficiency, the embodiment of this manual will package each SDK and then output it. The developers at the program access end only need to study the packaged SDK in a unified manner.

在本说明书的一个或多个实施例中,在所述修改对于所述冲突文件进行引用的程序语句之后,还包括:In one or more embodiments of this specification, after the modification of the program statement that references the conflicting file, it also includes:

确定需要发送给所述程序接入端的多个SDK,所述多个SDK和所述第一SDK用于共同实现第一服务;Determine multiple SDKs that need to be sent to the program access terminal, the multiple SDKs and the first SDK are used to jointly implement the first service;

将所述多个SDK和修改后的所述第一SDK进行封装,生成合并SDK;Encapsulating the plurality of SDKs and the modified first SDK to generate a merged SDK;

将所述合并SDK发送至所述程序接入端。Send the combined SDK to the program access terminal.

在本实施例中,第一SDK和多个SDK是以打包的形式存在的,即是以二进制的形式存在的,因此在对多个SDK进行合并之前,首先对每个SDK进行解压,得到class(代码)文件和资源文件,属性文件等等,如R.java文件和manifest文件。首先对属性文件等进行合并,然后对多个class文件进行合并。然后将合并后的属性文件和class文件在进行编译,生成合并后的SDK,然后发送至程序接入端。In this embodiment, the first SDK and multiple SDKs exist in a packaged form, that is, in a binary form. Therefore, before merging multiple SDKs, firstly decompress each SDK to obtain the class (code) files and resource files, property files, etc., such as R.java files and manifest files. First, merge properties files, etc., and then merge multiple class files. Then compile the merged property file and class file to generate the merged SDK, and then send it to the program access terminal.

在本说明书实施例中,第一SDK和多个SDK可以采用Java语言进行编辑开发。Java是一种跨平台的、解释型语言,Java源代码编译成中间“字节码”存储于class文件中。由于跨平台的需要,Java字节码中包括了很多源代码信息,如变量名、方法名,并且通过这些名称来访问变量和方法,这些符号带有许多语义信息,很容易被反编译成Java源代码。为了防止这种现象,可以使用Java混淆器对Java字节码进行混淆。In the embodiment of this specification, the first SDK and multiple SDKs can be edited and developed in Java language. Java is a cross-platform, interpreted language. Java source code is compiled into an intermediate "bytecode" and stored in a class file. Due to cross-platform requirements, Java bytecode includes a lot of source code information, such as variable names and method names, and access variables and methods through these names. These symbols carry a lot of semantic information and are easily decompiled into Java. source code. In order to prevent this phenomenon, you can use the Java obfuscator to obfuscate the Java bytecode.

混淆就是对发布出去的程序进行重新组织和处理,使得处理后的代码与处理前代码完成相同的功能,而混淆后的代码很难被反编译,即使反编译成功也很难得出程序的真正语义。被混淆过的程序代码,仍然遵照原来的档案格式和指令集,执行结果也与混淆前一样,只是混淆器将代码中的所有变量、函数、类的名称变为简短的英文字母代号,在缺乏相应的函数名和程序注释的情况下,即使被反编译,也将难以阅读。同时混淆是不可逆的,在混淆的过程中一些不影响正常运行的信息将永久丢失,这些信息的丢失使程序变得更加难以理解。Obfuscation is to reorganize and process the released program so that the processed code has the same function as the pre-processed code, and the obfuscated code is difficult to decompile, even if the decompilation is successful, it is difficult to obtain the true semantics of the program . The obfuscated program code still follows the original file format and instruction set, and the execution result is the same as before obfuscation, but the obfuscator changes the names of all variables, functions, and classes in the code into short English letter codes. In the case of corresponding function names and program comments, even if decompiled, it will be difficult to read. At the same time, obfuscation is irreversible. During the obfuscation process, some information that does not affect normal operation will be permanently lost. The loss of these information makes the program more difficult to understand.

混淆器的作用不仅仅是保护代码,它也有精简编译后程序大小的作用。由于以上介绍的缩短变量和函数名以及丢失部分信息的原因,编译后jar文件体积大约能减少25%,这对当前费用较贵的无线网络传输是有一定意义的。The function of the obfuscator is not only to protect the code, but also to reduce the size of the compiled program. Due to the shortening of variable and function names and the loss of some information described above, the volume of the compiled jar file can be reduced by about 25%, which is meaningful for the current expensive wireless network transmission.

本实施例将第一SDK和多个SDK进行打包后,统一进行混淆,避免了多个SDK采用多种混淆规则进行代码混淆的现象出现,提高了接入效率。In this embodiment, after the first SDK and multiple SDKs are packaged, they are uniformly obfuscated, which avoids the phenomenon that multiple SDKs use multiple obfuscation rules to perform code obfuscation, and improves access efficiency.

但是,在打包的时候需要解决多个SDK中资源文件的资源ID发生冲突的问题。为了解决上述问题,所述将所述多个SDK和修改后的所述第一SDK进行封装,具体包括:However, it is necessary to solve the problem of conflicting resource IDs of resource files in multiple SDKs during packaging. In order to solve the above problems, said packaging said multiple SDKs and said modified first SDK includes:

获取所述第一SDK中资源文件的第一资源ID;Obtain the first resource ID of the resource file in the first SDK;

获取所述多个SDK中资源文件的第二资源ID;Obtain the second resource ID of the resource files in the plurality of SDKs;

基于所述第一资源ID和所述第二资源ID,确定资源ID相同的冲突资源文件;determining conflicting resource files with the same resource ID based on the first resource ID and the second resource ID;

修改所述冲突资源文件的资源ID,以使一个所述资源ID标识的资源文件是唯一的;Modifying the resource ID of the conflicting resource file, so that a resource file identified by the resource ID is unique;

基于修改后的所述冲突资源文件的资源ID,修改对于所述冲突资源文件进行引用的程序语句;Based on the modified resource ID of the conflicting resource file, modify the program statement that refers to the conflicting resource file;

将修改后的所述多个SDK和修改后的所述第一SDK进行封装。Packaging the modified multiple SDKs and the modified first SDK.

资源文件会在编译过程中被打包进APK中(res文件夹)或者被打包成独立的资源APK包(比如framework-res.apk)。但是这些资源文件都会被赋予独一无二的ID即资源索引来方便系统访问。其中,gen目录下的R.java文件是编译器自动生成的,它无需开发人员对其进行维护。R.java会自动收录当前应用中所有的资源文件,并根据这些资源文件建立对应的ID,包括:布局资源、控件资源、String资源、Drawable资源等。可以简单的把R.java理解成是当前Android应用的资源字典。Resource files will be packaged into the APK (res folder) or packaged into an independent resource APK package (such as framework-res.apk) during the compilation process. But these resource files will be given a unique ID or resource index to facilitate system access. Among them, the R.java file in the gen directory is automatically generated by the compiler, and it does not require developers to maintain it. R.java will automatically collect all resource files in the current application, and create corresponding IDs based on these resource files, including: layout resources, control resources, String resources, Drawable resources, etc. R.java can be simply understood as the resource dictionary of the current Android application.

由于每个SDK中均包括一个R.java文件,R.java文件中的资源ID是自动生成的,由于包括多个R.java文件,只能保证在一个R.java文件中,不存在资源ID冲突的问题。但是,可能会存在一个资源ID存在于多个R.java文件中,也就是说,一个资源ID在不同的SDK中均有对应的资源文件,这样在通过该资源ID调用对应的资源文件的时候就会发生调用冲突。因此,需要修改该资源ID对应的多个资源文件的资源ID,以避免调用冲突的问题出现。Since each SDK includes an R.java file, the resource ID in the R.java file is automatically generated. Since multiple R.java files are included, it can only be guaranteed that there is no resource ID in one R.java file. Conflict issues. However, there may be a resource ID that exists in multiple R.java files, that is to say, a resource ID has corresponding resource files in different SDKs, so when calling the corresponding resource file through the resource ID A call conflict will occur. Therefore, it is necessary to modify the resource IDs of multiple resource files corresponding to the resource ID to avoid the problem of calling conflicts.

根据本方案的方法,如果发生资源ID冲突,首先需要确定多个SDK中发生资源ID冲突的资源文件,然后再对这些资源文件重新进行命名。重新命名可以设置一些特定的规则,这里不做具体限定。According to the method of this solution, if a resource ID conflict occurs, it is first necessary to determine the resource files in multiple SDKs where the resource ID conflict occurs, and then rename these resource files. Some specific rules can be set for renaming, which are not specifically limited here.

确定资源ID相同的冲突资源文件。可以采取如下方法:对于任意一个资源ID,可以从所有SDK中的R.java文件中进行查找,看该资源ID一共出现了几次。如果只出现了一次,那么就可以说明该资源ID对应唯一的资源文件。如果该资源ID出现了的次数为两次或者大于两次,就说明该资源ID出现在多个R.java文件中。因此就需要对多个SDK中的R.java文件的与该资源ID相同的资源ID进行修改。Identify conflicting resource files with the same resource ID. The following method can be adopted: For any resource ID, you can search it from all the R.java files in the SDK to see how many times the resource ID appears in total. If it only appears once, it means that the resource ID corresponds to a unique resource file. If the resource ID appears twice or more than twice, it means that the resource ID appears in multiple R.java files. Therefore, it is necessary to modify the same resource ID as the resource ID of the R.java files in multiple SDKs.

例如,一个资源ID“0x7f030000”对应多个资源文件a、b和c。其中,a位于SDK1中,b位于SDK2中,c位于SDK3中。为了避免资源文件调用冲突,可以只修改b和c的资源ID,如,b的资源ID可以修改为“0x7f030001”,c的资源ID可以修改为“0x7f030002”。也可以资源文件a、b和c都进行修改,如,b的资源ID可以修改为“0x7f030003”,b的资源ID可以修改为“0x7f030001”,c的资源ID可以修改为“0x7f030002”For example, one resource ID "0x7f030000" corresponds to multiple resource files a, b and c. Among them, a is located in SDK1, b is located in SDK2, and c is located in SDK3. In order to avoid resource file call conflicts, only the resource IDs of b and c can be modified. For example, the resource ID of b can be changed to "0x7f030001", and the resource ID of c can be changed to "0x7f030002". It is also possible to modify resource files a, b and c. For example, the resource ID of b can be modified to "0x7f030003", the resource ID of b can be modified to "0x7f030001", and the resource ID of c can be modified to "0x7f030002"

为了准确对资源文件进行调用,所述根据所述编译文件中的资源ID修改所述多个软件开发工具包中的资源ID,还可以包括:In order to accurately call the resource file, said modifying the resource IDs in the plurality of software development kits according to the resource IDs in the compiled files may also include:

将所述多个SDK中的R.java文件中的资源ID替换为修改后的资源ID;The resource IDs in the R.java files in the multiple SDKs are replaced with the modified resource IDs;

将所述软件开发工具包中的资源文件引用语句中的资源ID替换为修改后的资源ID。Replace the resource ID in the resource file reference statement in the software development kit with the modified resource ID.

在具体应用的时候,R.java文件中记载了资源文件与资源ID的对应关系,需要对R.java文件中资源ID进行修改,修改了R.java文件中的资源ID就是修改了资源文件与资源ID的对应关系。因此,为了能够准确对资源文件进行调用,对应的还要修改代码中对资源文件进行调用的程序语句。In the specific application, the R.java file records the corresponding relationship between the resource file and the resource ID, and the resource ID in the R.java file needs to be modified. Modifying the resource ID in the R.java file means modifying the resource file and the resource ID. Correspondence between resource IDs. Therefore, in order to accurately call the resource file, correspondingly, the program statement for calling the resource file in the code needs to be modified.

例如,在java程序中引用资源文件,按照java的语法来引用即:R.resource_type.resource_name,注意:resource_name不需要文件的后缀名。如果资源文件的资源ID由“0x7f030000”修改为“0x7f030001”,那么资源文件的引用语句就需要由“R.resource_type.0x7f030000”修改为“0x7f030001”。For example, to refer to a resource file in a java program, refer to it according to the syntax of java: R.resource_type.resource_name, note: resource_name does not need the suffix of the file. If the resource ID of the resource file is changed from "0x7f030000" to "0x7f030001", then the reference statement of the resource file needs to be changed from "R.resource_type.0x7f030000" to "0x7f030001".

另外,由于多对第一SDK和多个SDK进行合并,但是不同的SDK中的Android组件可能运行在不同的进程中,因此在实现一个服务的时候,往往需要多个进程并行,从而浪费系统资源。为了减少系统资源的浪费,所述将所述多个SDK和修改后的所述第一SDK进行封装,还可以包括:In addition, since multiple pairs of the first SDK and multiple SDKs are merged, Android components in different SDKs may run in different processes. Therefore, when implementing a service, multiple processes are often required to run in parallel, thus wasting system resources. . In order to reduce the waste of system resources, said packaging said plurality of SDKs and said modified first SDK may also include:

解压所述修改后的所述第一SDK,得到第一manifest文件;Decompressing the modified first SDK to obtain a first manifest file;

解压所述多个SDK,得到多个第二manifest文件;Decompressing the plurality of SDKs to obtain a plurality of second manifest files;

将所述第一manifest文件中的进程名以及所述多个第二manifest文件中的进程名修改为相同的进程名。Modifying the process name in the first manifest file and the process names in the plurality of second manifest files to the same process name.

在Android系统中,存在四大组件,分别为:有Activity(显示界面),Service(服务),Content ProvIDer(数据通信),BroadcastReceiver(广播)。In the Android system, there are four major components, namely: Activity (display interface), Service (service), Content ProvIDer (data communication), and BroadcastReceiver (broadcast).

Activities是用户和应用程序交互的窗口,一个Activity相当于实际的一个网页,当打开一个屏幕时,之前的那一个屏幕会被置为暂停状态,并且被压入历史堆栈中,用户可以通过回退操作返回到以前打开过的屏幕。Activities are windows for users to interact with applications. An Activity is equivalent to an actual web page. When a screen is opened, the previous screen will be put into a paused state and pushed into the history stack. Users can roll back Operation returns to the previously opened screen.

Service是一种程序,它可以运行很长的时间,相当于后台的一个服务。Service组件运行时不可见,但它负责更新数据源和可见的Activity,以及触发通知。当你的Activity已经不处于激活状态或不可见时,它们常用来执行一些需要持续运行的处理。Service is a program that can run for a long time, which is equivalent to a service in the background. The Service component is not visible at runtime, but it is responsible for updating data sources and visible Activities, as well as triggering notifications. They are often used to perform some processing that needs to run continuously when your Activity is no longer active or visible.

Content ProvIDer是内容提供者,提供共享的数据存储。可用来管理和共享应用程序的数据库,可通过它来共享自己的数据给外部调用,给第三方应用数据访问的接口。Content Provider is a content provider that provides shared data storage. A database that can be used to manage and share applications, through which you can share your own data to external calls, and provide an interface for third-party application data access.

Broadcast Receiver:接收一种或者多种Intent作为触发时间,接收相关消息,做一些简单处理,转换成一条Notification,统一了Android的事件广播模型。通过创建和注册一个Broadcast Receiver,应用程序可以监听符合特定条件的广播的Intent。BroadcastReceiver会自动的启动你的Android应用程序去响应新来的Intent。Broadcast Receiver: Receive one or more Intents as the trigger time, receive related messages, do some simple processing, convert them into a Notification, and unify the Android event broadcast model. By creating and registering a Broadcast Receiver, an application can listen for broadcast Intents that meet certain criteria. BroadcastReceiver will automatically start your Android application to respond to the new incoming Intent.

Android系统中的manifest文件可以理解为应用清单,每个应用的根目录中都必须包含一个,并且文件名必须一模一样。这个文件中包含了SDK的配置信息,系统需要根据里面的内容运行SDK的代码,显示界面。The manifest file in the Android system can be understood as an application manifest, which must be included in the root directory of each application, and the file name must be exactly the same. This file contains the configuration information of the SDK, and the system needs to run the code of the SDK according to the content inside to display the interface.

manifest文件主要有以下作用:The manifest file mainly has the following functions:

1、为应用的Java软件包命名。软件包名称充当应用的唯一标识符。这就是我们的apk的名字,通常我们的名字都是类似"com.Android.gles3jni"这种,和Java类名类似,目的是确定使其成为一个唯一值。1. Name the Java package of the application. The package name acts as a unique identifier for the app. This is the name of our apk, usually our name is like "com.Android.gles3jni", similar to the Java class name, the purpose is to make it a unique value.

2、描述应用的各个组件,包括构成应用的Activity、服务、广播接收器和内容提供程序。它还为实现每个组件的类命名并发布其功能,例如它们可以处理的Intent消息。这些声明向Android系统告知有关组件以及可以启动这些组件的条件的信息。2. Describe the various components of the application, including the activities, services, broadcast receivers, and content providers that make up the application. It also names the classes that implement each component and publishes their functionality, such as the Intent messages they can handle. These declarations tell the Android system about components and the conditions under which those components can be started.

3、确定托管应用组件的进程。3. Determine the process hosting the application components.

4、声明应用必须具备哪些权限才能访问API中受保护的部分并与其他应用交互。还声明其他应用与该应用组件交互所需具备的权限4. Declare which permissions the application must have to access protected parts of the API and interact with other applications. Also declares the permissions that other apps need to interact with the app's components

5、列出Instrumentation类,这些类可在应用运行时提供分析和其他信息。这些声明只会在应用处于开发阶段时出现在清单中,在应用发布之前将移除。5. List the Instrumentation classes that provide analysis and other information while the application is running. These declarations will only appear in the manifest while the app is in development and will be removed before the app is published.

6、声明应用所需的最低Android API级别6. Declare the minimum Android API level required by the application

7、列出应用必须链接到的库。7. List the libraries that the application must link against.

因此,想要修改进程名,就需要得到每个SDK的manifest文件。在本实施例中,调用的SDK是以打包的形式存在的,因此需要首先对SDK进行解压,得到manifest文件。然后,将所有manifest文件里面的进程名均修改为相同的进程名,然后再将所有manifest文件进行合并。这样,打包后的SDK在编译运行时,只需要建立一个进程就可以完成,无需建立多个进程,从而减少了系统资源的浪费。Therefore, if you want to modify the process name, you need to get the manifest file of each SDK. In this embodiment, the invoked SDK exists in a packaged form, so the SDK needs to be decompressed first to obtain a manifest file. Then, change the process names in all the manifest files to the same process name, and then merge all the manifest files. In this way, when compiling and running the packaged SDK, only one process needs to be established, and there is no need to establish multiple processes, thereby reducing the waste of system resources.

对于进程名的修改,可以采用原来就有的进程名,也可以采用新的进程名。For the modification of the process name, the original process name can be adopted, and a new process name can also be adopted.

在本说明书的一个或者多个实施例中,将所述第一manifest文件中的进程名以及所述多个第二manifest文件中的进程名修改为相同的进程名,具体可以包括:In one or more embodiments of this specification, modifying the process name in the first manifest file and the process names in the plurality of second manifest files to the same process name may specifically include:

获取所述第一manifest文件中的多个进程名和所述多个第二manifest文件中的多个进程名;Obtain a plurality of process names in the first manifest file and a plurality of process names in the plurality of second manifest files;

确定主进程名,所述主进程名为所述第一manifest文件中的多个进程名中的一个,或者,所述主进程名为所述多个第二manifest文件中的多个进程名中的一个;Determine the main process name, the main process name is one of the multiple process names in the first manifest file, or the main process name is one of the multiple process names in the multiple second manifest files one of;

将所述第二manifest文件中的多个进程名修改为所述主进程名;Modifying multiple process names in the second manifest file to the main process name;

将所述多个第二manifest文件中的多个进程名修改为所述主进程名。Modifying multiple process names in the multiple second manifest files to the main process name.

上述的实施例中,提供了一种修改manifest文件中进程名的方法,可以随机的选择第一manifest文件中的多个进程名中的一个,或者,所述多个第二manifest文件中的多个进程名中的一个作为主进程名。然后在将所述第一manifest文件中的多个进程名和所述多个第二manifest文件中的多个进程名全部修改为主进程名。In the above embodiment, a method for modifying the process name in the manifest file is provided, which can randomly select one of the multiple process names in the first manifest file, or multiple process names in the multiple second manifest files One of the process names is used as the main process name. Then modify all the process names in the first manifest file and the process names in the multiple second manifest files to the main process name.

需要注意的是,一个manifest文件中可能存在多个进程名,这是因为一个SDK可能包括多个Android的组件,而不同的组件也可能运行在不同的进程中。因此,需要对一个manifest文件中的多个进程名全部进行修改。It should be noted that there may be multiple process names in a manifest file, because an SDK may include multiple Android components, and different components may also run in different processes. Therefore, it is necessary to modify all the process names in a manifest file.

基于同样的思路,本说明书实施例还提供了上述方法对应的装置。图2为本说明书实施例提供的对应于图1的一种修改SDK中文件名的装置的结构示意图。如图2所示,该装置可以包括:Based on the same idea, the embodiment of this specification also provides a device corresponding to the above method. FIG. 2 is a schematic structural diagram of an apparatus for modifying file names in the SDK corresponding to FIG. 1 provided by the embodiment of this specification. As shown in Figure 2, the device may include:

第一获取模块201,用于获取第一文件名信息;所述第一文件名信息用于表示需要发送给程序接入端的第一SDK中的文件的文件名;The first obtaining module 201 is used to obtain the first file name information; the first file name information is used to indicate the file name of the file in the first SDK that needs to be sent to the program access terminal;

第二获取模块202,用于获取第二文件名信息;所述第二文件名信息用于表示所述程序接入端已存储的第二SDK中的文件的文件名;The second acquiring module 202 is configured to acquire second file name information; the second file name information is used to indicate the file name of the file in the second SDK stored by the program access terminal;

冲突文件确定模块203,用于基于所述第一文件名信息与所述第二文件名信息,确定所述第一SDK中的冲突文件;所述冲突文件的文件名与所述第二SDK中的文件的文件名相同;A conflicting file determining module 203, configured to determine a conflicting file in the first SDK based on the first file name information and the second file name information; the file name of the conflicting file is the same as that in the second SDK. The file name of the file is the same;

文件名修改模块204,用于修改所述冲突文件的文件名。The file name modifying module 204 is configured to modify the file name of the conflicting file.

图2的装置,在将第一SDK发送至程序接入端之前,首先获取程序接入端存储的第二SDK,第一SDK框和第二SDK的包名相同,然后对比第一SDK和第二SDK的中的文件的文件名是否相同。如果相同,就修改第一SDK的文件名,从而避免第一SDK在程序接入端中进行编译的时候,与第二SDK发生冲突的问题出现。上述方法可以有效的解决同一机器中存在两个不同版本的SDK,而发生版本冲突不兼容的问题,与现有技术中通过人为的升级软件低版本的解决方法相比,提高了程序接入的处理效率。The device in Figure 2, before sending the first SDK to the program access terminal, first obtains the second SDK stored in the program access terminal, the package names of the first SDK box and the second SDK are the same, and then compares the first SDK and the second SDK Whether the file names of the files in the two SDKs are the same. If they are the same, modify the file name of the first SDK, so as to avoid the conflict between the first SDK and the second SDK when compiling in the program access terminal. The above method can effectively solve the problem that there are two different versions of SDK in the same machine, and the problem of version conflict and incompatibility occurs. Processing efficiency.

可选的,在所述获取第一文件名信息之前,所述装置还可以包括:Optionally, before the obtaining of the first file name information, the device may further include:

第一版本获取模块,用于获取第一SDK的第一版本号信息;The first version obtaining module is used to obtain the first version number information of the first SDK;

第二SDK确定模块,用于根据所述第一SDK的包名确定所述第二SDK,所述第二SDK的包名与所述第一SDK的包名相同;The second SDK determination module is configured to determine the second SDK according to the package name of the first SDK, the package name of the second SDK is the same as the package name of the first SDK;

第二版本获取模块,用于获取所述第二SDK的第二版本号信息;a second version obtaining module, configured to obtain the second version number information of the second SDK;

判断模块,用于基于所述第一版本号信息和所述第二版本号信息,判断所述第一SDK和所述第二SDK的版本是否相同,得到判断结果;A judging module, configured to judge whether the versions of the first SDK and the second SDK are the same based on the first version number information and the second version number information, and obtain a judgment result;

所述第一获取模块201,具体可以用于:当所述判断结果表示当所述第一SDK和所述第二SDK的版本不同时,获取所述第一文件名信息。The first obtaining module 201 may be specifically configured to: obtain the first file name information when the judgment result indicates that the versions of the first SDK and the second SDK are different.

可选的,所述装置还可以包括:Optionally, the device may also include:

引用语句修改模块,用于根据修改后的所述冲突文件的文件名,修改对于所述冲突文件进行引用的程序语句。The reference statement modification module is used to modify the program statement that refers to the conflict file according to the modified file name of the conflict file.

可选的,所述文件名修改模块204,具体可以用于:在所述冲突文件原有的文件名中增加特定字符串,其中,当所述冲突文件为多个时,多个所述冲突文件的文件名增加的特定字符串相同。Optionally, the file name modification module 204 may be specifically configured to: add a specific character string to the original file name of the conflicting file, wherein, when there are multiple conflicting files, multiple conflicting files The file name of the file is incremented by the same specific string.

可选的,所述装置还可以包括:Optionally, the device may also include:

多个SDK确定模块,用于确定需要发送给所述程序接入端的多个SDK,所述多个SDK和所述第一SDK用于共同实现第一服务;A plurality of SDK determination modules, configured to determine a plurality of SDKs that need to be sent to the program access terminal, and the plurality of SDKs and the first SDK are used to jointly implement the first service;

封装模块,用于将所述多个SDK和修改后的所述第一SDK进行封装,生成合并SDK;An encapsulation module, configured to encapsulate the plurality of SDKs and the modified first SDK to generate a merged SDK;

发送模块,用于将所述合并SDK发送至所述程序接入端。A sending module, configured to send the merged SDK to the program access terminal.

可选的,所述封装模块,具体可以包括:Optionally, the packaging module may specifically include:

第一资源ID单元,用于获取所述第一SDK中资源文件的第一资源ID;The first resource ID unit is used to obtain the first resource ID of the resource file in the first SDK;

第二资源ID单元,用于获取所述多个SDK中资源文件的第二资源ID;The second resource ID unit is used to obtain the second resource ID of the resource files in the plurality of SDKs;

冲突资源文件确定单元,用于基于所述第一资源ID和所述第二资源ID,确定资源ID相同的冲突资源文件;A conflicting resource file determining unit, configured to determine conflicting resource files with the same resource ID based on the first resource ID and the second resource ID;

资源ID修改单元,用于修改所述冲突资源文件的资源ID,以使一个所述资源ID标识的资源文件是唯一的;A resource ID modifying unit, configured to modify the resource ID of the conflicting resource file, so that a resource file identified by the resource ID is unique;

引用语句修改单元,用于基于修改后的所述冲突资源文件的资源ID,修改对于所述冲突资源文件进行引用的程序语句;A reference statement modifying unit, configured to modify a program statement that refers to the conflict resource file based on the modified resource ID of the conflict resource file;

封装单元,用于将修改后的所述多个SDK和修改后的所述第一SDK进行封装。A packaging unit, configured to package the modified multiple SDKs and the modified first SDK.

可选的,所述封装模块,还可以包括:Optionally, the packaging module may also include:

第一解压单元,用于解压所述修改后的所述第一SDK,得到第一manifest文件;a first decompression unit, configured to decompress the modified first SDK to obtain a first manifest file;

第二解压单元,用于解压所述多个SDK,得到多个第二manifest文件;The second decompression unit is used to decompress the multiple SDKs to obtain multiple second manifest files;

进程名修改单元,用于将所述第一manifest文件中的进程名以及所述多个第二manifest文件中的进程名修改为相同的进程名。A process name modifying unit, configured to modify the process name in the first manifest file and the process names in the plurality of second manifest files to the same process name.

基于同样的思路,本说明书实施例还提供了上述方法对应的设备。Based on the same idea, the embodiment of this specification also provides a device corresponding to the above method.

图3为本说明书实施例提供的对应于图1的一种电子设备的结构示意图。如图3所示,设备300可以包括:FIG. 3 is a schematic structural diagram of an electronic device corresponding to FIG. 1 provided by the embodiment of this specification. As shown in Figure 3, device 300 may include:

至少一个处理器310;以及,at least one processor 310; and,

与所述至少一个处理器通信连接的存储器330;其中,a memory 330 communicatively connected to the at least one processor; wherein,

所述存储器330存储有可被所述至少一个处理器310执行的指令320,所述指令被所述至少一个处理器310执行,以使所述至少一个处理器310能够:The memory 330 stores instructions 320 executable by the at least one processor 310, the instructions are executed by the at least one processor 310, so that the at least one processor 310 can:

获取第一文件名信息;所述第一文件名信息用于表示需要发送给程序接入端的第一SDK中的文件的文件名;Obtain first file name information; the first file name information is used to indicate the file name of the file in the first SDK that needs to be sent to the program access terminal;

获取第二文件名信息;所述第二文件名信息用于表示所述程序接入端已存储的第二SDK中的文件的文件名;Obtaining second file name information; the second file name information is used to indicate the file name of the file in the second SDK stored by the program access terminal;

基于所述第一文件名信息与所述第二文件名信息,确定所述第一SDK中的冲突文件;所述冲突文件的文件名与所述第二SDK中的文件的文件名相同;Determine the conflicting file in the first SDK based on the first file name information and the second file name information; the file name of the conflicting file is the same as the file name of the file in the second SDK;

修改所述冲突文件的文件名。Modify the filename of the conflicting file.

图3的电子设备,在将第一SDK发送至程序接入端之前,首先获取程序接入端存储的第二SDK,第一SDK框和第二SDK的包名相同,然后对比第一SDK和第二SDK的中的文件的文件名是否相同。如果相同,就修改第一SDK的文件名,从而避免第一SDK在程序接入端中进行编译的时候,与第二SDK发生冲突的问题出现。上述方法可以有效的解决同一机器中存在两个不同版本的SDK,而发生版本冲突不兼容的问题,与现有技术中通过人为的升级软件低版本的解决方法相比,提高了程序接入的处理效率。The electronic device in Figure 3, before sending the first SDK to the program access terminal, first obtains the second SDK stored in the program access terminal, the package name of the first SDK box and the second SDK are the same, and then compares the first SDK and the second SDK. Whether the file name of the file in the second SDK is the same. If they are the same, modify the file name of the first SDK, so as to avoid the conflict between the first SDK and the second SDK when compiling in the program access terminal. The above method can effectively solve the problem that there are two different versions of SDK in the same machine, and the problem of version conflict and incompatibility occurs. Processing efficiency.

本说明书实施例还提供了一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现上述的修改SDK中文件名的方法。The embodiment of this specification also provides a computer-readable medium, on which computer-readable instructions are stored, and the computer-readable instructions can be executed by a processor to implement the above-mentioned method for modifying a file name in the SDK.

在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable GateArray,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware DescriptionLanguage)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(RubyHardware Description Language)等,目前最普遍使用的是VHDL(Very-High-SpeedIntegrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, the improvement of a technology can be clearly distinguished as an improvement in hardware (for example, improvements in circuit structures such as diodes, transistors, and switches) or improvements in software (improvement in method flow). However, with the development of technology, the improvement of many current method flows can be regarded as the direct improvement of the hardware circuit structure. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (Programmable Logic Device, PLD) (such as a Field Programmable Gate Array (Field Programmable Gate Array, FPGA)) is such an integrated circuit, and its logic function is determined by programming the device by a user. It is programmed by the designer to "integrate" a digital system on a PLD, instead of asking a chip manufacturer to design and make a dedicated integrated circuit chip. Moreover, nowadays, instead of making integrated circuit chips by hand, this kind of programming is mostly realized by "logic compiler (logic compiler)" software, which is similar to the software compiler used when writing programs. The original code of the computer must also be written in a specific programming language, which is called a hardware description language (Hardware Description Language, HDL), and there is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language) , AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., currently the most commonly used is VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. It should also be clear to those skilled in the art that only a little logical programming of the method flow in the above-mentioned hardware description languages and programming into an integrated circuit can easily obtain a hardware circuit for realizing the logic method flow.

控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller may be implemented in any suitable way, for example the controller may take the form of a microprocessor or processor and a computer readable medium storing computer readable program code (such as software or firmware) executable by the (micro)processor , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers, and embedded microcontrollers, examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic. Those skilled in the art also know that, in addition to realizing the controller in a purely computer-readable program code mode, it is entirely possible to make the controller use logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded The same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in it for realizing various functions can also be regarded as structures within the hardware component. Or even, means for realizing various functions can be regarded as a structure within both a software module realizing a method and a hardware component.

上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules, or units described in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementing device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Combinations of any of these devices.

为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, when describing the above devices, functions are divided into various units and described separately. Of course, when implementing the present application, the functions of each unit can be implemented in one or more pieces of software and/or hardware.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM. Memory is an example of computer readable media.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带式磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, A magnetic tape cartridge, magnetic tape disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes Other elements not expressly listed, or elements inherent in the process, method, commodity, or apparatus are also included. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。This application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.

本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant parts, refer to part of the description of the method embodiment.

以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above descriptions are only examples of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may occur in this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims (9)

1. A method of modifying file names in an SDK, comprising:
acquiring first file name information; the first file name information is used for representing the file name of a file in a first SDK which needs to be sent to a program access end;
acquiring second file name information; the second file name information is used for representing the file name of a file in a second SDK stored by the program access end; the first SDK and the second SDK have the same packet name;
determining a conflicting file in the first SDK based on the first file name information and the second file name information; the conflict file is represented by comparing the file name corresponding to the first file name information with the file name corresponding to the second file name information, and screening out the file names of the files with the same file name; the file name of the conflict file is the same as the file name of the file in the second SDK;
modifying the file name of the conflict file specifically comprises the following steps: adding a specific character string in the original file name of the conflict file;
setting a mapping relation, and mapping the original file of the conflict file to the modified file;
the method further comprises the following steps:
determining a plurality of SDKs which need to be sent to the program access terminal, wherein the plurality of SDKs and the first SDK are used for jointly realizing a first service;
packaging the plurality of SDKs and the modified first SDK to generate a combined SDK;
and sending the combined SDK to the program access end.
2. The method of claim 1, further comprising, prior to said obtaining first filename information:
acquiring first version number information of the first SDK;
determining the second SDK according to the packet name of the first SDK, wherein the packet name of the second SDK is the same as the packet name of the first SDK;
acquiring second version number information of the second SDK;
judging whether the versions of the first SDK and the second SDK are the same or not based on the first version number information and the second version number information to obtain a judgment result;
the acquiring of the first file name information specifically includes:
and when the judgment result shows that the versions of the first SDK and the second SDK are different, acquiring the first file name information.
3. The method according to claim 1, wherein the modifying the filename of the conflicting file specifically comprises:
and adding specific character strings in the original file names of the conflict files, wherein when the conflict files are multiple, the added specific character strings of the file names of the multiple conflict files are the same.
4. The method of claim 1, further comprising, after said modifying the filename of the conflicting file:
and modifying the program statement for referencing the conflict file according to the modified file name of the conflict file.
5. The method of claim 1, wherein the encapsulating the plurality of SDKs and the modified first SDK comprises:
acquiring a first resource ID of a resource file in the first SDK;
acquiring second resource IDs of resource files in the plurality of SDKs;
determining a conflicting resource file with the same resource ID based on the first resource ID and the second resource ID;
modifying the resource IDs of the conflicting resource files such that a resource file identified by one of the resource IDs is unique;
modifying a program statement for referencing the conflicted resource file based on the modified resource ID of the conflicted resource file;
and packaging the modified plurality of SDKs and the modified first SDK.
6. The method of claim 5, the encapsulating the plurality of SDKs and the modified first SDK, further comprising:
decompressing the modified first SDK to obtain a first manifest file;
decompressing the plurality of SDKs to obtain a plurality of second manifest files;
and modifying the process name in the first manifest file and the process names in the plurality of second manifest files into the same process name.
7. An apparatus for modifying a file name in an SDK, comprising:
the first acquisition module is used for acquiring first file name information; the first file name information is used for representing the file name of a file in a first SDK which needs to be sent to a program access end;
the second acquisition module is used for acquiring second file name information; the second file name information is used for representing the file name of a file in a second SDK stored by the program access terminal; the first SDK and the second SDK have the same packet name;
a conflict file determining module, configured to determine a conflict file in the first SDK based on the first file name information and the second file name information; the file name of the conflict file is the same as the file name of the file in the second SDK; the conflict file is represented by comparing the file name corresponding to the first file name information with the file name corresponding to the second file name information, and screening out the file names of the files with the same file name;
the file name modifying module is used for modifying the file name of the conflict file; adding a specific character string in the original file name of the conflict file; setting a mapping relation, and mapping the original file of the conflict file to the modified file;
a determining module, configured to determine multiple SDKs that need to be sent to the program access terminal, where the multiple SDKs and the first SDK are used to jointly implement a first service;
the generating module is used for packaging the plurality of SDKs and the modified first SDK to generate a combined SDK;
and the sending module is used for sending the combined SDK to the program access end.
8. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring first file name information; the first file name information is used for representing the file name of a file in a first SDK which needs to be sent to a program access end;
acquiring second file name information; the second file name information is used for representing the file name of a file in a second SDK stored by the program access terminal; the first SDK and the second SDK have the same packet name;
determining a conflicting file in the first SDK based on the first file name information and the second file name information; the conflict file is represented by comparing the file name corresponding to the first file name information with the file name corresponding to the second file name information, and screening out the file names of the files with the same file name; the file name of the conflict file is the same as the file name of the file in the second SDK;
modifying the file name of the conflict file specifically comprises the following steps:
adding a specific character string in the original file name of the conflict file;
setting a mapping relation, and mapping the original file of the conflict file to the modified file;
determining a plurality of SDKs which need to be sent to the program access terminal, wherein the plurality of SDKs and the first SDK are used for jointly realizing a first service;
packaging the plurality of SDKs and the modified first SDK to generate a combined SDK;
and sending the combined SDK to the program access end.
9. A computer readable medium having stored thereon computer readable instructions executable by a processor to implement the method of modifying filenames in an SDK of any of claims 1 to 6.
CN201911273604.2A 2019-12-12 2019-12-12 Method and device for modifying file name in SDK (software development kit) and electronic equipment Active CN110941443B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911273604.2A CN110941443B (en) 2019-12-12 2019-12-12 Method and device for modifying file name in SDK (software development kit) and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911273604.2A CN110941443B (en) 2019-12-12 2019-12-12 Method and device for modifying file name in SDK (software development kit) and electronic equipment

Publications (2)

Publication Number Publication Date
CN110941443A CN110941443A (en) 2020-03-31
CN110941443B true CN110941443B (en) 2023-03-17

Family

ID=69910901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911273604.2A Active CN110941443B (en) 2019-12-12 2019-12-12 Method and device for modifying file name in SDK (software development kit) and electronic equipment

Country Status (1)

Country Link
CN (1) CN110941443B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552510B (en) * 2020-04-24 2023-05-02 北京字节跳动网络技术有限公司 File construction method and device, electronic equipment and computer readable storage medium
CN113688102A (en) * 2020-05-19 2021-11-23 腾讯科技(深圳)有限公司 File name modification method and device and storage medium
CN111858500A (en) * 2020-08-05 2020-10-30 北京酷豹科技有限公司 Electronic image naming method, device, device and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4875159A (en) * 1987-12-22 1989-10-17 Amdahl Corporation Version management system using plural control fields for synchronizing two versions of files in a multiprocessor system
US5600834A (en) * 1993-05-14 1997-02-04 Mitsubishi Electric Information Technology Center America, Inc. Method and apparatus for reconciling different versions of a file
US6564369B1 (en) * 1998-08-20 2003-05-13 Pearson Technical Software, Inc. Conflict checking using configuration images
JP2013186779A (en) * 2012-03-09 2013-09-19 Nec Corp Information processor and program execution method

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6591418B2 (en) * 1999-03-26 2003-07-08 Dell U.S.A., L.P. Factory software management system
CN105574000B (en) * 2014-10-08 2019-11-05 中兴通讯股份有限公司 Method and device for expanding APK file application
CN109542445A (en) * 2017-08-01 2019-03-29 北京京东尚科信息技术有限公司 A kind of method and apparatus that Android plug-in unit melts hair
CN107589947A (en) * 2017-08-02 2018-01-16 成都极娱网络科技有限公司 A kind of SDK cut-in methods, client and system
CN107844301A (en) * 2017-12-12 2018-03-27 苏州蜗牛数字科技股份有限公司 A kind of Android application channel closes bag method and device
CN108037927B (en) * 2017-12-29 2020-10-30 有米科技股份有限公司 Development kit packaging method, system, readable storage medium and computer equipment
CN109683954A (en) * 2018-12-29 2019-04-26 北京小米移动软件有限公司 The library lib integrated approach, device and storage medium
CN110457045B (en) * 2019-08-16 2023-05-16 百度在线网络技术(北京)有限公司 Component combining and compiling method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4875159A (en) * 1987-12-22 1989-10-17 Amdahl Corporation Version management system using plural control fields for synchronizing two versions of files in a multiprocessor system
US5600834A (en) * 1993-05-14 1997-02-04 Mitsubishi Electric Information Technology Center America, Inc. Method and apparatus for reconciling different versions of a file
US6564369B1 (en) * 1998-08-20 2003-05-13 Pearson Technical Software, Inc. Conflict checking using configuration images
JP2013186779A (en) * 2012-03-09 2013-09-19 Nec Corp Information processor and program execution method

Also Published As

Publication number Publication date
CN110941443A (en) 2020-03-31

Similar Documents

Publication Publication Date Title
CN110502222B (en) AAR method, apparatus, medium, and device for outbound dependency on internal base repository
CN107092475B (en) Calling method and device of interactive control
CN107045438B (en) Application top view processing method, device and component
CN107506181A (en) Business processing, data processing method, device and electronic equipment
CN110764748B (en) Code calling method, device, terminal and storage medium
CN110941443B (en) Method and device for modifying file name in SDK (software development kit) and electronic equipment
CN108647032B (en) Application loading method and apparatus, computer apparatus and computer-readable storage medium
CN111782300A (en) Data processing method, device, equipment and system
CN108595246B (en) Method, device and equipment for running application
CN106775781B (en) Method and device for reducing application installation packages and electronic equipment
CN111090425B (en) Program packaging method and device and electronic equipment
CN108170430B (en) Interface display method and system
CN113407165A (en) SDK generation and self-upgrade method, device, readable medium and equipment
CN110502251B (en) Application installation method and device
CN111045746B (en) Code expansion method and framework
CN109409037B (en) Method, device and equipment for generating data confusion rule
CN113709171B (en) Method and device for cross-component state communication
WO2024221415A1 (en) Page rendering method and apparatus, device, and storage medium
CN113448585B (en) Compiling method and device of thread pool, electronic equipment and storage medium
CN110874322A (en) Test method and test server for application program
CN115357762A (en) Data verification method and device, storage medium and electronic equipment
CN105338025B (en) Invocation component method, system, client and concentration assembly method and server
CN112925527B (en) Calling method, calling device, storage medium and electronic equipment
CN117519733B (en) Project deployment method, device, storage medium and electronic device
CN117170669B (en) Page display method based on front-end high-low code fusion

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230110

Address after: 200120 Floor 15, No. 447, Nanquan North Road, China (Shanghai) Pilot Free Trade Zone, Pudong New Area, Shanghai

Applicant after: Alipay.com Co.,Ltd.

Address before: 310000 801-11 section B, 8th floor, 556 Xixi Road, Xihu District, Hangzhou City, Zhejiang Province

Applicant before: Alipay (Hangzhou) Information Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant