Unified software development method and system for multiple platforms

Through semantic segmentation and test case library mapping technology, differential codes are generated and encapsulated, the problem of rapid development and iteration difficulty in multi-platform software development is solved, and unified development is realized on multi-platform, reducing development costs and software package volume.

CN118939270BActive Publication Date: 2025-03-25MEDO MONITORING
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410995295.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2025-03-25
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

In the development of multi-platform software, it is difficult to achieve rapid software development and iteration, and the development cost is high, the software package is bloated, and the maintenance difficulty is increased.

Method used

By semantic segmentation of development requirements, a mapping between test case library and development requirements is established, differential code is generated and encapsulated, and a unified development method of multi-platforms is realized.

Benefits of technology

It realizes a unified development method among multiple platforms, saves development time, improves development convenience, reduces development costs, and reduces software package volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939270B_ABST
    Figure CN118939270B_ABST
Patent Text Reader

Abstract

The present invention provides a unified software development method and system for multiple platforms, wherein the method includes the following steps: semantically segmenting development requirements to obtain a semantic description script; matching test cases, establishing a first mapping and compilation model between the semantic description script and the test case; obtaining an SDK corresponding to the compiler, writing a difference description script that is not matched in the semantic description script, using the difference description script as a re-encoding parameter to write to the test case and establish a difference description code; merging the function code and the difference description code to obtain a first compilation code; obtaining a logic description script of an unsegmented element in the development requirements, compiling to obtain a second compilation code; merging the first compilation code and the second compilation code to obtain the main code of the target software platform; obtaining a difference code from the target software platform to the target hardware platform, compiling to obtain a third compilation code; and packaging to obtain the software. The present invention realizes a unified development method between different software platforms and different hardware platforms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of software development, and in particular relates to a unified software development method and system for multiple platforms. Background Art

[0002] During the software development process, different hardware platforms have different business processing or different logic implementation codes. The above different codes need to be reasonably and effectively distinguished according to the characteristics and compatibility of the hardware platforms. One processing method applicable to multiple hardware platforms in the prior art is to encapsulate all differentiated codes into the same software package. The software package is applicable to the corresponding hardware platform by calling the corresponding code to achieve the compatibility of the software with different platforms. However, this processing method will greatly increase the size of the encapsulated software package and with subsequent maintenance and development, the size of the software package will become more bloated.

[0003] In addition, in the current software development field, the generation of each application includes a hybrid architecture. When a new software needs to be developed, developers are required to master multiple development languages ​​and multiple development environments accordingly. Similarly, when new software is produced in the later stage, different versions of the software also need to be developed separately. Especially in a multi-platform environment, the development cycle is long, which is not conducive to the rapid development and iteration of the software, and will also increase the development cost accordingly.

[0004] In view of this, a unified software development method and system for multiple platforms are provided. Summary of the invention

[0005] To this end, the present invention provides a unified software development method and system for multiple platforms, and provides a standardized development process in a multiple platform environment.

[0006] A first aspect of the present invention provides a unified software development method for multiple platforms, comprising the following steps:

[0007] S1. Acquire development requirements, and semantically segment the development requirements to obtain a semantic description script;

[0008] S2, matching multiple test cases whose matching degree with the semantic description script is above a preset value from a test case library, and establishing a first mapping between the semantic description script and the test case;

[0009] Establishing a compilation model of the test case according to the first mapping, each of the compilation models includes a compiler corresponding to multiple target software platforms for the test case and a functional code for implementing the test case;

[0010] S3, obtaining the SDK corresponding to the compiler, writing the difference description script that is not matched in the semantic description script, writing the difference description script into the test case using the difference description script as a re-encoding parameter and establishing a difference description code;

[0011] S4, combining the function code and the difference description code to obtain a first compiled code;

[0012] S5. Obtain an undivided element in the development requirement, obtain a logic description script in the undivided element, and compile to obtain a second compiled code for the logic description script based on the SDK and the compiler;

[0013] S6. Merge the first compiled code and the second compiled code to obtain a main code of a target software platform;

[0014] S7, obtaining a difference code from the target software platform to the target hardware platform, and separately compiling the difference code file to obtain a third compiled code corresponding to the target hardware platform;

[0015] S8. After packaging the main code and the third compiled code, software for the target hardware platform is obtained.

[0016] As a further preferred embodiment, in step S3, the unmatched difference description script includes a first difference description script and a second difference description script;

[0017] The first difference description script is after matching is performed in step S2.

[0018] Semantic description scripts that are not matched to any test cases;

[0019] The second difference description script is after the matching is performed in step S2.

[0020] There is no matching semantic description script in the matched test cases;

[0021] Before executing step S3 to establish the difference description code, the following steps are also included:

[0022] If the difference description script is the first difference description script, generate a test case for the first difference description script and establish its function code using any of the target software platforms, and write a tag of the test case into a test case library;

[0023] If the difference description script is a second difference description script, retrieve the test case including the second difference description script from the test case library and set the semantic description script matching degree as in S2, and repeat this step until no second difference description script is included; or,

[0024] There is a second difference description script and it is impossible to retrieve a test case with a matching degree above a preset value in the test case library. A test case for the second difference description script is generated and its functional code is established using any of the target software platforms. The label of this test case is written into the test case library.

[0025] As a further preferred embodiment, after executing S5, logic description verification is further performed, and the steps of logic description verification are:

[0026] Combining at least two groups of the semantic description scripts and corresponding unsegmented elements to obtain a combined description script;

[0027] Retrieving the combined description script in the test case library, and executing S2-S3;

[0028] Obtaining a fourth compiled code regarding the combined description script;

[0029] Obtaining first compiled codes obtained from two groups of the semantic description scripts and second compiled codes corresponding to the corresponding undivided elements;

[0030] Calling a test case to execute a first test on the fourth compiled code;

[0031] Calling a test case to execute a second test on the first compiled code and the second compiled code;

[0032] comparing the outputs of the first test and the second test under equal variables;

[0033] If the outputs are consistent, the undivided element is retained, and the undivided element and the labels of the two sets of semantic descriptions are written and stored in the test case library;

[0034] Otherwise, mark the undivided element.

[0035] As a further preferred embodiment, after executing the logic description verification, single variable verification is also included;

[0036] Variant testing of test cases obtained from semantic description scripts,

[0037] Obtaining a single variable in the test case, and retrieving a test case including only the single variable from a test case library;

[0038] Obtaining the functional code of the test case of each single variable;

[0039] After obtaining the logic script in the semantic description script, the steps of logic description verification are performed.

[0040] As a further preferred embodiment, the test case library includes:

[0041] Single variable test cases, each of which performs a test on only a single variable;

[0042] Standard test cases, each of which performs a test on the semantic description script;

[0043] Combining test cases, each of which performs a test on an undivided element and at least two sets of the semantic description scripts;

[0044] And the functional codes corresponding to each type of test case.

[0045] Further preferably, after executing S8, the combined test cases of the functional codes corresponding to the combined description scripts are updated to the test case library.

[0046] A second aspect of the present invention provides a system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect of the present invention is implemented.

[0047] According to a third aspect of the present invention, there is provided a storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in the first aspect or the second aspect.

[0048] The above technical solution of the present invention has the following advantages compared with the prior art:

[0049] The present invention obtains the required business data for SDKs of multiple platforms during the development process, divides it into multiple test cases in the form of semantic scripts, and establishes a fast mapping based on the recompilable characteristics of the test cases to simultaneously generate multiple groups of difference codes for different platforms and then encapsulate them, thereby realizing a unified development method among multiple platforms.

[0050] The present invention also converts development requirements into semantic description scripts, abstracts the variables and parameters in the development requirements, then matches them with the development requirements by building a test case library, and establishes a mapping index mechanism between test cases and function codes in the test case library, so that after obtaining the development requirements, the relevant function code can be directly retrieved from the test case library, and the software package can be obtained by merging the logic description text as the code with the function code, thereby realizing a unified development method for different development environments and different software platforms, saving development time and improving development convenience. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a flowchart of the method provided in Example 1 of the present invention.

[0052] Figure 2It is a schematic diagram of an electronic device provided in Embodiment 2 of the present invention.

[0053] Among them, 30, processor; 31, memory; 32, communication interface; 33, bus. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] Embodiment 1

[0056] In a first aspect of the embodiments of the present disclosure, Figure 1 As shown, a unified software development method for multiple platforms is provided, comprising the following steps:

[0057] S1. Acquire development requirements, and semantically segment the development requirements to obtain a semantic description script;

[0058] S2, matching multiple test cases whose matching degree with the semantic description script is above a preset value from a test case library, and establishing a first mapping between the semantic description script and the test case;

[0059] Establishing a compilation model of the test case according to the first mapping, each of the compilation models includes a compiler corresponding to multiple target software platforms for the test case and a functional code for implementing the test case;

[0060] S3, obtaining the SDK corresponding to the compiler, writing the difference description script that is not matched in the semantic description script, writing the difference description script into the test case using the difference description script as a re-encoding parameter and establishing a difference description code;

[0061] S4, combining the function code and the difference description code to obtain a first compiled code;

[0062] S5. Obtain an undivided element in the development requirement, obtain a logic description script in the undivided element, and compile to obtain a second compiled code for the logic description script based on the SDK and the compiler;

[0063] S6. Merge the first compiled code and the second compiled code to obtain a main code of a target software platform;

[0064] S7, obtaining a difference code from the target software platform to the target hardware platform, and separately compiling the difference code file to obtain a third compiled code corresponding to the target hardware platform;

[0065] S8. After packaging the main code and the third compiled code, software for the target hardware platform is obtained.

[0066] In the embodiments disclosed herein, the method of semantic segmentation is a common technical means in the art and will not be elaborated here. The principle of semantic segmentation is to use the words that meet the template matching degree, part of speech and phrase unit size as the segmented semantic description scripts based on the part of speech and phrase unit size of the participle and the template matching degree of each participle.

[0067] As a further preferred embodiment, in step S3, the unmatched difference description script includes a first difference description script and a second difference description script;

[0068] The first difference description script is after matching is performed in step S2.

[0069] Semantic description scripts that are not matched to any test cases;

[0070] The second difference description script is after the matching is performed in step S2.

[0071] There is no matching semantic description script in the matched test cases;

[0072] Before executing step S3 to establish the difference description code, the following steps are also included:

[0073] If the difference description script is the first difference description script, generate a test case for the first difference description script and establish its function code using any of the target software platforms, and write a tag of the test case into a test case library;

[0074] If the difference description script is a second difference description script, retrieve the test case including the second difference description script from the test case library and set the semantic description script matching degree as in S2, and repeat this step until no second difference description script is included; or,

[0075] There is a second difference description script and it is impossible to retrieve the test case with a matching degree above the preset value in the test case library. A test case for the second difference description script is generated and its functional code is established using any of the target software platforms. The label of this test case is written into the test case library to realize traversal of the semantic description script. By traversing the test cases saved in the test case library, the function code is called and the software is generated, saving development time.

[0076] In the embodiment of the present disclosure, the purpose of writing the label of the test case is to archive its association with the semantic description text. Specifically, the first mapping in the embodiment of the present disclosure is indexed by the text of the semantic description text and the label of each test case.

[0077] As a further preferred embodiment, after executing S5, logic description verification is further performed, and the steps of logic description verification are:

[0078] Combining at least two groups of the semantic description scripts and corresponding unsegmented elements to obtain a combined description script;

[0079] Retrieving the combined description script in the test case library, and executing S2-S3;

[0080] Obtaining a fourth compiled code regarding the combined description script;

[0081] Obtaining first compiled codes obtained from two groups of the semantic description scripts and second compiled codes corresponding to the corresponding undivided elements;

[0082] Calling a test case to execute a first test on the fourth compiled code;

[0083] Calling a test case to execute a second test on the first compiled code and the second compiled code;

[0084] comparing the outputs of the first test and the second test under equal variables;

[0085] If the outputs are consistent, the undivided element is retained, and the undivided element and the labels of the two sets of semantic descriptions are written and stored in the test case library;

[0086] Otherwise, mark the undivided element. It should be noted that in the embodiment of the present disclosure, the undivided element has been used as an associated logical description script of multiple semantic description scripts before S5 of the embodiment of the present disclosure. Therefore, if the output of the undivided element is inconsistent after the semantic description scripts are combined, other test cases associated with the undivided element in the test case library are retrieved respectively, and the associated test cases are still set to have a matching degree with the semantic description script above a preset value, and the traversal is executed until the test results after the associated retrieval of the undivided element are consistent. The purpose of this step is to directly perform combination matching between test cases, calibrate the accuracy of the logical description script through the semantic description script, and mark the undivided element and its corresponding logical description script in the test case. In addition, since the logical description script is not accidental, its associated test cases are not only the combinations retrieved by the semantic description script before S5, so it can be traversed and retrieved to obtain test cases of different combinations, thereby calibrating the accuracy.

[0087] As a further preferred embodiment, after executing the logic description verification, single variable verification is also included;

[0088] Variant testing of test cases obtained from semantic description scripts,

[0089] Obtaining a single variable in the test case, and retrieving a test case including only the single variable from a test case library;

[0090] Obtaining the functional code of the test case of each single variable;

[0091] After obtaining the logic script in the semantic description script, the steps of logic description verification are performed.

[0092] As a further preferred embodiment, the test case library includes:

[0093] Single variable test cases, each of which performs a test on only a single variable;

[0094] Standard test cases, each of which performs a test on the semantic description script;

[0095] Combining test cases, each of which performs a test on an undivided element and at least two sets of the semantic description scripts;

[0096] And the functional codes corresponding to each type of test case.

[0097] Further preferably, after executing S8, the combined test cases of the functional codes corresponding to the combined description scripts are updated to the test case library.

[0098] The present invention constructs a test case library, and establishes a combination of test cases corresponding to the code combination obtained after each development. After iterative development, a mapping between each single variable test case and its associated logic description text, a mapping between a standard test case and its associated logic description text, and a mapping between a combined test case and its associated logic description text are obtained. In the next development process, after completing the matching of the test cases, the obtained functional code combination can be tested to obtain accurate compiled code.

[0099] The disclosed embodiment obtains the required business data for SDKs of multiple platforms during the development process, divides it into multiple test cases in the form of semantic scripts, and establishes a fast mapping based on the recompilable characteristics of the test cases to simultaneously generate multiple groups of difference codes for different platforms and then encapsulate them, thereby achieving a unified development method among multiple platforms.

[0100] The disclosed embodiment also converts development requirements into semantic description scripts, abstracts the variables and parameters in the development requirements, and then matches them with the development requirements by building a test case library, and establishes a mapping index mechanism between test cases and function codes in the test case library, so that after obtaining the development requirements, the relevant function code can be directly retrieved from the test case library, and the software package can be obtained by merging the logic description text as the code with the function code, thereby realizing a unified development method for different development environments and different software platforms, saving development time and improving development convenience.

[0101] Embodiment 2

[0102] Combination Figure 2 As shown, an embodiment of the present disclosure provides a system, including a processor 30 and a memory 31. Optionally, the electronic device may further include a communication interface 32 and a bus 33. The processor 30, the communication interface 32, and the memory 31 may communicate with each other through the bus 33. The communication interface 32 may be used for information transmission. The processor 30 may call the logic instructions in the memory 31 to execute the method of the above-mentioned embodiment 1.

[0103] An embodiment of the present disclosure provides a storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the method as described in the first embodiment.

[0104] The above-mentioned storage medium may be a transient computer-readable storage medium or a non-transient computer-readable storage medium. Non-transient storage media include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, and may also be a transient storage medium.

[0105] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0106] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these effects are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described effects, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, devices and units may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0107] The flowchart and block diagram in the accompanying drawings show the possible architecture, role and operation of the device, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical role. In some alternative implementations, the role marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed in parallel, and they can sometimes be executed in the opposite order, which can depend on the role involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed in parallel, and they can sometimes be executed in the opposite order, which can depend on the role involved. Each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based device that performs the specified role or action, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A unified software development method for multiple platforms, characterized in that: The steps include: S1. Acquire development requirements, and semantically segment the development requirements to obtain a semantic description script; S2, matching multiple test cases whose matching degree with the semantic description script is above a preset value from a test case library, and establishing a first mapping between the semantic description script and the test case; Establishing a compilation model of the test case according to the first mapping, each of the compilation models includes a compiler corresponding to multiple target software platforms for the test case and a functional code for implementing the test case; S3, obtaining the SDK corresponding to the compiler, writing the difference description script that is not matched in the semantic description script, writing the difference description script into the test case using the difference description script as a re-encoding parameter and establishing a difference description code; The unmatched difference description scripts include a first difference description script and a second difference description script; The first difference description script is after matching is performed in step S2. Semantic description scripts that are not matched to any test cases; The second difference description script is after the matching is performed in step S2. There is no matching semantic description script in the matched test cases; S4, combining the function code and the difference description code to obtain a first compiled code; S5. Obtain an undivided element in the development requirement, obtain a logic description script in the undivided element, and compile to obtain a second compiled code for the logic description script based on the SDK and the compiler; S6. Merge the first compiled code and the second compiled code to obtain a main code of a target software platform; S7, obtaining a difference code from the target software platform to the target hardware platform, and separately compiling the difference code file to obtain a third compiled code corresponding to the target hardware platform; S8. After packaging the main code and the third compiled code, software for the target hardware platform is obtained.

2. The unified software development method for multiple platforms according to claim 1, characterized in that: Before executing step S3 to establish the difference description code, the following steps are also included: If the difference description script is the first difference description script, generate a test case for the first difference description script and establish its function code using any of the target software platforms, and write a tag of the test case into a test case library; If the difference description script is a second difference description script, retrieve the test case including the second difference description script from the test case library and set the semantic description script matching degree as in S2, and repeat this step until no second difference description script is included; or, There is a second difference description script and it is impossible to retrieve a test case with a matching degree above a preset value in the test case library. A test case for the second difference description script is generated and its functional code is established using any of the target software platforms. The label of this test case is written into the test case library.

3. The multi-platform unified software development method according to claim 2, characterized in that: After executing S5, logic description verification is also performed, and the steps of logic description verification are: Combining at least two groups of the semantic description scripts and corresponding unsegmented elements to obtain a combined description script; Retrieving the combined description script in the test case library, and executing S2-S3; Obtaining a fourth compiled code regarding the combined description script; Obtaining first compiled codes obtained from two groups of the semantic description scripts and second compiled codes corresponding to the corresponding undivided elements; Calling a test case to execute a first test on the fourth compiled code; Calling a test case to execute a second test on the first compiled code and the second compiled code; comparing the outputs of the first test and the second test under equal variables; If the outputs are consistent, the undivided element is retained, and the undivided element and the labels of the two sets of semantic descriptions are written and stored in the test case library; Otherwise, mark the undivided element.

4. The multi-platform unified software development method according to claim 3, characterized in that: After performing the logic description verification, it also includes single variable verification; Variant testing of test cases obtained from semantic description scripts, Obtaining a single variable in the test case, and retrieving a test case including only the single variable from a test case library; Obtaining the functional code of the test case of each single variable; After obtaining the logic script in the semantic description script, the steps of logic description verification are performed.

5. The multi-platform unified software development method according to claim 1, characterized in that: The test case library includes: Single variable test cases, each of which performs a test on only a single variable; Standard test cases, each of which performs a test on the semantic description script; Combining test cases, each of which performs a test on an undivided element and at least two sets of the semantic description scripts; And the functional codes corresponding to each type of test case.

6. The multi-platform unified software development method according to claim 1, characterized in that: After executing S8, the combined test cases of the functional codes corresponding to the combined description scripts are updated to the test case library.

7. A unified software development system for multiple platforms, characterized by: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 6 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and system for identifying incompatibility between versions of compiled software code

    US20220028146A1

  • Compiler retargeting based on instruction semantic models

    US9280326B1