Version handling method and device
By obtaining parameter information of the current and historical versions of the interface, the system automatically determines the type and compatibility of the updated content, solving the problem of low efficiency in manually determining the compatibility of new and old versions in existing technologies, and achieving efficient and automatic determination of interface version compatibility.
Patent Information
- Application Number
- CN202111070738.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-13
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2041-09-13
AI Technical Summary
In the process of upgrading the interface version, the existing technology requires manual judgment of the compatibility between the old and new versions, which results in low efficiency in determining compatibility.
A version processing method and device are provided, which automatically determines the update content type and compatibility of the interface by obtaining the parameter information of the current version and historical versions of the target interface, thereby achieving automatic compatibility judgment.
It improves the efficiency of version compatibility determination, reduces the time required for manual judgment, and ensures that compatibility between interface versions is automatically determined and compatibility boundaries are clearly defined.
Smart Images

Figure CN115794141B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a version processing method and device. Background Technology
[0002] During the development or maintenance of business systems, interfaces are frequently used. However, due to various reasons (such as changes in business requirements), it may be necessary to modify these interfaces to generate new versions.
[0003] Currently, when upgrading the interface version, it is necessary to consider the version compatibility issue, that is, to determine whether the new version of the interface is compatible with the previous version of the interface. Therefore, there is an urgent need for a method to determine the compatibility between the new and old versions of the interface. Summary of the Invention
[0004] This invention provides a version processing method and device to determine the compatibility between new and old versions of an interface.
[0005] In a first aspect, embodiments of the present invention provide a version processing method, the method comprising:
[0006] Obtain parameter information for the current version and historical versions of the target interface;
[0007] The update content type corresponding to the target interface is determined based on the parameter information of the current version and the parameter information of the historical version.
[0008] The version compatibility result corresponding to the target interface is determined based on the type of update content.
[0009] In one possible design, the parameter information includes parameter names;
[0010] The step of determining the update content type corresponding to the target interface based on the parameter information of the current version and the parameter information of the historical version includes:
[0011] For each current parameter name in the parameter information of the current version, determine whether there is a target historical parameter name that is the same as the current parameter name in the parameter information of the historical version;
[0012] If there is no target historical parameter name with the same name as the current parameter name in the parameter information of the historical version, then the update content type is determined to be a new interface parameter.
[0013] In one possible design, determining the version compatibility result corresponding to the target interface based on the updated content type includes:
[0014] If the updated content type is a new interface parameter, then the version compatibility result is determined to be compatible with the current version and historical versions.
[0015] In one possible design, the parameter information also includes data type;
[0016] The step of determining the update content type corresponding to the target interface based on the parameter information of the current version and the parameter information of the historical version includes:
[0017] If the parameter information of the historical version contains a target historical parameter name that is the same as the current parameter name, then obtain the data type corresponding to the current parameter name and obtain the data type corresponding to the target historical parameter name;
[0018] If the data type corresponding to the current parameter name is a first preset data type, and the data type corresponding to the target historical parameter name is a second preset data type, then the updated content type is a data type upward change.
[0019] In one possible design, determining the version compatibility result corresponding to the target interface based on the updated content type includes:
[0020] If the updated content type is a data type change upwards, then the version compatibility result is determined to be that the current version and the historical version are incompatible.
[0021] In one possible design, the method further includes:
[0022] Obtain the entity name selected by the user, and obtain the attribute information corresponding to the entity name;
[0023] The parameter name corresponding to the target interface is determined based on the attribute information.
[0024] In a second aspect, embodiments of the present invention provide a version processing device, the device comprising:
[0025] The information acquisition module is used to acquire parameter information for the current version and parameter information for the historical versions of the target interface.
[0026] The processing module is used to determine the update content type corresponding to the target interface based on the parameter information of the current version and the parameter information of the historical version;
[0027] The processing module is also used to determine the version compatibility result corresponding to the target interface based on the updated content type.
[0028] In one possible design, the parameter information includes parameter names;
[0029] The processing module is also used for:
[0030] For each current parameter name in the parameter information of the current version, determine whether there is a target historical parameter name that is the same as the current parameter name in the parameter information of the historical version;
[0031] If there is no target historical parameter name with the same name as the current parameter name in the parameter information of the historical version, then the update content type is determined to be a new interface parameter.
[0032] In one possible design, the processing module is further configured to:
[0033] If the updated content type is a new interface parameter, then the version compatibility result is determined to be compatible with the current version and historical versions.
[0034] In one possible design, the parameter information also includes data type;
[0035] The processing module is also used for:
[0036] If the parameter information of the historical version contains a target historical parameter name that is the same as the current parameter name, then obtain the data type corresponding to the current parameter name and obtain the data type corresponding to the target historical parameter name;
[0037] If the data type corresponding to the current parameter name is a first preset data type, and the data type corresponding to the target historical parameter name is a second preset data type, then the updated content type is a data type upward change.
[0038] In one possible design, the processing module is further configured to:
[0039] If the updated content type is a data type change upwards, then the version compatibility result is determined to be that the current version and the historical version are incompatible.
[0040] In one possible design, the processing module is further configured to:
[0041] Obtain the entity name selected by the user, and obtain the attribute information corresponding to the entity name;
[0042] The parameter name corresponding to the target interface is determined based on the attribute information.
[0043] Thirdly, embodiments of the present invention provide an electronic device, comprising: at least one processor and a memory;
[0044] The memory stores computer-executed instructions;
[0045] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the processing method described in the first aspect and various possible designs of the first aspect.
[0046] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the version processing method described in the first aspect and various possible designs of the first aspect.
[0047] Fifthly, embodiments of the present invention provide a computer program product, including a computer program, which, when executed by a processor, implements the version processing method described in the first aspect and various possible designs of the first aspect.
[0048] This invention provides a version processing method and device. By acquiring the parameter information of the current version of the target interface (i.e., the interface that has undergone version change) and the parameter information of the old version (i.e., the historical version), the method determines the interface change status of the target interface using the parameter information of the current version and the parameter information of the historical version, i.e., determines the update content type corresponding to the target interface. Based on the update content type, the method determines the compatibility between the current version and the historical version of the target interface, i.e., determines whether the new version of the interface is compatible with the historical version of the interface, so as to obtain the version compatibility result corresponding to the target interface and realize the automatic determination of the version compatibility of the interface. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 A schematic diagram of a scenario for the version processing method provided in an embodiment of the present invention;
[0051] Figure 2 Flowchart of the version processing method provided in the embodiments of the present invention Figure 1 ;
[0052] Figure 3 Flowchart of the version processing method provided in the embodiments of the present invention Figure 2 ;
[0053] Figure 4 A schematic diagram illustrating the business entity processing procedure provided in an embodiment of the present invention;
[0054] Figure 5 A schematic diagram of the interface processing procedure provided in the embodiments of the present invention. Figure 1 ;
[0055] Figure 6 A schematic diagram of the interface processing procedure provided in the embodiments of the present invention. Figure 2 ;
[0056] Figure 7 A schematic diagram of the structure of the version processing device provided in an embodiment of the present invention;
[0057] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0059] With version iterations and the demands of distributed microservices and canary deployments, interface compatibility has become a core issue. Currently, determining compatibility between old and new interface versions typically relies on manual judgment by developers, resulting in lengthy verification processes and low efficiency in version compatibility assessment.
[0060] Therefore, to address the aforementioned problems, the technical concept of this invention is to provide a version management system that can perform compatibility analysis on different versions of interfaces based on interface changes, determining whether the old and new versions of the interface are compatible. This achieves automatic version compatibility judgment without manual intervention, improving the efficiency of version compatibility determination. Simultaneously, it can also determine compatibility boundaries, i.e., historical versions of interfaces compatible with the latest version, thereby enabling relevant personnel to understand the compatibility status of different interface versions and determine whether upgrades or downgrades are feasible.
[0061] The technical solutions of this disclosure and how they solve the aforementioned technical problems are explained in detail below with specific examples. These specific examples can be combined with each other, and the same or similar concepts or processes may not be repeated in some examples. Examples of this disclosure will now be described with reference to the accompanying drawings.
[0062] Figure 1 This is a schematic diagram of a scenario for the version processing method provided in an embodiment of the present invention, such as... Figure 1As shown, the user modifies, or changes, the relevant information of interface 1 on electronic device 101, and after entering a confirmation command (for example, clicking...). Figure 1 (Clicking the "Confirm Change" button in (a)) allows electronic device 101 to generate the latest version of Interface 1. Furthermore, electronic device 101 can perform a compatibility analysis between the latest version of Interface 1 and historical versions to determine the corresponding version compatibility results and display these results (e.g., ...). Figure 1 (as shown in (b)).
[0063] Among them, electronic devices can be computers, servers, mobile terminals, and other devices.
[0064] Figure 2 Flowchart of the version processing method provided in the embodiments of the present invention Figure 1 The execution entity in this embodiment can be, for example, Figure 1 Electronic devices in the system. For example... Figure 2 As shown, the method includes:
[0065] S201. Obtain the parameter information of the current version and the parameter information of the historical version corresponding to the target interface.
[0066] In this embodiment, the modified interface is obtained, namely the parameter information of the current version of the target interface and the parameter information of the historical version.
[0067] Among them, the parameter information of the current version of the target interface represents the interface parameter information of the latest version of the target interface.
[0068] Among them, the parameter information of the target interface corresponding to the historical version represents the interface parameter information of the target interface in the old version.
[0069] Alternatively, the number of historical versions corresponding to the target interface can be at least one. Specifically, the historical version can be all historical versions corresponding to the target interface, or one or more of all historical versions. For example, the historical version is the historical version whose generation time is closest to the generation time corresponding to the current version.
[0070] Optional, parameter information, i.e., interface parameter information, includes parameter name and / or data type;
[0071] Specifically, the parameter name represents the name of the parameter (e.g., variable, field) used by the interface. The data category identifies the data type of the parameter used by the interface, including string, floating-point, integer, etc.
[0072] The interface, or target interface, is the entry point for the system to expose its functions. A typical interface is a predicate + object structure. Accessing the interface allows you to obtain the services provided by the system. Examples include "place an order" and "query an order".
[0073] S202. Determine the update content type corresponding to the target interface based on the parameter information of the current version and the parameter information of the historical version.
[0074] S203. Determine the version compatibility result of the target interface based on the type of updated content.
[0075] In this embodiment, for each historical version corresponding to the target interface, the parameter information of the current version of the target interface is compared with the parameter information of the historical version. The changes of the target interface in the current version compared with the target interface in the historical version are used to obtain the update content type of the target interface. The update content type is used to determine whether the target interface in the current version is compatible with the target interface in the historical version, that is, to determine whether the interface of the new and old versions is compatible, thereby obtaining the version compatibility result corresponding to the historical version, that is, obtaining the version compatibility result corresponding to the target interface.
[0076] The version compatibility result includes both version compatible and version incompatible. Specifically, a version compatibility result of "version compatible" indicates that the target interface of the current version is compatible with the target interface of the previous version. A version compatibility result of "version incompatible" indicates that the target interface of the current version is incompatible with the target interface of the previous version.
[0077] Optionally, when there are multiple historical versions, they are sorted according to their generation time, only in ascending order. Following the order of the historical versions, their parameter information is compared sequentially with the parameters of the current version of the target interface to determine compatibility and thus obtain the version compatibility result for that historical version.
[0078] Taking a specific application scenario as an example, the obtained parameter information for historical versions includes parameters for historical version 1, historical version 2, and historical version 3. Historical version 1 was generated on June 23, 2021; historical version 2 on May 23, 2021; and historical version 3 on March 20, 2021. Historical versions 1, 2, and 3 are sorted in ascending order of their generation time. The sorted historical versions are historical version 1, historical version 2, and historical version 3. When comparing the parameter information of the historical versions with the parameters of the current version of the target interface according to the order of the historical versions, the parameter information of historical version 1 is compared with the parameter information of the current version first to determine whether historical version 1 and the current version are compatible, thus obtaining the version compatibility result for historical version 1. Then, the parameter information of historical version 2 is compared with the parameter information of the current version to determine whether historical version 2 and the current version are compatible, thus obtaining the version compatibility result for historical version 2. Finally, the parameter information of historical version 3 is compared with the parameter information of the current version to determine whether historical version 3 and the current version are compatible, thus obtaining the version compatibility result corresponding to historical version 3.
[0079] Furthermore, optionally, during the process of comparing the parameter information of historical versions with the parameters of the current version of the target interface in the order of historical versions, if the version compatibility result for a historical version is determined to be compatible, then the remaining parameter information of historical versions is not further compared with the parameters of the current version of the target interface. If the version compatibility result for a historical version is determined to be incompatible, then the remaining parameter information of historical versions is further compared with the parameters of the current version of the target interface to determine the boundary of version compatibility, that is, to determine the historical versions compatible with the current version.
[0080] Following the above application scenario, if the version compatibility result for historical version 1 is determined to be compatible, it is not necessary to further determine the version compatibility results for historical version 2 and historical version 3. If the version compatibility result for historical version 1 is determined to be incompatible, then it is necessary to further determine whether historical version 2 is compatible with the current version. If the version compatibility result for historical version 2 is determined to be incompatible, then it is necessary to further determine whether historical version 3 is compatible with the current version.
[0081] In this embodiment, relevant personnel can also use the visual interface of interface version management to determine the evolution path of the version, modify the upgrade and downgrade logic, and generate code to improve user satisfaction.
[0082] In this embodiment, interface compatibility analysis is performed based on the parameter information of the historical version of the target interface and the parameter information of the current version to determine whether the old and new versions of the target interface are compatible. Specifically, it determines whether the current version of the target interface is compatible with a certain number of historical versions of the target interface, thus achieving automatic compatibility judgment. Simultaneously, it can also determine which historical version of the target interface the current version is compatible with, thereby identifying the compatibility boundary version. This allows relevant personnel to determine whether an upgrade or downgrade is possible based on the compatibility between versions.
[0083] As described above, the process involves obtaining the parameter information of the current version of the target interface (i.e., the interface that has undergone version changes) and the parameter information of the old version (i.e., the historical version). Using this parameter information, the interface change status of the target interface is determined, i.e., the update content type of the target interface is determined. Based on this update content type, the compatibility between the current version and the historical version of the target interface is determined, i.e., whether the new version of the interface is compatible with the historical version of the interface, so as to obtain the version compatibility result of the target interface and realize the automatic determination of the interface version compatibility.
[0084] Figure 3 Flowchart of the version processing method provided in the embodiments of the present invention Figure 2 This embodiment Figure 2 Based on the implementation examples, relevant information about the entity can be used to determine relevant information about the interface. This process will be described below with reference to a specific embodiment. For example... Figure 3 As shown, the method includes:
[0085] S301. Obtain the entity name selected by the user and obtain the attribute information corresponding to the entity name.
[0086] In this embodiment, when defining an interface, such as a target interface, it is necessary to define the parameters of the target interface. This can be done using related entities, i.e., obtaining the interface name input by the user and displaying a page including a list of entities. The user can select an entity related to the interface name from this entity list, i.e., the entity name. After obtaining the entity name selected by the user, the attribute information corresponding to that entity name is obtained, i.e., the fields included in the entity corresponding to that entity name.
[0087] Among them, an entity, or business entity, is a logical model used to record the processing targets involved in the business process, such as order entity, product entity, customer entity, etc.
[0088] Correspondingly, the attribute information, or fields, corresponding to an entity are components of that entity. For example, the price and recipient in an order entity are attribute information corresponding to that order entity. Of course, the attribute information corresponding to an entity can itself be a business entity; for example, the recipient in an order entity is also an entity.
[0089] Alternatively, relevant personnel can define business entities to standardize terminology and nouns when defining interfaces. Interface field names and enumeration values all originate from these definitions. Furthermore, business entities can inherit from and be composed of each other (e.g., Figure 4 The user can choose whether or not to inherit an existing entity, i.e., a business entity.
[0090] S302. Determine the parameter name corresponding to the target interface based on the attribute information.
[0091] In this embodiment, after determining the attribute information corresponding to the entity name of the target interface, it indicates that the parameter information corresponding to the target interface needs to be determined. The user can then select the required attribute information from the attribute information corresponding to the entity name and determine it as the parameter name corresponding to the target interface. For example, if the user selects the order entity as the entity name and the user selects the price as the attribute information, then the price will be used as the parameter name corresponding to the target interface.
[0092] Optionally, all attributes corresponding to the selected entity name can be used as the parameter names for the target interface.
[0093] In addition, such as Figure 5 As shown, after the user selects whether to inherit from an existing entity, the user selects the parameter name corresponding to the target interface, thus determining the parameter name for the target interface. After determining the parameter name for the target interface, relevant personnel can also enter information such as parameter type, length, and whether it is required. Of course, users can also customize the parameter name of the target interface when defining it.
[0094] In this embodiment, when defining the target interface, relevant personnel can select the corresponding entity, i.e., the entity name, through the relevant interface, and use the attribute information of the entity name as the interface field, i.e. the parameter name of the target interface, thereby reducing the risk of non-standard parameter naming due to manual parameter naming, i.e., reducing human error.
[0095] In this embodiment, when the parameter name of the target interface is determined by an entity, the parameter name can be displayed using a first style. When the parameter name of the target interface is customized, the parameter name can be displayed using a second style. The first style is different from the second style, thereby enabling the differentiation of parameter names.
[0096] Optionally, after the interface definition is complete, the associated entity can be retrieved, i.e., the entity name selected by the user, and the interface parameter information (e.g., parameter name, data type, etc.). Based on the predefined document template, the corresponding positions in the document template are populated according to the entity and parameter information to obtain the corresponding interface document. After generation, relevant personnel can also be notified via email.
[0097] S303. Obtain the parameter information of the current version and the parameter information of the historical version corresponding to the target interface.
[0098] S304. Determine the update content type corresponding to the target interface based on the parameter information of the current version and the parameter information of the historical version.
[0099] Optionally, the update content type corresponding to the target interface can be determined based on the parameter information of the current version and the parameter information of historical versions, including:
[0100] For each current parameter name in the current version's parameter information, determine whether there exists a target historical parameter name that is the same as the current parameter name in the parameter information of the previous version.
[0101] If there is no target historical parameter name with the same name as the current parameter name in the parameter information of the historical version, then the update content type is determined to be a new interface parameter.
[0102] Specifically, when determining the compatibility between the current version and historical versions, for each parameter name in the parameter information of the current version, i.e. the current parameter name, it is determined whether there is a historical parameter name with the same name as the current parameter name in the parameter information of the historical version, i.e. the target historical parameter name. If it does not exist, it indicates that the parameter corresponding to the current parameter name is a newly added interface parameter, and the update content type is determined to be a newly added interface parameter.
[0103] Correspondingly, if the update content type is a new interface parameter, the version compatibility result is determined to be that the current version and the historical version are compatible. That is, if the update content type corresponding to the target interface only includes new interface parameters, it indicates that the target interface of the current version is compatible with the target interface of the historical version. Therefore, the version compatibility result of the target interface, i.e. the historical version, is determined to be that the current version and the historical version are compatible.
[0104] In this embodiment, after modifying the parameters of the interface to change the interface, the compatibility of the changed interface, i.e., the new version of the interface, can be determined. For example, adding a "Total Items" field to the "Place Order (create_order)" interface of version v1.0.0, and making this field mandatory, results in the "Place Order (create_order)" interface of version v1.0.1. The electronic device displays an interface preview interface to show the effect after the interface is generated. After the operator confirms, the compatibility analysis will analyze that this interface has added a new field, which is mandatory, and no other parameters have been modified or deleted. Therefore, the new version of the interface is compatible with the historical version of the interface, and the compatibility result is displayed to the operator so that the operator can confirm whether to accept it. The electronic device also records the content added to the "Place Order (create_order)" interface of version v1.0.1, and is compatible with version v1.0.0.
[0105] Optionally, the update content type corresponding to the target interface can be determined based on the parameter information of the current version and the parameter information of historical versions, including:
[0106] If a target historical parameter name with the same name as the current parameter name exists in the parameter information of the historical version, then obtain the data type corresponding to the current parameter name and the data type corresponding to the target historical parameter name.
[0107] If the data type corresponding to the current parameter name is the first preset data type, and the data type corresponding to the target historical parameter name is the second preset data type, then the updated content type is a data type upward change.
[0108] Specifically, when determining compatibility between the current version and historical versions, for each parameter name in the parameter information of the current version (i.e., the current parameter name), it is determined whether there exists a historical parameter name with the same name in the parameter information of the historical version (i.e., the target historical parameter name). If there is a historical parameter name with the same name in the parameter information of the historical version (i.e., the target historical parameter name), the data type corresponding to the current parameter name is further determined. If the data type of the parameter corresponding to the current parameter name is different from the data type of the parameter corresponding to the target historical parameter name, it is determined whether they are the same. If they are different, and the data type corresponding to the current parameter name is a first preset data type, and the data type corresponding to the target historical parameter name is a second preset data type, it indicates that the data type corresponding to the current parameter name and the data type corresponding to the target historical parameter name are incompatible. Therefore, the update content type is determined to be a data type upward change.
[0109] The first preset data type can be floating-point, and the second preset data type can be integer. Of course, the first and second preset data types can also be other data types, as long as the first preset data type is incompatible with the second preset data type.
[0110] Correspondingly, if the updated content type is a data type change upwards, the version compatibility result is determined to be that the current version and the historical version are incompatible. That is, if the updated content type corresponding to the target interface includes a data type change upwards, it indicates that the target interface of the current version is incompatible with the target interface of the historical version. Therefore, the version compatibility result of the target interface, i.e. the historical version, is determined to be that the current version and the historical version are incompatible.
[0111] For example, the current version of the "Place Order" interface is v1.0.1. Due to changes in business requirements, this interface needs to be modified. The original order total amount type was changed from an integer without decimals to a floating-point type, retaining two hours. The resulting latest version is v1.1.0, and v1.0.1 becomes a historical version. Because v1.0.1 requires the order total amount to be an integer without decimals, while the latest version is a floating-point type, v1.1.0 and v1.0.1 are incompatible. That is, the new version's interface standard cannot access the v1.0.1 interface. The system will automatically analyze the above conclusion. If the operator confirms the interface definition, the system will generate a new version number 1.1.0 and record that it is incompatible with 1.0.1. Analyzing the version path backwards, it is also incompatible with 1.0.0.
[0112] S305. Determine the version compatibility result of the target interface based on the type of updated content.
[0113] In this embodiment, during the development of the interface, the fields corresponding to the interface, i.e., the parameters, can also be validated to avoid vulnerabilities caused by insufficient or inadequate validation of the fields in the interface. Specifically, during validation, validation can be performed according to preset validation rules (e.g., whether the length of the interface field exceeds a threshold) to determine the validation result corresponding to the field.
[0114] The validation rules consist of business entities, custom parameters, interface definitions, and error templates. Furthermore, the validation rules can be modified through a visual interface provided by electronic devices to meet the validation needs of developers.
[0115] Additionally, optionally, the return code is part of the interface and requires maintaining a unified and well-designed return code table. It is defined as a five-character string, divided into two parts: the source of the error and a four-digit number. The source of the error is categorized as A / B / C.
[0116] Specifically, A indicates that the error originates from the user, such as incorrect parameters, an outdated user version, or payment timeout; B indicates that the error originates from the current system, often due to business logic errors or poor program robustness; C indicates that the error originates from a third-party service, such as CDN service errors or message delivery timeouts; the four-digit number ranges from 0001 to 9999, with a 100-digit increment between categories.
[0117] In this embodiment, after the interface development is completed, such as Figure 6 As shown, the electronic device can also generate simulated interface messages, request a specified URL, receive return messages, and call data in a user-friendly manner to achieve online and rapid debugging of the interface.
[0118] In this embodiment, after the interface is completed, the electronic device automatically generates the corresponding Java code and JAR file. The Java code serves as a connection example. The JAR file contains the service provider's interface entity class (VO layer), as well as interface validation logic and standard exception returns. This feature ensures interface standardization. Developers only need to reference the required interface dependency package + version number (GAV) in the pom.xml file to easily implement a usable interface. The JAR file can be executed independently as a service, facilitating system demonstrations or interface confirmation and development by service consumers (e.g., front-end developers).
[0119] In this embodiment, business entities can be defined visually and without code, interfaces can be standardized, and interface validation and compatibility testing can be automated, reducing daily workload and improving software quality.
[0120] Figure 7 This is a schematic diagram of the structure of the version processing device provided in an embodiment of the present invention, such as... Figure 7 As shown, this version of the processing device 700 includes: an information acquisition module 701 and a processing module 702.
[0121] The information acquisition module 701 is used to acquire the parameter information of the current version and the parameter information of the historical version corresponding to the target interface.
[0122] Processing module 702 is used to determine the update content type corresponding to the target interface based on the parameter information of the current version and the parameter information of the historical version.
[0123] The processing module 702 is also used to determine the version compatibility result corresponding to the target interface based on the type of updated content.
[0124] In one possible design, the parameter information includes the parameter name.
[0125] Processing module 702 is also used for:
[0126] For each current parameter name in the current version's parameter information, determine whether there exists a target historical parameter name that is the same as the current parameter name in the parameter information of the previous version.
[0127] If there is no target historical parameter name with the same name as the current parameter name in the parameter information of the historical version, then the update content type is determined to be a new interface parameter.
[0128] In one possible design, the processing module 702 is also used for:
[0129] If the updated content type is a new interface parameter, then the version compatibility result is that the current version and the historical version are compatible.
[0130] In one possible design, the parameter information also includes the data type.
[0131] Processing module 702 is also used for:
[0132] If a target historical parameter name with the same name as the current parameter name exists in the parameter information of the historical version, then obtain the data type corresponding to the current parameter name and the data type corresponding to the target historical parameter name.
[0133] If the data type corresponding to the current parameter name is the first preset data type, and the data type corresponding to the target historical parameter name is the second preset data type, then the updated content type is a data type upward change.
[0134] In one possible design, the processing module 702 is also used for:
[0135] If the updated content type is a data type change upwards, then the version compatibility result is determined to be that the current version and the historical version are incompatible.
[0136] In one possible design, the processing module 702 is also used for:
[0137] Get the entity name selected by the user, and get the attribute information corresponding to the entity name.
[0138] Determine the parameter name corresponding to the target interface based on the attribute information.
[0139] The version processing device provided in this embodiment of the invention can implement the version processing method of the above embodiment. Its implementation principle and technical effect are similar, and will not be described again here.
[0140] Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. For example... Figure 8 As shown, the electronic device 800 of this embodiment includes: a processor 801 and a memory 802;
[0141] Among them, memory 802 is used to store computer-executed instructions;
[0142] The processor 801 is used to execute computer execution instructions stored in the memory to implement the various steps performed by the receiving device in the above embodiments. For details, please refer to the relevant descriptions in the foregoing method embodiments.
[0143] Alternatively, the memory 802 can be either standalone or integrated with the processor 801.
[0144] When the memory 802 is set up independently, the electronic device also includes a bus 803 for connecting the memory 802 and the processor 801.
[0145] This invention also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the version processing method described above.
[0146] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the version processing method described above.
[0147] In the several embodiments provided by this invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0148] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0149] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0150] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application.
[0151] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0152] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0153] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0154] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0155] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0156] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A version processing method, characterized in that, include: Obtain parameter information for the current version and parameter information for historical versions corresponding to the target interface; the parameter information includes parameter name and data type; the number of historical versions is at least one, and the historical versions are sorted from latest to earliest generation time; For each current parameter name in the parameter information of the current version, determine whether there is a target historical parameter name that is the same as the current parameter name in the parameter information of the historical version; If there is no target historical parameter name in the parameter information of the historical version that is the same as the current parameter name, then the update content type corresponding to the target interface is determined to be a new interface parameter, and the current version and the historical version are determined to be compatible. If the parameter information of the historical version contains a target historical parameter name that is the same as the current parameter name, the data type corresponding to the current parameter name is a first preset data type, and the data type corresponding to the target historical parameter name is a second preset data type, and the first preset data type is incompatible with the second preset data type, then it is determined that the update content type corresponding to the target interface is a data type upward change, and it is determined that the current version and the historical version are incompatible. The comparison steps described above are executed sequentially according to the order of the historical versions. When any historical version is determined to be compatible with the current version, the comparison of the remaining historical versions is stopped. When any historical version is determined to be incompatible with the current version, the comparison of the next historical version continues to determine the interface of the historical version that is compatible with the interface of the latest version.
2. The method according to claim 1, characterized in that, The method further includes: Obtain the entity name selected by the user, and obtain the attribute information corresponding to the entity name; The parameter name corresponding to the target interface is determined based on the attribute information.
3. A version processing device, characterized in that, include: The information acquisition module is used to acquire parameter information of the current version and parameter information of the historical version corresponding to the target interface; the parameter information includes parameter name and data type; the number of historical versions is at least one, and the historical versions are sorted from latest to earliest generation time; The processing module is used to determine, for each current parameter name in the parameter information of the current version, whether there is a target historical parameter name that is the same as the current parameter name in the parameter information of the historical version; If there is no target historical parameter name in the parameter information of the historical version that is the same as the current parameter name, then the update content type corresponding to the target interface is determined to be a new interface parameter, and the current version and the historical version are determined to be compatible. If the parameter information of the historical version contains a target historical parameter name that is the same as the current parameter name, the data type corresponding to the current parameter name is a first preset data type, and the data type corresponding to the target historical parameter name is a second preset data type, and the first preset data type is incompatible with the second preset data type, then it is determined that the update content type corresponding to the target interface is a data type upward change, and it is determined that the current version and the historical version are incompatible. The comparison steps described above are executed sequentially according to the order of the historical versions. When any historical version is determined to be compatible with the current version, the comparison of the remaining historical versions is stopped. When any historical version is determined to be incompatible with the current version, the comparison of the next historical version continues to determine the interface of the historical version that is compatible with the interface of the latest version.
4. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the version processing method as described in any one of claims 1 to 2.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the version processing method as described in any one of claims 1 to 2.
6. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the version processing method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Method and system for managing network management system interfaces in various versions
CN102651696A
Interface comparison method and device for software system
CN110262782A
Dubbo service interface compatibility detection method and device, storage medium and equipment
CN111459492A