Version Number Processing Method and Device
By automatically detecting the interface layer changes of component code, the version number rules are generated, which solves the problem of version number update accuracy and low efficiency, and achieves accurate and efficient update of version number.
Patent Information
- Application Number
- CN202210037581.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-13
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-01-13
AI Technical Summary
In the prior art, the accuracy and efficiency of version number updates are low, mainly due to errors and inefficiency caused by human update methods.
By automatically detecting the interface layer changes of component code, generating version number rules based on the change information, automatic update and verification of version number is realized, and manual verification is combined to ensure the accuracy and efficiency of version number.
It improves the accuracy and efficiency of version number updates, can quickly reflect the changes in component code, reduces human errors, and improves the accuracy and flexibility of version number.
Smart Images

Figure CN114416168B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of big data in computer technology, and in particular to a version number processing method and device. Background Art
[0002] With the continuous development of Internet technology, many products on the Internet provide users with a variety of services.
[0003] During the iteration process of Internet products, a version number is often required to indicate the product's iteration status. Currently, in existing technologies, when updating a version number, the version number is typically incremented by 1 based on the number of iterations, and the incremented version number is manually added to a designated location to update the version number.
[0004] However, the manual implementation of updating the version number will result in low accuracy and efficiency of the version number update. Summary of the invention
[0005] The present disclosure provides a version number processing method and device.
[0006] According to a first aspect of the present disclosure, a version number processing method is provided, comprising:
[0007] Obtaining a first component code currently stored from a preset storage space, and obtaining a first version number corresponding to the first component code;
[0008] Determining change information of a second component code to be submitted based on the first component code;
[0009] Determining a second version number of the second component code to be submitted according to the change information and the first version number;
[0010] According to the second component code and the second version number, the component code and version number stored in the preset storage space are updated.
[0011] According to a second aspect of the present disclosure, a version number processing device is provided, comprising:
[0012] an acquisition module, configured to acquire a currently stored first component code from a preset storage space, and acquire a first version number corresponding to the first component code;
[0013] A first determining module is configured to determine change information of a second component code to be submitted based on the first component code;
[0014] A second determining module, configured to determine a second version number of the second component code to be submitted based on the change information and the first version number;
[0015] An update module, configured to update the component code and version number stored in the preset storage space according to the second component code and the second version number.
[0016] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0017] At least one processor; and
[0018] A memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect.
[0020] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method described in the first aspect.
[0021] According to a fifth aspect of the present disclosure, there is provided a computer program product, the computer program product including: a computer program, the computer program is stored in a readable storage medium, and at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the electronic device executes the method described in the first aspect.
[0022] The technology according to the present disclosure solves the problem of low accuracy and efficiency in version number update.
[0023] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:
[0025] Figure 1 is a schematic diagram of a scenario of the version number processing method provided by an embodiment of the present disclosure;
[0026] Figure 2 is a flowchart of the version number processing method provided by an embodiment of the present disclosure;
[0027] Figure 3 is the process of the version number processing method provided by an embodiment of the present disclosure Figure 2 ;
[0028] Figure 4Schematic diagram of changes in component code provided by embodiments of the present disclosure Figure 1 ;
[0029] Figure 5 Schematic diagram of changes in component code provided by embodiments of the present disclosure Figure 2 ;
[0030] Figure 6 Schematic diagram of changes in component code provided by embodiments of the present disclosure Figure 3 ;
[0031] Figure 7 Schematic structural diagram of the version number processing device provided by embodiments of the present disclosure;
[0032] Figure 8 Block diagram of an electronic device for implementing the version number processing method provided by embodiments of the present disclosure. Detailed implementation manners
[0033] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted below.
[0034] To better understand the technical solutions of the present disclosure, the related technologies involved in the present disclosure are further introduced in detail below.
[0035] In recent years, with the popularization of the Internet and the increase in mobile devices, almost everyone has a smart device. Application programs (APPs) based on smart devices can provide different services for users to use. Similarly, with the development of the Internet industry, the service time of many products for users has exceeded 10 years, or even more. It can be understood that with the accumulation of time, the scale of products has also been increasing. At this time, the cost of the product iteration process will become higher and the impact will be greater. These problems are all potential R & D costs. For example:
[0036] In terms of scale: Generally speaking, the number of lines of code for lightweight products is tens of thousands, while the number of lines of code for super APPs is several million, or more.
[0037] In terms of R & D: Generally speaking, a few R & D personnel can handle lightweight products, but hundreds or thousands of R & D personnel are required for super APPs. The collaboration and communication among these personnel are both costs.
[0038] In terms of quality: For super APPs, due to the diversity of functions, the scale of personnel, and the relatively high coordination costs, changes to some modules pose low risks to most coordinated modules. However, there may also be situations where, due to misaligned communication, the impact cannot be perceived in advance.
[0039] In terms of detectability: For super APPs, the cost of complete understanding is indeed relatively high. However, during the R & D process of a certain module, tasks such as the assessment of the impact scope, notification, and verification lack clear completion criteria and are driven by responsibility and awareness or by post - effect verification.
[0040] In terms of impact scope: For super APPs, changes to basic modules have a large impact, the risks generated are also large, and the cost of later repair is high. When multiple components are changed and upgraded, the cost of change perception is relatively high, and the adaptation cost is high.
[0041] Based on the above introduction, it can be determined that the quality and cost of the software R & D process are affected by many factors. The larger the scale, the higher the coordination cost and the cost of risk discovery. Especially for modifications to basic - level modules, the impact scope is large and problem feedback is not obvious. By means of systematic behavior, according to the causes of risks and costs, constructing automated detection work is the key to improving the efficiency of software R & D projects.
[0042] Therefore, the technical solution of this disclosure proposes to automate the analysis of component changes and make agreements based on the version number changes of components, so that component changes can be directly reflected in the version number. For the use of components, by directly referring to the version number, it is possible to know the changes of a specific component during a certain period of time, and the risk of component upgrade can be perceived in advance, thus realizing an efficient assessment of the reuse process of components in different products.
[0043] More specifically, each company and platform currently has development specifications, and the version number is one of the specifications. In related technologies, the writing of version numbers is usually done manually. For example, when updating the version number currently, usually the version number is incremented by 1 according to the number of iterations, and the incremented version number is manually written to the specified location to complete the update of the version number.
[0044] However, the implementation method of manually updating the version number results in relatively low accuracy and efficiency of version number updates. Specifically, because the team's code scale is large, the familiarity of all R & D personnel with functions will affect the writing of the version number, thus leading to low efficiency in version number updates. And since the process of writing the version number is manual and lacks a supervision mechanism, it is prone to errors.
[0045] In view of the problems in the prior art, the present disclosure proposes the following technical concept: By setting the rules for version numbers, where the rules for version numbers can be related to changes in the interface layer. Through changes in the interface layer of the module, the upgrade of the version number is determined. For developers, when submitting code, the interface layer is detected. Based on the changes in the interface and the versions already submitted in the current online code repository, a new version number is calculated, automatically filled in, or a verification prompt is given for the existing filling, so as to effectively improve the correctness and efficiency of filling in the version number.
[0046] The following introduces the version number processing method provided by the present disclosure in combination with specific embodiments. First, in combination with Figure 1 the application scenarios of the version number processing method in the present disclosure are introduced. Figure 1 FIG. is a schematic diagram of the scenario of the version number processing method provided by the embodiments of the present disclosure.
[0047] As Figure 1 shown, in the current application scenario, it includes a terminal device 101 and a code repository 102.
[0048] Among them, the terminal device 101 can be a computer, a mobile phone, etc. The specific implementation of the terminal device 101 in this embodiment is not limited, as long as it allows users to upload component code and version numbers to the code repository. And the code repository 102 is a place to store project code for facilitating the continued development of the project in different places. The code repository 102 in the present disclosure can also be understood as a cloud server, a cloud storage unit, etc.
[0049] In this embodiment, the terminal device 101 and the code repository 102 can perform data interaction. For example, the user can upload component code and version numbers through the terminal device, and the component code and version numbers can be stored in the code repository. And the terminal device can also obtain the currently stored component code and version numbers from the code repository. Among them, the data interaction between the terminal device and the code repository can be direct data interaction between the terminal device and the code repository, or the terminal device and the code repository can perform data interaction through a relay device, and the relay device can be a server, etc.
[0050] Based on the scenario introduced above, Figure 1 the following introduces the version number processing method provided by the present disclosure in detail in combination with specific embodiments. It should be noted that the execution subject of each embodiment in the present disclosure can be the terminal device introduced above, or it can also be a device with data processing functions such as a server, a processor, a microprocessor, etc. The execution subject of the embodiments in the present disclosure is not limited here, and it can be selected and set according to actual needs. As long as it is a device with data processing functions, it can be used as the execution subject in this embodiment.
[0051] First, it will be introduced in combination with Figure 2 as follows. Figure 2 FIG. is a flowchart of the version number processing method provided by the embodiments of the present disclosure.
[0052] As Figure 2 shown, the method includes:
[0053] S201. Obtain the currently stored first component code from a preset storage space, and obtain the first version number corresponding to the first component code.
[0054] The preset storage space in this embodiment is a storage space for storing component codes and the version numbers corresponding to the component codes. In a possible implementation manner, the preset storage space can be, for example, the code repository introduced above, or the preset storage space can also be any cloud storage space. The specific implementation manner of the preset storage space in this embodiment is not limited as long as the preset storage space can be used to store component codes and the version numbers corresponding to the component codes.
[0055] And it can be understood that during the development of an application, the component code is continuously iteratively updated. After each iterative update is completed, the updated component code is stored in the preset storage space. Then correspondingly, before the iteration, the current component code is stored in the preset storage space. In this embodiment, the currently stored component code in the preset storage space is referred to as the first component code.
[0056] Therefore, in this embodiment, the currently stored first component code can be obtained from the preset storage space, and the version number corresponding to the first component code is also stored in the preset storage space. In this embodiment, it is referred to as the first version number. Therefore, the first version number corresponding to the first component code can also be obtained from the preset storage space in this embodiment.
[0057] Based on the above introduction, it can be determined that the first component code is the component code currently being used in the application, and the first version number is the version number of the first component code currently being used.
[0058] S202. Determine the change information of the second component code to be submitted according to the first component code.
[0059] And in this embodiment, there is also a second component code to be submitted. The second component code is the component code after iterative update. The second component code can be, for example, submitted by a user through a terminal device.
[0060] Then it can be determined that the first component code can be understood as the historical component code, and the second component code can be understood as the latest component code. Iteratively updating the component code actually means replacing the first component code with the second component code. Since the component code needs to be updated currently, there must be a certain update to the second component code compared to the first component code.
[0061] Therefore, in this embodiment, the change information of the second component code to be submitted can be determined according to the first component code, where the change information technology is the change of the second component code compared to the first component code.
[0062] S203. Determine the second version number of the second component code to be submitted according to the change information and the first version number.
[0063] After determining the change information, the second version number of the second component code to be submitted can be determined in this embodiment. The second version number in this embodiment is updated based on the current first version number. Therefore, the second version number of the second component code to be submitted can be determined according to the change information and the first version number.
[0064] In a possible implementation manner, for example, a version number generation rule may be set in this embodiment, where the version number generation rule is used to indicate how to update the first version number according to the change information to obtain the second version number. The specific implementation of the version number generation rule can be selected and set according to actual needs, and this embodiment does not limit this.
[0065] S204. Update the component code and version number stored in the preset storage space according to the second component code and the second version number.
[0066] After determining the second component code and the second version number, the component code and version number stored in the preset storage space can be updated. For example, the current first component code and the first version number stored in the preset storage space can be deleted, and the second component code and the second version number can be stored in the preset storage space to update the component code and version number in the preset storage space.
[0067] The version number processing method provided by the embodiments of the present disclosure includes: obtaining the currently stored first component code from a preset storage space, and obtaining the first version number corresponding to the first component code. Determining the change information of the second component code to be submitted according to the first component code. Determining the second version number of the second component code to be submitted according to the change information and the first version number. Updating the component code and version number stored in the preset storage space according to the second component code and the second version number. By determining the change information of the component code according to the historical component code and the updated component code, and then automatically generating the second version number of the updated component code based on the first version number of the historical component code according to the change information, and using the updated component code and the second version number to update the component code and version number stored in the preset storage space, the automatic writing of the version number can be realized, so as to effectively improve the accuracy and efficiency of writing the version number.
[0068] Based on the above embodiments, the following combines Figures 3 to 6 to further introduce the version number processing method provided by the present disclosure in detail. Figure 3 is the flow of the version number processing method provided by the embodiments of the present disclosure Figure 2 , Figure 4 is the change schematic diagram of the component code provided by the embodiments of the present disclosure Figure 1 , Figure 5 is the change schematic diagram of the component code provided by the embodiments of the present disclosure Figure 2 , Figure 6 is the change schematic diagram of the component code provided by the embodiments of the present disclosure Figure 3 .
[0069] As Figure 3 shown, the method includes:
[0070] S301. Obtain the currently stored first component code from a preset storage space, and obtain the first version number corresponding to the first component code.
[0071] Among them, the implementation manner of S301 is similar to that of S201, and will not be elaborated here.
[0072] S302. Obtain the interface layer information in the first component code, and obtain the interface layer information in the second component code, where the interface layer information includes at least one of the following: class name, function name, variable name, variable definition, constant definition.
[0073] In this embodiment, when determining the change information of the second component code relative to the first component code, for example, it can be to determine the change of the interface layer information in the component code. Therefore, in this embodiment, the interface layer information of the first component code can be obtained, and the interface layer information in the second component code can be obtained.
[0074] In a possible implementation, the interface layer information may include, for example, at least one of the following: class name, function name, variable name, variable definition, constant definition. In the actual implementation process, the specific implementation of the interface layer information can also be selected and set according to actual requirements, as long as the information related to the interface in the component information can be used as the interface layer information in this embodiment. For example, the interface layer information can also include changes in public files, etc.
[0075] S303. Determine the change information of the second component code according to the interface layer information in the first component code and the interface layer information of the second component code.
[0076] Since the change information in this embodiment can be the information related to the change of the interface layer information, after obtaining the interface layer information of the first component code and the interface layer information of the second component code, the change information of the second component code can be determined according to the interface layer information in the first component code and the interface layer information in the second component code.
[0077] The following Figure 4 gives an exemplary introduction to the implementation of the component code, as Figure 4 shown. Assume that for the first component code, there is a module m1 in the current system, where the interface class m1s1 is defined in module m1, and the public interfaces or global parameters of the interface class m1s1, such as functions F1, F2; member variable V1, constant C1; and the dependent module m2, and the interface class m1s2 in module m2 defines the function F8. Figure 4 What is shown is an exemplary introduction to the component code of the system.
[0078] Then when determining the change information, in a possible implementation, if the interface layer information in the first component code is the same as the interface layer information in the second component code, the change information is determined to be the first change information.
[0079] For example, in the Figure 4 example, Figure 4 the first component code and the second component code are given. Based on Figure 4 it can be determined, and assume that the current developer has fixed a function bug of F1 and thus submitted the second component code. Then the change between the first component code in the code repository of the system and the second component code submitted this time shows that the definition related to the interface of module m1 has not changed. That is to say, the interface layer information in the first component code is the same as the interface layer information in the second component code. Therefore, the change information can be determined to be the first change information. The first change information in this embodiment is used to indicate that the interface layer information of the second component code has not changed relative to the first component code.
[0080] Alternatively, if there is an increase in the interface layer information in the first component code compared to the interface layer information in the second component code, determine that the change information is the second change information.
[0081] For example, in Figure 5 the example of Figure 5 the first component code and the second component code are given. Based on Figure 5 it can be determined that assuming a developer adds a function F9 to m1s1 of the first component code and thus submits the second component code, then for the change between the first component code in the current system code repository and the second component code submitted this time, there are new definitions related to the interface of the m1 module. This means that the user can still use the original interface normally but has new capabilities. That is, there is an increase in the interface layer information in the first component code compared to the interface layer information in the second component code. Therefore, it can be determined that the change information is the second change information. The first change information in this embodiment is used to indicate that there is an increase in the interface layer information of the second component code compared to the first component code.
[0082] Alternatively, if there is a deletion or modification in the interface layer information in the first component code compared to the interface layer information in the second component code, determine that the change information is the third change information.
[0083] For example, in Figure 6 the example of Figure 6 the first component code and the second component code are given. Based on Figure 6 it can be determined that assuming a developer modifies the function F1 in m1s1 of the first component code to F1' (or adds new parameters to it, or deletes F1) and thus submits the second component code, then for the change between the first component code in the current system code repository and the second component code submitted this time, there are changes in the definitions related to the interface of the m1 module. That is, there is a deletion or modification in the interface layer information in the first component code compared to the interface layer information in the second component code. Therefore, it can be determined that the change information is the third change information. The third change information in this embodiment is used to indicate that there is a deletion or modification in the interface layer information of the second component code compared to the first component code.
[0084] S304. Obtain the first byte, the second byte, and the third byte in the first version number.
[0085] After determining the change information introduced above, the second version number can be obtained by updating based on the first version number according to the determined change information.
[0086] In a possible implementation, the version number may sequentially include a first byte, a second byte, and a third byte. For example, the first byte, the second byte, and the third byte in the first version number can be obtained.
[0087] S305. According to the change information, at least one of the first byte, the second byte, and the third byte is updated to obtain an updated first byte, an updated second byte, and an updated third byte.
[0088] After obtaining the first byte, the second byte, and the third byte in the first version number, at least one of the first byte, the second byte, and the third byte can be updated according to the determined change information above, so as to obtain an updated first byte, an updated second byte, and an updated third byte.
[0089] It can be understood that when updating the first byte, the second byte, and the third byte, one or more of them may be updated. For the bytes that are not updated, the updated bytes are actually the same as the bytes before the update.
[0090] Based on the above introduction, it can be determined that the change information in this embodiment may include first change information, second change information, and third change information. In this embodiment, for different change information, the implementation methods of the updated bytes are different.
[0091] In a possible implementation, if the change information is the first change information, then add 1 to the third byte in the first version number to obtain an updated first byte, an updated second byte, and an updated third byte.
[0092] In this embodiment, for example, x can be used to represent the first byte, y can be used to represent the second byte, and z can be used to represent the third byte. Then the version number of the component code in this embodiment can be represented as x.y.z, for example. And assume that the version number of the first component code is 1.1.1, that is, the first byte x is equal to 1, the second byte y is equal to 2, and the third byte z is equal to 3.
[0093] Then corresponding to the above Figure 4 introduced example, Figure 4 if the change information in it is the first change information, then add 1 to the third byte z in the first version number, so as to obtain an updated first byte x equal to 1, an updated second byte y equal to 1, and an updated third byte z equal to 2. Then the second version number of the second component code is Figure 4 as shown in 1.1.2.
[0094] Alternatively, if the change information is the second change information, increment the second byte in the first version number by 1 and set the third byte to a preset value to obtain the updated first byte, updated second byte, and updated third byte.
[0095] Similarly, assume the version number of the first component code is 1.1.1, that is, the first byte x is equal to 1, the second byte y is equal to 2, and the third byte z is equal to 3. Then corresponding to the Figure 5 example introduced above, Figure 5 if the change information in it is the second change information, then increment the second byte y in the first version number by 1 and set the third byte z to a preset value (such as 0), so as to obtain the updated first byte x equal to 1, the updated second byte y equal to 2, and the updated third byte z equal to 0. Then the second version number of the second component code is Figure 5 as shown in 1.2.0.
[0096] Alternatively, if the change information is the third change information, increment the first byte in the first version number by 1 and set the second byte and the third byte to preset values to obtain the updated first byte, updated second byte, and updated third byte.
[0097] Similarly, assume the version number of the first component code is 1.1.1, that is, the first byte x is equal to 1, the second byte y is equal to 2, and the third byte z is equal to 3. Then corresponding to the Figure 6 example introduced above, Figure 6 if the change information in it is the third change information, then increment the first byte x in the first version number by 1 and set the second byte y and the third byte z to preset values (such as 0), so as to obtain the updated first byte x equal to 2, the updated second byte y equal to 0, and the updated third byte z equal to 0. Then the second version number of the second component code is Figure 5 as shown in 2.0.0.
[0098] Based on the above introduction, it can be understood that the third byte z in this embodiment can correspond to no change in the interface layer. This bit represents the internal implementation change, and the capabilities provided by the module to the outside remain unchanged. And the second byte y corresponds to an increase in the interface layer. This bit represents that there is no change in the original interface, and this module has added capabilities. The first byte x represents a change in the interface layer. This bit represents that there is a change in the original interface, including the deletion and modification of the interface. Based on this, the generation rule of the version number can be expressed as: for each submission of the component code, the version number +1, starting from 0 by default; upgrade the high bit and reset the low bit to 0.
[0099] S306. Determine the second version number of the second component code, where the second version number sequentially includes the updated first byte, the updated second byte, and the updated third byte.
[0100] After determining the updated first byte, the updated second byte, and the updated third byte based on the above-introduced content, the second version number in the second component code can be determined. In this embodiment, the second version number sequentially includes the updated first byte, the updated second byte, and the updated third byte.
[0101] And in an optional implementation, the version number in this embodiment can include additional information in addition to the first byte, the second byte, and the third byte. For example, it can include a fourth byte, where the fourth byte can be used to record the time when the component code is submitted.
[0102] Then in this embodiment, for example, the submission time of the second component code can also be obtained, and the submission time can be determined as the fourth byte. Then, for example, the second version number can sequentially include the updated first byte, the updated second byte, the updated third byte, and the fourth byte.
[0103] Wherein, the specific position of the fourth byte can be selected according to actual needs, and the order of each byte is not limited. For example, if the fourth byte is represented by a, then the version number can be represented as x.y.z.a, or the version number can also be represented as a.x.y.z, or the version number can also be represented as x.a.y.z, etc. This embodiment does not limit the specific arrangement order of each byte in the version number, and it can be selected and set according to actual needs.
[0104] In a specific example, for example, when the code submission time is 2021-08-08-08:08:08, then this time can be added as a to the version number. Then, for example, for the above Figure 4 example, the second version number can be represented as 1.1.2.2021-08-08-08:08:08. The implementation for the other several diagrams is similar and will not be elaborated here.
[0105] And it can be understood that in the actual implementation process, in addition to the content introduced above, the version number can also include any information that needs to be reflected in the version number, as long as the corresponding rules are predefined. The specific implementation of the version number is not limited here.
[0106] S307. Store the second component code in a preset storage space and delete the first component code in the preset storage space.
[0107] After generating the second version number of the second component code, the component code and version number stored in the preset storage space can be updated based on the second component code and the second version number.
[0108] The update of the component code and the version number will be described separately below. When updating the component code, the second component code can be stored in the preset storage space, and the first component code stored in the preset storage space can be deleted, so as to realize the update of the component code in the preset storage space.
[0109] S308. If the version number in the preset storage space has not been updated, the second version number is stored in the preset storage space, and the first version number in the preset storage space is deleted.
[0110] In this embodiment, when updating the version number, the version number can support automatic update or manual update. Therefore, before storing the generated second version number in the preset storage space, it can be first determined whether the version number in the preset storage space has been updated.
[0111] In a possible implementation manner, if it is determined that the version number in the preset storage space has not been updated, that is, the first version number is still stored in the preset storage space, it can be determined that the version number in the preset storage space has not been manually modified. Then, the second version number can be directly stored in the preset storage space, and the first version number stored in the preset storage space is deleted, so as to realize the automatic update of the version number stored in the preset storage space.
[0112] S309. If the version number in the preset storage space has been updated, obtain the updated version number stored in the preset storage space, and perform verification according to the second version number and the updated version number to update the version number stored in the preset storage space.
[0113] In another possible implementation manner, if it is determined that the version number in the preset storage space has been updated, that is, the first version number is not stored in the preset storage space, it can be determined that the version number in the preset storage space has been manually modified. Then, for example, the updated version number stored in the preset storage space can be obtained, and verification is performed according to the second version number and the updated version number to realize the update of the version number stored in the preset storage space.
[0114] When verifying according to the second version number and the updated version number, for example, it can be verified whether the second version number and the updated version number are the same.
[0115] In a possible implementation manner, if the second version number and the updated version number are the same, it is determined that the updated version number is the updated version number in the preset storage space.
[0116] For example, in the above example, if it is determined that the second version number is 1.1.2, and assuming that the currently manually filled update version number is also 1.1.2, then it can be determined that the second version number is the same as the update version number, and thus it can be determined that the version number filled in manually is correct. Therefore, it can be determined that the update version number is the updated version number in the preset storage space.
[0117] Alternatively, if the second version number is different from the update version number, the second version number is stored in the preset storage space, and the update version number is deleted.
[0118] For example, in the above example, if it is determined that the second version number is 1.1.2, and assuming that the currently manually filled update version number is 8.0.0, then it can be determined that the second version number is different from the update version number, and thus it can be determined that the version number filled in manually is incorrect. Then, in order to ensure that the correct version number is updated to the preset storage space, the second version number can be stored in the preset storage space, and the update version number in the preset storage space is deleted.
[0119] When storing the second version number in the preset storage space, in order to enable the person filling in the version number to determine that the version number they filled in has been updated, for example, a prompt message can be displayed first. The prompt message is used to prompt that the generated second version number is different from the stored update version number. Then, if a modification confirmation message for the prompt message is received, it is determined to use the second version number to overwrite the update version number. The modification confirmation message is, for example, generated when the user operates on the interaction interface to indicate agreement to use the second version number to overwrite the update version number.
[0120] The version number processing method provided by the embodiments of the present disclosure determines the second version number based on the changes in the interface layer of the component code when generating the second version number. Therefore, the second version number in this embodiment can effectively reflect whether there are changes in the interface layer of the component code, and specifically what changes have occurred, whether it is deletion, modification, or addition. Therefore, the second version number generated in this embodiment can quickly and effectively reflect the change information of the component code, so as to enhance the richness of the information expressed by the version number. At the same time, in this embodiment, when updating the version number, it can first be determined whether the version number has been modified. If it has been modified, a prompt is given to indicate whether it is necessary to use the automatically generated second version number to overwrite the manually filled version number. If there is no modification, the new version number is directly written, so as to support both the automatic filling of the version number and the manual filling of the version number at the same time, thereby improving the flexibility of filling in the version number. And for the manually filled version number, further verification will be carried out. When it is determined that the manually filled version number is inconsistent with the automatically generated version number, a prompt for modification will be given, thereby effectively improving the correctness of filling in the version number.
[0121] Figure 7 The structural schematic diagram of the version number processing device according to an embodiment of the present disclosure. As Figure 7 shown, the version number processing device 700 in this embodiment may include: an acquisition module 701, a first determination module 702, a second determination module 703, and an update module 704.
[0122] The acquisition module 701 is configured to acquire the currently stored first component code from a preset storage space, and acquire the first version number corresponding to the first component code;
[0123] The first determination module 702 is configured to determine the change information of the second component code to be submitted according to the first component code;
[0124] The second determination module 703 is configured to determine the second version number of the second component code to be submitted according to the change information and the first version number;
[0125] The update module 704 is configured to update the component code and version number stored in the preset storage space according to the second component code and the second version number.
[0126] In a possible implementation manner, the first determination module 702 is specifically configured to:
[0127] Acquire the interface layer information in the first component code, and acquire the interface layer information in the second component code, where the interface layer information includes at least one of the following: class name, function name, variable name, variable definition, constant definition;
[0128] Determine the change information of the second component code according to the interface layer information in the first component code and the interface layer information of the second component code.
[0129] In a possible implementation manner, the first determination module 702 is specifically configured to:
[0130] If the interface layer information in the first component code is the same as the interface layer information in the second component code, determine that the change information is the first change information; or,
[0131] If the interface layer information in the first component code is increased relative to the interface layer information in the second component code, determine that the change information is the second change information; or,
[0132] If the interface layer information in the first component code is deleted or modified relative to the interface layer information in the second component code, determine that the change information is the third change information.
[0133] In a possible implementation, the version number sequentially includes a first byte, a second byte, and a third byte;
[0134] The second determination module 703 is specifically configured to:
[0135] Obtain the first byte, the second byte, and the third byte in the first version number;
[0136] According to the change information, update at least one of the first byte, the second byte, and the third byte to obtain an updated first byte, an updated second byte, and an updated third byte;
[0137] Determine the second version number of the second component code, where the second version number sequentially includes the updated first byte, the updated second byte, and the updated third byte.
[0138] In a possible implementation, the second determination module 703 is specifically configured to:
[0139] If the change information is the first change information, add 1 to the third byte in the first version number to obtain an updated first byte, an updated second byte, and an updated third byte; or,
[0140] If the change information is the second change information, add 1 to the second byte in the first version number and set the third byte to a preset value to obtain an updated first byte, an updated second byte, and an updated third byte; or,
[0141] If the change information is the third change information, add 1 to the first byte in the first version number and set the second byte and the third byte to the preset value to obtain an updated first byte, an updated second byte, and an updated third byte.
[0142] In a possible implementation, the version number further includes a fourth byte, and the fourth byte is used to record the time when the component code is submitted;
[0143] The second determination module 703 is further configured to:
[0144] After updating at least one of the first byte, the second byte, and the third byte according to the change information to obtain an updated first byte, an updated second byte, and an updated third byte, obtain the submission time of the second component code and determine the submission time as the fourth byte;
[0145] Among them, the second version number sequentially includes the updated first byte, the updated second byte, the updated third byte, and the fourth byte.
[0146] In a possible implementation, the update module 704 is specifically configured to:
[0147] Store the second component code in the preset storage space, and delete the first component code in the preset storage space;
[0148] Update the version number stored in the preset storage space according to the second version number.
[0149] In a possible implementation, the update module 704 is specifically configured to:
[0150] If the version number in the preset storage space has not been updated, store the second version number in the preset storage space, and delete the first version number in the preset storage space; or,
[0151] If the version number in the preset storage space has been updated, obtain the updated version number stored in the preset storage space, and perform verification according to the second version number and the updated version number to update the version number stored in the preset storage space.
[0152] In a possible implementation, the update module 704 is specifically configured to:
[0153] If the second version number is the same as the updated version number, determine that the updated version number is the updated version number in the preset storage space; or,
[0154] If the second version number is different from the updated version number, store the second version number in the preset storage space, and delete the updated version number.
[0155] In a possible implementation, the update module 704 is specifically configured to:
[0156] Display a prompt message for prompting that the generated second version number is different from the stored updated version number;
[0157] If a modification confirmation message for the prompt message is received, determine to use the second version number to overwrite the updated version number.
[0158] The present disclosure provides a version number processing method and apparatus, which are applied to the big data field in a computer to achieve the purpose of improving the accuracy and efficiency of version number update.
[0159] It should be noted that the human head model in this embodiment is not a human head model specific to a certain user and does not reflect the personal information of a certain specific user. It should be noted that the two-dimensional face images in this embodiment are from a public data set.
[0160] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, and disclosure of the user's personal information and other processing are all in compliance with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0161] According to the embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0162] According to the embodiments of the present disclosure, the present disclosure also provides a computer program product. The computer program product includes: a computer program. The computer program is stored in a readable storage medium. At least one processor of the electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to enable the electronic device to execute the solution provided in any of the above embodiments.
[0163] Figure 8 FIG. shows a schematic block diagram of an exemplary electronic device 800 that can be used to implement the embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0164] As Figure 8 shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 802 or the computer program loaded from the storage unit 808 into the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.
[0165] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as a keyboard, mouse, etc.; output unit 807, such as various types of displays, speakers, etc.; storage unit 808, such as a disk, optical disc, etc.; and communication unit 809, such as a network card, modem, wireless communication transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0166] Computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of computing unit 801 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Computing unit 801 executes the various methods and processes described above, such as the version number processing method. For example, in some embodiments, the version number processing method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by computing unit 801, one or more steps of the version number processing method described above can be executed. Alternatively, in other embodiments, computing unit 801 can be configured to execute the version number processing method in any other suitable way (e.g., by means of firmware).
[0167] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), system-on-a-chip systems (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0168] The program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, a special purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program codes may be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on the remote machine or server.
[0169] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0170] In order to provide interaction with a user, the systems and techniques described herein may be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0171] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
[0172] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services ("Virtual Private Server", or simply "VPS"). The server can also be a server of a distributed system, or a server combined with a blockchain.
[0173] It should be understood that various forms of the processes shown above can be used, reordering, adding, or deleting steps. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitations are imposed herein.
[0174] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A method for processing version numbers, comprising: Obtaining the currently stored first component code from a preset storage space, and obtaining the first version number corresponding to the first component code; Obtaining the interface layer information in the first component code, and obtaining the interface layer information in the second component code, where the interface layer information includes at least one of the following: class name, function name, variable name, variable definition, constant definition; Determining the change information of the second component code according to the interface layer information in the first component code and the interface layer information of the second component code; Determining the second version number of the second component code to be submitted according to the change information and the first version number; Storing the second component code in the preset storage space, and deleting the first component code in the preset storage space; If the version number in the preset storage space is not updated, storing the second version number in the preset storage space, and deleting the first version number in the preset storage space; or, If the version number in the preset storage space has been updated, obtaining the updated version number stored in the preset storage space, and performing verification according to the second version number and the updated version number to update the version number stored in the preset storage space.
2. The method according to claim 1, wherein The determining the change information of the second component code according to the interface layer information in the first component code and the interface layer information of the second component code includes: If the interface layer information in the first component code is the same as the interface layer information in the second component code, determining the change information as the first change information; or, If there is an increase in the interface layer information in the first component code relative to the interface layer information in the second component code, determining the change information as the second change information; or, If there is a deletion or modification in the interface layer information in the first component code relative to the interface layer information in the second component code, determining the change information as the third change information.
3. The method according to claim 1 or 2, wherein The version number sequentially includes a first byte, a second byte, and a third byte; Determining the second version number of the second component code to be submitted according to the change information and the first version number includes: Obtaining the first byte, the second byte, and the third byte in the first version number; Updating at least one of the first byte, the second byte, and the third byte according to the change information to obtain an updated first byte, an updated second byte, and an updated third byte; Determining the second version number of the second component code, where the second version number sequentially includes the updated first byte, the updated second byte, and the updated third byte.
4. The method according to claim 3, wherein The updating at least one of the first byte, the second byte, and the third byte according to the change information to obtain an updated first byte, an updated second byte, and an updated third byte includes: If the change information is the first change information, adding 1 to the third byte in the first version number to obtain an updated first byte, an updated second byte, and an updated third byte; or, If the change information is the second change information, increment the second byte in the first version number by 1, and set the third byte to a preset value to obtain an updated first byte, an updated second byte, and an updated third byte; or, If the change information is the third change information, increment the first byte in the first version number by 1, and set the second byte and the third byte to the preset value to obtain an updated first byte, an updated second byte, and an updated third byte.
5. The method according to claim 4, wherein the version number further includes a fourth byte for recording the time when the component code is submitted; After updating at least one of the first byte, the second byte, and the third byte according to the change information to obtain an updated first byte, an updated second byte, and an updated third byte, the method further includes: Obtaining the submission time of the second component code and determining the submission time as the fourth byte; Wherein, the second version number sequentially includes the updated first byte, the updated second byte, the updated third byte, and the fourth byte.
6. The method according to claim 1, wherein, The verifying according to the second version number and the updated version number to update the version number stored in the preset storage space includes: If the second version number is the same as the updated version number, determining the updated version number as the updated version number in the preset storage space; or, If the second version number is different from the updated version number, storing the second version number in the preset storage space and deleting the updated version number.
7. The method according to claim 6, wherein, The storing the second version number in the preset storage space and deleting the updated version number includes: Displaying a prompt message for prompting that the generated second version number is different from the stored updated version number; If a modification confirmation message for the prompt message is received, determining to overwrite the updated version number with the second version number.
8. A version number processing device, comprising: An obtaining module, configured to obtain a currently stored first component code from a preset storage space, and obtain a first version number corresponding to the first component code; A first determining module, configured to obtain interface layer information in the first component code and obtain interface layer information in the second component code, where the interface layer information includes at least one of the following: class name, function name, variable name, variable definition, constant definition; determining change information of the second component code according to the interface layer information in the first component code and the interface layer information of the second component code; A second determining module, configured to determine a second version number of the second component code to be submitted according to the change information and the first version number; An updating module, configured to store the second component code in the preset storage space and delete the first component code in the preset storage space; If the version number in the preset storage space has not been updated, store the second version number in the preset storage space and delete the first version number in the preset storage space; or, If the version number in the preset storage space has been updated, obtain the updated version number stored in the preset storage space, and perform verification based on the second version number and the updated version number to update the version number stored in the preset storage space.
9. The device according to claim 8, wherein, The first determination module is specifically configured to: If the interface layer information in the first component code is the same as the interface layer information in the second component code, determine that the change information is first change information; or, If there is an increase in the interface layer information in the first component code relative to the interface layer information in the second component code, determine that the change information is second change information; Or, If there is a deletion or modification in the interface layer information in the first component code relative to the interface layer information in the second component code, determine that the change information is third change information.
10. The device according to claim 8 or 9, wherein, The version number sequentially includes a first byte, a second byte, and a third byte; The second determination module is specifically configured to: Obtain the first byte, the second byte, and the third byte in the first version number; Update at least one of the first byte, the second byte, and the third byte according to the change information to obtain an updated first byte, an updated second byte, and an updated third byte; Determine the second version number of the second component code, where the second version number sequentially includes the updated first byte, the updated second byte, and the updated third byte.
11. The device according to claim 10, wherein, The second determination module is specifically configured to: If the change information is first change information, add 1 to the third byte in the first version number to obtain an updated first byte, an updated second byte, and an updated third byte; or, If the change information is second change information, add 1 to the second byte in the first version number and set the third byte to a preset value to obtain an updated first byte, an updated second byte, and an updated third byte; or, If the change information is third change information, add 1 to the first byte in the first version number and set the second byte and the third byte to the preset value to obtain an updated first byte, an updated second byte, and an updated third byte.
12. The device according to claim 11, wherein the version number further includes a fourth byte, and the fourth byte is used to record the time when the component code is submitted; The second determination module is further configured to: After updating at least one of the first byte, the second byte, and the third byte according to the change information to obtain an updated first byte, an updated second byte, and an updated third byte, obtain the submission time of the second component code and determine the submission time as the fourth byte; Among them, The second version number sequentially includes the updated first byte, the updated second byte, the updated third byte, and the fourth byte.
13. The apparatus according to claim 8, wherein, The update module is specifically configured to: If the second version number is the same as the update version number, determine the update version number as the updated version number in the preset storage space; or, If the second version number is different from the update version number, store the second version number in the preset storage space and delete the update version number.
14. The apparatus according to claim 13, wherein, The update module is specifically configured to: Display a prompt message for prompting that the generated second version number is different from the stored update version number; If a modification confirmation message for the prompt message is received, determine to overwrite the update version number with the second version number.
15. An electronic device, comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1-7.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
17. A computer program product, comprising a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1-7.
Citation Information
Patent Citations
Techniques for maintaining compatibility of a software core module and an interacting module
US6971093B1