Operating system version updating method and storage medium
By obtaining and merging the update code of the distributed version control system in the operating system, performing code testing and target code determination, the problems of low version update efficiency and large data volume in the existing technology are solved, and efficient operating system version update is achieved.
Patent Information
- Application Number
- CN202411888024.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-25
AI Technical Summary
The existing technology lacks standardized operating system version update methods, resulting in low version update efficiency and large data volume, affecting the normal operation of the operating system.
By obtaining the update code for version update in the branch of the distributed version control system, combining it into the current code on the main branch, performing code testing, determining the target code, and performing version updates based on the target code.
Ensure that the updated operating system can run normally, reduce the amount of updated data, and improve the efficiency of the operating system version update.
Smart Images

Figure CN119883314A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data processing, and in particular to an operating system version updating method and a storage medium. Background Art
[0002] The open source Dianhong IoT operating system has the characteristics of the Internet of Everything, which can realize the interconnection between various types of power equipment, facilitate the unified management and interactive collaboration of power equipment, and thus make the transmission and processing of power data clearer and more efficient.
[0003] However, there is currently a lack of standardized version update methods when updating the operating system, which urgently needs to be solved. Summary of the invention
[0004] The embodiment of the present invention provides an operating system version update method and a storage medium to implement version update of a target operating system.
[0005] According to one aspect of the present invention, a method for updating an operating system version is provided, which may include:
[0006] For a target operating system to be updated, obtaining an update code for updating the target operating system in a branch of a distributed version control system;
[0007] Merge the updated code into the current code on the main branch of the distributed version control system to obtain the merged code, and perform code testing on the merged code, wherein the current code is the system code currently applied by the target operating system;
[0008] If the merged code test passes, determine the target code for version updating of the target operating system based on the merged code and the current code;
[0009] Based on the target code, the target operating system is updated.
[0010] According to another aspect of the present invention, a computer-readable storage medium is provided, on which computer instructions are stored, and the computer instructions are used to enable a processor to implement the operating system version update method provided by any embodiment of the present invention when executed.
[0011] The technical solution in the embodiment of the present invention is to obtain the update code for updating the target operating system in the branch of the distributed version control system for the target operating system to be updated; merge the update code into the current code on the main branch of the distributed version control system to obtain the merged code, and perform code testing on the merged code, wherein the current code is the system code currently applied by the target operating system to ensure that the updated operating system can run normally; if the merged code test passes, determine the target code for updating the target operating system based on the merged code and the current code to reduce the amount of updated data and improve the efficiency of the operating system version update; based on the target code, perform version update on the target operating system. The above technical solution can realize version update of the target operating system through a distributed version control system.
[0012] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0014] Figure 1 is a flowchart of an operating system version update method provided according to an embodiment of the present invention;
[0015] Figure 2 is a flowchart of another operating system version update method provided according to an embodiment of the present invention;
[0016] Figure 3 is a flowchart of another operating system version update method provided according to an embodiment of the present invention;
[0017] Figure 4 is a flowchart of an operating system version updating method according to a specific example of another operating system version updating method provided in an embodiment of the present invention;
[0018] Figure 5 is a structural block diagram of an operating system version updating device provided according to an embodiment of the present invention;
[0019] Figure 6 It is a structural schematic diagram of an electronic device that implements the operating system version updating method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. The situations of "target", "original", etc. are similar and will not be repeated here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0022] Figure 1 1 is a flowchart of an operating system version update method provided in an embodiment of the present invention. This embodiment is applicable to the case where the operating system version is updated. The method can be executed by an operating system version update device provided in an embodiment of the present invention, and the device can be implemented by software and / or hardware. The device can be integrated in an electronic device, and the electronic device can be various user terminals or servers.
[0023] See also Figure 1 The method of the embodiment of the present invention specifically includes the following steps:
[0024] S110: For a target operating system to be updated, obtain an update code for updating the target operating system in a branch of a distributed version control system.
[0025] The target operating system can be understood as the IoT operating system to be updated, and the target operating system can be used to interconnect hardware devices such as monitoring systems, protection devices, cameras, and environmental sensors in the power system. Optionally, the target operating system can be a Dianhong operating system.
[0026] A distributed version control system can be understood as a version control system that allows each software developer to have a complete copy of the code repository on their own computer, such as the Git (Git-Distributed Version Control System) system and the Mercurial system.
[0027] The update code for updating the target operating system can be more conveniently written in the branch of the distributed version control system, so as to improve the development efficiency and writing flexibility of the update code.
[0028] S120, merging the updated code into the current code on the main branch of the distributed version control system to obtain a merged code, and performing code testing on the merged code, wherein the current code is the system code currently applied by the target operating system.
[0029] The current code can be understood as the code currently applied by the distributed version control system. By merging the updated code with the current code, the merged code to update the distributed version control system can be obtained. The feasibility and security of the merged code can then be verified by code testing the merged code.
[0030] S130: When the merged code test passes, determine a target code for performing a version update on the target operating system based on the merged code and the current code.
[0031] The target code can be understood as the code to be issued to each distributed version control system to update the version of the distributed version control system. It can be determined by the merged code and the current code. Optionally, the merged code and the current code can be compared, and the changed part can be used as the target code. The merged code can also be further verified by the current code, and the verified merged code can be used as the target code.
[0032] S140: Update the target operating system based on the target code.
[0033] After receiving the target code, the target operating system can execute the target code to perform version update.
[0034] The technical solution in the embodiment of the present invention is to obtain the update code for updating the target operating system in the branch of the distributed version control system for the target operating system to be updated; merge the update code into the current code on the main branch of the distributed version control system to obtain the merged code, and perform code testing on the merged code, wherein the current code is the system code currently applied by the target operating system to ensure that the updated operating system can run normally; if the merged code test passes, determine the target code for updating the target operating system based on the merged code and the current code to reduce the amount of updated data and improve the efficiency of the operating system version update; based on the target code, perform version update on the target operating system. The above technical solution can realize version update of the target operating system through a distributed version control system.
[0035] An optional technical solution also includes: based on a secure hash algorithm, calculating the hash values corresponding to the update code, the current code and the target code respectively, so as to detect the calling and tampering of the update code, the current code and the target code based on each hash value.
[0036] Among them, the secure hash algorithm can generate a unique hash value based on the data to be processed. Optionally, it can be the SHA-256 secure hash algorithm. The SHA-256 secure hash algorithm is a one-way hash function, that is, the original input data cannot be deduced from the hash value. Different input data will produce different hash values. Even if the input data has only slight differences, regardless of the length of the input data, the output hash value is always 256 bits. Through the secure hash algorithm, the hash values corresponding to the update code, current code and target code are calculated respectively. Based on each hash value, the call and tampering of the update code, current code and target code can be detected.
[0037] The above technical solution can improve the traceability and security of the code through the secure hash algorithm.
[0038] Another optional technical solution is that code testing includes unit testing and integration testing, and code testing is performed on the merged code, including: compiling the merged code into a binary file; and performing unit testing and integration testing on the binary file.
[0039] When testing the merged code, the merged code can be compiled into a binary file to facilitate automated testing. Optionally, the merged code can be compiled into a binary file through project management tools such as Maven and Gradle. Then, by implementing the CI / CD process, the binary file can be automatically unit tested and integrated tested to verify the correctness of the merged code, the collaborative work between modules, and the overall functionality.
[0040] The above technical solution can perform automated code testing on the merged code and improve testing efficiency.
[0041] Another optional technical solution, after the target operating system is updated, further includes: obtaining the updated operating system; and migrating the data of the target operating system to the updated operating system based on a pre-written data migration script associated with the target code.
[0042] The updated operating system can be understood as an updated operating system obtained by updating the target operating system based on the target code. After obtaining the updated operating system, the data of the target operating system can be migrated to the updated operating system using a pre-written data migration script associated with the target code to ensure that the data of the target operating system can be smoothly migrated to the updated operating system.
[0043] The above technical solution can realize the automatic migration of updated target operating system data.
[0044] Figure 2 It is a flowchart of another operating system version update method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, based on the merged code and the current code, a target code for version updating of the target operating system is determined, including: for dependencies in the merged code and functional components in the merged code that interact with the dependencies, based on a pre-built version compatibility test model, compatibility testing is performed on the dependencies and functional components; when the result of the compatibility test is passed, the target code for version updating of the target operating system is determined based on the merged code and the current code.
[0045] The explanations of the terms that are the same as or corresponding to the above embodiments are not repeated here.
[0046] See also Figure 2 The method of this embodiment may specifically include the following steps:
[0047] S210: For a target operating system to be updated, obtain an update code for updating the target operating system in a branch of a distributed version control system.
[0048] S220, merging the updated code into the current code on the main branch of the distributed version control system to obtain a merged code, and performing code testing on the merged code, wherein the current code is the system code currently applied by the target operating system.
[0049] S230. When the merged code test passes, compatibility testing is performed on the dependencies in the merged code and the functional components in the merged code that interact with the dependencies based on a pre-built version compatibility testing model.
[0050] Among them, when the merged code test passes, it is necessary to perform compatibility testing on the dependencies in the merged code and the functional components in the merged code that interact with the dependencies to avoid compatibility problems caused by dependency updates.
[0051] The compatibility test model can be understood as a pre-built model for automated testing of the dependencies of the merged code. Optionally, the compatibility test model can be built using algorithms such as random forests and support vector machines. After the build is complete, the compatibility test model can be used to perform compatibility tests on dependencies and functional components.
[0052] S240: When the result of the compatibility test is passed, determine the target code for version updating of the target operating system based on the merged code and the current code.
[0053] S250: Based on the target code, update the target operating system.
[0054] The technical solution of the embodiment of the present invention performs compatibility testing on the merged code through a compatibility testing model, which can improve the accuracy of version compatibility prediction and identify potential version conflicts in advance, providing strong support for version update decisions.
[0055] An optional technical solution determines the target code for version updating of the target operating system based on the merged code and the current code, including: processing the merged code and the current code based on binary difference technology to determine the target code for version updating of the target operating system.
[0056] The binary difference technology can merge the difference between the code and the current code at the instruction level or the data level. Based on the binary difference technology, the merged code and the current code can be processed, and the target code for the version update of the target operating system can be determined according to the processing result.
[0057] On this basis, optionally, based on binary difference technology, the merged code and the current code are processed to determine the target code for version update of the target operating system, including:
[0058] Based on the binary difference technology, the merged code and the current code are compared to determine the differential code in the merged code that is different from the current code; the differential code is used as the target code for version updating of the target operating system.
[0059] Among them, the merged code and the current code can be compared based on binary difference technology to determine the differential code in the merged code that is different from the current code. Optionally, during the comparison process, the difference code can be identified through multiple comparison methods such as byte-by-byte comparison, hash-based comparison, and structure-based comparison. The differential code is further used as the target code for version update of the target operating system.
[0060] The above technical solution can identify the difference between the level merged code and the current code through binary difference technology, and only update the difference part, thereby improving the efficiency of version update.
[0061] Figure 3 It is a flowchart of another operating system version update method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, based on the target code, the target operating system is updated, including: based on a pre-set version naming strategy, the target code is named, and based on the named target code, the target operating system is updated. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.
[0062] See also Figure 3 The method of this embodiment may specifically include the following steps:
[0063] S310: For a target operating system to be updated, obtain an update code for updating the target operating system in a branch of a distributed version control system.
[0064] S320, merging the updated code into the current code on the main branch of the distributed version control system to obtain a merged code, and performing code testing on the merged code, wherein the current code is the system code currently applied by the target operating system.
[0065] S330: When the merged code test passes, determine the target code for performing version update on the target operating system based on the merged code and the current code.
[0066] S340: Name the target code based on a preset version naming strategy, and update the target operating system based on the named target code.
[0067] The version naming strategy can be understood as a strategy for naming the target code. The target code can be named according to the pre-set version naming strategy to ensure that the updated content of each version is clear and unambiguous.
[0068] The technical solution of the embodiment of the present invention can be understood as naming the target code through the version naming strategy, which can ensure the clarity of the updated content of each version and improve the traceability of the version update.
[0069] An optional technical solution, the version naming strategy includes a version number release naming strategy and a version release naming strategy, and the target code is named based on a pre-set version naming strategy, including: using the pre-set version number release naming strategy to determine the version number of the target code based on the version update type corresponding to the target code; based on the released version of the target code, using the version release naming strategy to determine the version suffix of the target code; naming the target code based on the version number and the version suffix.
[0070] The version number release naming strategy can be understood as a strategy for naming the version number of the target code, which can include a major version number, a subversion number, and a revision number. The version number of the target code can be determined according to the corresponding version update type of the target code. For example, when an incompatible API modification is made, the major version number needs to be increased; when a backward compatible functional addition is made, the minor version number needs to be increased; when a backward compatible problem is corrected, the revision number needs to be increased.
[0071] The version release naming strategy can be understood as a strategy for naming the version suffix of the target code, such as development version and release version.
[0072] You can use the version number release naming strategy to determine the version number of the target code based on the version update type corresponding to the target code, and use the version release naming strategy to determine the version suffix of the target code based on the released version of the target code. Finally, combine the version number and version suffix to name the target code.
[0073] The above technical solution can clearly and explicitly show the updated content of the target code by naming the version number and version suffix of the target code.
[0074] In order to better understand the above-mentioned technical solutions, the following is an exemplary description in combination with a specific example. In this specific example, the target operating system is the Dianhong operating system and the distributed version control system is the Git system. Figure 4 As shown, the specific steps are as follows:
[0075] Step 1: Get the update code for updating the version of the Dianhong operating system in the branch of the Git system.
[0076] Step 2: Merge the updated code into the current code on the main branch of the Git system to obtain the merged code.
[0077] Step 3: Perform code testing on the merged code.
[0078] Submit the merged code to the Git system's code repository, implement the CI / CD process, and use build tools such as Maven or Gradle to compile the merged code into an executable binary file. After the build is completed, perform automated testing, including unit testing and integration testing, to verify the correctness of the code, the collaboration between modules, and the overall functionality. The build and test results need to be fed back to the development team members in a timely manner so that they can quickly know the test status of the code.
[0079] Step 4: Based on the merged code and the current code, determine the target code and name the target code. Based on the target code, update the version of the Dianhong operating system.
[0080] Determine the version number of the target code according to the corresponding version update type of the target code. For example, fix a bug: update the version to 1.2.4; add a new feature: update the version to 1.3.0; make incompatible changes: update the version to 2.0.0. Use the version number release naming strategy to determine the version number of the target code based on the version update type corresponding to the target code. Based on the release version of the target code, use the version release naming strategy to determine the version suffix of the target code, for example, release a development version: update the version to 2.0.0-alpha.
[0081] Step 5: Based on a pre-written data migration script associated with the target code, migrate the data of the Dianhong operating system before the version update to the Dianhong operating system after the version update.
[0082] Write data migration scripts to ensure that data from the old version of the Dianhong operating system can be smoothly migrated to the new version. Develop upgrade strategies, including online upgrades and offline upgrades, to ensure smooth upgrades to the new version. Use the D3.js data visualization library to achieve intuitive display of version differences and dependencies to assist decision-making analysis.
[0083] Step 6: Establish a monitoring system to monitor the operating status and performance of the updated Dianhong operating system.
[0084] The monitoring system is used to monitor the operating status and performance of the Dianhong operating system. Through the monitoring system, potential problems can be discovered and repaired in a timely manner to ensure the stability and reliability of the system. Security audits and vulnerability scans are performed on the Dianhong operating system on a regular basis to ensure the security of the system.
[0085] In this specific example, the version of the target operating system can be updated through the Git system.
[0086] Figure 5This is a structural block diagram of an operating system version update device provided in an embodiment of the present invention, and the device is used to execute the operating system version update method provided in any of the above embodiments. The device and the operating system version update method of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the operating system version update device, please refer to the embodiment of the above operating system version update method. Figure 5 The device may specifically include: an update code acquisition module 410, a code testing module 420, a target code determination module 430 and a version update module 440.
[0087] The update code acquisition module 410 is used to acquire, for a target operating system to be updated, an update code for performing a version update on the target operating system in a branch of the distributed version control system;
[0088] A code testing module 420 is used to merge the updated code into the current code on the main branch of the distributed version control system to obtain the merged code, and perform code testing on the merged code, wherein the current code is the system code currently applied by the target operating system;
[0089] A target code determination module 430 is used to determine a target code for performing a version update on a target operating system based on the merged code and the current code when the merged code test passes;
[0090] The version update module 440 is used to update the version of the target operating system based on the target code.
[0091] Optionally, the target code determination module 430 includes:
[0092] A compatibility test submodule, which is used to perform compatibility tests on dependencies and functional components in the merged code that interact with dependencies based on a pre-built version compatibility test model;
[0093] The target code determination submodule is used to determine the target code for version updating of the target operating system based on the merged code and the current code when the result of the compatibility test is passed.
[0094] On this basis, an optional, target code determination submodule includes:
[0095] The target code determination unit is used to process the merged code and the current code based on the binary difference technology to determine the target code for version updating of the target operating system.
[0096] On this basis, optionally, the target code determination unit includes:
[0097] A differential code determination subunit, used for comparing the merged code with the current code based on a binary difference technique, and determining a differential code in the merged code that is different from the current code;
[0098] The target code determination subunit is used to use the differential code as the target code for version updating of the target operating system.
[0099] Alternatively, the version update module 440 includes:
[0100] The version update submodule is used to name the target code based on a preset version naming strategy, and to perform version update on the target operating system based on the named target code.
[0101] On this basis, an optional version naming strategy includes a version number release naming strategy and a version release naming strategy, and a version update submodule, including:
[0102] A version number determination unit, used to determine the version number of the target code based on the version update type corresponding to the target code by using a preset version number release naming strategy;
[0103] A version suffix determination unit, used to determine the version suffix of the target code based on the release version of the target code and using the version release naming strategy;
[0104] The object code naming unit is used to name the object code based on the version number and version suffix.
[0105] Another option also includes:
[0106] The code detection module is used to calculate the hash values corresponding to the update code, the current code and the target code based on the secure hash algorithm, so as to detect the calling and tampering of the update code, the current code and the target code based on the hash values.
[0107] Alternatively, the code test includes unit test and integration test, and the code test module 420 includes:
[0108] The binary file compilation submodule is used to compile the merged code into binary files;
[0109] Integration-test submodule for performing unit and integration tests on the binary.
[0110] Another option also includes:
[0111] An operating system update module is used to obtain an updated operating system;
[0112] The data migration module is used to migrate the data of the target operating system to the updated operating system based on a pre-written data migration script associated with the target code.
[0113] The operating system version update device in the embodiment of the present invention obtains the update code for performing version update on the target operating system to be updated in the branch of the distributed version control system through the update code acquisition module; merges the update code into the current code on the main branch of the distributed version control system through the code testing module to obtain the merged code, and performs code testing on the merged code, wherein the current code is the system code currently applied by the target operating system to ensure that the updated operating system can run normally; through the target code determination module, if the merged code test passes, the target code for performing version update on the target operating system is determined based on the merged code and the current code to reduce the amount of updated data and improve the operating system version update efficiency; through the version update module, the target operating system is updated based on the target code. The above technical scheme can realize version update of the target operating system through a distributed version control system.
[0114] The operating system version updating device provided in the embodiment of the present invention can execute the operating system version updating method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0115] It is worth noting that in the embodiment of the above-mentioned operating system version updating device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0116] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) 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 invention described and / or required herein.
[0117] like Figure 6As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11 in communication, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14. Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks. The processor 11 can be various general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc.
[0118] The processor 11 performs the various methods and processes described above, such as the operating system version update method. In some embodiments, the operating system version update method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via ROM12 and / or communication unit 19. When the computer program is loaded into RAM13 and executed by the processor 11, one or more steps of the operating system version update method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the operating system version update method in any other appropriate manner (for example, by means of firmware). Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip systems (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs, which may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general programmable processor, which may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device. The computer program for implementing the method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a dedicated computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server. In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or device. Computer readable storage media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium.More specific examples of machine-readable storage media would include electrical connections based on one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device 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 trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input from the user can be received in any form (including acoustic input, voice input, or tactile input). The systems and techniques described herein may be implemented in a computing system including a backend component (e.g., as a data server), or a computing system including a middleware component (e.g., an application server), or a computing system including a frontend component (e.g., a user computer with 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 may be interconnected by digital data communication (e.g., a communication network) in any form or medium. Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet. A computing system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client and server relationship is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services. It should be understood that the various forms of the process shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, as long as the expected results of the technical solution of the present invention can be achieved, and this document does not impose any limitations thereon.
[0119] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for updating an operating system version, characterized in that: include: For a target operating system to be updated, obtaining an update code for updating the target operating system in a branch of a distributed version control system; Merging the updated code into the current code on the main branch of the distributed version control system to obtain a merged code, and performing code testing on the merged code, wherein the current code is the system code currently applied by the target operating system; If the merged code test passes, determining a target code for performing a version update on the target operating system based on the merged code and the current code; Based on the target code, the target operating system is updated.
2. The method according to claim 1, characterized in that: The step of determining a target code for performing a version update on the target operating system based on the merged code and the current code includes: For dependencies in the merged code and functional components in the merged code that interact with the dependencies, based on a pre-built version compatibility test model, compatibility testing is performed on the dependencies and the functional components; When the result of the compatibility test is passed, a target code for performing a version update on the target operating system is determined based on the merged code and the current code.
3. The method according to claim 2, characterized in that The step of determining a target code for performing a version update on the target operating system based on the merged code and the current code includes: Based on the binary difference technology, the merged code and the current code are processed to determine the target code for version updating of the target operating system.
4. The method according to claim 3, characterized in that: The step of processing the merged code and the current code based on the binary difference technology to determine the target code for performing version update on the target operating system includes: Based on the binary difference technology, the merged code and the current code are compared to determine the differential code in the merged code that is different from the current code; The differential code is used as the target code for performing version update on the target operating system.
5. The method according to claim 1, characterized in that The updating of the target operating system based on the target code includes: The target code is named based on a preset version naming strategy, and the target operating system is updated based on the named target code.
6. The method according to claim 5, characterized in that The version naming strategy includes a version number release naming strategy and a version release naming strategy. The target code is named based on the preset version naming strategy, including: Determining the version number of the target code based on the version update type corresponding to the target code by using the preset version number release naming strategy; Based on the release version of the target code, using the version release naming strategy, determining a version suffix of the target code; The object code is named based on the version number and the version suffix.
7. The method according to claim 1, characterized in that Also includes: Based on a secure hash algorithm, hash values corresponding to the update code, the current code and the target code are calculated respectively, so as to detect the calling and tampering of the update code, the current code and the target code based on the hash values.
8. The method according to claim 1, characterized in that The code testing includes unit testing and integration testing, and the code testing of the merged code includes: Compiling the merged code into a binary file; The unit test and the integration test are performed on the binary file.
9. The method according to claim 1, characterized in that: After the target operating system is updated, the method further includes: Get an updated operating system; Based on a pre-written data migration script associated with the target code, the data of the target operating system is migrated to the updated operating system.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the operating system version update method as described in any one of claims 1-9 when executed.