Software package deployment method and device, software package restoration method and device and computer equipment
By segmenting and encrypting the header data of RPM software packages, the security and issuance efficiency problems in traditional software package distribution are solved, and the effect of improving issuance efficiency while ensuring security is achieved.
Patent Information
- Application Number
- CN202411703064.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-26
AI Technical Summary
During the process of deploying software sub-sources by third parties, software packages may be replaced, tampered, injected, deleted or distributed secondaryly, resulting in the security of the operating system. At the same time, the encryption and decryption process consumes a large amount of system performance and affects issuance efficiency.
By obtaining the basic information and warehouse information of the software package, the segmented software package is header data, load data and segmented record data, and the header data is encrypted and stored in different databases to ensure the security and issuance efficiency of the software package.
On the premise of ensuring the security of software packages, through segmentation and encryption technology, the time for encryption and decryption and system performance consumption are reduced, and the issuance efficiency of software packages is improved.
Smart Images

Figure CN119577040A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software package distribution, and in particular to a software package deployment method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] In the field of operating system distribution, software package distribution management is an important part. Among them, RPM (Red Hat Package Manager) implements a software packaging, distribution, and installation solution based on structured file descriptions. Traditional open source operating system distributors use open file download services to build RPM software sources based on the RPM software distribution solution and use them for software distribution.
[0003] In the process of third-party software deployment, traditional RPM software sources are distributed to third-party devices or systems in the form of available files, which may lead to security issues such as software packages being replaced, tampered with, injected, deleted, and redistributed, thus affecting the security of the operating system.
[0004] In the related art, open source operating system distributors use file encryption and decryption to ensure file security during the distribution process. However, the operating system software package has a huge amount of data, and the encryption and decryption process consumes a lot of system performance, making the distribution efficiency insufficient while ensuring the security of the software package. Summary of the invention
[0005] Based on this, it is necessary to provide a software package deployment method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the distribution efficiency while ensuring the security of the software package in order to address the above technical problems.
[0006] In a first aspect, the present application provides a method for deploying a software package. The method comprises:
[0007] Obtaining basic information of a software package and information of a repository to which the software package belongs; the basic information at least includes a complete file summary; the complete file summary is a summary corresponding to the software package;
[0008] When the basic information and warehouse information of the software package meet the deployment conditions, the software package is segmented to obtain header data, payload data and segmentation record data of the software package; the segmentation record data includes a header summary of the header data, a payload summary of the payload data and a payload data storage location;
[0009] Encrypting the header data to obtain header encrypted data, and adding the header encrypted data and a header encrypted data digest corresponding to the header encrypted data to the segmented record data;
[0010] The basic information and warehouse information are stored in a first database, the segmentation record data are stored in a second database, and the load data of the software package is stored in a third database.
[0011] In one embodiment, obtaining basic information of a software package and information of a warehouse to which the software package belongs includes:
[0012] Receiving the software package and the warehouse information to which the software package belongs through the file upload interface;
[0013] The software package is parsed to obtain basic information of the software package; the basic information also includes name, version, platform, header length, payload length and signature information.
[0014] In one embodiment, segmenting the software package to obtain header data, payload data, and segmentation record data of the software package includes:
[0015] Segmenting the software package according to the data structure of the software package or the preset segmentation byte amount of the software package to obtain header data and payload data of the software package;
[0016] Determine that the summary of the header data is a header summary;
[0017] Writing the payload data into a temporary file, determining a summary of the temporary file as a payload summary, and determining a to-be-stored path of the temporary file as a payload data storage location;
[0018] The complete file summary in the basic information is desensitized to obtain a desensitized file summary, and added to the segmented record data.
[0019] In a second aspect, the present application provides a method for restoring a software package. The method comprises:
[0020] Based on the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, a complete file summary corresponding to the software package to be downloaded is determined in the first database, and based on the complete file summary, segmentation record data and payload data corresponding to the software package to be downloaded are respectively obtained in the second database and the third database; the complete file summary is stored in the basic information of the first database; the segmentation record data includes the header encryption data, payload data storage location, header encryption data summary, payload summary and header summary corresponding to the software package to be downloaded;
[0021] Determining the header encryption data corresponding to the software package to be downloaded from the segmented record data; the header encryption data is determined after segmenting and encrypting the software package to be downloaded; the payload data is determined after segmenting the software package to be downloaded;
[0022] When the header encrypted data is decrypted and the header encrypted data digest, payload digest and header digest are verified, the decrypted header data is merged with the payload data to obtain a restoration file corresponding to the software package to be downloaded, so that the user terminal downloads and deploys the restoration file.
[0023] In one embodiment, based on the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, determining the complete file summary corresponding to the software package to be downloaded in the first database, and acquiring the segmentation record data and the load data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file summary, includes:
[0024] According to the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, determining in the first database a software record table matching the request information; the request information at least includes the name of the software package to be downloaded;
[0025] In the software record table, determining basic information matching the request information, and obtaining a complete file summary in the basic information;
[0026] Desensitizing the complete file summary to obtain a desensitized file summary of the software package to be downloaded;
[0027] In the second database, it is determined that the segmented record data of the desensitized file summary is stored in advance, which is the segmented record data of the software package to be downloaded;
[0028] Based on the payload data storage location in the segmented record data, the payload data of the to-be-downloaded software package is determined in a third database.
[0029] In one of the embodiments, after determining the payload data of the to-be-downloaded software package in the third database based on the payload data storage location in the segmented record data, the method further comprises:
[0030] Calculating a first digest corresponding to the header encrypted data of the software package to be downloaded, and if the first digest is the same as the header encrypted data digest in the segmented record data, determining that the header encrypted data passes the verification;
[0031] When it is determined that the header encrypted data passes the verification, a second digest corresponding to the payload digest of the software package to be downloaded is calculated, and if the second digest is the same as the payload digest in the segmented record data, it is determined that the payload data passes the verification;
[0032] When the payload data passes verification and the header encrypted data is decrypted to obtain the decrypted header data, the third summary of the decrypted header data is calculated. If the third summary is the same as the header summary in the segmented record data, it is determined that the decrypted header data passes verification.
[0033] In one embodiment, the step of combining the decrypted header data with the payload data to obtain a restored file corresponding to the software package to be downloaded includes:
[0034] Prefill the decrypted header data into the pre-built byte buffer stream;
[0035] Obtaining a file stream handle corresponding to the payload data, and inputting the payload data into the byte buffer stream based on the file stream handle;
[0036] The restoration file corresponding to the software package to be downloaded is obtained through the byte buffer stream.
[0037] In a third aspect, the present application also provides a software package deployment device. The device includes:
[0038] An information acquisition module, used to acquire basic information of a software package and information of a repository to which the software package belongs; the basic information at least includes a complete file summary; the complete file summary is a summary corresponding to the software package;
[0039] A software package segmentation module is used to segment the software package when the basic information and warehouse information of the software package meet the deployment conditions, and obtain the header data, load data and segmentation record data of the software package; the segmentation record data includes the header summary of the header data, the load summary of the load data and the load data storage location;
[0040] A data encryption module, used for encrypting the header data to obtain header encrypted data, and adding the header encrypted data and a header encrypted data digest corresponding to the header encrypted data to the segmented record data;
[0041] The data storage module is used to store the basic information and warehouse information in a first database, store the segmentation record data in a second database, and store the load data of the software package in a third database.
[0042] In a fourth aspect, the present application further provides a software package restoration device. The device comprises:
[0043] A data acquisition module, based on the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, determines the complete file summary corresponding to the software package to be downloaded in the first database, and acquires the segmented record data and the payload data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file summary; the complete file summary is stored in the basic information of the first database; the segmented record data includes the header encryption data corresponding to the software package to be downloaded, the payload data storage location, the header encryption data summary, the payload summary and the header summary;
[0044] An encrypted data determination module, used to determine the header encrypted data corresponding to the software package to be downloaded from the segmented record data; the header encrypted data is determined after the software package to be downloaded is segmented and encrypted; the payload data is determined after the software package to be downloaded is segmented;
[0045] The data merging module is used to merge the decrypted header data with the payload data when the header encrypted data is decrypted and the header encrypted data summary, the payload summary and the header summary are verified, so as to obtain a restoration file corresponding to the software package to be downloaded, so that the user terminal can download and deploy the restoration file.
[0046] In a fifth aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in the first aspect or the second aspect are implemented.
[0047] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.
[0048] In a seventh aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.
[0049] The software package deployment method, software package restoration method, device, computer equipment, storage medium and computer program product obtain the basic information and warehouse information of the software package, and when it is determined that the basic information and warehouse information meet the deployment conditions, the data of each software package is segmented to obtain the header data and load data of the software package, and the data obtained in the segmentation process is used as segmentation record data. The segmentation record data includes the header summary of the header data, the load summary and the storage location of the load data. Based on this, the header data is encrypted to obtain the header encrypted data, and the header encrypted data summary corresponding to the header encrypted data is determined. The header encrypted data and the header encrypted data summary obtained above are added to the segmentation record data. Finally, the basic information and warehouse information are stored in the first database, the segmentation record data is stored in the second database, and the load data is stored in the third database.
[0050] Since the complete software package is split into header data and payload data, and the header data is encrypted. When the user terminal requests to download the software package, it cannot locate the payload data corresponding to the requested software package, and cannot directly identify and obtain the complete software package through the request information. In the case of header data encryption, the security of the software package distribution process can be guaranteed, and only the header data is encrypted. When the user terminal requests to download the software package, it only needs to decrypt the header data to obtain the header data and the payload data corresponding to the header data, thereby reducing the encryption and decryption time, and achieving the technical effect of improving the efficiency of software package distribution while ensuring the security of the software package. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 An application environment diagram of a software package deployment method in an embodiment;
[0053] Figure 2 A schematic diagram of a process flow of a software package deployment method in one embodiment;
[0054] Figure 3 is a flowchart of a method for restoring a software package in one embodiment;
[0055] Figure 4 A schematic diagram of the data structure of an RPM software package in one embodiment;
[0056] Figure 5 A schematic diagram of a structure for deploying a restoration system in an embodiment;
[0057] Figure 6 A schematic diagram of a flow chart of a software package deployment method in another embodiment;
[0058] Figure 7 is a flowchart of a method for restoring a software package in another embodiment;
[0059] Figure 8 It is a structural block diagram of a software package deployment device in one embodiment;
[0060] Fig. 9 is a structural block diagram of a software package restoration device in an embodiment;
[0061] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0063] The software package deployment method and software package restoration method provided in the embodiments of the present application can be applied to Figure 1 In the application environment shown. Among them, the software source 102 and the user terminal 106 can communicate with the server 104 through the network. The software source 102 can be deployed in the server 104. The data storage system can store data that the server 104 needs to process, such as the various software packages included in the software source. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers.
[0064] The server 104 can obtain the basic information of each software package and the warehouse information of the warehouse to which the software package belongs in the software source. Each warehouse can contain multiple software packages. The basic information and warehouse information of the software package can be stored in the first database. Among them, the basic information includes a complete file summary, and the complete file summary can be used as the basis for the user terminal 106 to request to find a certain software package. When it is determined that the software package meets the deployment conditions, the server 104 can segment the software package to obtain header data, load data and segmentation record data. The segmentation record data includes a header summary, a load summary and a load storage location, the header summary is a summary of the header data, and the load summary is a summary of the load data. The server 104 encrypts the header data to obtain header encryption data, and determines the header encryption data summary corresponding to the header encryption data, and adds it to the segmentation record data. When the user terminal requests a software package, the server 104 can determine the segmentation record data corresponding to the requested software package through the segmentation record table. In an example, the required location information of the header encryption data and the load storage location of the load data can be obtained in the segmentation record data, and the header encryption data is obtained based on the location information, and the load data is obtained based on the load storage location. In an example, the header encryption data can be directly obtained in the segmentation record data. After obtaining the encrypted header data, the server 104 may decrypt the encrypted header data to obtain the original header data. The server 104 may integrate the original header data with the payload data to obtain a complete software package.
[0065] The user terminal 106 may be, but is not limited to, various personal computers, laptops, smart phones, and tablet computers. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers. The software source 102 may be another set of servers independent of the server 104. The software source 102 may also be multiple software package repositories deployed internally in the server 104.
[0066] In an exemplary embodiment, Figure 2 As shown, a software package deployment method is provided, which is applied to Figure 1 The server 104 in the example is used as an example to illustrate the method, which includes the following steps S202 to S208. Among them:
[0067] Step S202, obtaining basic information of the software package and information of the repository to which the software package belongs; the basic information at least includes a complete file summary.
[0068] The complete file summary is the summary corresponding to the software package; the complete file summary can be obtained by performing summary calculation on the data of the entire software package; the basic information is the basic information of the software package, such as the name, type, purpose, and unique identifier of the software package. The warehouse information is used to indicate the warehouse to which each software package belongs and the basic information of each warehouse. For example, the basic information of the warehouse can be the warehouse name, warehouse type, etc.
[0069] Specifically, the server initiates a data request to the software source, and receives the software package returned by the software source through the data interface. The server parses the software package to determine the basic information of each software package and the warehouse information corresponding to the software package.
[0070] Step S204: When the basic information and warehouse information of the software package meet the deployment conditions, the software package is segmented to obtain the header data, load data and segmentation record data of the software package.
[0071] The segmented record data includes the header summary of the header data, the payload summary of the payload data, and the payload data storage location. The header summary is obtained by performing a summary calculation on the header data; the payload summary is obtained by performing a summary calculation on the payload data. The header data and the payload data are combined to obtain a complete software package. The payload data is the substantial data of the software package, mainly including software products, configuration files, services or scripts installed on the system. The header data contains basic information of the key package, header summary, signature information, protocol version and other information.
[0072] Specifically, for each software package, the server judges the basic information and warehouse information of the software package to determine whether the basic information of the software package and the warehouse information match the software warehouse requirements. If the process of parsing the basic information fails, or the warehouse information does not match the software warehouse requirements, such as platform mismatch, version dependency, etc., it is determined that the software package does not meet the deployment conditions.
[0073] If it is determined that the basic information and warehouse information of the software package meet the deployment conditions, the server can split the software package into two parts: header data and payload data, and determine the header summary of the header data, the payload summary of the payload data, and the payload data storage location during the segmentation process, and add the above header summary, payload summary, and payload data storage location to the segmentation record data.
[0074] Step S206, encrypting the header data to obtain header encrypted data, and adding the header encrypted data and the header encrypted data digest corresponding to the header encrypted data to the segmented record data.
[0075] Specifically, the encryption strategy used for encryption can be any encryption strategy. After the server encrypts the header data, it obtains the header encrypted data, and the unencrypted header data can be deleted at this time. In order to verify the header encrypted data in the subsequent process of issuing the software package, the server can determine the summary of the header encrypted data, obtain the header encrypted data summary, and store both the header encrypted data and the header encrypted data summary in the segmented record data.
[0076] Step S208, storing the basic information and warehouse information in the first database, storing the segmentation record data in the second database, and storing the load data of the software package in the third database.
[0077] Specifically, the server may store basic information and warehouse information of each software package in the first database, so that the first database contains basic information of multiple software packages and warehouse information to which each software package belongs. A software record table may be established for each software warehouse, and the software record table may contain basic information of each software package corresponding to the software warehouse. The first database may contain multiple software record tables.
[0078] The server may store the segmentation record data in a second database, and the second database may record the segmentation record data corresponding to each software package. For example, the second database may include a segmentation record table corresponding to each software warehouse, and each segmentation record table includes segmentation record data of multiple software packages. The server may store the load data in a third database or a pre-configured folder.
[0079] In the above software package deployment method, by obtaining the basic information and warehouse information of the software package, and when it is determined that the basic information and warehouse information meet the deployment conditions, the data of each software package is segmented to obtain the header data and payload data of the software package, and the data obtained in the segmentation process is used as segmentation record data. The segmentation record data includes a header summary of the header data, a payload summary, and a storage location of the payload data. Based on this, the header data is encrypted to obtain header encrypted data, and the header encrypted data summary corresponding to the header encrypted data is determined. The header encrypted data and the header encrypted data summary obtained above are added to the segmentation record data. Finally, the basic information and warehouse information are stored in the first database, the segmentation record data is stored in the second database, and the payload data is stored in the third database.
[0080] Since the complete software package is split into header data and payload data, and the header data is encrypted. When the user terminal requests to download the software package, it cannot locate the payload data corresponding to the requested software package, and cannot directly identify and obtain the complete software package through the request information. In the case of header data encryption, the security of the software package distribution process can be guaranteed, and only the header data is encrypted. When the user terminal requests to download the software package, it only needs to decrypt the header data to obtain the header data and the payload data corresponding to the header data, thereby reducing the encryption and decryption time, and achieving the technical effect of improving the efficiency of software package distribution while ensuring the security of the software package.
[0081] In an exemplary embodiment, the specific implementation process of the step of "obtaining basic information of the software package and information of the warehouse to which the software package belongs" includes:
[0082] The software package and the warehouse information to which the software package belongs are received through the file upload interface; the software package is parsed to obtain the basic information of the software package.
[0083] The basic information also includes name, version, platform, header length, payload length and signature information.
[0084] Specifically, the server provides a file upload interface, such as local upload, network download, synchronization from upstream software source, etc. The server can obtain the software package and the warehouse information to which the software package belongs through the file upload interface. The server can parse the software package and obtain the basic information contained in the package header data, such as name, version, platform, header length, payload length, signature information, complete file summary, etc.
[0085] Optionally, after the basic information and warehouse information are obtained, the basic information and warehouse information of the software package may be used as a software and warehouse information record entry, and the entry may be recorded in the first database.
[0086] In this embodiment, the software package and the software warehouse to which the software package belongs can be obtained through the file upload interface. In addition, the basic information of the software package can be obtained through parsing, which can improve the accuracy of obtaining the basic information.
[0087] In an exemplary embodiment, the specific implementation process of the step of "segmenting the software package to obtain the header data, payload data and segmentation record data of the software package" includes:
[0088] According to the data structure of the software package, or the preset segmentation byte amount of the software package, the software package is segmented to obtain the header data and the payload data of the software package; the summary of the header data is determined to be the header summary; the payload data is written to a temporary file, and the summary of the temporary file is determined to be the payload summary, and the path to be stored of the temporary file is determined to be the payload data storage location; the complete file summary in the basic information is desensitized to obtain a desensitized file summary, and added to the segmentation record data.
[0089] Specifically, the server can split the software package according to the data structure inside the software package to obtain header data and load data. The server can also determine the data contained in the preset split byte amount as header data and the remaining data as load data based on the preset split byte amount. The server can read the header summary contained in the header data, or perform summary calculation on the header data to determine the header summary. The server writes the split load data into a temporary file, calculates the summary of the temporary file, and determines it as the load summary. The server can obtain the path to be stored of the temporary file, and use it as the load data storage location corresponding to the software package. Based on this, the server can desensitize the complete file summary in the basic information, obtain a desensitized file summary, and add it to the split record data. So that subsequent user terminals can find the corresponding split record data in the second database through the desensitized file summary. At this time, the split record data contains a header summary, a load summary, a load data storage location, and a desensitized file summary.
[0090] In this embodiment, by segmenting the software package and determining the payload summary of the payload data, the payload data storage location, and the desensitized file summary corresponding to the complete file summary, the software package can be split into multiple groups of data, and the connection between the segmented record data and the first database is established through the desensitized file summary, thereby improving the security of the deployment.
[0091] In an exemplary embodiment, Figure 3 As shown, a software package deployment method is provided, which is applied to Figure 1 The server 104 in the example is used as an example to illustrate the method, which includes the following steps S302 to S306. Among them:
[0092] Step S302, based on the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, determine the complete file summary corresponding to the software package to be downloaded in the first database, and obtain the segmentation record data and load data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file summary.
[0093] The complete file summary is stored in the basic information of the first database; the segmented record data includes the header encryption data corresponding to the software package to be downloaded, the payload data storage location, the header encryption data summary, the payload summary and the header summary. The request information may include some basic information, such as the name, version, platform and other information of the software package to be downloaded.
[0094] Specifically, after receiving the request information of the software package to be downloaded sent by the user terminal, the server can determine the software warehouse corresponding to the software package to be downloaded through the request information and the warehouse information stored in the server itself. The server can query the basic information matching the software package to be downloaded in the first database based on the software warehouse, so as to obtain the complete file summary of the software package to be downloaded. The server can query the second database through the complete file summary of the software package to be downloaded to obtain the segmented record data containing the complete file summary. Afterwards, the server can obtain the payload data corresponding to the software package to be downloaded in the third database based on the payload data storage location in the segmented record data.
[0095] Step S304: determine the header encrypted data corresponding to the software package to be downloaded from the segmented record data.
[0096] The header encrypted data is determined after the software package to be downloaded is segmented and encrypted; the payload data is determined after the software package to be downloaded is segmented;
[0097] Specifically, the server may determine, according to the meaning of each field in the segmented record data, that the data corresponding to the field having the meaning of header encrypted data is the header encrypted data.
[0098] Step S306, when the header encrypted data is decrypted and the header encrypted data summary, payload summary and header summary are verified, the decrypted header data is merged with the payload data to obtain a restoration file corresponding to the software package to be downloaded, so that the user terminal downloads and deploys the restoration file.
[0099] The strategy and method used for decryption may correspond to the strategy and method used for encryption.
[0100] Specifically, the server can decrypt the header encrypted data through the decryption strategy to obtain the decrypted header data. In addition, the server can verify the obtained header encrypted data summary, payload summary and header summary to determine whether there are abnormalities in the header encrypted data, payload data and header data. When the header encrypted data is decrypted and the header encrypted data summary, payload summary and header summary pass the verification, the server can merge the decrypted header data and payload data to obtain the restored file of the software package to be downloaded. At this time, the restored file that can be directly downloaded and accessed already exists in the server. The user terminal can download the restored file from the server through the communication network and deploy the file in the user terminal.
[0101] In the above software package restoration method, the complete file summary of the software package to be downloaded can be determined in the first database through the request information and warehouse information of the software package to be downloaded, and the segmented record data can be obtained in the second database through the complete file summary, and the payload data can be obtained in the third database through the payload data storage location of the segmented record data. The header encrypted data in the segmented record data is decrypted, and the header encrypted data, payload data, and decrypted header data are verified. If the verification is passed, the decrypted header data and payload data are merged to obtain a restored file for download by the user terminal. Since the software package to be downloaded on the server is split, encrypted and stored in multiple databases, criminals cannot directly query and modify the software package in the server, ensuring the security of the software package. Afterwards, when the user terminal obtains data, it only needs to decrypt the header encrypted data, and does not need to decrypt the payload data, thereby reducing the amount of decrypted data and improving the efficiency of obtaining the restored file, thereby achieving the technical effect of improving the efficiency of issuing software packages while ensuring the security of the software package.
[0102] In an exemplary embodiment, the specific implementation process of the step of "determining the complete file summary corresponding to the software package to be downloaded in the first database based on the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, and acquiring the segmentation record data and the load data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file summary" includes:
[0103] According to the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, a software record table matching the request information is determined in the first database; in the software record table, basic information matching the request information is determined, and a complete file summary in the basic information is obtained; the complete file summary is desensitized to obtain a desensitized file summary of the software package to be downloaded; in the second database, segmented record data in which the desensitized file summary is stored in advance is determined to be the segmented record data of the software package to be downloaded; based on the storage location of the load data in the segmented record data, the load data of the software package to be downloaded is determined in the third database.
[0104] The request information at least includes the name of the software package to be downloaded.
[0105] Specifically, the server can determine the software warehouse to which the software package to be downloaded belongs according to the name in the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which the software package belongs. The server can obtain the software record table corresponding to the software warehouse in the first database, and the server traverses and queries the software record table to determine the basic information including the name, thereby obtaining the basic information of the software package to be downloaded, and obtaining the complete file summary in the basic information.
[0106] The server can perform desensitization processing on the complete file summary to obtain a desensitized file summary of the software package to be downloaded, wherein the desensitization processing here is exactly the same as the desensitization processing in the software package deployment method. The server can determine the segmented record data containing the desensitized file summary in the second database based on the desensitized file summary, thereby obtaining the segmented record data of the software package to be downloaded. Based on this, the server initiates a data acquisition request to the third database based on the storage location of the load data in the segmented record data, and obtains the load data of the software package to be downloaded in the third database.
[0107] In this embodiment, the complete file summary can be determined in the first database through the request information and the basic information. At this time, desensitization processing is performed to obtain a desensitized file summary, and the corresponding segmented record data can be retrieved from the desensitized file summary in the second database, and the payload data can be determined based on the storage location of the payload data in the segmented record data, which can improve the security of obtaining the segmented record data and the payload data.
[0108] In an exemplary embodiment, after the step of "determining the payload data of the software package to be downloaded in the third database based on the payload data storage location in the segmented record data", the method further includes:
[0109] Calculate the first digest corresponding to the header encrypted data of the software package to be downloaded. If the first digest is the same as the digest of the header encrypted data in the segmented record data, determine that the header encrypted data has passed the verification; when it is determined that the header encrypted data has passed the verification, calculate the second digest corresponding to the payload digest of the software package to be downloaded. If the second digest is the same as the payload digest in the segmented record data, determine that the payload data has passed the verification; when the payload data has passed the verification and the header encrypted data has been decrypted to obtain the decrypted header data, calculate the third digest of the decrypted header data. If the third digest is the same as the header digest in the segmented record data, determine that the decrypted header data has passed the verification.
[0110] Specifically, the server can calculate the first digest corresponding to the header encrypted data of the software package to be downloaded, and determine whether the first digest is the same as the header encrypted data digest stored in the segmented record data. If they are the same, it is determined that the header encrypted data has passed the verification; if they are different, it is determined that the header encrypted data has not passed the verification and it is necessary to re-acquire the header encrypted data. After the header encrypted data passes the verification, the server can calculate the second digest of the payload digest and determine whether the second digest is the same as the payload digest stored in the segmented record data. If they are the same, it is determined that the payload data has passed the verification; if they are different, it is determined that the payload data has not passed the verification and it is necessary to re-acquire the payload data. After the payload data passes the verification, the server can calculate the third digest of the decrypted header data and determine whether the third digest is the same as the header digest stored in the segmented record data. If they are the same, it is determined that the decrypted header data has passed the verification; if they are different, it is determined that the decrypted header data has not passed the verification.
[0111] In this embodiment, the header encryption data summary, the payload summary and the header summary can be used to verify whether the header encryption data, the payload data and the header data obtained by the server are correct, thereby improving the accuracy of restoring the software package.
[0112] In an exemplary embodiment, the specific implementation process of the step of "merging the decrypted header data with the payload data to obtain a restored file corresponding to the software package to be downloaded" includes:
[0113] The decrypted header data is pre-filled into a pre-built byte buffer stream; a file stream handle corresponding to the payload data is obtained, and the payload data is input into the byte buffer stream based on the file stream handle; and a restored file corresponding to the software package to be downloaded is obtained through the byte buffer stream.
[0114] Specifically, the server may create a byte buffer stream, and first fill the decrypted header data into the byte buffer stream in order. The server may obtain a file stream handle of the payload data, and append the payload data to the byte buffer stream through the file stream handle. The server may use the byte buffer stream as a file content source, and use it for the summary calculation of the original file or provide it to the terminal as file data for download. For example, the server may store the data in the byte buffer stream through a storage file, and use it as a restoration file corresponding to the software package to be downloaded.
[0115] Optionally, the server calculates the file digest through the restored software package byte buffer stream to obtain a fourth digest. If the fourth digest is completely identical to the complete file digest corresponding to the software package to be downloaded in the first database, it is determined that the restored file passes the verification. If the fourth digest is different from the complete file digest corresponding to the software package to be downloaded in the first database, the restoration fails, and an error message is fed back to the user terminal.
[0116] Optionally, in the event that restoration of the byte buffer stream fails, a summary of the encrypted header data and the payload data is recalculated according to the segmentation record data in the segmentation record table, and compared with the segmentation record data to identify damaged data; if data damage is not identified, the step of pre-filling the decrypted header data into the pre-built byte buffer stream is re-executed until the restored file is obtained and passes the verification; if data damage is identified, the corresponding data entries are cleaned up, and an attempt is made to reintroduce the software package.
[0117] In this embodiment, the header data and the payload data are merged by means of a byte buffer stream, thereby avoiding the generation of intermediate files, avoiding the risk of file leakage, and increasing the security when the user terminal requests a software package.
[0118] The following describes in detail the specific implementation process of the software package deployment method and software package restoration method in conjunction with a specific embodiment. The core of the software package deployment method and software package restoration method is:
[0119] By splitting the RPM software package file, its structured header data is encrypted and stored in a database or other means; while the main load part is stored in a general file manner. Since the load part file lacks the RPM standard header, it cannot be recognized, processed, and used by software package management tools such as RPM, thereby avoiding the risk of software package leakage, secondary distribution, and use. Figure 1 As shown, the data structure of an RPM software package file includes header data and payload data.
[0120] By means of encrypted database and other methods, an RPM package original information record table and an RPM package segmentation information record table are maintained. The original information record table records the native basic information of the RPM package, including at least: package name, package version, platform, summary, header length, payload length, etc.; while the segmentation information record table records the header data storage information and payload data storage information after the RPM package is segmented, including at least: the original summary of the package, the header data storage information (including summary, encryption information and storage path, etc.), and the payload data storage information (summary and storage path, etc.).
[0121] When a terminal requests to download and use the RPM software package, the RPM information record table and the segmentation information record table are used to integrate resources according to the segmentation records to restore the RPM software package file; at the same time, the summary of the RPM software package is calculated and confirmed to ensure the integrity and consistency of the file. After verification, the integrated RPM software package is sent to the terminal for use.
[0122] Based on this, Figure 5 As shown, the embodiment of the present application can construct an RPM software source management system. The RPM software source management system includes: a software source RPM import module (M1), an RPM software information parsing module (M2), an RPM software and warehouse information database (M3), an RPM software segmentation storage module (M4), an RPM header storage module (M5), an RPM load file storage (M6), an RPM software segmentation information database (M7), an RPM file integration module (M8), an RPM terminal request processing module (M9), and a software source RPM file download module (M10).
[0123] Among them, (M1) software source RPM import module: provides service interfaces (such as local upload, network download, synchronization from upstream software sources, etc.), supports submitting RPM software files to the system; when importing RPM software into the system, it is necessary to specify that the software package be bound to a specific software repository.
[0124] (M2) RPM software information parsing module: Through the RPM package parsing capability, the imported RPM package is parsed to obtain the basic data of the RPM package (the basic data may include name, version, platform, header length, payload length, signature information, RPM file summary, etc.); at the same time, according to the software warehouse information provided during import, RPM software and warehouse information record entries are generated and recorded in the RPM software and warehouse information database.
[0125] (M3) RPM software and warehouse information database: records the information of multiple software warehouses in the system, as well as the basic information of each RPM software package. This database provides complete resource retrieval information when the terminal requests RPM file download.
[0126] (M4) RPM software segmentation storage module: After the M2 module completes the analysis of the RPM, the data distribution in the RPM software package can be obtained, and the RPM file is segmented into two parts: header data (which may include protocol header, RPM information header, RPM signature data) and payload data. The header data is encrypted and stored (the header data can be stored in a database or file), and the storage information of the header data is recorded (the storage information may include the original summary, encrypted summary, storage path, storage index identifier, etc.); the payload data is stored in a file, and the storage information of the payload data (such as summary, storage path, etc.) is recorded.
[0127] (M5) RPM header storage module: Stores the encrypted RPM header information through files or databases. The core is to record the stored information in the RPM segmentation record database so that the RPM file can be restored later.
[0128] (M6) RPM load storage module: stores RPM load data in the form of files; the file name is a summary of the load data. The core needs to record the storage information in the RPM segmentation database to facilitate the subsequent recovery of the RPM file.
[0129] (M7) RPM segmentation record database: This database stores each RPM segmentation storage information by means of data encryption, including at least: summary information of the complete RPM, header summary information, header storage location information, load summary information, load storage location information, etc. The core, segmentation record data entries need to be encrypted when stored in the database to ensure that the complete reorganization information of the RPM cannot be obtained after the database is logged in or viewed externally.
[0130] (M8) RPM file integration module: This module uses the complete RPM summary information submitted by the RPM terminal processing module, based on the records in the RPM segmentation database, to obtain and decrypt the header data, and then stream splice it with the payload data to restore the file stream of the original RPM package. Then, the summary of the file stream is calculated to ensure that the restored RPM is consistent with the integrity of the original RPM.
[0131] (M9) RPM terminal request processing module: This module queries the RPM record information from the RPM software and warehouse information database according to the terminal request information (the terminal request information may include software name, version, warehouse, etc.); and requests the RPM file integration module with the summary information of the RPM software package in the record information to restore the RPM file. After the restoration is successful, data segmentation or file stream proxy is performed according to the data requirements of the download module, thereby providing the terminal with file download capabilities.
[0132] (M10) Software source RPM download module: This module mainly provides a standard RPM management interface for terminals, including RPM metadata download, RPM file download, etc.
[0133] The embodiment of the present application stores key data through RPM file segmentation, and restores it when needed; ensures that the RPM file cannot be identified and used alone during storage and transmission, and avoids secondary distribution; at the same time, through integrity verification, ensures that the RPM file cannot be tampered with during transmission and storage, ensuring its safe use. A good balance can be achieved between security and system overhead, making the modified method very practical. The embodiment of the present application stores key data through RPM file segmentation, and only encrypts key data such as RPM header data and segmentation information; because the amount of this part of data is very small, it is guaranteed that the implementation of this solution will not cause excessive overhead to the system.
[0134] In an exemplary embodiment, the RPM software and warehouse information database (M3), the RPM software segmentation information database (M7), and the RPM header storage (M5) are all stored in a relational database (such as MySQL), using one database and multiple tables. Among them:
[0135] The RPM software and warehouse information database contains two table structures (the table structure design is shown in Table 1): the warehouse table and the software record table to which the warehouse belongs. In the warehouse table, each record represents an RPM software warehouse service provided by the system to the terminal (such as centos7-x86, which represents a software warehouse for the centos7 system X86 platform). The core fields include: warehouse name, platform, description, etc. In the software record table to which the warehouse belongs, each table is associated with a software warehouse, and a software warehouse can contain multiple entries; each entry represents a software package record, and the core fields include: software package name, version, release number, summary, header length, payload length, signature, dependency, file list, etc.
[0136] The RPM software segmentation information database and RPM header storage share a table structure (Table structure design diagram shown in Table 1): the segmentation storage record table to which the warehouse belongs. The segmentation storage record table is the same as the software record table. Each segmentation storage record table is associated with a software warehouse; each entry in the segmentation storage record table records the information of a software package being segmented and stored. The core fields include: RPM file original summary, RPM file header original data summary, RPM header encrypted data, RPM file header encrypted data summary, RPM payload data storage path and file, and RPM payload data summary.
[0137] Table 1
[0138]
[0139] Further, the functions of other modules are described as follows:
[0140] (M1) Software source RPM import module: provides capabilities and interfaces to support importing RPM software packages into the system. There are many ways to import, such as HTTP (HTTPS) standard WEB interface, local copy, disk mount, etc. In the embodiment, a more convenient and universal HTTP network interface is adopted. During the RPM import process, it is necessary to synchronously configure the software warehouse information to which it belongs (such as centos7-x86) to facilitate file association when subsequent terminal requests.
[0141] (M2) RPM software information parsing module: By integrating the librpm library, or rpm-related middleware, or directly calling rpm-related tools, the RPM software package parsing capability is obtained. The imported RPM package is parsed to obtain the basic data of the RPM package (basic data includes software name, software version, platform, header length, payload length, signature information, RPM file summary, etc.); at the same time, according to the software warehouse information provided during import, RPM software and warehouse information record entries are generated and recorded in the RPM software and warehouse information database.
[0142] (M4) RPM software segmentation storage module: After RPM is parsed, the data distribution in the RPM software package can be obtained (see RPM file structure Figure 4 ), RPM file segmentation can be implemented according to the file structure. There are two common segmentation methods: first, fixed-length segmentation (such as 1500 bytes, which must include part or all of the RPM Header segment data); second, full-header segmentation (including protocol header LEAD segment, RPM Signature segment, RPM Header segment). In the embodiment of the present application, 1500-byte fixed-length segmentation is used.
[0143] After the split, first calculate the summary information of the load part (which may be part of the load data, or all the load data plus part of the header data), then use the summary information as the file name, and save the load part data in the file system in the form of a binary file; use AES symmetric encryption on the header data to obtain the encrypted data; calculate the summary of the split header data and the encrypted header data respectively; save the encrypted header data, as well as the header summary information before and after encryption, together with the load part file storage information and the load part summary information, into the split storage record table. In particular, in the process of saving to the split storage record table, it is necessary to record the summary information of the original RPM software package (usually as a KEY); and the summary information needs to be desensitized (such as using a salted Hash algorithm) to ensure that the original RPM package information cannot be directly associated with the database entry information.
[0144] (M8) RPM file integration module: This module uses the complete RPM summary information submitted by the RPM terminal processing module, based on the records in the RPM segmentation database, to obtain and decrypt the header data, and then stream splice it with the payload data to restore the file stream of the original RPM package. Then, the summary of the file stream is calculated to ensure that the restored RPM is consistent with the integrity of the original RPM.
[0145] (M9) RPM terminal request processing module: This module queries the RPM record information from the RPM software and warehouse information database according to the terminal request information (the terminal request information may include software name, version, warehouse, etc.); and requests the RPM file integration module with the summary information of the RPM software package in the record information to restore the RPM file. After the restoration is successful, data segmentation or file stream proxy is performed according to the data requirements of the download module, thereby providing the terminal with file download capabilities.
[0146] (M10) Software source RPM download module: This module mainly provides a standard RPM management interface for terminals, including RPM metadata download, RPM file download, etc.
[0147] The RPM software source management system has two important processes in the process of managing RPM software packages: first, the process of importing RPM software packages into the system storage; second, the process of downloading and restoring RPM software packages.
[0148] The RPM software package is imported into the system storage process. The flow chart is as follows Figure 6 As shown, the steps are:
[0149] (s100) The file upload interface of the software source RPM import module receives the RPM file and submission parameters, and caches the file in the private directory of the workspace. The private directory does not allow external access.
[0150] (s101) The RPM parsing module parses the file to obtain the basic information of the RPM software package; calculates the summary information of the RPM package (denoted as rpm_checksum) and confirms that it is consistent with the summary information of the imported configuration; combines the warehouse information submitted by s100 and the matching warehouse information in the database to confirm whether the software package matches the software warehouse requirements; if the parsing fails, or the summary verification fails, or it does not match the warehouse requirements (such as platform mismatch, version dependency not met, etc.), the process is terminated and an error prompt is given.
[0151] (s102) After the basic information of the RPM software package is verified, a software record information is added to the software record table of the corresponding warehouse, and its status is set to "new" and its entry ID is recorded.
[0152] (s103) Open the RPM cache file and read 1500 bytes into the cache as header data in binary stream mode; if the RPM length is less than 1500, read it all.
[0153] (s104) Write the remaining file contents into a new temporary file and calculate the summary of the temporary file, recorded as pld_checksum.
[0154] (s105) According to the system configuration, the temporary file generated in s104 is named according to its summary value and moved to the file storage location; the full path of the file storage location is recorded as pld_fname.
[0155] (s106) Calculate a summary of the header data, recorded as org_hd_checksum; perform AES data encryption on the header data, recorded as sec_hd_data, and calculate a summary of the encrypted header data, recorded as sec_hd_checksum.
[0156] (s107) The original RPM software package summary information rpm_checksum in step 101 is desensitized by using a salted HASH method and recorded as sec_rpm_checksum.
[0157] (s108) The segmented record data pld_checksum, pld_fname, org_hd_check, sec_hd_data, sec_hd_check, and sec_rpm_checksum generated in steps s104 to s107 are integrated into entries in the segmented storage record table and saved in the segmented storage record table of the corresponding warehouse.
[0158] (s109) Based on the ID of the software entry added in step s102, the entry status is updated to "active". A software entry with the status "active" indicates that it can be provided for download.
[0159] (s110) After the file is stored, the original RPM package cache file in the workspace is cleared and a success response is sent to the import interface.
[0160] On the other hand, the process of restoring when downloading RPM is as follows Figure 7 The process is as follows:
[0161] (s200) Identify the software warehouse requested by the user through the user request information (system model, system version, requested RPM software name, requested RPM software version, etc.), and query the matching software record entry from the corresponding software record table. If no software warehouse is matched, or no software record entry is matched, return failure.
[0162] (s201) Based on the original RPM summary information in the software entry information queried in step s200, the sec_rpm_checksum of the software package is calculated using the salted HASH algorithm consistent with that in step s107; and using this as the key, the RPM segmentation storage record table corresponding to the software warehouse is queried to obtain the RPM package segmentation record data. If no RPM is found, a failure is returned.
[0163] (s202) According to the split storage record information queried in step s201, obtain the encrypted header information and verify the summary; obtain the payload file path, confirm the payload file status (if the file status is that the file exists, it is determined to be accessible), verify the summary of the payload file, and ensure file integrity.
[0164] (s203) Apply the decryption algorithm and key matched with step s106 to the obtained encrypted header information, decrypt the encrypted header data, and perform summary verification on the decrypted header information to ensure data consistency.
[0165] (s204) Open the payload file and obtain the file stream handle; construct a buffered byte stream and pre-fill the decrypted header content into the buffer; then use the file stream of the payload file as the input source of the buffer, thereby forming a complete byte stream of the RPM file.
[0166] (s205) Calculate the digest of the RPM file byte stream completed in step s204, and verify that it is consistent with the digest of the original RPM file recorded in the software record table to ensure file integrity. Optionally, when the file integrity check fails, the RPM software package can be re-obtained through the upstream service and the damaged resources can be updated.
[0167] (s206) Repeat step s204 to rebuild the RPM file stream. Because step s205 has consumed the buffer byte stream, the RPM file stream is integrated with the download request (as the http payload content) to distribute the file content to the user end.
[0168] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0169] Based on the same inventive concept, the embodiment of the present application also provides a software package deployment device for implementing the software package deployment method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in the one or more software package deployment device embodiments provided below can refer to the limitations of the software package deployment method above, and will not be repeated here.
[0170] In an exemplary embodiment, Figure 8 As shown, a software package deployment device 800 is provided, including: an information acquisition module 801, a software package segmentation module 802, a data encryption module 803 and a data storage module 804, wherein:
[0171] The information acquisition module 801 is used to acquire basic information of the software package and information of the repository to which the software package belongs; the basic information at least includes a complete file summary; the complete file summary is a summary corresponding to the software package;
[0172] The software package segmentation module 802 is used to segment the software package when the basic information and warehouse information of the software package meet the deployment conditions, and obtain the header data, load data and segmentation record data of the software package; the segmentation record data includes the header summary of the header data, the load summary of the load data and the load data storage location;
[0173] The data encryption module 803 is used to encrypt the header data to obtain header encrypted data, and add the header encrypted data and the header encrypted data digest corresponding to the header encrypted data to the segmented record data;
[0174] The data storage module 804 is used to store the basic information and warehouse information in the first database, store the segmentation record data in the second database, and store the load data of the software package in the third database.
[0175] Furthermore, the information acquisition module 801 is specifically used to: receive the software package and the warehouse information to which the software package belongs through the file upload interface; parse the software package to obtain basic information of the software package; the basic information also includes name, version, platform, header length, payload length and signature information.
[0176] Furthermore, the software package segmentation module 802 is specifically used to: segment the software package according to the data structure of the software package, or the preset segmentation byte amount of the software package, to obtain the header data and payload data of the software package; determine the summary of the header data as the header summary; write the payload data to a temporary file, and determine the summary of the temporary file as the payload summary, and determine the path to be stored of the temporary file as the payload data storage location; desensitize the complete file summary in the basic information to obtain a desensitized file summary, and add it to the segmentation record data.
[0177] Based on the same inventive concept, the embodiment of the present application also provides a software package deployment device for implementing the software package restoration method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more software package restoration device embodiments provided below can refer to the limitations of the software package restoration method above, and will not be repeated here.
[0178] In an exemplary embodiment, Fig. 9 As shown, a software package deployment device 900 is provided, including: a data acquisition module 901, an encrypted data determination module 902 and a data merging module 904, wherein:
[0179] The data acquisition module 901 determines the complete file summary corresponding to the software package to be downloaded in the first database based on the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, and acquires the segmented record data and the payload data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file summary; the complete file summary is stored in the basic information of the first database; the segmented record data includes the header encryption data corresponding to the software package to be downloaded, the payload data storage location, the header encryption data summary, the payload summary and the header summary;
[0180] The encrypted data determination module 902 is used to determine the header encrypted data corresponding to the software package to be downloaded from the segmented record data; the header encrypted data is determined after the software package to be downloaded is segmented and encrypted; the payload data is determined after the software package to be downloaded is segmented;
[0181] The data merging module 903 is used to merge the decrypted header data with the payload data after the header encrypted data is decrypted and the header encrypted data summary, payload summary and header summary are verified to obtain the restoration file corresponding to the software package to be downloaded, so that the user terminal can download and deploy the restoration file.
[0182] Furthermore, the data acquisition module 901 is specifically used to: determine in the first database a software record table that matches the request information based on the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs; the request information at least includes the name of the software package to be downloaded; in the software record table, determine the basic information that matches the request information, and obtain the complete file summary in the basic information; desensitize the complete file summary to obtain a desensitized file summary of the software package to be downloaded; in the second database, determine the segmented record data in which the desensitized file summary is stored in advance, which is the segmented record data of the software package to be downloaded; based on the load data storage location in the segmented record data, determine the load data of the software package to be downloaded in the third database.
[0183] Furthermore, the device also includes a data verification module, which is specifically used to: calculate a first digest corresponding to the header encrypted data of the software package to be downloaded, and if the first digest is the same as the header encrypted data digest in the segmented record data, determine that the header encrypted data has passed the verification; when it is determined that the header encrypted data has passed the verification, calculate a second digest corresponding to the payload digest of the software package to be downloaded, and if the second digest is the same as the payload digest in the segmented record data, determine that the payload data has passed the verification; when the payload data has passed the verification and the header encrypted data has been decrypted to obtain the decrypted header data, calculate a third digest of the decrypted header data, and if the third digest is the same as the header digest in the segmented record data, determine that the decrypted header data has passed the verification.
[0184] Furthermore, the data merging module 903 is specifically used to: pre-fill the decrypted header data into a pre-constructed byte buffer stream; obtain a file stream handle corresponding to the payload data, and input the payload data into the byte buffer stream based on the file stream handle; and obtain a restored file corresponding to the software package to be downloaded through the byte buffer stream.
[0185] Each module in the software package deployment device and software package restoration device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0186] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store basic information, warehouse information, header data, load data, and segmentation record data of each software package. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a software package deployment method and a software package restoration method are implemented.
[0187] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0188] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0189] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0190] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0191] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0192] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0193] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A software package deployment method, characterized in that: The method comprises: Obtaining basic information of a software package and information of a repository to which the software package belongs; the basic information at least includes a complete file summary; the complete file summary is a summary corresponding to the software package; When the basic information and warehouse information of the software package meet the deployment conditions, the software package is segmented to obtain header data, payload data and segmentation record data of the software package; the segmentation record data includes a header summary of the header data, a payload summary of the payload data and a payload data storage location; Encrypting the header data to obtain header encrypted data, and adding the header encrypted data and a header encrypted data digest corresponding to the header encrypted data to the segmented record data; The basic information and warehouse information are stored in a first database, the segmentation record data are stored in a second database, and the load data of the software package is stored in a third database.
2. The method according to claim 1, characterized in that The basic information of the software package and the warehouse information to which the software package belongs are obtained, including: Receiving the software package and the warehouse information to which the software package belongs through the file upload interface; The software package is parsed to obtain basic information of the software package; the basic information also includes name, version, platform, header length, payload length and signature information.
3. The method according to claim 1, characterized in that The step of segmenting the software package to obtain header data, payload data and segmentation record data of the software package includes: Segmenting the software package according to the data structure of the software package or the preset segmentation byte amount of the software package to obtain header data and payload data of the software package; Determine that the summary of the header data is a header summary; Writing the payload data into a temporary file, determining a summary of the temporary file as a payload summary, and determining a to-be-stored path of the temporary file as a payload data storage location; The complete file summary in the basic information is desensitized to obtain a desensitized file summary, and added to the segmented record data.
4. A method for restoring a software package, characterized in that: The method comprises: Based on the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, a complete file summary corresponding to the software package to be downloaded is determined in the first database, and based on the complete file summary, segmentation record data and payload data corresponding to the software package to be downloaded are respectively obtained in the second database and the third database; the complete file summary is stored in the basic information of the first database; the segmentation record data includes the header encryption data, payload data storage location, header encryption data summary, payload summary and header summary corresponding to the software package to be downloaded; Determining the header encryption data corresponding to the software package to be downloaded from the segmented record data; the header encryption data is determined after segmenting and encrypting the software package to be downloaded; the payload data is determined after segmenting the software package to be downloaded; When the header encrypted data is decrypted and the header encrypted data digest, payload digest and header digest are verified, the decrypted header data is merged with the payload data to obtain a restoration file corresponding to the software package to be downloaded, so that the user terminal downloads and deploys the restoration file.
5. The method according to claim 4, characterized in that The method of determining the complete file summary corresponding to the software package to be downloaded in the first database based on the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, and acquiring the segmentation record data and the load data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file summary, includes: According to the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, determining in the first database a software record table matching the request information; the request information at least includes the name of the software package to be downloaded; In the software record table, determining basic information matching the request information, and obtaining a complete file summary in the basic information; Desensitizing the complete file summary to obtain a desensitized file summary of the software package to be downloaded; In the second database, it is determined that the segmented record data of the desensitized file summary is stored in advance, which is the segmented record data of the software package to be downloaded; Based on the payload data storage location in the segmented record data, the payload data of the to-be-downloaded software package is determined in a third database.
6. The method according to claim 4, characterized in that After determining the payload data of the to-be-downloaded software package in the third database based on the payload data storage location in the segmented record data, the method further includes: Calculating a first digest corresponding to the header encrypted data of the software package to be downloaded, and if the first digest is the same as the header encrypted data digest in the segmented record data, determining that the header encrypted data passes the verification; When it is determined that the header encrypted data passes the verification, a second digest corresponding to the payload digest of the software package to be downloaded is calculated, and if the second digest is the same as the payload digest in the segmented record data, it is determined that the payload data passes the verification; When the payload data passes verification and the header encrypted data is decrypted to obtain the decrypted header data, the third summary of the decrypted header data is calculated. If the third summary is the same as the header summary in the segmented record data, it is determined that the decrypted header data passes verification.
7. The method according to claim 4, characterized in that The step of combining the decrypted header data with the payload data to obtain a restored file corresponding to the software package to be downloaded includes: Prefill the decrypted header data into the pre-built byte buffer stream; Obtaining a file stream handle corresponding to the payload data, and inputting the payload data into the byte buffer stream based on the file stream handle; The restoration file corresponding to the software package to be downloaded is obtained through the byte buffer stream.
8. A software package deployment device, characterized in that: The device comprises: An information acquisition module, used to acquire basic information of a software package and information of a repository to which the software package belongs; the basic information at least includes a complete file summary; the complete file summary is a summary corresponding to the software package; A software package segmentation module is used to segment the software package when the basic information and warehouse information of the software package meet the deployment conditions, and obtain the header data, load data and segmentation record data of the software package; the segmentation record data includes the header summary of the header data, the load summary of the load data and the load data storage location; A data encryption module, used for encrypting the header data to obtain header encrypted data, and adding the header encrypted data and a header encrypted data digest corresponding to the header encrypted data to the segmented record data; The data storage module is used to store the basic information and warehouse information in a first database, store the segmentation record data in a second database, and store the load data of the software package in a third database.
9. A software package restoration device, characterized in that: The device comprises: A data acquisition module, based on the request information of the software package to be downloaded sent by the user terminal and the warehouse information to which each software package belongs, determines the complete file summary corresponding to the software package to be downloaded in the first database, and acquires the segmented record data and the payload data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file summary; the complete file summary is stored in the basic information of the first database; the segmented record data includes the header encryption data corresponding to the software package to be downloaded, the payload data storage location, the header encryption data summary, the payload summary and the header summary; An encrypted data determination module, used to determine the header encrypted data corresponding to the software package to be downloaded from the segmented record data; the header encrypted data is determined after the software package to be downloaded is segmented and encrypted; the payload data is determined after the software package to be downloaded is segmented; The data merging module is used to merge the decrypted header data with the payload data when the header encrypted data is decrypted and the header encrypted data summary, the payload summary and the header summary are verified, so as to obtain a restoration file corresponding to the software package to be downloaded, so that the user terminal can download and deploy the restoration file.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Supply method, acquisition method, equipment and processing system of application software installation package
CN102981879A
Vehicle-mounted system installation package downloading method, electronic equipment and storage medium
CN113031978A
Business file storage method and device based on block chain and electronic equipment
CN113032841A
Method and apparatus for creating and distributing non-sensitized information summaries to users
US20020059369A1
File encryption method, file decrypton method, electronic device, and storage medium
US20180365434A1