IP Library Granted Patent US 12,307,228
Granted Patent B2
US 12,307,228 · App. 17/678,625 · Granted May 20, 2025

Software code change method and apparatus

Inventors: Guangtai Liang (Beijing, CN); Tianyong Wu (Shenzhen, CN); Xiao Cheng (Shanghai, CN); Zeyu Wang (Beijing, CN); Zhao Wei (Gui'an, CN)
Assignee: Huawei Cloud Computing Technologies Co., Ltd.
G06F8/65
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,307,228
App. No.
17/678,625
Granted
May 20, 2025
Kind
B2
Abstract

In a software code change method, an apparatus determines to-be-changed software code and change configuration information according to an instruction of a user. The apparatus selects, from stored changers based on the change configuration information, a plurality of changers to be called to implement changes to the software code, and determines a calling sequence of the plurality of changers and sets attributes of each changer. The apparatus then sequentially calls the plurality of changers according to the calling sequence and based on the attributes of each changer to make changes to the software code.

Claims (40)

1. A software code change method performed by a change apparatus, comprising:

obtaining software code and change configuration information from a user in a library upgrade operation or a software code format change operation, wherein the change configuration information comprises multiple to-be-changed code elements in the software code, change manners of the multiple to-be-changed code elements, and multiple changed code elements corresponding to the multiple to-be-changed code elements; and

sequentially calling the plurality of changers according to the calling sequence to update the software code or change the format of the software code, wherein each changer is configured to change selected to-be-changed code elements in the software code, the selected to-be-changed code elements are of a type corresponding to said each changer, and the changers correspond respectively to different types of code elements, wherein the calling sequence of the plurality of changers is based on the change configuration information, an input of a first called changer of the plurality of changers is the software code, and changed software code of the first called changer is input into a subsequently called changer of the plurality of changers, wherein when there are conflicting changers in the plurality of changers, a change mode for changing the software code is a serial change mode or a partial serial or partial parallel change mode.

2. The method according to claim 1 , wherein a changer of the plurality of changers performs direct change content and delayed change content, and the step of sequentially calling the plurality of changers comprises:

calling the changer to apply the direct change content as input into the changer; and

calling the changer again to apply the delayed change content after calling a last changer in the calling sequence.

3. The method according to claim 2 , wherein the change configuration information further comprises attributes of each changer, and an attribute of said each changer indicates processing performed by each changer on a change on a target line in the software code.

4. The method according to claim 2 , wherein before the step of sequentially calling the plurality of changers, the method further comprises:

determining attributes of each changer based on the calling sequence of the plurality of changers, wherein an attribute of said each changer indicates processing performed by said each changer on a change on a target line in the software code.

5. The method according to claim 2 , further comprising:

determining the direct change content of the changer based on attributes of the changer.

6. The method according to claim 5 , wherein the step of determining the direct change content determines the direct change content of the changer based on a first attribute of the changer, wherein the first attribute of the changer indicates retention or deletion of a change on a first target line of the software code, and the first target line is a line on which the changer and a changer called prior to the changer both change the software code.

7. The method according to claim 5 , wherein the step of determining the direct change content of the changer comprises:

determining the direct change content of the changer based on a second attribute of the changer, wherein the second attribute indicates retention or deletion of a change on a second target line of the software code, and the second target line is a line on which the changer changes the software code and the changer called prior to the changer does not change the software code.

8. The method according to claim 1 , further comprising:

storing an analysis result of the first called changer on the software code, wherein the analysis result comprises a position of each code element in the software code, wherein the subsequently called changer of the plurality of changers reads the stored analysis result and changes the software code.

9. The method according to claim 1 , further comprising:

outputting changed software code generated after the plurality of changers change the software code, and

displaying change positions and change content of changes performed on the software code by the plurality of changers.

10. An apparatus, comprising:

a communication interface;

a memory storing executable instructions; and

a processor configured to execute the executable instructions to:

obtain software code and change configuration information from a user in a library upgrade operation or a software code format change operation, wherein the change configuration information comprises multiple to-be-changed code elements in the software code, multiple change manner of the to-be-changed code elements, and multiple changed code elements corresponding to the multiple to-be-changed code elements; and

sequentially call the plurality of changers based on the calling sequence of the plurality of changers to update the software code or change the format of the software code, wherein each changer is configured to change selected to-be-changed code elements in the software code, the selected to-be-changed code elements are of a type corresponding to said each changer, and the changers correspond respectively to different types of code elements, wherein the calling sequence of the plurality of changers is based on the change configuration information, an input of a first called changer of the plurality of changers is the software code, and changed software code of the first called changer is input into a subsequently called changer of the plurality of changers, wherein when there are conflicting changers in the plurality of changers, a change mode for changing the software code is a serial change mode or a partial serial or partial parallel change mode.

11. The apparatus according to claim 10 , wherein a changer performs direct change content and delayed change content, and wherein the processor is configured to sequentially call the plurality of changers by:

calling the changer according to the calling sequence to apply the direct change content to the software code;

calling the changer again to apply the delayed change content after calling a last changer in the calling sequence.

12. The apparatus according to claim 11 , wherein the change configuration information further comprises attributes of each changer, and an attribute of said each changer indicates processing performed by each changer on a change on a target line in the software code.

13. The apparatus according to claim 11 , wherein before sequentially calling the plurality of changers, the processor is configured to execute the executable instructions to:

determine attributes of each changer based on the calling sequence of the plurality of changers, wherein an attribute of said each changer indicates processing performed by said each changer on a change on a target line in the software code.

14. The apparatus according to claim 11 , wherein the processor is configured to further execute the executable instructions to:

determine the direct change content of the changer based on attributes of the changer.

15. The apparatus according to claim 14 , wherein the processor is configured to determine the direct change content of the changer based on a first attribute of the changer, wherein the first attribute of the changer indicates retention or deletion of a change on a first target line of the software code, and the first target line is a line on which the changer and a changer called prior to the changer both change the software code.

16. The apparatus according to claim 14 , wherein the processor is configured to determine the direct change content of the changer based on a second attribute of the changer, wherein the second attribute of the changer indicates retention or deletion of a change on a second target line of the software code, and the second target line is a line on which the changer changes the software code and the changer called prior to the changer does not change the software code.

17. The apparatus according to claim 10 , wherein the processor is configured to further execute the executable instructions to:

store an analysis result of the first called changer on the software code, wherein the analysis result comprises a position of each code element in the software code, wherein a subsequently called changer of the plurality of changers reads the stored analysis result and changes the software code.

18. The apparatus according to claim 10 , wherein the processor is configured to further execute the executable instructions to:

output changed software code generated after the plurality of changers change the software code, and

display change positions and change content of changes performed on the software code by the plurality of changers.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 24, 2024
From: LIANG, GUANGTAI; WU, TIANYONG; CHENG, XIAO; WANG, ZEYU; WEI, ZHAO
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 068390/0475 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 24, 2024
From: LIANG, GUANGTAI; WU, TIANYONG; CHENG, XIAO; WANG, ZEYU; WEI, ZHAO
To: HUAWEI CLOUD COMPUTING TECHNOLOGIES CO., LTD.
Reel/Frame 068390/0515 →
Priority Claims (2)
CN 201910792544.9 · Aug 26, 2019 · national
CN 201910877510.X · Sep 17, 2019 · national
Continuity (2)
Continuation PCTCN2020111326 · Aug 26, 2020
Related Publication 20220179642A1 · Jun 9, 2022
References Cited (37)
US 6564374B1 · Jaaskelainen, Jr. · 2003 [cited by examiner]
US 6792595B1 · Storistenau · 2004 [cited by examiner]
US 9727623B1 · Catania · 2017 [cited by examiner]
US 10223076B1 · Owen et al. · 2019 [cited by applicant]
US 20030101437A1 · Gritter · 2003 [cited by examiner]
US 20030131342A1 · Bates · 2003 [cited by examiner]
US 20070300215A1 · Bardsley · 2007 [cited by examiner]
US 20100050151A1 · Balasubramanian · 2010 [cited by examiner]
US 20110239201A1 · Vaidya · 2011 [cited by examiner]
US 20110246993A1 · Moir · 2011 [cited by examiner]
US 20120084756A1 · Subramanian · 2012 [cited by examiner]
US 20130047138A1 · Radez · 2013 [cited by examiner]
US 20140215446A1 · Araya et al. · 2014 [cited by applicant]
US 20170161061A1 · Eberlein et al. · 2017 [cited by applicant]
US 20200097389A1 · Smith · 2020 [cited by examiner]
US 20200201608A1 · Wallbaum · 2020 [cited by examiner]
CN 102279873A · 2011 [cited by applicant]
CN 105159715A · 2015 [cited by applicant]
CN 106033391A · 2016 [cited by applicant]
CN 106648618A · 2017 [cited by applicant]
CN 106648636A · 2017 [cited by applicant]
CN 109117164A · 2019 [cited by applicant]
CN 109828808A · 2019 [cited by applicant]
CN 109933326A · 2019 [cited by applicant]
CN 110780897A · 2020 [cited by applicant]
Tao Binxian,“Coderebuilder: the Research and Implementation of an Automated Java Concurrent Program Refactoring Tool”,Nanjing University of Aeronautics and Astronautics, Jan. 2014, with an English abstract, total 59 pag… [cited by applicant]
Hoan Anh Nguyen et al.,“A Graph-based Approach to API Usage Adaptation”,OOPSLA/SPLASH 10, Oct. 17-21, 2010, total 20 pages. [cited by applicant]
Ling Wu et al.,“Transforming Code with Compositional Mappings for API-Library Switching”,2015 IEEE 39th Annual International Computers, Software and Applications Conference, total 10 pages. [cited by applicant]
Sichen Meng et al.,“A History-Based Matching Approach to Identification of Framework Evolution”,2012 IEEE, total 11 pages. [cited by applicant]
Kingsum Chow et al., Semi-automatic update of applications in response to library changes, 1996 IEEE, total 10 pages. [cited by applicant]
Chenglong Wang et al.,“Transforming Programs between APIs with Many-to-Many Mappings”,30th European Conference on Object-Oriented Programming (ECOOP 2016), total 26 pages. [cited by applicant]
Caitlin Sadowski et al.,“Tricorder: Building a Program Analysis Ecosystem”,2015 IEEE/ACM 37th IEEE International Conference on Software Engineering, total 11 pages. [cited by applicant]
Marius Nita et al.,“Using Twinning to Adapt Programs to Alternative APIs”,ICSE 10, May 2-8, 2010, total 10 pages. [cited by applicant]
Sukhee Lee et al., Automated scheduling for clone-based refactoring using a competent GA, Software practice and Experience, Dec. 29, 2010, 30 pages. [cited by applicant]
H Liu et al., Conflict-aware schedule of software refactorings, IET Software, Apr. 24, 2008, 15 pages. [cited by applicant]
Minhaz Fahim Zibran et al., Conflict-aware optimal scheduling of prioritised code clone refactoring, IET Software, Apr. 9, 2013, 20 pages. [cited by applicant]
Miguel P. Monteiro et al., An illustrative example of refactoring object-oriented source code with aspect-oriented mechanisms, Software practice and Experience, Aug. 21, 2007, 36 pages. [cited by applicant]