CN115543399A - Software processing system, software processing method and device - Google Patents

Software processing system, software processing method and device Download PDF

Info

Publication number
CN115543399A
CN115543399A CN202110742190.4A CN202110742190A CN115543399A CN 115543399 A CN115543399 A CN 115543399A CN 202110742190 A CN202110742190 A CN 202110742190A CN 115543399 A CN115543399 A CN 115543399A
Authority
CN
China
Prior art keywords
software
data block
client
granularity
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110742190.4A
Other languages
Chinese (zh)
Inventor
孟小珍
黄凯耀
郑云洲
祁德春
鲁志军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202110742190.4A priority Critical patent/CN115543399A/en
Publication of CN115543399A publication Critical patent/CN115543399A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a software processing system, a software processing method and a device, and the method can be used in the field of software detection and update. The system comprises a client and a server, wherein first software is stored on the client, second software is stored on the server, the first software is a mirror image file of the second software, and the client acquires a plurality of first hash values corresponding to the first software; the server sends a target patch package corresponding to the abnormal data block to the client, a plurality of second hash values corresponding to second software are stored on the server, the abnormal data block belongs to the first software, and the first hash value corresponding to the abnormal data block and the second hash value corresponding to the abnormal data block have different values; and the client updates the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block. The complete system software does not need to be sent to the client, and the problem that the time consumption of the system software repairing process is long is solved.

Description

Software processing system, software processing method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a software processing system, a software processing method, and an apparatus.
Background
In the starting process of the terminal equipment, when detecting that the terminal equipment cannot enter a main system (main system), triggering to enter an emergency repair system, downloading a full package from a server by the emergency repair system, namely downloading complete system software from the server by the emergency repair system, and updating a mirror image file on the terminal equipment according to the downloaded full package so as to repair the system software on the terminal equipment.
However, the repair process of the system software is time-consuming because the data volume of the full packet is large.
Disclosure of Invention
The application provides a software processing system, a software processing method and a device, only a target patch package corresponding to an abnormal data block is sent, that is, complete system software is not required to be sent to a client, so that the problem that the time consumption of the repair process of the system software is long is solved, and the waste of bandwidth between a server and the client is avoided.
In order to solve the technical problem, the application provides the following technical scheme:
in a first aspect, the present application provides a software processing system, which can be used in the field of software detection and update. The software processing system comprises a client and a server, wherein first software is stored on the client, second software is stored on the server, the first software is an image file (image file) of the second software, and the image file can also be called as an image file. That is, the first software is configured on the client after copying the second software on the server. The client is used for acquiring a plurality of first hash values corresponding to a plurality of data blocks in the first software, wherein the adopted hash functions include but are not limited to a 64-bit xxHash function, a murmurmur 3 hash function, a t1ha hash function and the like. The server is used for sending a target patch package corresponding to the abnormal data block to the client; the server stores a plurality of second hash values corresponding to a plurality of data blocks in the second software, the abnormal data block belongs to the first software, the first hash value corresponding to the abnormal data block and the second hash value corresponding to the abnormal data block have different values, and the target patch package may include a correct program code corresponding to the abnormal data block. The client is used for updating the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block to obtain the repaired first software. Specifically, the client updates the program code in the abnormal data block to the program code carried in the target patch package, so as to update the abnormal data block, and obtain the updated data block corresponding to the abnormal data block.
In the implementation mode, the server only sends the target patch package corresponding to the abnormal data block to the client, namely, the complete system software is not required to be sent to the client any more, so that the problem that the time consumption of the system software in the repair process is long is solved, and the waste of the bandwidth between the server and the client is avoided; in addition, the first software can be not only system software but also application software, and the application scene of the scheme is expanded.
In one possible implementation manner of the first aspect, the first software may be embodied as system software, application software or other types of software, wherein the system software is a collection of various programs that do not require user intervention, and the main function is to schedule, monitor and maintain the computer system and is responsible for managing various independent hardware in the computer system, so that the aforementioned multiple hardware can work in coordination. The concept of the application software corresponds to that of the system software, the application software is provided for meeting the application requirements of users in different fields and different problems, and the application software can widen the application field of the computer system and amplify the functions of hardware.
In one possible implementation of the first aspect, the client stores the plurality of first hash values using a merkel tree, a list, an array, or other data structure. In the implementation mode, the Merckel tree is used for storing the plurality of first hash values, so that the accuracy of the first software can be verified efficiently, and the efficiency of the whole verification process of the accuracy of the first software is improved.
In a possible implementation manner of the first aspect, the software processing system is further configured to, when it is determined that the first hash value corresponding to the first data block and the second hash value corresponding to the second data block are different, execute a comparison operation according to a plurality of first hash values corresponding to the plurality of third data blocks and a plurality of second hash values corresponding to the plurality of fourth data blocks to determine the abnormal data block. The first data block is included in the first software, the granularity of the first data block is a first granularity, the first data block comprises a plurality of third data blocks, and the granularity of the third data blocks is a second granularity. The second data block is a data block corresponding to the first data block in the second software, that is, the start address of the second data block in the second software is consistent with the start address of the first data block in the first software, and the length of the second data block is consistent with the length of the first data block. The granularity of the second data block is the first granularity, the second data block comprises a plurality of fourth data blocks, the granularity of the fourth data blocks is the second granularity, and the first granularity is larger than the second granularity. It should be noted that, the client may directly perform a hash operation on a plurality of first hash values corresponding to a plurality of third data blocks, so as to obtain a first hash value corresponding to the first data block, and correspondingly, the server may directly perform a hash operation on a plurality of second hash values corresponding to a plurality of fourth data blocks, so as to obtain a second hash value corresponding to the second data block. That is, the first data block and the second data block are logical concepts introduced by the scheme for convenience of description, the client may not divide the first software into a plurality of first data blocks, and correspondingly, the server may not divide the second software into a plurality of second data blocks.
In this implementation manner, generally, only a few data blocks are abnormal data blocks, and it may be first determined, at a level of a first granularity, whether a plurality of second hash values after a plurality of first hash values are the same, and in a case where it is determined that a first hash value corresponding to a first data block of the first granularity is different from a second hash value corresponding to a second data block of the first granularity, a plurality of first hash values corresponding to a plurality of third data blocks and a plurality of second hash values corresponding to a plurality of fourth data blocks, where the third data block and the fourth data blocks are both data blocks of the second granularity, and the first granularity is greater than the second granularity; that is, at the level of the first granularity, the undamaged data blocks are removed, and then the fine granularity comparison is performed on the abnormal data blocks, so as to further improve the efficiency of the whole abnormal data block positioning process, and facilitate the reduction of the number of hash values sent by the client to the server, i.e., reduce the usage amount of communication resources between the client and the server.
In a possible implementation manner of the first aspect, the server is further configured to perform a hash operation on each target patch package to obtain at least one second hash value corresponding to at least one target patch package one to one, and send the second hash value corresponding to the target patch package to the client, where a hash function used when the server generates the second hash value corresponding to each target patch package is consistent with a hash function used when the client generates the first hash value. The client is further used for acquiring updated data blocks corresponding to the abnormal data blocks from the repaired first software, and performing hash operation on each updated data block to obtain at least one first hash value corresponding to at least one updated data block one to one; the client is further configured to compare the second hash value corresponding to the target patch package with the first hash value corresponding to the updated data block to determine a type of the repair result of the first software, where the type of the repair result of the first software includes repair success and repair failure.
In this implementation manner, in the process of updating the abnormal data block on the client by using the target patch package, situations such as bit (bit) jump may occur, so that the accuracy of the repaired first software cannot be ensured, a second hash value corresponding to the target patch package is also obtained, the second hash value corresponding to the target patch package is compared with the first hash value corresponding to the updated data block, whether the first software is successfully repaired is determined, and it is ensured that the final result of the first software at this time is successful in repair, so that the user can normally use the first software, and the user viscosity of the scheme provided in the embodiment of the present application is improved.
In one possible implementation form of the first aspect, the first software is system software. When the accuracy of the system software is detected, the client is triggered to acquire a plurality of first hash values corresponding to the first software. Further, the client can perform accurate detection on the first software once every fixed time; or the client can perform accuracy detection on the first software once when the client is powered off; or, the client may be configured with a key for triggering the accuracy detection of the first software, where the key may be a virtual key or an entity key; or, the client may also perform accuracy detection on the first software before loading and running the system software in the boot stage. Or when the system software fails to start, triggering the client to acquire a plurality of first hash values corresponding to the first software. In the implementation mode, two application scenes are provided, and the implementation flexibility of the scheme is improved.
In a possible implementation manner of the first aspect, the client is further configured to send the version number of the first software and the at least one first hash value to the server. The server can store one or more versions of software, and is further configured to determine second software from the versions of the multiple types of software according to the version number of the first software, acquire multiple second hash values corresponding to multiple data blocks in the second software, and compare the received first hash value with the acquired second hash value to determine a target patch package corresponding to an abnormal data block, where the version number of the second software is consistent with the version number of the first software.
In the implementation mode, the client sends the version of the first software and the plurality of first hash values to the server, the server executes the check operation between the first hash values and the second hash values, and the accuracy of the plurality of second hash values stored on the server can be guaranteed, so that the accuracy of the check result between the first hash values and the second hash values can be guaranteed.
In a possible implementation manner of the first aspect, the client is further configured to obtain, from the local data, a plurality of second hash values corresponding to a plurality of data blocks in the second software; the plurality of second hash values corresponding to the plurality of data blocks in the second software are configured on the client when the client leaves a factory; or, when the server sends the first software to the client, the server may also send a plurality of second hash values corresponding to a plurality of data blocks in the second software to the client. The client is further used for determining the abnormal data block according to the obtained second hash values and the first hash values corresponding to the data blocks in the first software. In this implementation, the client locally pre-stores a plurality of second hash values corresponding to a plurality of data blocks in the second software, so that the client can directly execute the comparison operation of the first hash value and the second hash value according to the local data, which is beneficial to improving the efficiency of the comparison process of the first hash value and the second hash value, and is also beneficial to improving the efficiency of the repair process of the whole first software.
In a second aspect, the present application provides a software processing method, which may be used in the field of software detection and update, and is applied to a client in a software processing system, where the software processing system further includes a server, first software is stored on the client, second software is stored on the server, and the first software is an image file of the second software, and the method includes: acquiring a plurality of first hash values corresponding to a plurality of data blocks in first software; receiving a target patch package which is sent by a server and corresponds to an abnormal data block, wherein the abnormal data block belongs to first software, a first hash value corresponding to the abnormal data block and a second hash value corresponding to the abnormal data block have different values, and a plurality of second hash values correspond to a plurality of data blocks in second software; and updating the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block to obtain the repaired first software.
For the second aspect of the present application, the client is further configured to perform other steps performed by the client in the first aspect, specific implementation steps of various possible implementation manners of the second aspect, and beneficial effects brought by each possible implementation manner, which may refer to descriptions in various possible implementation manners of the first aspect, and are not described herein again.
In a third aspect, the present application provides a software processing method, which can be used in the field of software detection and update. The method is applied to a server in a software processing system, the software processing system also comprises a client, first software is stored on the client, second software and a plurality of second hash values corresponding to a plurality of data blocks in the second software are stored on the server, and the first software is a mirror image file of the second software, and the method comprises the following steps: acquiring a target patch package corresponding to an abnormal data block, wherein the abnormal data block is included in first software, a first hash value corresponding to the abnormal data block and a second hash value corresponding to the abnormal data block have different values, and a plurality of first hash values correspond to a plurality of data blocks in the first software; and sending the target patch package to the client.
For the third aspect of the present application, the server is further configured to execute other steps executed by the server in the first aspect, specific implementation steps of various possible implementation manners of the third aspect, and beneficial effects brought by each possible implementation manner, all of which refer to descriptions in the various possible implementation manners of the first aspect, and are not repeated here.
In a fourth aspect, the present application provides a software processing apparatus, which can be used in the field of software detection and update. The software processing device is applied to a client in the software processing system, the software processing system also comprises a server, first software is stored on the client, second software is stored on the server, and the first software is a mirror image file of the second software, and the device comprises: the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a plurality of first hash values corresponding to a plurality of data blocks in first software; the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a target patch package which is sent by a server and corresponds to an abnormal data block, the abnormal data block belongs to first software, a first hash value corresponding to the abnormal data block and a second hash value corresponding to the abnormal data block have different values, and the plurality of second hash values correspond to a plurality of data blocks in second software; and the updating module is used for updating the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block to obtain the repaired first software.
For the fourth aspect of the present application, the software processing apparatus is further configured to execute other steps executed by the client in the first aspect, specific implementation steps of various possible implementation manners of the fourth aspect, and beneficial effects brought by each possible implementation manner, which may refer to descriptions in various possible implementation manners in the first aspect and are not described herein again.
In a fifth aspect, the present application provides a software processing apparatus, which can be used in the field of software detection and update. The software processing device is applied to a server in a software processing system, the software processing system also comprises a client, first software is stored on the client, second software and a plurality of second hash values corresponding to a plurality of data blocks in the second software are stored on the server, the first software is an image file of the second software, and the software processing device comprises: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a target patch package corresponding to an abnormal data block, the abnormal data block is included in first software, a first hash value corresponding to the abnormal data block and a second hash value corresponding to the abnormal data block have different values, and a plurality of first hash values correspond to a plurality of data blocks in the first software; and the sending module is used for sending the target patch package to the client.
For the fifth aspect of the present application, the software processing apparatus is further configured to execute other steps executed by the server in the first aspect, specific implementation steps of various possible implementation manners of the fifth aspect, and beneficial effects brought by each possible implementation manner, which may refer to descriptions in various possible implementation manners in the first aspect, and are not described herein again.
In a sixth aspect, the present application provides a client, which may include a processor, a processor coupled to a memory, and the memory storing program instructions, wherein when the program instructions stored in the memory are executed by the processor, the steps performed by the client in the software processing system according to the first aspect are implemented.
In a seventh aspect, the present application provides a server, which may include a processor, a processor coupled to a memory, and the memory storing program instructions, and when the program instructions stored in the memory are executed by the processor, the steps performed by the server in the software processing system according to the first aspect are implemented.
In an eighth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when run on a computer, causes the computer to perform the method of the second or third aspect.
In a ninth aspect, the present application provides circuitry comprising processing circuitry configured to perform the method of the second or third aspects above.
In a tenth aspect, the present application provides a computer program which, when run on a computer, causes the computer to perform the method of the second or third aspect described above.
In an eleventh aspect, the present application provides a chip system comprising a processor for enabling the functionality referred to in the above aspects, e.g. to send or process data and/or information referred to in the above methods. In one possible design, the system-on-chip further includes a memory for storing program instructions and data necessary for the server or the communication device. The chip system may be formed by a chip, or may include a chip and other discrete devices.
Drawings
FIG. 1 is a schematic diagram of an architecture of a software processing system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a software processing method according to an embodiment of the present application;
fig. 3a is a schematic diagram of a data structure for storing a first hash value in the software processing method according to the embodiment of the present application;
fig. 3b is another schematic diagram of a data structure for storing a first hash value in the software processing method according to the embodiment of the present application;
fig. 4 is a schematic flowchart illustrating a comparison between a first hash value and a second hash value in the software processing method according to the embodiment of the present application;
fig. 5 is another schematic flowchart of a software processing method according to an embodiment of the present application;
fig. 6 is another schematic flowchart of a software processing method according to an embodiment of the present application;
fig. 7 is a schematic flowchart of another software processing method according to an embodiment of the present application;
FIG. 8 is a schematic flowchart of another software processing method according to an embodiment of the present application;
fig. 9 is a schematic flowchart of a software processing method according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a software processing system provided by an embodiment of the present application;
fig. 11 is a schematic structural diagram of a software processing apparatus according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a software processing apparatus according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a software processing apparatus according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of a software processing apparatus according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of a client according to an embodiment of the present application;
fig. 16 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
The terms "first," "second," and the like in the description and in the claims of the present application and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances and are merely descriptive of the manner in which objects of the same nature are distinguished in the embodiments of the application. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of elements is not necessarily limited to those elements, but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Embodiments of the present application are described below with reference to the accompanying drawings. As can be known to those skilled in the art, with the development of technology and the emergence of new scenarios, the technical solution provided in the embodiments of the present application is also applicable to similar technical problems.
The embodiment of the Application can be applied to an Application scene for detecting or updating accuracy of various software with large data volume, wherein the software with large data volume comprises system software (system software) and Application software (Application). The system software is a set of various programs without user intervention, and has the main functions of scheduling, monitoring and maintaining the computer system and is responsible for managing various independent hardware in the computer system, so that the hardware can work in a coordinated manner. The concept of the application software corresponds to that of the system software, the application software is software provided for meeting application requirements of users in different fields and different problems, and the application software can widen the application field of a computer system and amplify the functions of hardware.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a software processing system according to an embodiment of the present application. The software processing system 100 may include a server 110, a client 120, and a target electronic device 130, where the client 120 may be embodied as a terminal device or a server, etc.
When the second software is generated, the target electronic device 130 may split the second software into a plurality of data blocks according to a preset granularity, and generate a plurality of patch packages corresponding to the plurality of data blocks one to one, that is, a patch package set corresponding to the entire second software. The target electronic device 130 may send the second software and the set of patch packages to the server 110, the server 110 stores the second software and the set of patch packages locally, and the server 110 may further perform a hash operation on a plurality of data blocks in the second software to obtain a plurality of second hash values corresponding to the plurality of data blocks in the second software.
The client 120 stores a first software, and the first software is an image file of a second software. When the client 120 wants to check the correctness of the first software, or the client 120 determines that the first software has an abnormality (i.e., needs to be repaired), the client 120 may obtain a plurality of first hash values corresponding to the data blocks in the first software. The software processing system 100 may compare the second hash value on the server 110 with the first hash value on the client 120 to determine the abnormal data block in the first software, and then the server 110 sends the target patch package corresponding to the abnormal data block to the client 120, and the client 120 updates the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block, so as to obtain the repaired first software. In the embodiment of the present application, since the server 110 only sends the target patch package corresponding to the abnormal data block to the client 120, that is, it is no longer necessary to send the complete second software to the client 120, which reduces the time consumption of the repair process of the first software and also avoids the waste of bandwidth between the server 110 and the client 120.
In some embodiments of the present application, please refer to fig. 1, the target electronic device 130 and the server 110 are two independent devices, and it should be noted that fig. 2 is only an architectural schematic diagram of the software processing system 100 according to the embodiment of the present invention, and the positional relationship between the devices, modules, etc. shown in the diagram does not limit any limitation. For example, in other embodiments of the present application, the target electronic device 130 and the server 110 may be integrated.
In the embodiment of the present application, the software processing system 100 needs to compare the second hash value on the server 110 with the first hash value on the client 120; further, the server 110 may perform the comparison operation, or the client 120 may perform the comparison operation, and the two cases are described below.
1. Comparing, by the server, the first hash value and the second hash value
In an embodiment of the present application, referring to fig. 2, fig. 2 is a schematic flowchart of a software processing method provided in the embodiment of the present application, where the software processing method provided in the embodiment of the present application may include:
201. the client acquires a plurality of first hash values corresponding to a plurality of data blocks in the first software.
In the embodiment of the application, first software is stored on a client, when the first software on the client needs to be compared with second software on a server, the client needs to read the first software, split the read data into a plurality of data blocks, perform hash operation on each data block to obtain a plurality of first hash values corresponding to the plurality of data blocks in the first software, and store the plurality of first hash values; the client also needs to generate identification information for each data block.
The first software is software arranged on the client, and may specifically be system software, application software or other types of software, and for the concepts of the system software and the application software, reference may be made to the above description, which is not described herein again.
Further, the first software may be an image file (image file) of the second software, and the image file may also be referred to as an image file. That is, the first software is configured on the client after copying the second software on the server. The format of the image file includes, but is not limited to ISO, IMG, BIN, VCD, NRG, CDI, MCD, or other formats, etc., which are not exhaustive herein.
In the case that the first software is System software, the first software may include a plurality of partitions, for example, the first software may include a System (System) partition, a cut partition, a Boot (Boot) partition, or other partitions, and the specific System software includes which partitions need to be determined in conjunction with an actual operating System.
The hash function (hash function) used includes, but is not limited to, a 64-bit xxHash function, a murmurmur 3 hash function, a t1ha hash function, or other types of hash functions, which are not limited herein.
The size of one data block can be determined by combining the size of the whole first software, the size of the bandwidth between the client and the server or other factors; by way of example, the fixed granularity may be, for example, 512KB, 1024KB, 2048KB, or other values; as another example, the first software is system software, and the client may regard each partition as a data block, etc., it should be understood that the examples are only for convenience of understanding of the present solution and are not intended to limit the present solution.
The plurality of data blocks corresponding to the plurality of first hash values may all be data blocks of the same granularity. Alternatively, the plurality of data chunks corresponding to the plurality of first hash values may include data chunks of M levels of granularity, M being an integer greater than or equal to 2. The M levels of granularities may include a first granularity and a second granularity, and correspondingly, the plurality of first hash values may include hash values corresponding to data blocks of the first granularity and hash values corresponding to data blocks of the second granularity, where the first granularity is greater than the second granularity. By way of example, the size of the data blocks of the first granularity is 1024KB and the size of the data blocks of the second granularity is 512KB, which are not exhaustive here. It should be noted that the granularity of M levels may also include granularity of three levels, or may also include granularity of more levels, which should be determined according to actual situations.
Specifically, in one case, "data blocks of M levels of granularity" may be a logical concept introduced for convenience of describing the present solution, and the client may divide the first software according to only the minimum granularity of the M levels of granularity, that is, there is no "data block of M levels of granularity" on the client. The client may perform the hash operation again directly according to the plurality of second hash values corresponding to the plurality of data blocks of the second granularity to generate the first hash value corresponding to the data block of the first granularity.
In another case, the client may also perform division operation on the first software for M times to obtain M data block sets corresponding to M hierarchies, respectively, and further generate M groups of first hash values corresponding to the granularities of the M hierarchies.
If the client reads the first software according to the logical address of the first software, the "data block" may also be referred to as a "logical block", and in an implementation, the identification information of the data block may specifically be a starting logical address and a length of the data block. Further, if the first software is specifically system software, the starting logical address of the data block may be an address of the data block in the partition to which the data block belongs, or may be an address of the data block in the entire first software.
In another implementation manner, a generation rule of identification information of a data block may be preconfigured on the client, and for any one data block (hereinafter referred to as a "target data block" for convenience of description) in a plurality of data blocks included in the first software, the client may generate identification information of the target data block according to the aforementioned generation rule, where the identification information of the target data block may be specifically represented as a character string, for example, the identification information of the target data block may be 00001, S00000001, or another form, and the identification information of the specific data block may be determined in combination with an actual application scenario, which is not limited herein.
The client may use a merkel (Merkle) tree, a list, data, or other data format to store the generated plurality of first hash values and the identification information corresponding to each first hash value; the merkel tree is a binary tree. In the embodiment of the application, the plurality of first hash values are stored by using the merkel tree, so that the accuracy of the first software can be effectively verified, and the efficiency of the whole verification process of the accuracy of the first software is improved.
For a more intuitive understanding of the present disclosure, please refer to fig. 3a and 3b, and fig. 3a and 3b are two schematic diagrams of a data structure for storing the first hash value in the software processing method according to the embodiment of the present disclosure. Referring to fig. 3a, in fig. 3a, a merkel tree is used for storing the first hash values, and the merkel tree is 3 layers, that is, all the first hash values correspond to 3 levels of granularity (that is, the value of M is 3); and fig. 3a shows a plurality of first hash values corresponding to the partition S, which is any one of at least one partition included in the first software. The unit size of the data blocks corresponding to the multiple hash values of the first layer is 512KB, that is, the client divides the data in the S partition into data blocks with a granularity of 512KB, and performs hash operation on the divided data blocks to obtain the first hash value in the first layer of fig. 3 a; each leaf node also stores the identification information of the data block, and fig. 3a takes the example that the identification information of the data block is related to the location information of the data block.
The first hash value in the second layer in fig. 3a is obtained by performing hash calculation on the first hash value in the first layer, that is, the client no longer divides the data in the S partition into data blocks with a granularity of 1024KB, but the unit size of the data block logically corresponding to the plurality of first hash values in the second layer is 1024KB. The first hash value in the third layer in fig. 3a is obtained by performing hash calculation on the first hash value in the second layer, and the unit size of the data block logically corresponding to the plurality of first hash values in the second layer is 2048KB. It should be noted that in practical cases, a merkel tree may have more or less layers, and the example in fig. 3a is only for convenience of understanding of the present solution and is not intended to limit the present solution.
Referring to fig. 3b again, fig. 3b illustrates an example of storing a plurality of first hash values by using a list, and fig. 3b illustrates a plurality of first hash values corresponding to the S partition and the C partition, respectively. Fig. 3b illustrates an example that all the first hash values correspond to a granularity of 2 levels (that is, a value of M is 2), as shown in fig. 3b, each data item in the list stores one first hash value and identification information of a data block, and it should be understood that the example in fig. 3b is only for facilitating understanding of a storage form of the first hash value, and is not used to limit the present solution.
Specifically, the time for acquiring the plurality of first hash values is triggered for the client. In some application scenarios, when a client detects the accuracy of first software, the client is triggered to acquire a plurality of first hash values corresponding to the first software, that is, the first software is triggered to be collated with second software stored on a server, so as to determine the accuracy of the first software.
Further, the client may perform an accuracy check on the first software every fixed duration, for example, the client performs an accuracy check on the first software every week, fifteen days, one month, or other fixed duration. Or, the client may perform an accuracy check on the first software each time the client shuts down. Or, the client may be configured with a key for triggering the accuracy detection on the first software, where the key may be a virtual key or an entity key. Or, if the first software is system software, the client may also perform accuracy detection on the first software in a boot stage before loading and running the system software, and the like.
In other application scenarios, when the first software fails to be started, the client is triggered to acquire a plurality of first hash values corresponding to the first software, that is, to trigger the accuracy detection on the first software. In the embodiment of the application, two application scenes of the embodiment of the application are provided, and the implementation flexibility of the scheme is improved.
202. And the client sends the version number of the first software and the first hash value to the server.
In some embodiments of the application, in order to enable the server to compare the first hash value with the second hash value, the client sends the version number of the first software, at least one first hash value, and identification information of the data block corresponding to each first hash value to the server; by way of example, the version number of the first software may be 3.5, 3.6, V2, V5.2 or other forms, etc., which are not exhaustive here.
Specifically, in one case, the data blocks corresponding to the plurality of first hash values generated in step 201 are all of the same granularity. The client needs to send all the first hash values generated in step 201 to the server.
In another case, the plurality of data chunks corresponding to the plurality of first hash values generated in step 201 may logically comprise M levels of granularity of data chunks. In an implementation manner, the client may first obtain a first hash value corresponding to the data block with the target granularity from the multiple first hash values generated in step 201, and send the first hash value corresponding to the data block with the target granularity to the server; wherein the target granularity includes a largest N granularity among the M levels of granularity, N being an integer greater than or equal to 1. For example, in conjunction with the above fig. 3a, the client may first send the hash values in the first layer and the second layer of the merkel tree shown in fig. 3a to the server, that is, the value of N is 2, and it should be understood that this example is only for convenience of understanding the present solution.
203. The server compares the received first hash value with the second hash value.
In some embodiments of the present application, because the server may store one or more versions of software, if the server stores multiple versions of software, the server may determine, according to the version number of the first software, the second software from the multiple versions of software, where the version number of the second software is consistent with the version number of the first software, and obtain a plurality of second hash values corresponding to a plurality of data blocks in the second software, and identification information of the data block corresponding to each second hash value.
First, a plurality of second hash values stored on the server and corresponding to a plurality of data blocks in the second software correspond to a plurality of first hash values generated on the client one to one; and the hash function adopted by the server to generate the second hash value is consistent with the hash function adopted by the client to generate the first hash value. Further, if the plurality of data blocks corresponding to the plurality of first hash values are all data blocks with the same granularity, the plurality of data blocks corresponding to the plurality of second hash values are all data blocks with the same granularity. The plurality of second hash values includes hash values corresponding to the M levels of granularity of the data blocks if the plurality of first hash values includes hash values corresponding to the M levels of granularity of the data blocks.
Secondly, the identification information of the data blocks stored on the server is in one-to-one correspondence with and identical to the identification information of the data blocks stored on the client; as an example, for example, the client stores identification information of four data blocks, which are 0KB to 512KB of the S partition, 512KB to 1024KB of the S partition, 1024KB to 1536KB of the S partition, and 1536KB to 2048KB of the S partition, the server also stores identification information of four data blocks, which are 0KB to 512KB of the S partition, 512KB to 1024KB of the S partition, 1024KB to 1536KB of the S partition, and 1536KB to 2048KB of the S partition.
Specifically, in one case, the data blocks corresponding to the plurality of first hash values generated in step 201 are all of the same granularity, and after receiving the plurality of first hash values sent by the client and the plurality of identification information in one-to-one correspondence with the plurality of first hash values, the server performs a comparison process for any one of the plurality of first hash values (hereinafter referred to as "target first hash value" for the description of the aspect). And the server acquires target second hash values corresponding to the target first hash values one by one from a plurality of locally stored second hash values according to the target identification information corresponding to the target hash values.
The server compares the target first hash value with the target second hash value, and if the target first hash value is the same as the target second hash value, the server determines that the data block pointed by the target identification information is not an abnormal data block; and if the target first hash value is different from the target second hash value, determining that the data block pointed by the target identification information is an abnormal data block, and determining the target identification information as the identification information of the abnormal data block.
The server traverses all the received first hash values, executes the operation on each received first hash value to obtain the identification information of one or more abnormal data blocks, and then can directly enter step 204; if the comparison results of the received first hash values and the locally stored second hash values are consistent, it is proved that an abnormal data block does not exist in the first software stored in the client, and the server can send first indication information to the client, wherein the first indication information is used for informing the client that the first software is accurate.
In another case, the plurality of data chunks corresponding to the plurality of first hash values generated in step 201 may logically comprise M levels of granularity of data chunks. The server receives a first plurality of hash values corresponding to the data chunks at a target granularity comprising a maximum of N of the M levels of granularity. The server may compare a plurality of first hash values corresponding to the data blocks with N levels of granularity with a plurality of second hash values corresponding to the data blocks with N levels of granularity, and the specific implementation manner of the comparison operation may refer to the above description, which is not described herein again. If the comparison results are consistent, the server determines that the first software is accurate, that is, the first software does not have an abnormal data block.
If it is determined that the first hash value corresponding to the first data block is different from the second hash value corresponding to the second data block according to the comparison result, the server may send the identification information of one or more first data blocks to the client, and re-enter step 202. The first data block is included in the first software, the granularity of the first data block is a first granularity, and the first granularity is the smallest granularity of the N granularities; the second data block corresponds to the first data block, that is, the start address of the second data block in the second software is consistent with the start address of the first data block in the first software, and the length of the second data block is consistent with the length of the first data block.
After receiving the identification information of at least one first data block through step 203, the client may obtain a plurality of first hash values corresponding to a plurality of third data blocks and identification information of each third data block, and send the plurality of first hash values corresponding to the plurality of third data blocks and the identification information of each third data block to the server. The first data block includes the plurality of third data blocks, the granularity of the third data blocks is a second granularity, the second granularity may include t levels of granularities, t is an integer greater than or equal to 1, and the t levels of granularity included in the second granularity are all smaller than the first granularity.
The server acquires a plurality of second hash values corresponding to a plurality of fourth data blocks according to the identification information of each third data block, compares a plurality of first hash values corresponding to the plurality of third data blocks with a plurality of second hash values corresponding to the plurality of fourth data blocks, and further can directly determine the identification information of at least one abnormal data block. The second data block comprises a plurality of fourth data blocks, and the granularity of the fourth data blocks is a second granularity; the granularity of the abnormal data block is the minimum granularity in the t levels of the granularities, and the first hash value corresponding to the abnormal data block and the second hash value corresponding to the abnormal data block have different values. It should be noted that the client may directly perform hash operation on a plurality of first hash values corresponding to a plurality of third data blocks, so as to obtain first hash values corresponding to the first data blocks, and correspondingly, the server may directly perform hash operation on a plurality of second hash values corresponding to a plurality of fourth data blocks, so as to obtain second hash values corresponding to the second data blocks. That is, the first data block and the second data block are logical concepts introduced by the scheme for convenience of description, the client may not divide the first software into a plurality of first data blocks, and correspondingly, the server may not divide the second software into a plurality of second data blocks.
Or, after determining that the first hash value corresponding to the fifth data block is inconsistent with the second hash value corresponding to the sixth data block, the server may send the identification information of the fifth data block to the client, and re-enter step 202 to re-execute the above steps. The granularity of the fifth data block is the smallest granularity among the t levels of granularity, the sixth data block corresponds to the fifth data block, namely the starting address of the fifth data block in the second software is consistent with the starting address of the sixth data block in the first software, and the length of the fifth data block is consistent with the length of the sixth data block. That is, the server and the client may perform multiple interactions to locate the abnormal data block, where the multiple interactions may be 2 times, 3 times, 4 times or more, and the like, and the multiple interactions are specifically adopted to locate the abnormal data block, and need to be determined in combination with an actual application scenario, which is not limited here.
For a more intuitive understanding of the present disclosure, please refer to fig. 4, where fig. 4 is a schematic flowchart illustrating a comparison between a first hash value and a second hash value in a software processing method provided in an embodiment of the present disclosure. Fig. 4 can be understood in conjunction with the above description of fig. 3a, where fig. 4 includes (a) a sub-diagram and (b) a sub-diagram, where (a) the sub-diagram shows a plurality of first hash values, and (b) the sub-diagram shows a plurality of second hash values, and in fig. 4, the server and the client determine the identification information of the abnormal data block after two information interactions. In the first interaction process, the client sends a plurality of first Hash values stored in the second layer and the third layer to the server, after the server performs a comparison operation between the first Hash values and the second Hash values, it can be determined that the first Hash value (i.e., hash6 in A1 in fig. 4) corresponding to the first data block is inconsistent with the second Hash value (i.e., hash7 in A2 in fig. 4) corresponding to the second data block, and the server sends the identification information of the first data block and the identification information of the second data block to the client.
In the second interaction process, the client sends the two first hash values stored on the two leaf nodes of the parent node pointed by A1 to the server, and the server compares the two second hash values stored on the two leaf nodes of the parent node pointed by A2 with the received two first hash values, so as to obtain the identification information of the abnormal data block from the leaf node B2 (also referred to as the leaf node B1).
In this embodiment of the application, because in an actual situation, only a few data blocks are data blocks with an exception, it may be first determined whether a plurality of second hash values after a plurality of first hash values are the same on a level of a first granularity, and under a condition that a first hash value corresponding to a first data block with the first granularity is determined to be different from a second hash value corresponding to a second data block with the first granularity, a plurality of first hash values corresponding to a plurality of third data blocks and a plurality of second hash values corresponding to a plurality of fourth data blocks, where the third data block and the fourth data block are data blocks with a second granularity, where the first granularity is greater than the second granularity; that is, at the level of the first granularity, the undamaged data blocks are removed, and then the fine granularity comparison is performed on the abnormal data blocks, so as to further improve the efficiency of the whole abnormal data block positioning process, and facilitate to reduce the number of hash values sent by the client to the server, i.e. reduce the usage amount of communication resources between the client and the server.
204. And the server sends the identification information of the abnormal data block to the client.
In this embodiment of the application, after determining the identification information of the abnormal data block through steps 203 and 204, the server may send the identification information of the abnormal data block to the client.
205. The server determines a target patch package corresponding to the abnormal data block.
In the embodiment of the application, the server acquires at least one target patch package corresponding to at least one abnormal data block one to one according to the identification information of the at least one abnormal data block. Wherein the target patch package may include correct program code corresponding to the abnormal data block.
For the obtaining manner of the multiple patch packages, in one case, the server may be configured with multiple patch packages corresponding to multiple data blocks with the minimum granularity one to one, and identification information of the data block corresponding to each patch package, where the granularity of the data block with the minimum granularity is consistent with the granularity of the abnormal data block. In step 205, the server obtains at least one target patch package from the plurality of patch packages corresponding to the second software according to the identification information of the at least one abnormal data block.
In another case, the server may obtain, from the second software, at least one to-be-processed data block corresponding to at least one abnormal data block one to one according to the identification information of the one or more abnormal data blocks, generate a target patch package corresponding to each to-be-processed data block, and further store the target patch package to the local to wait for the client to download. As an example, for example, the first software and the second software are both system software, the identification information of the plurality of abnormal data blocks is 1024KB to 2048KB in C area, 0KB to 1024KB in S area, and 4096KB to 5120KB in S area, respectively, and the logical addresses of the plurality of data blocks to be processed in the second software are 1024KB to 2048KB in C area, 0KB to 1024KB in S area, and 4096KB to 5120KB in S area, respectively.
Or, since the same server may communicate with multiple clients at the same time, for example, to avoid that the dynamically generated target patch packet occupies too much space, the server may determine, according to the identification information of one or more abnormal data blocks, an address of each to-be-processed data block in the second software, where the address includes a start logical address and a length of each to-be-processed data block.
Optionally, after determining the identification information of at least one abnormal data block, the server may count the total number of the abnormal data blocks in the first software, and if the total number of the abnormal data blocks is greater than or equal to the first threshold, the server may directly determine the whole second software as the data to be sent instead of determining the target patch package corresponding to the abnormal data block.
206. And the server sends the target patch package corresponding to the abnormal data block to the client.
In the embodiment of the application, after receiving the identification information of at least one abnormal data block, the client may generate a download request and send the download request to the server. The downloading request carries identification information of one or more abnormal data blocks; optionally, the download request further carries a version number of the first software.
The server responds to the downloading request sent by the client, and can determine second software corresponding to the first software according to the version number of the first software, wherein the version number of the second software is consistent with the version number of the first software. And the server acquires a target patch package corresponding to each abnormal data block according to the identification information of each abnormal data block.
Further, if a plurality of patch packages corresponding to the plurality of data blocks with the minimum granularity are pre-stored in the server, the server may obtain at least one target patch package corresponding to the at least one abnormal data block from the plurality of pre-stored patch packages in response to the download request sent by the client (i.e., execute step 205), and send the at least one target patch package corresponding to the at least one abnormal data block to the client.
If the server dynamically generates the target patch package corresponding to the abnormal data block based on the second software, the server may obtain the target patch package corresponding to the abnormal data block determined in step 205 in response to the download request sent by the client, and send the target patch package corresponding to the abnormal data block to the client.
Alternatively, if the total number of abnormal data blocks is greater than or equal to the first threshold, the server may directly send the entire second software to the client.
Optionally, the server may further perform a hash operation on data in each target patch package, that is, perform a hash operation on the correct program code corresponding to each abnormal data block, to generate a second hash value corresponding to each target patch package, and send the second hash value corresponding to each target patch package to the client; and the hash function adopted when the server generates the second hash value corresponding to each target patch package is consistent with the hash function adopted when the client generates the first hash value. Further, the second hash value corresponding to the at least one target patch package may be stored in a merkel tree, a list, an array, or other forms, which are not limited herein.
207. And the client updates the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block to obtain the repaired first software.
In the embodiment of the application, after downloading and storing the target patch package corresponding to the abnormal data block to the local, the client may update the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block, so as to obtain the repaired first software. Specifically, the client updates the program code in the abnormal data block to the program code carried in the target patch package, so as to update the abnormal data block, and obtain the updated data block corresponding to the abnormal data block.
208. And the client acquires the updated data block corresponding to the abnormal data block from the repaired first software, and generates a first hash value corresponding to the updated data block.
In some embodiments of the application, if the client further receives the second hash value corresponding to each target patch package, after the client completes the repair of all the abnormal data blocks, that is, after the repaired first software is obtained, the client may further obtain, from the repaired first software, an updated data block corresponding to each abnormal data block, and perform hash operation on each updated data block to obtain a first hash value corresponding to each updated data block. The hash function used by the client to perform the hash operation on each updated data block is consistent with the hash function used by the client to generate the plurality of first hash values in step 201.
209. And the client compares the second hash value corresponding to the target patch package with the first hash value corresponding to the updated data block to determine the type of the repair result of the first software, wherein the type of the repair result of the first software comprises repair success and repair failure.
In some embodiments of the application, because at least one target patch package received by the client corresponds to at least one abnormal data block one to one, that is, the received at least one target patch package corresponds to at least one updated data block one to one, the client compares a second hash value corresponding to each target patch package with a first hash value corresponding to the updated data block according to a one-to-one correspondence relationship between the target patch package and the updated data block, and if the comparison results are consistent, the client determines that the repair result of the first software is a successful repair.
If the second hash value corresponding to the first patch package is inconsistent with the first hash value corresponding to the first updated data block, the client determines that the repair result of the first software is a repair failure, that is, determines the first updated data block as an abnormal data block. The client needs to obtain the identification information of at least one first updated data block, and sends a download request to the server again, where the download request carries the identification information of each first updated data block and the version number of the first software.
The server, in response to the received download request, obtains the target patch packages corresponding to the one or more first updated data blocks, and sends the target patch package corresponding to each first updated data block to the client again, that is, re-enters step 206, so as to re-execute the operations in steps 206 to 208.
The first patch package belongs to the at least one target patch package, the first updated data block is a data block which fails to be updated in the at least one updated data block, and the first patch package is used for updating an abnormal data block corresponding to the first updated data block. The meaning of the "identification information of the first updated data block" is similar to the meaning of the "identification information of the abnormal data block", and can be understood by referring to the above description, which is not described herein again.
In the embodiment of the application, in the process of updating the abnormal data block on the client by using the target patch package, situations such as bit (bit) jump may occur, so that the accuracy of the repaired first software cannot be ensured, a second hash value corresponding to the target patch package is also obtained, the second hash value corresponding to the target patch package is compared with the first hash value corresponding to the updated data block, whether the first software is successfully repaired is determined, the final result of the first software is ensured to be successful in repairing, and therefore a user can normally use the first software, and the user viscosity of the scheme provided by the embodiment of the application is improved.
For a more intuitive understanding of the present solution, please refer to fig. 5 and fig. 6, and fig. 5 and fig. 6 are two schematic flow diagrams of a software processing method provided in an embodiment of the present application, respectively. In fig. 5, the server and the client both store the hash value through the merck tree, and the first software and the second software are both system software. In step 1.1, a repair module in the client reads locally stored system software (i.e., first software), generates a plurality of first hash values corresponding to the first software according to the read system software, and acquires the plurality of first hash values corresponding to the first software. In step 1.2, the repair module in the client sends the version number of the first software and at least one first hash value to the server. In step 1.3, a plurality of second hash values corresponding to the second software are stored in the server, and the server compares the received first hash value with the locally stored second hash value to determine the identification information of the abnormal data block in the first software. In step 1.2 and step 1.3, the repair module in the client may compare the first hash value and the second hash value corresponding to the data block with the large granularity, and then compare the first hash value and the second hash value corresponding to the data block with the small granularity, and the specific implementation manners of step 1.2 and step 1.3 may refer to the above description of step 202 and step 203, which is not described herein again.
In step 2.1, the server sends the identification information of the at least one abnormal data block to the client. In step 2.2, the repair module in the client sends a download request to the server, where the download request carries the identification information of the abnormal data block and the version number of the first software. In step 3.1, the server obtains at least one target patch package in one-to-one correspondence with the at least one anomaly database. In step 3.2, the server sends at least one target patch package corresponding to at least one abnormal database to the client, and correspondingly, the repair module in the client stores the received target patch package to the local. In step 4, the repair module in the client updates the abnormal data block in the system software (i.e., the first software) according to the obtained target patch package, so as to obtain the repaired system software. It should be understood that the example in fig. 5 is only for convenience of understanding the present solution and is not intended to limit the present solution.
Referring to fig. 6, in fig. 6, it is taken as an example that the first software and the second software are both system software, the server and the client store hash values through a list, and all the hash values correspond to data blocks with the same granularity. The "mirror image S" in fig. 6 may also be referred to as "partition S", where the partition S corresponds to a System partition in System software; the "mirror C" in fig. 6 may also be referred to as "partition C", and the partition C corresponds to a Cust partition in the system software. In step 1.1, a repair module in the client generates a plurality of first hash values corresponding to locally stored system software (i.e., first software), and acquires all the first hash values corresponding to the first software. In step 1.2, the repair module in the client sends all the first hash values corresponding to the first software to the server. In step 1.3, a plurality of second hash values corresponding to the second software are stored in the server, and the server compares the received first hash value with all the locally stored second hash values to determine the identification information of the abnormal data block in the first software.
The specific implementation manner of step 2.1 to step 4 in fig. 6 is similar to the specific implementation manner of step 2.1 to step 4 in fig. 5, and can be understood by directly referring to the above description, which is not described herein. It should be understood that the example in fig. 6 is only for convenience of understanding the present solution and is not intended to limit the present solution.
In the embodiment of the application, the client sends the version of the first software and the plurality of first hash values to the server, and the server executes the verification operation between the first hash values and the second hash values.
2. Comparing, by the client, the first hash value and the second hash value
In this embodiment of the present application, referring to fig. 7, fig. 7 is a schematic flowchart of a software processing method provided in this embodiment of the present application, where the software processing method provided in this embodiment of the present application may include:
701. the client acquires a plurality of second hash values corresponding to a plurality of data blocks in the second software.
In some embodiments of the application, the client may further obtain a plurality of second hash values corresponding to a plurality of data blocks in the second software. Specifically, in one case, the first software is software configured on the client when the client leaves a factory, and the client may also be configured with a plurality of second hash values corresponding to a plurality of data blocks in the second software and identification information of the data block corresponding to each second hash value when the client leaves the factory. For understanding the concept of "a plurality of second hash values corresponding to a plurality of data blocks in the second software" and the storage manner of the plurality of second hash values, reference may be made to the description in the embodiment corresponding to fig. 2, which is not described herein again.
In another case, the first software is sent to the client by the server, and when the server sends the first software to the client, the server may also send, to the client, a plurality of second hash values corresponding to a plurality of data blocks in the second software and identification information of the data block corresponding to each second hash value; therefore, a plurality of second hash values corresponding to a plurality of data blocks in the second software and identification information of the data block corresponding to each second hash value can be stored in advance on the client.
Optionally, during the operation of the client, the plurality of second hash values stored on the client may be tampered, so as to improve the reliability of the plurality of second hash values stored on the client. If the client uses the data structure of the mercker tree to store the plurality of second hash values, in an implementation manner, when the client acquires the first mercker tree in which the plurality of second hash values are stored, the client can copy the acquired first mercker tree, so that two identical first mercker trees can be stored on the client, and the client can also separately store the hash values placed on the root node of the first mercker tree.
When the client needs to verify the first hash value and the second hash value, whether the hash values in the two locally stored first merkel trees are consistent or not can be compared, if the comparison result is consistent, it is proved that the hash values in the two locally stored first merkel trees are not tampered, and a plurality of second hash values corresponding to a plurality of data blocks in the second software can be obtained according to the two locally stored first merkel trees.
And if the comparison result is inconsistent, comparing the hash values placed on the root nodes of the two locally stored first Merckel trees with the locally and separately stored hash values to acquire a correct second Merckel tree from the two first Merckel trees, and acquiring a plurality of second hash values corresponding to a plurality of data blocks in the second software according to the correct second Merckel tree.
If the exact merkel tree cannot be obtained through the comparison, the server may execute the comparison operation of the first hash value and the second hash value.
In another implementation manner, when the client acquires the first merkel tree in which the plurality of second hash values are stored, the client also stores the hash values on the root nodes of the first merkel tree at different positions, so that when the client needs to compare the first hash value with the second hash value, the client can compare the hash value on the root node of the first merkel tree stored on the client with the hash values of the two root nodes stored respectively to determine whether the first merkel tree currently stored on the client is reliable or not, and if the determination result is reliable, the client can obtain the plurality of second hash values corresponding to the plurality of data blocks in the second software according to the first merkel tree currently stored on the client. And if the judgment result is unreliable, the server executes the comparison operation of the first hash value and the second hash value.
702. The client acquires a plurality of first hash values corresponding to a plurality of data blocks in the first software.
In this embodiment of the application, a specific implementation manner of step 702 may refer to the description of step 201 in the embodiment corresponding to fig. 2, and a meaning of a concept of "a plurality of first hash values corresponding to a plurality of data blocks in the first software" may also refer to the description in the embodiment corresponding to fig. 2, which is not described herein again.
703. And the client compares the obtained plurality of second hash values with the obtained plurality of first hash values to determine the identification information of the abnormal data block.
In the embodiment of the application, the client needs to compare the obtained multiple second hash values with the obtained multiple first hash values. In one case, the data blocks corresponding to the first hash values mentioned in steps 701 and 702 are all data blocks with the same granularity, as can be known from the description in the embodiment corresponding to fig. 2, if the second hash values and the first hash values are in a one-to-one correspondence relationship, the client needs to traverse all the first hash values and all the second hash values, compare each obtained first hash value and each obtained second hash value to determine whether an abnormal data block exists in the first software, and if an abnormal data block exists in the first software, determine the identification information of the abnormal data block. The process of comparing the first hash value and the second hash value by the client may refer to the description in step 203 in the embodiment corresponding to fig. 2, which is not repeated herein.
In another case, the plurality of data blocks corresponding to the plurality of first hash values mentioned in step 701 and step 702 each include data blocks with M hierarchical granularities, and the client may compare the plurality of first hash values corresponding to the data blocks with the target granularity with the plurality of second hash values corresponding to the data blocks with the target granularity. If the comparison results are consistent, the client determines that the first software is accurate, that is, the first software does not have an abnormal data block. The meaning of the "data block with target granularity" and the specific implementation manner of the foregoing steps may refer to the description in the embodiment corresponding to fig. 2, and are not described herein again.
If it is determined that the first hash value corresponding to the first data block is different from the second hash value corresponding to the second data block according to the comparison result, the client may compare the plurality of first hash values corresponding to the plurality of third data blocks with the plurality of second hash values corresponding to the plurality of fourth data blocks to determine the abnormal data block in the first software. The concepts of the first data block, the second data block, the third data block, and the fourth data block may refer to the description in the embodiment corresponding to fig. 2, and the specific implementation manner of the foregoing steps may also refer to the description in the embodiment corresponding to fig. 2, which is not described herein again.
704. And the client sends a downloading request to the server, wherein the downloading request carries the identification information of the abnormal data block.
In the embodiment of the application, after determining the identification information of at least one abnormal data block existing in the first software, the client sends a downloading request to the server. The downloading request is used for requesting to download the target patch package corresponding to the abnormal data block, and the downloading request carries the identification information of the abnormal data block; optionally, the download request further carries a version number of the first software.
705. And the server responds to the received downloading request and sends a target patch package corresponding to the abnormal data block to the client.
706. And the client updates the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block to obtain the repaired first software.
707. And the client acquires the updated data block corresponding to the abnormal data block from the repaired first software, and generates a first hash value corresponding to the updated data block.
708. And the client compares the second hash value corresponding to the target patch package with the first hash value corresponding to the updated data block to determine the type of the repair result of the first software, wherein the type of the repair result of the first software comprises success repair and failure repair.
In this embodiment of the application, the specific implementation manner of steps 705 to 708 may refer to the description in steps 206 to 209 in the embodiment corresponding to fig. 2, and is not described herein again.
For a more intuitive understanding of the present solution, please refer to fig. 8 and fig. 9, and fig. 8 and fig. 9 are two schematic flow diagrams of a software processing method provided in an embodiment of the present application, respectively. Fig. 8 illustrates an example in which the server and the client both store hash values via the merck tree, and the first software and the second software are both system software. In step 1.1, the client obtains a plurality of second hash values corresponding to a plurality of data blocks in the second software, and the specific implementation manner of step 1.1 may refer to the above description of step 701. In step 1.2, the repair module in the client reads the locally stored system software (i.e., the first software), generates a plurality of first hash values corresponding to the first software according to the read system software (i.e., generates a merkel tree in which the plurality of first hash values are stored), and acquires the plurality of first hash values corresponding to the first software. In step 1.3, the client compares the obtained plurality of first hash values with the plurality of second hash values to determine the identification information of the abnormal data block in the first software. The client may compare the first hash value and the second hash value corresponding to the data chunk with large granularity, and then compare the first hash value and the second hash value corresponding to the data chunk with small granularity.
In step 2, the client sends a download request to the server, where the download request carries the identification information of the abnormal data block and the version number of the first software. The specific implementation manner of step 3.1 to step 4 in fig. 8 is similar to the specific implementation manner of step 3.1 to step 4 in fig. 5, and can be understood by directly referring to the above description, which is not described herein. It should be understood that the example in fig. 8 is only for convenience of understanding the present solution and is not intended to limit the present solution.
Referring to fig. 9, in fig. 9, the server and the client both store the hash value through the merkel tree, and the first software and the second software are both system software. The specific implementation of steps 1.1 to 4 in fig. 9 is similar to that of steps 1.1 to 4 in fig. 8, and can be understood by reference. The differences are that: first, fig. 8 illustrates an embodiment in which a first hash value and a second hash value are stored using a merkel tree; fig. 9 illustrates a corresponding embodiment in which the first hash value and the second hash value are stored in a list. Secondly, in step 1.3 of the embodiment corresponding to fig. 8, the client may compare the first hash value and the second hash value corresponding to the data block with large granularity, and then compare the first hash value and the second hash value corresponding to the data block with small granularity; however, since all the data blocks in the embodiment corresponding to fig. 9 correspond to the same granularity, in step 1.3 of the embodiment corresponding to fig. 9, the client directly compares all the first hash values with all the second hash values, and it should be understood that the example in fig. 9 is only for convenience of understanding the present solution, and is not used to limit the present solution.
In the embodiment of the application, the client locally stores a plurality of second hash values corresponding to a plurality of data blocks in the second software in advance, so that the client can directly execute the comparison operation of the first hash value and the second hash value according to local data, which is beneficial to improving the efficiency of the comparison process of the first hash value and the second hash value, namely the efficiency of the repair process of the whole first software.
In the embodiment of the application, the server only sends the target patch package corresponding to the abnormal data block to the client, that is, the complete system software is not required to be sent to the client any more, so that the problem that the time consumption of the system software in the repair process is long is solved, and the waste of the bandwidth between the server and the client is avoided; in addition, the first software can be not only system software but also application software, and the application scene of the scheme is expanded.
On the basis of the embodiments corresponding to fig. 1 to 9, in order to better implement the above-mentioned scheme of the embodiments of the present application, the following also provides related equipment for implementing the above-mentioned scheme. In the embodiment of the present application, a software processing system is further provided, please refer to fig. 10, and fig. 10 is a schematic diagram of the software processing system provided in the embodiment of the present application. Software processing system 100 may include a server 110 and a client 120. The client 120 stores first software, the server 110 stores second software, and the first software is a mirror image file of the second software; the client 120 is configured to obtain a plurality of first hash values corresponding to a plurality of data blocks in the first software; the server 110 is configured to send a target patch package corresponding to an abnormal data block to the client 120, where the server 110 stores a plurality of second hash values corresponding to a plurality of data blocks in second software, the abnormal data block belongs to the first software, and values of the first hash value corresponding to the abnormal data block and the second hash value corresponding to the abnormal data block are different; the client 120 is configured to update the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block, so as to obtain the repaired first software.
In one possible design, the software processing system 100 is further configured to determine an abnormal data block according to a plurality of first hash values corresponding to a plurality of third data blocks and a plurality of second hash values corresponding to a plurality of fourth data blocks when it is determined that the first hash value corresponding to the first data block and the second hash value corresponding to the second data block are different. The first data block is included in first software, the granularity of the first data block is a first granularity, the first data block includes a plurality of third data blocks, the granularity of the third data blocks is a second granularity, the second data block is a data block corresponding to the first data block in second software, the granularity of the second data block is a first granularity, the second data block includes a plurality of fourth data blocks, the granularity of the fourth data blocks is a second granularity, and the first granularity is greater than the second granularity.
In one possible design, the server 110 is further configured to send a second hash value corresponding to the target patch package to the client 120; the client 120 is further configured to obtain an updated data block corresponding to the abnormal data block from the repaired first software, and generate a first hash value corresponding to the updated data block; the client 120 is further configured to compare the second hash value corresponding to the target patch package with the first hash value corresponding to the updated data block to determine a type of the repair result of the first software, where the type of the repair result of the first software includes success of repair and failure of repair.
In one possible design, the first software is system software; when the accuracy of the system software is detected, triggering the client 120 to obtain a plurality of first hash values corresponding to the first software; or, when the system software fails to start, the client 120 is triggered to obtain a plurality of first hash values corresponding to the first software.
In one possible design, the client 120 is further configured to send the version number of the first software and the first hash value to the server 110; the server 110 is further configured to compare the received first hash value with a second hash value to determine a target patch package corresponding to the abnormal data block, where a version number of the second software is consistent with a version number of the first software.
In one possible design, the client 120 is further configured to obtain, from the local data, a plurality of second hash values corresponding to a plurality of data chunks in the second software; the client 120 is further configured to determine an abnormal data block according to the obtained multiple second hash values and multiple first hash values corresponding to multiple data blocks in the first software.
It should be noted that, the information interaction, the execution process, and the like between the server 110 and the client 120 in the software processing system 100 are based on the same concept as that of each of the method embodiments corresponding to fig. 2 to 9 in the present application, and specific contents may refer to the description in the foregoing method embodiments in the present application, and are not described herein again.
The embodiment of the present application further provides a software processing device, specifically referring to fig. 11, where fig. 11 is a schematic structural diagram of the software processing device provided in the embodiment of the present application. The software processing apparatus 1100 is applied to a client in a software processing system, the software processing system further includes a server, first software is stored on the client, second software is stored on the server, the first software is a mirror image file of the second software, and the software processing apparatus 1100 includes: an obtaining module 1101, configured to obtain a plurality of first hash values corresponding to a plurality of data blocks in the first software; a receiving module 1102, configured to receive a target patch package sent by a server and corresponding to an abnormal data block, where the abnormal data block belongs to a first software, a first hash value corresponding to the abnormal data block and a second hash value corresponding to the abnormal data block have different values, and multiple second hash values correspond to multiple data blocks in a second software; and the updating module is used for updating the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block to obtain the repaired first software.
In a possible design, please refer to fig. 12, wherein fig. 12 is a schematic structural diagram of a software processing apparatus according to an embodiment of the present disclosure. The software processing apparatus 1100 further includes: a sending module 1103, configured to send, to the server, a first hash value corresponding to the data block with the first granularity; the sending module 1103 is further configured to send, to the server, a plurality of first hash values corresponding to a plurality of third data blocks when the first hash value corresponding to the first data block is different from the second hash value corresponding to the second data block, where the plurality of third data blocks are used by the server to determine an abnormal data block; the first data block is included in the first software, the granularity of the first data block is a first granularity, the first data block includes a plurality of third data blocks, the granularity of the third data blocks is a second granularity, the second data block is a data block corresponding to the first data block in the second software, and the granularity of the second data block is the first granularity.
In one possible design, referring to fig. 12, the receiving module 1102 is further configured to receive a second hash value corresponding to the target patch package; the software processing apparatus 1100 further includes: a generating module 1104, configured to obtain an updated data block corresponding to the abnormal data block from the repaired first software, and generate a first hash value corresponding to the updated data block; the comparing module 1105 is configured to compare the second hash value corresponding to the target patch package with the first hash value corresponding to the updated data block, so as to determine the type of the repair result of the first software, where the type of the repair result of the first software includes success repair and failure repair.
It should be noted that, the information interaction, the execution process, and the like between the modules/units in the software processing apparatus 1100 are based on the same concept as that of the method embodiments corresponding to fig. 2 to 9 in the present application, and specific contents may refer to the description in the foregoing method embodiments in the present application, and are not described herein again.
Fig. 13 is a schematic structural diagram of a software processing apparatus provided in an embodiment of the present application, and fig. 13 is a specific structural diagram of the software processing apparatus provided in the embodiment of the present application. The software processing apparatus 1300 is applied to a server in a software processing system, the software processing system further includes a client, the client stores first software, the server stores second software and a plurality of second hash values corresponding to a plurality of data blocks in the second software, the first software is an image file of the second software, and the software processing apparatus 1300 includes: an obtaining module 1301, configured to obtain a target patch package corresponding to an abnormal data block, where the abnormal data block is included in the first software, a first hash value corresponding to the abnormal data block and a second hash value corresponding to the abnormal data block have different values, and the first hash values correspond to multiple data blocks in the first software; a sending module 1302, configured to send the target patch package to the client.
In a possible design, please refer to fig. 14, and fig. 14 is a schematic structural diagram of a software processing apparatus according to an embodiment of the present disclosure. The software processing apparatus 1300 further includes: a receiving module 1303, configured to receive a first hash value corresponding to a data block with a first granularity; a receiving module 1303, configured to receive multiple first hash values corresponding to multiple third data blocks when it is determined that a first hash value corresponding to a first data block is different from a second hash value corresponding to a second data block; the determining module 1304 is configured to determine an abnormal data block according to a plurality of first hash values corresponding to a plurality of third data blocks and a plurality of second hash values corresponding to a plurality of fourth data blocks. The first data block is included in first software, the granularity of the first data block is a first granularity, the first data block includes a plurality of third data blocks, the granularity of the third data blocks is a second granularity, the second data block is a data block corresponding to the first data block in second software, the granularity of the second data block is a first granularity, the second data block includes a plurality of fourth data blocks, the granularity of the fourth data blocks is a second granularity, and the first granularity is greater than the second granularity.
It should be noted that, the contents of information interaction, execution process, and the like between the modules/units in the software processing apparatus 1300 and the method embodiments corresponding to fig. 2 to fig. 9 in the present application are based on the same concept, and specific contents may refer to the description in the foregoing method embodiments in the present application, and are not repeated herein.
Referring to fig. 15, fig. 15 is a schematic structural diagram of a client according to an embodiment of the present application, where a software processing device 1200 described in the embodiment corresponding to fig. 11 or 12 may be disposed on the client 120 to implement the functions of the client in the embodiments corresponding to fig. 2 to 9. Specifically, the client 120 includes: a receiver 1501, a transmitter 1502, a processor 1503 and a memory 1504 (wherein the number of processors 1503 in the client 120 may be one or more, for example one processor in fig. 15), wherein the processor 1503 may include an application processor 15031 and a communication processor 15032. In some embodiments of the present application, the receiver 1501, the transmitter 1502, the processor 1503 and the memory 1504 may be connected by a bus or other means.
Memory 1504, which may include both read-only memory and random access memory, provides instructions and data to the processor 1503. The portion of the memory 1504 may also include non-volatile random access memory (NVRAM). The memory 1504 stores processors and operating instructions, executable modules or data structures, or subsets thereof, or expanded sets thereof, wherein the operating instructions may include various operating instructions for performing various operations.
The processor 1503 controls the operation of the client. In a particular application, the various components of the client are coupled together by a bus system that may include a power bus, a control bus, a status signal bus, etc., in addition to a data bus. For clarity of illustration, the various buses are referred to in the figures as bus systems.
The method disclosed in the embodiments of the present application may be implemented in the processor 1503 or implemented by the processor 1503. The processor 1503 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be implemented by hardware integrated logic circuits or instructions in software in the processor 1503. The processor 1503 may be a general-purpose processor, a Digital Signal Processor (DSP), a microprocessor or a microcontroller, and may further include an Application Specific Integrated Circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. The processor 1503 may implement or execute the methods, steps and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in ram, flash, rom, prom, or eprom, registers, etc. as is well known in the art. The storage medium is located in a memory 1504, and a processor 1503 reads information in the memory 1504 and completes the steps of the above method in combination with hardware thereof.
The receiver 1501 may be used to receive input numeric or character information and generate signal inputs related to the relevant settings and function control of the client. The transmitter 1502 may be configured to output numeric or character information through a first interface; the transmitter 1502 may also be configured to send instructions to the disk pack via the first interface to modify data in the disk pack; the transmitter 1502 may also include a display device such as a display screen.
In this embodiment, the application processor 15031 in the processor 1503 is configured to execute the software processing method executed by the client in the embodiment corresponding to fig. 2 to 9. The specific manner in which the processor 15031 executes the foregoing steps is based on the same concept as that of the method embodiments corresponding to fig. 2 to fig. 9 in the present application, and the technical effects brought by the method embodiments are the same as those of the method embodiments corresponding to fig. 2 to fig. 9 in the present application, and specific contents can be referred to the description in the foregoing method embodiments in the present application, and are not repeated here.
Referring to fig. 16, fig. 16 is a schematic structural diagram of a server provided in the embodiment of the present application, where a software processing apparatus 1300 described in the embodiment corresponding to fig. 13 or fig. 14 may be deployed on the server 110 to implement the functions of the server in the embodiment corresponding to fig. 2 to fig. 9, specifically, the server 110 is implemented by one or more servers, and the server 110 may generate a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 1622 (e.g., one or more processors) and a memory 1632, and one or more storage media 1630 (e.g., one or more mass storage devices) for storing an application program 1642 or data 1644. Memory 1632 and storage media 1630 may be transient or persistent storage, among others. The program stored on the storage medium 1630 may include one or more modules (not shown), each of which may include a sequence of instructions operating on a server. Still further, central processing unit 1622 may be configured to communicate with storage medium 1630 to execute a series of instruction operations on server 110 from storage medium 1630.
The server 110 may also include one or more power supplies 1626, one or more wired or wireless network interfaces 1650, one or more input-output interfaces 1658, and/or one or more operating systems 1641, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
In this embodiment, the central processing unit 1622 is configured to execute a software processing method executed by the server in the embodiment corresponding to fig. 2 to 9. It should be noted that, the specific manner in which the central processing unit 1622 executes the above steps is based on the same concept as that of each method embodiment corresponding to fig. 2 to 9 in the present application, and the technical effect brought by the specific manner is the same as that of each method embodiment corresponding to fig. 2 to 9 in the present application, and specific contents may refer to descriptions in the foregoing method embodiments in the present application, and are not described herein again.
Also provided in an embodiment of the present application is a computer-readable storage medium having stored therein a program for generating a driving speed of a vehicle, which when executed on a computer, causes the computer to perform the steps performed by a client in the method described in the foregoing embodiment shown in fig. 2 to 9, or causes the computer to perform the steps performed by a server in the method described in the foregoing embodiment shown in fig. 2 to 9.
Embodiments of the present application also provide a computer program product, which when executed on a computer, causes the computer to perform the steps performed by a client in the method described in the foregoing embodiments shown in fig. 2 to 9, or causes the computer to perform the steps performed by a server in the method described in the foregoing embodiments shown in fig. 2 to 9.
Further provided in the embodiments of the present application is a circuit system, which includes a processing circuit configured to execute the steps executed by the client in the method described in the foregoing embodiments shown in fig. 2 to 9, or execute the steps executed by the server in the method described in the foregoing embodiments shown in fig. 2 to 9.
The software processing device, the client and the server provided by the embodiment of the application can be chips, and the chips comprise: a processing unit, which may be, for example, a processor, and a communication unit, which may be, for example, an input/output interface, a pin or a circuit, etc. The processing unit may execute the computer executable instructions stored by the storage unit to cause the chip to perform the methods described in the embodiments of fig. 2-9 above. Optionally, the storage unit is a storage unit in the chip, such as a register, a cache, and the like, and the storage unit may also be a storage unit located outside the chip in the wireless access device, such as a read-only memory (ROM) or another type of static storage device that can store static information and instructions, a Random Access Memory (RAM), and the like.
Wherein any of the aforementioned processors may be a general purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits configured to control the execution of the programs of the method of the first aspect.
It should be noted that the above-described embodiments of the apparatus are merely schematic, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiments of the apparatus provided in the present application, the connection relationship between the modules indicates that there is a communication connection therebetween, and may be implemented as one or more communication buses or signal lines.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by software plus necessary general-purpose hardware, and certainly can also be implemented by special-purpose hardware including special-purpose integrated circuits, special-purpose CLUs, special-purpose memories, special-purpose components and the like. Generally, functions performed by computer programs can be easily implemented by corresponding hardware, and specific hardware structures for implementing the same functions may be various, such as analog circuits, digital circuits, or dedicated circuits. However, for the present application, the implementation of a software program is more preferable. Based on such understanding, the technical solutions of the present application may be substantially embodied in the form of a software product, which is stored in a readable storage medium, such as a floppy disk, a usb disk, a removable hard disk, a RON, a RAN, a magnetic disk, an optical disk, or the like of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods described in the embodiments of the present application.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.

Claims (20)

1. A software processing system is characterized by comprising a client and a server, wherein first software is stored on the client, second software is stored on the server, and the first software is a mirror image file of the second software;
the client is used for acquiring a plurality of first hash values corresponding to a plurality of data blocks in the first software;
the server is used for sending a target patch package corresponding to an abnormal data block to the client, wherein a plurality of second hash values corresponding to a plurality of data blocks in the second software are stored in the server, the abnormal data block belongs to the first software, and the first hash value corresponding to the abnormal data block and the second hash value corresponding to the abnormal data block have different values;
the client is used for updating the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block to obtain the repaired first software.
2. The system of claim 1,
the software processing system is further configured to determine the abnormal data block according to a plurality of first hash values corresponding to a plurality of third data blocks and a plurality of second hash values corresponding to a plurality of fourth data blocks, when it is determined that the first hash value corresponding to the first data block and the second hash value corresponding to the second data block are different;
wherein the first data block is included in the first software, the granularity of the first data block is a first granularity, the first data block includes the plurality of third data blocks, the granularity of the third data blocks is a second granularity, the second data block is a data block corresponding to the first data block in the second software, the granularity of the second data block is the first granularity, the second data block includes the plurality of fourth data blocks, the granularity of the fourth data block is the second granularity, and the first granularity is greater than the second granularity.
3. The system according to claim 1 or 2,
the server is further used for sending a second hash value corresponding to the target patch package to the client;
the client is further used for acquiring an updated data block corresponding to the abnormal data block from the repaired first software and generating a first hash value corresponding to the updated data block;
the client is further configured to compare the second hash value corresponding to the target patch package with the first hash value corresponding to the updated data block to determine a type of the repair result of the first software, where the type of the repair result of the first software includes repair success and repair failure.
4. The system of claim 1 or 2, wherein the first software is system software;
when the accuracy of the system software is detected, triggering the client to acquire a plurality of first hash values corresponding to the first software; alternatively, the first and second electrodes may be,
and when the system software fails to be started, triggering the client to acquire a plurality of first hash values corresponding to the first software.
5. The system according to claim 1 or 2,
the client is further used for sending the version number of the first software and the first hash value to the server;
the server is further configured to compare the received first hash value with the second hash value to determine a target patch package corresponding to the abnormal data block, where a version number of the second software is consistent with a version number of the first software.
6. The system of claim 1 or 2,
the client is further used for acquiring a plurality of second hash values corresponding to a plurality of data blocks in the second software from local data;
the client is further configured to determine the abnormal data block according to the obtained multiple second hash values and multiple first hash values corresponding to multiple data blocks in the first software.
7. A software processing method, applied to a client in a software processing system, where the software processing system further includes a server, and a first software is stored on the client, and a second software is stored on the server, and the first software is an image file of the second software, the method including:
acquiring a plurality of first hash values corresponding to a plurality of data blocks in the first software;
receiving a target patch package which is sent by the server and corresponds to an abnormal data block, wherein the abnormal data block belongs to the first software, the first hash value corresponding to the abnormal data block and the second hash value corresponding to the abnormal data block have different values, and the plurality of second hash values correspond to a plurality of data blocks in the second software;
and updating the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block to obtain the repaired first software.
8. The method of claim 7, wherein after obtaining the first plurality of hash values corresponding to the first plurality of data chunks in the first software, the method further comprises:
sending the first hash value corresponding to a data block of a first granularity to the server;
under the condition that the first hash value corresponding to the first data block and the second hash value corresponding to the second data block are different, sending a plurality of first hash values corresponding to a plurality of third data blocks to the server, wherein the plurality of third data blocks are used for determining abnormal data blocks by the server;
the first data block is included in the first software, the granularity of the first data block is the first granularity, the first data block includes the plurality of third data blocks, the granularity of the third data blocks is a second granularity, the second data block is a data block corresponding to the first data block in the second software, and the granularity of the second data block is the first granularity.
9. The method according to claim 7 or 8, characterized in that the method further comprises:
receiving a second hash value corresponding to the target patch package;
acquiring an updated data block corresponding to the abnormal data block from the repaired first software, and generating a first hash value corresponding to the updated data block;
and comparing the second hash value corresponding to the target patch package with the first hash value corresponding to the updated data block to determine the type of the repair result of the first software, wherein the type of the repair result of the first software comprises repair success and repair failure.
10. A software processing method, applied to a server in a software processing system, the software processing system further including a client, the client storing first software thereon, the server storing second software and a plurality of second hash values corresponding to a plurality of data blocks in the second software, the first software being an image file of the second software, the method comprising:
acquiring a target patch package corresponding to an abnormal data block, wherein the abnormal data block is included in the first software, values of the first hash value corresponding to the abnormal data block and the second hash value corresponding to the abnormal data block are different, and the first hash values correspond to a plurality of data blocks in the first software;
and sending the target patch package to the client.
11. The method of claim 10, further comprising:
receiving the first hash value corresponding to a data block of a first granularity;
under the condition that the first hash value corresponding to the first data block and the second hash value corresponding to the second data block are different, receiving a plurality of first hash values corresponding to a plurality of third data blocks;
determining the abnormal data block according to a plurality of first hash values corresponding to a plurality of third data blocks and a plurality of second hash values corresponding to a plurality of fourth data blocks;
wherein the first data block is included in the first software, the granularity of the first data block is a first granularity, the first data block includes the plurality of third data blocks, the granularity of the third data blocks is a second granularity, the second data block is a data block corresponding to the first data block in the second software, the granularity of the second data block is the first granularity, the second data block includes the plurality of fourth data blocks, the granularity of the fourth data block is the second granularity, and the first granularity is greater than the second granularity.
12. A software processing apparatus, applied to a client in a software processing system, the software processing system further including a server, first software being stored on the client, second software being stored on the server, and the first software being an image file of the second software, the apparatus comprising:
an obtaining module, configured to obtain a plurality of first hash values corresponding to a plurality of data blocks in the first software;
a receiving module, configured to receive a target patch packet sent by the server and corresponding to an abnormal data block, where the abnormal data block belongs to the first software, values of the first hash value corresponding to the abnormal data block and the second hash value corresponding to the abnormal data block are different, and the plurality of second hash values correspond to a plurality of data blocks in the second software;
and the updating module is used for updating the abnormal data block in the first software according to the target patch package corresponding to the abnormal data block to obtain the repaired first software.
13. The apparatus of claim 12, further comprising:
a sending module, configured to send the first hash value corresponding to a data block of a first granularity to the server;
the sending module is further configured to send, to the server, a plurality of first hash values corresponding to a plurality of third data blocks when the first hash value corresponding to the first data block and the second hash value corresponding to the second data block are different, where the plurality of third data blocks are used by the server to determine an abnormal data block;
the first data block is included in the first software, the granularity of the first data block is the first granularity, the first data block includes the plurality of third data blocks, the granularity of the third data blocks is a second granularity, the second data block is a data block corresponding to the first data block in the second software, and the granularity of the second data block is the first granularity.
14. The apparatus of claim 12 or 13,
the receiving module is further configured to receive a second hash value corresponding to the target patch package;
the device further comprises: a generating module, configured to obtain an updated data block corresponding to the abnormal data block from the repaired first software, and generate a first hash value corresponding to the updated data block;
and the comparison module is used for comparing the second hash value corresponding to the target patch package with the first hash value corresponding to the updated data block to determine the type of the repair result of the first software, wherein the type of the repair result of the first software comprises success repair and failure repair.
15. A software processing apparatus applied to a server in a software processing system, the software processing system further including a client, the client storing first software thereon, the server storing second software and a plurality of second hash values corresponding to a plurality of data blocks in the second software, the first software being an image file of the second software, the apparatus comprising:
an obtaining module, configured to obtain a target patch package corresponding to an abnormal data block, where the abnormal data block is included in the first software, values of the first hash value corresponding to the abnormal data block and the second hash value corresponding to the abnormal data block are different, and multiple first hash values correspond to multiple data blocks in the first software;
and the sending module is used for sending the target patch package to the client.
16. The apparatus of claim 15, further comprising:
a receiving module, configured to receive the first hash value corresponding to a data block of a first granularity;
the receiving module is configured to receive a plurality of first hash values corresponding to a plurality of third data blocks when it is determined that the first hash value corresponding to the first data block is different from the second hash value corresponding to the second data block;
the determining module is used for determining the abnormal data block according to a plurality of first hash values corresponding to a plurality of third data blocks and a plurality of second hash values corresponding to a plurality of fourth data blocks;
wherein the first data block is included in the first software, the granularity of the first data block is a first granularity, the first data block includes the plurality of third data blocks, the granularity of the third data blocks is a second granularity, the second data block is a data block corresponding to the first data block in the second software, the granularity of the second data block is the first granularity, the second data block includes the plurality of fourth data blocks, the granularity of the fourth data block is the second granularity, and the first granularity is greater than the second granularity.
17. A computer program for causing a computer to perform the steps performed by a client in a software processing system as claimed in any one of claims 1 to 6 or the steps performed by a server in a software processing system as claimed in any one of claims 1 to 6, when the computer program is run on a computer.
18. A computer-readable storage medium, characterized by comprising a program which, when run on a computer, causes the computer to perform the steps performed by a client in the software processing system of any one of claims 1 to 6, or causes the computer to perform the steps performed by a server in the software processing system of any one of claims 1 to 6.
19. A client comprising a processor and a memory, the processor coupled with the memory,
the memory is used for storing programs;
the processor, configured to execute the program in the memory, so that the client performs the steps performed by the client in the software processing system according to any one of claims 1 to 6.
20. A server comprising a processor and a memory, the processor coupled with the memory,
the memory is used for storing programs;
the processor, configured to execute the program in the memory to cause the server to perform the steps performed by the server in the software processing system according to any one of claims 1 to 6.
CN202110742190.4A 2021-06-30 2021-06-30 Software processing system, software processing method and device Pending CN115543399A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110742190.4A CN115543399A (en) 2021-06-30 2021-06-30 Software processing system, software processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110742190.4A CN115543399A (en) 2021-06-30 2021-06-30 Software processing system, software processing method and device

Publications (1)

Publication Number Publication Date
CN115543399A true CN115543399A (en) 2022-12-30

Family

ID=84723112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110742190.4A Pending CN115543399A (en) 2021-06-30 2021-06-30 Software processing system, software processing method and device

Country Status (1)

Country Link
CN (1) CN115543399A (en)

Similar Documents

Publication Publication Date Title
US20210124574A1 (en) Techniques for updating a file using a multi-version patch file
US8196130B2 (en) Tri-phase boot process in electronic devices
CN108509215B (en) System software replacing method and device, terminal equipment and storage medium
US20130138934A1 (en) Loading configuration information
CN109710317B (en) System starting method and device, electronic equipment and storage medium
KR20050061378A (en) Applying custom software image updates to non-volatile storage in a failsafe manner
US10795688B2 (en) System and method for performing an image-based update
CN110162429B (en) System repair method, server and storage medium
CN110825399B (en) Deployment method and device of application program
CN110995825A (en) Intelligent contract issuing method, intelligent node equipment and storage medium
CN114116305A (en) BIOS firmware recovery method, system, terminal and storage medium based on PFR
US10642623B1 (en) Preserving firmware settings during firmware updates
CN113485755A (en) Device driver verification method, device and storage medium
US20220004636A1 (en) Statistical detection of firmware-level compromises
WO2023198056A1 (en) Firmware update method for embedded device, and embedded device
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
WO2020000741A1 (en) Rootkit measurement method, apparatus, and server
CN115543399A (en) Software processing system, software processing method and device
CN107179911B (en) Method and equipment for restarting management engine
US11354109B1 (en) Firmware updates using updated firmware files in a dedicated firmware volume
CN114153503A (en) BIOS control method, device and medium
US11314603B2 (en) Recovery image downloads via data chunks
CN113076122A (en) Resource file management method, device, equipment and storage medium
CN112559131A (en) Method, device and equipment for updating container mirror image and computer readable storage medium
US20240036896A1 (en) Generating installation images based upon dpu-specific capabilities

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination