Version rollback control method and device, medium and program product
By obtaining the mapping relationship between hardware models and supporting date and time, the date and time threshold is determined, and the problem of lack of automation and flexibility of version fallback methods in the prior art is solved, and a more concise and flexible version fallback control is achieved to ensure device stability and reliability.
Patent Information
- Application Number
- CN202410171410.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2025-08-08
AI Technical Summary
The existing version fallback method relies on the configuration compatibility information in the device or version, and lacks automation and flexibility, resulting in the version fallback range being small or unable to adapt to compatible alternative chips, affecting device stability and reliability.
By obtaining the hardware models of multiple target hardware in the device, using the mapping relationship between the hardware models and the supported date and time to determine the date and time threshold, comparing the release date and time of the expected fallback version to determine whether to allow fallback, and avoiding relying on the hardware compatibility information configured in the device or version.
More flexible and automated version fallback control is achieved, improving the simplicity of version fallback, and avoiding the inability to boot up or business interruption caused by the failure of the version to support new compatible alternative chips.
Smart Images

Figure CN120447944A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer equipment technology, and in particular to a version rollback control method, device, medium, and program product. Background Art
[0002] During the development and production of communications equipment, new compatible replacement chips are often introduced. To support these replacement chips, software code must be modified and updated, and new software versions released to accommodate them. However, due to certain needs, such as restoring stability, ensuring data security, and meeting specific requirements, version rollbacks may be necessary. If version rollbacks are not restricted and allow rollbacks to any older version, the rolled-back version may not support the new compatible replacement chip, resulting in device startup failures or service interruptions, impacting device stability and reliability.
[0003] Among the current methods for limiting version rollback, one is to configure version compatibility information in the device to indicate which versions are allowed to roll back, but it does not distinguish between chip types. Instead, a "one-size-fits-all" approach is adopted to directly consider version types compatible with all chips, resulting in a small range of rollback versions. If new compatible replacement chips are added later, the compatibility information in the original device may no longer be accurate. Another version rollback method is to configure chip compatibility information in the software version header. When rolling back the target version, the chip model used in the current device is first obtained, and the target version is parsed to obtain the chip model compatible with the target version. Rollback is allowed only when the model matches. This method requires modifying the software version and releasing the version each time a compatible chip is added, and additional information needs to be attached to the software version to exhaustively enumerate all compatible models. It is not suitable for scenarios where the upgrade method cannot be modified or the software version format cannot be modified due to historical reasons. Summary of the Invention
[0004] The embodiments of the present application provide a version rollback control method, device, medium and program product, which aim to solve the problem that the version rollback method relies on configuring compatibility information in the device or version and lacks automation and flexibility.
[0005] In a first aspect, an embodiment of the present application provides a version rollback control method, the method comprising:
[0006] Get the hardware models of multiple target hardware in the device;
[0007] Determine the support date and time corresponding to each target hardware according to a preset mapping relationship between the hardware model and the support date and time, wherein the support date and time represents the release date and time of the software version supporting the hardware;
[0008] Determine a date and time threshold from supported date and time corresponding to each of the target hardware;
[0009] The release date and time of the expected rollback version is compared with the date and time threshold, and if the release date and time of the expected rollback version is greater than or equal to the date and time threshold, the device is rolled back to the expected rollback version.
[0010] In a second aspect, an embodiment of the present application provides an electronic device, including:
[0011] one or more processors;
[0012] A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the version rollback control method as described in the first aspect.
[0013] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the version rollback control method as described in the first aspect.
[0014] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the version rollback control method as described in the first aspect.
[0015] In an embodiment of the present application, by obtaining the hardware models of multiple target hardware in the device, the supported date and time corresponding to each of the target hardware is determined according to the mapping relationship between the preset hardware model and the supported date and time, a date and time threshold is determined from the supported date and time corresponding to each of the target hardware, the release date and time of the expected rollback version is compared with the date and time threshold, and when the release date and time of the expected rollback version is greater than or equal to the date and time threshold, the device is rolled back to the expected rollback version. The version rollback control method, device and medium proposed in the embodiment of the present application do not rely on the hardware compatibility information configured in the device or version, can control version rollback more flexibly, and improve the simplicity, automation and flexibility of version rollback. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of the structure of a single-board system provided in an embodiment of the present application;
[0017] Figure 2 A flowchart of a version rollback control method provided in an embodiment of the present application;
[0018] Figure 3 A schematic diagram of the mapping relationship between hardware models and supported date and time provided in an embodiment of the present application;
[0019] Figure 4 A schematic diagram of the mapping relationship between another hardware model and supported date and time provided in an embodiment of the present application;
[0020] Figure 5 for Figure 2 Specific flow diagram of step S102;
[0021] Figure 6 A schematic diagram of a process flow for obtaining supported date and time for a hardware category provided in an embodiment of the present application;
[0022] Figure 7 for Figure 2 Specific flow diagram of step S103;
[0023] Figure 8 A schematic diagram of a specific process of a version rollback control method provided in an embodiment of the present application;
[0024] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the technical solution of the present application, the technical solution provided by the present application is described in detail below with reference to the accompanying drawings.
[0026] Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but the described example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the scope of this application to those skilled in the art.
[0027] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0028] The terms used herein are used only to describe specific embodiments and are not intended to limit this application. As used herein, the singular forms "a," "an," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, they specify the presence of features, wholes, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or groups thereof.
[0029] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0030] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present application, and will not be interpreted as having an idealized or overly formal meaning, unless clearly defined in the examples of the present application.
[0031] To facilitate a better understanding of the solutions of the embodiments of the present application, the relevant technologies are first introduced below.
[0032] General-Purpose Input / Output (GPIO) ports serve as a bridge between microcontrollers and other external hardware devices. Widely used in hardware devices such as microcontrollers and embedded systems, they provide a flexible way to read and write digital signals, enabling hardware devices to interact and control external hardware. In STM32 microcontrollers, GPIOs are organized into multiple groups, each containing 16 pins. These pins can be independently configured as input or output and support multiple operating modes. This allows a GPIO group to contain multiple input / output (IO) ports, each of which can be independently configured and controlled to implement digital signal input, output, and interaction. Each GPIO group has corresponding registers to control its configuration and operation, such as the port configuration register, port input data register, and port output data register.
[0033] A Complex Programmable Logic Device (CPLD) is an integrated circuit whose internal logic can be customized by the user. It offers advantages such as flexible programming, high integration, short design and development cycles, and a wide range of applications. CPLDs primarily consist of an array of programmable logic macrocells and a programmable interconnect array, and are primarily used to implement a variety of complex digital systems. Compared with traditional digital system design methods, using CPLDs can significantly shorten design time, improve design efficiency, and reduce design costs. Consequently, CPLDs are widely used in communications, electronics, automation, control systems, and other fields.
[0034] Compatible replacement chips are solutions that can replace traditional chips, offering similar performance, packaging, and pinout to the original chip, while offering lower prices and more stable supply. These replacement chips are typically produced by domestic chip manufacturers and can meet demand for cost-sensitive devices or those requiring a stable supply. When selecting a compatible replacement chip, consider factors such as performance compatibility and packaging compatibility to ensure the final chip meets your needs.
[0035] Version rollback refers to reverting the current state of software or systems to a previous historical version to resolve issues or meet specific requirements. When performing a version rollback, certain principles and steps must be followed, including determining the rollback target, backing up data, executing the rollback operation, and verifying the rollback results. Version rollbacks can help resolve compatibility issues, restore stability, meet specific requirements, or ensure data security. For example, during collaborative development, incorrect commits may occur. In such cases, a version rollback can be used to undo the commit and return the program to its pre-commit state.
[0036] During the development and production of communications equipment, new compatible replacement chips are often introduced. To support these replacement chips, software code must be modified and updated, and new software versions released to accommodate them. However, due to certain needs, such as restoring stability, ensuring data security, and meeting specific requirements, version rollbacks may be necessary. If version rollbacks are not restricted and allow rollbacks to any older version, the rolled-back version may not support the new compatible replacement chip, resulting in device startup failures or service interruptions, impacting device stability and reliability.
[0037] Among the current methods for restricting version rollback, one is to configure version compatibility information in the device to indicate which versions are allowed to roll back. However, this does not distinguish between chip types. Instead, a "one-size-fits-all" approach is adopted to directly consider compatible version types of all chips. If similar chips from different manufacturers and models are mixed during production without distinction, the compatibility information configured for each device will need to consider chips from all manufacturers and models to be compatible, resulting in a small range of rollback versions. If new compatible replacement chips are added later, the compatibility information in the original device may no longer be accurate.
[0038] Another version rollback method is to configure chip compatibility information in the software version header. When rolling back the target version, first obtain the chip model used in the current device, and parse the target version to obtain the chip model compatible with the target version. Rollback is allowed only when the model matches. This method requires modifying the software version and releasing the version every time a compatible chip is added, and additional information needs to be added to the software version to enumerate all compatible models. It is not suitable for scenarios where the upgrade method cannot be modified or the software version format cannot be modified due to historical reasons.
[0039] Please refer to Figure 1 , is a structural diagram of a single board system provided in an embodiment of the present application, such as Figure 1As shown, in the single-board system structure provided by the embodiments of the present application, a single board houses multiple chips, and the central processing unit (CPU) performs initialization, monitoring, and management functions for the entire board. A GPIO group is a set of GPIOs used to indicate the version number of the printed circuit board (PCB) of this board. The GPIO group is connected to the CPU, which in turn is connected to different types of chips.
[0040] It is understandable that in the embodiments of the present application, there are multiple categories of chips, including but not limited to storage chips, Ethernet PHY chips, complex programmable logic chips, etc. The present application does not limit the type of chips used.
[0041] It should be noted that in the embodiment of the present application, the hardware model includes but is not limited to the PCB version number and the chip model.
[0042] When the Figure 1 The single-board system shown imports a new chip to be compatible with the original chip in the single-board system. For example, if the storage chip, Ethernet PHY chip or complex programmable logic chip in the single-board system is replaced, the single-board system needs to be rolled back, and the rolled back version needs to be compatible with all types of hardware in the single-board system (including PCB boards, CPUs and various chips). The version rollback methods provided by related technologies either rely on the version compatibility information configured in the device, resulting in a small range of rollback versions, or are not applicable to scenarios where the upgrade method cannot be modified or the software version format cannot be modified due to historical reasons.
[0043] Based on the above issues, the embodiments of the present application provide a version rollback control method, an electronic device, a computer-readable storage medium and a computer program product, aiming to solve the problem that the version rollback method relies on configuring compatibility information in the device or version and lacks automation and flexibility.
[0044] The following is an introduction to the version rollback control method provided in the embodiment of the present application.
[0045] Please refer to Figure 2 , is a flow chart of a version rollback control method provided in an embodiment of the present application, such as Figure 2 As shown, the version rollback control method provided in the embodiment of the present application includes but is not limited to the following steps:
[0046] Step S101: Obtain hardware models of multiple target hardware in a device.
[0047] Step S102: Determine the supported date and time corresponding to each target hardware according to the preset mapping relationship between the hardware model and the supported date and time.
[0048] Step S103: Determine a date and time threshold from the supported date and time corresponding to each target hardware.
[0049] Step S104: Compare the release date and time of the expected rollback version with the date and time threshold. If the release date and time of the expected rollback version is greater than or equal to the date and time threshold, roll back the device to the expected rollback version.
[0050] According to the technical solution provided by the embodiment of the present application, when the device triggers a version rollback operation, it first obtains the hardware models of multiple target hardware in the device, and then determines the support date and time corresponding to each of the target hardware according to the preset mapping relationship between the hardware model and the support date and time; determines the date and time threshold from the support date and time corresponding to each target hardware, for example, determines the maximum value among the support date and time corresponding to each target hardware as the date and time threshold; then compares the release date and time of the expected rollback version with the date and time threshold, and if the release date and time of the expected rollback version is greater than or equal to the date and time threshold, the device is rolled back to the expected rollback version, otherwise rollback to the version is not allowed. The embodiment of the present application does not rely on configuring hardware compatibility information in the device or version, and is more concise, flexible, and automated than the solutions of the related technology.
[0051] It should be noted that for existing hardware devices, the mapping relationship between hardware models and supported date and time can be constructed through the following steps:
[0052] Traverse all categories of hardware, and for the traversed hardware, obtain the hardware model of the hardware and the release date and time of the software version that supports the hardware, and add the hardware model of the hardware and the release date and time of the software version that supports the hardware to the mapping relationship table, where the mapping relationship table is used to record the mapping relationship between the hardware model and the support date and time.
[0053] For importing new hardware and releasing new software versions to support the new hardware, the mapping between hardware models and supported date and time is constructed using the following steps:
[0054] When a device imports new hardware and releases a new software version to support the new hardware, obtain the hardware model of the new hardware and use the release date and time of the new software version as the support date and time corresponding to the new hardware;
[0055] Add the hardware model and support date and time of the new hardware to the mapping table.
[0056] It is understandable that when new hardware is imported, it is analyzed and determined whether the software code needs to be modified. If the software code needs to be modified to support the hardware, steps S202 and S203 are implemented while the software code is modified to ensure the functionality is available.
[0057] By constructing a relationship mapping table, the embodiment of the present application can traverse the query mapping relationship table when version rollback is required, obtain the date and time when the software supports the hardware in sequence, and control the version rollback to the version that can support the hardware. In this way, the version rollback is controlled to avoid the situation where the version cannot support the new chip, resulting in the device being unable to start or business interruption, affecting the stability and reliability of the device.
[0058] It should be noted that in the embodiment of the present application, the multiple target hardware includes at least one of a circuit board, a memory chip, an Ethernet physical layer PHY chip, and a complex programmable logic device CPLD chip. The following description takes a circuit PCB board and a memory chip as an example.
[0059] For example, please refer to Figure 3 , is a schematic diagram of the mapping relationship between hardware models and supported date and time provided in an embodiment of the present application, such as Figure 3 As shown in the figure, the PCB version number of the single board is represented by a combination of high and low levels through the GPIO group. The driver software can determine the PCB version number of the single board by reading these GPIOs. As time goes by, every time the PCB is changed, the PCB version number is increased by 1, and the corresponding date and time are recorded and added to the mapping table.
[0060] Specifically, in one embodiment of the present application, if the software completes the single board debugging at 1:01:01 on January 1, 2023, and the PCB version number is version 1, it is added to the mapping relationship table, and the single board with the PCB version number of version 1 is added, and its support date and time corresponding to 1 is 20230101010101. When the hardware single board is changed, the software completes the single board debugging at 2:02:02 on February 2, 2023, and the PCB version number is version 2. Then, in the mapping relationship table, the single board with the PCB version number of version 2 is added, and its support date and time corresponding to 20230202020202.
[0061] For example, in the embodiment of the present application, the chips are classified, for example, the memory chip is chip type 1, the Ethernet PHY chip is chip type 2, the complex programmable logic chip is chip type 3, and so on. For different types of chips, the corresponding relationship mapping table is constructed, please refer to Figure 4 , is a schematic diagram of the mapping relationship between another hardware model and supported date and time provided in an embodiment of the present application, such as Figure 4 As shown, after the CPU obtains the chip category, it adds its corresponding support date and time to the relationship mapping table.
[0062] It should be noted that in this embodiment, chip category 1 contains multiple chips. These chips may be from different manufacturers or different models of the same manufacturer. Chip models 1-1, 1-2, and 1-n are compatible and interchangeable. During production, the same product model and the same position may use chip model 1-1, 1-2, or 1-n.
[0063] Specifically, in one embodiment of the present application, if the code is modified at 10:05:30 on July 1, 2023 to support a compatible memory chip, whose model is assumed to be 1-1, then in the mapping relationship table, add the chip model 1-1 and its support date and time 20230701100530; if the code is modified at 6:09:12 on August 3, 2023 to support a compatible memory chip, whose model is assumed to be 1-2, then in the mapping relationship table, add the chip model 1-2 and its support date and time 20230803060912.
[0064] In the embodiment of the present application, step S102 determines the supported date and time corresponding to each target hardware according to the preset mapping relationship between the hardware model and the supported date and time. For the specific process, please refer to Figure 5 ,like Figure 5 As shown, step S102 provided in the embodiment of the present application includes but is not limited to the following steps:
[0065] Step S1021: Search the mapping table for the supported date and time corresponding to the hardware model of the target hardware;
[0066] Step S1022: If the supported date and time corresponding to the hardware model of the target hardware is not found in the mapping relationship table, the supported date and time corresponding to the target hardware is set to a preset special value.
[0067] Exemplarily, the preset special value may be 0 or a null value (Null).
[0068] For example, please refer to Figure 6 , which is a flowchart of a hardware category supporting date and time acquisition provided in an embodiment of the present application, such as Figure 6 As shown, when it is necessary to determine the supported date and time corresponding to each target hardware according to the mapping relationship between the preset hardware model and the supported date and time,
[0069] First, identify the manufacturer and model information of the hardware;
[0070] If the identification fails, the supported date and time of the hardware category is set to 0. If the identification is successful, the mapping table stored in the software is queried based on the identified manufacturer and model information to obtain the supported date and time of the actual hardware category;
[0071] If the supported date and time of the hardware category cannot be found, the supported date and time of the hardware category is regarded as 0. If the query is successful, the supported date and time of the hardware category is obtained.
[0072] Exemplarily, in step S101, obtaining hardware models of multiple target hardware in the device may specifically include: establishing a communication connection with the target hardware, reading the ID value of each target hardware, and determining the hardware model of each target hardware according to the ID value.
[0073] It should be noted that in the implementation of this application, the method of identifying the manufacturer and model information of the hardware can be to establish a communication connection with the hardware and obtain its information to determine the specific manufacturer and model of the chip. The manufacturer and model information of the hardware can be identified in other ways. This application does not limit the method of identifying the manufacturer and model information of the hardware.
[0074] Please refer to Figure 7 ,for Figure 2 The specific flow chart of step S103 is as follows: Figure 7 As shown, step S103, after determining the supported date and time corresponding to each target hardware, determining the date and time threshold from the supported date and time corresponding to each target hardware, includes but is not limited to the following steps:
[0075] Step S1031: Add the supported date and time corresponding to each target hardware to the date and time set.
[0076] Step S1032: Determine the maximum value in the date and time set as the date and time threshold.
[0077] It should be noted that when the supported date and time of a hardware type is obtained once, the obtained supported date and time will be stored in a temporary set, which is the date and time set. The maximum value in the time set is used as the date and time threshold for determining whether version rollback is possible.
[0078] For example, please refer to Figure 8 , is a specific flow chart of a version rollback control method provided in an embodiment of the present application, such as Figure 8 As shown, in the embodiment of the present application, the version rollback operation of the device can be implemented by the following steps:
[0079] First, obtain the supported date and time of hardware type 1, obtain the supported date and time of hardware type 2, and finally obtain the supported date and time of hardware type n. Then, store them in a date and time set, which is recorded as SET.
[0080] Then find the maximum value in the set SET and determine it as the date and time threshold, recorded as MAX_T;
[0081] Get the release date and time of the version to be rolled back, read the user's version file to be rolled back, parse and obtain the date and time attribute in the version header, which is the release date and time of the expected rollback version, recorded as VER_T;
[0082] Compare the release date and time of the desired rollback version, VER_T, with the date and time threshold, MAX_T. If VER_T is greater than or equal to MAX_T, rollback to that version is allowed based on hardware compatibility. Otherwise, the check fails and rollback to that version is not allowed.
[0083] It is understandable that when performing a version rollback control operation, for the target hardware whose hardware model cannot be obtained, the support date and time corresponding to the target hardware is set to a preset special value. Exemplarily, the preset special value can be 0 or a null value (Null).
[0084] Specifically, in one embodiment of the present application, when a software version rollback occurs, first obtain the current device hardware PCB version number, query the mapping relationship table, obtain its supported date and time value, assuming it is 20230101010101; then obtain the model of the storage chip used by the current device, obtain its supported date and time value, assuming it is 20230801010101; obtain the model of the Ethernet PHY chip used by the current device, obtain its supported date and time value, assuming it is 20230601010101; obtain the model of the CPLD chip used by the current device, obtain its supported date and time value The date and time value is assumed to be 20230501010101, and so on. Finally, the PCB version number supports the date and time value 20230101010101, the storage chip supports the date and time value 20230801010101, the Ethernet PHY chip supports the date and time value 20230601010101, and the CPLD chip supports the date and time value 20230501010101. The maximum value of these supported date and time values is 20230801010101, and 20230801010101 is used as the date and time threshold.
[0085] If the release date of the desired rollback version is 00:00:00 on July 1, 2023, and the date and time value is 20230701000000, and the earliest supported date and time of the current device hardware is 20230801010101, and the release date of the desired rollback version is 20230701000000, this indicates that the desired rollback software version theoretically cannot support the current device hardware, and version rollback is not allowed.
[0086] If the release date and time of the expected rollback version is 00:00:00 on September 1, 2023, and the date and time value is 20230901000000, the earliest supported date and time of the current device hardware is 20230801010101, and the release date and time of the expected rollback version is 20230901000000, it means that the expected rollback software version theoretically supports the current device hardware, and version rollback is allowed.
[0087] If the device uses a compatible replacement chip from another manufacturer, and the support date and time of the new compatible replacement storage chip is 20231001010101, the earliest rollback date and time automatically changes to 20231001010101. If the release date and time of the desired rollback version is September 1, 2023, 00:00:00, version rollback is not allowed.
[0088] In an embodiment of the present application, a mapping relationship between the hardware model and the date and time when the driver software supports the hardware is established. This mapping relationship is stored in the driver software in the form of a constant, and can also be stored in a database or configuration file.
[0089] In an embodiment of the present application, the date and time, such as 10:05:30 on July 1, 2023, can be expressed in the format of 20230701100530, or in other forms, such as in the form of a Unix timestamp, that is, with 0:00 on January 1, 1970 as the starting time, expressed as 1688177130.
[0090] It should be noted that although operations are described in a specific order in the drawings in the embodiments of the present application, this should not be construed as requiring that these operations be performed in the specific order shown or in a serial order, or that all of the operations shown be performed to obtain the desired result. In certain circumstances, multitasking and parallel processing may be advantageous.
[0091] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0092] The present application also provides an electronic device, such as Figure 9 As shown, the electronic device 1400 includes:
[0093] one or more processors 1410;
[0094] The memory 1420 stores one or more programs. When the one or more programs are executed by the one or more processors 1410, the one or more processors 1410 implement a version rollback control method provided in an embodiment of the present application.
[0095] For example, execute the following steps:
[0096] Get the hardware models of multiple target hardware in the device;
[0097] Determine the support date and time corresponding to each target hardware according to the preset mapping relationship between the hardware model and the support date and time, wherein the support date and time represents the release date and time of the software version supporting the hardware;
[0098] Determine a date and time threshold from supported date and time corresponding to each target hardware;
[0099] The release date and time of the desired rollback version is compared with the date and time threshold. If the release date and time of the desired rollback version is greater than or equal to the date and time threshold, the device is rolled back to the desired rollback version.
[0100] The memory 1420 is a non-transient network system that can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory 1420 may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1420 may optionally include a memory 1420 remotely located relative to the processor 1410, and these remote memories 1420 may be connected to the processor 1410 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0101] The memory 1420 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1420 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1420 and is called by the processor 1410 to execute the methods of the embodiments of this application.
[0102] The processor 1410 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0103] In some embodiments, the electronic device further comprises:
[0104] Input / output interface, used to realize information input and output;
[0105] Communication interface, used to realize communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, Wi-Fi, Bluetooth, etc.);
[0106] A bus that transmits information between various components of the device (e.g., the processor 1410, memory 1420, input / output interfaces, and communication interfaces);
[0107] The processor 1410 , the memory 1420 , the input / output interface, and the communication interface can be communicatively connected to each other within the device via a bus.
[0108] An embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, which are used to execute a version rollback control method provided in an embodiment of the present application.
[0109] For example, execute the following steps:
[0110] Get the hardware models of multiple target hardware in the device;
[0111] Determine the support date and time corresponding to each target hardware according to the preset mapping relationship between the hardware model and the support date and time, wherein the support date and time represents the release date and time of the software version supporting the hardware;
[0112] Determine a date and time threshold from supported date and time corresponding to each target hardware;
[0113] The release date and time of the desired rollback version is compared with the date and time threshold. If the release date and time of the desired rollback version is greater than or equal to the date and time threshold, the device is rolled back to the desired rollback version.
[0114] An embodiment of the present application also provides a computer program product, including a computer program or computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, so that the computer device executes a version rollback control method provided in an embodiment of the present application.
[0115] For example, execute the following steps:
[0116] Get the hardware models of multiple target hardware in the device;
[0117] Determine the support date and time corresponding to each target hardware according to the preset mapping relationship between the hardware model and the support date and time, wherein the support date and time represents the release date and time of the software version supporting the hardware;
[0118] Determine a date and time threshold from supported date and time corresponding to each target hardware;
[0119] The release date and time of the desired rollback version is compared with the date and time threshold. If the release date and time of the desired rollback version is greater than or equal to the date and time threshold, the device is rolled back to the desired rollback version.
[0120] The system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of the system architecture and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
[0121] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0122] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0123] Those skilled in the art will appreciate that all or some of the steps and systems in the method disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include computer storage media (or non-transitory media) and communication media (or temporary media). As known to those skilled in the art, the term computer storage media is included in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data) and is volatile and non-volatile, removable, and non-removable. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory, or other memory technology, CD-ROM, digital versatile disks (DVD), or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage, or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0124] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0125] The above description of some embodiments of the present application with reference to the accompanying drawings does not limit the scope of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present application shall be within the scope of the present application.
Claims
1. A version rollback control method, the method comprising: Get the hardware models of multiple target hardware in the device; Determine the support date and time corresponding to each target hardware according to a preset mapping relationship between the hardware model and the support date and time, wherein the support date and time represents the release date and time of the software version supporting the hardware; Determine a date and time threshold from supported date and time corresponding to each of the target hardware; The release date and time of the expected rollback version is compared with the date and time threshold, and if the release date and time of the expected rollback version is greater than or equal to the date and time threshold, the device is rolled back to the expected rollback version.
2. The method according to claim 1, characterized in that The mapping relationship between the hardware model and the supported date and time is constructed through the following steps: Traverse all categories of hardware, and for the traversed hardware, obtain the hardware model of the hardware and the release date and time of the software version that supports the hardware, and add the hardware model of the hardware and the release date and time of the software version that supports the hardware to a mapping relationship table, wherein the mapping relationship table is used to record the mapping relationship between the hardware model and the support date and time.
3. The method according to claim 2, characterized in that The mapping relationship between the hardware model and the supported date and time is constructed through the following steps: When the device imports new hardware and releases a new software version to support the new hardware, obtain the hardware model of the new hardware and use the release date and time of the new software version as the support date and time corresponding to the new hardware; Add the hardware model and support date and time of the new hardware to the mapping relationship table.
4. The method according to claim 2 or 3, characterized in that The determining of the supported date and time corresponding to each target hardware according to the preset mapping relationship between the hardware model and the supported date and time includes: Searching the mapping table for a supported date and time corresponding to the hardware model of the target hardware; If the supported date and time corresponding to the hardware model of the target hardware is not found in the mapping relationship table, the supported date and time corresponding to the target hardware is set to a preset special value.
5. The method according to claim 1, characterized in that Determining the date and time threshold from the supported date and time corresponding to each of the target hardware includes: Adding the supported date and time corresponding to each target hardware to the date and time set; The maximum value in the date and time set is determined as the date and time threshold.
6. The method according to claim 1, characterized in that The method further comprises: For the target hardware whose hardware model cannot be obtained, the support date and time corresponding to the target hardware is set to a preset special value.
7. The method according to claim 1, characterized in that The obtaining of hardware models of multiple target hardware in the device includes: The ID value of each target hardware is obtained, and the hardware model of the target hardware is determined according to the ID value.
8. The method according to claim 1, characterized in that The plurality of target hardware include at least one of a circuit board, a memory chip, an Ethernet physical layer PHY chip, and a complex programmable logic device CPLD chip.
9. An electronic device comprising: one or more processors; A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the version rollback control method as described in any one of claims 1-8.
10. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the version rollback control method according to any one of claims 1 to 8 is implemented.
11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the version rollback control method according to any one of claims 1 to 8 is implemented.