Software package deployment method, software package restoration method, device and computer equipment
By splitting the software package into header and payload data, and encrypting and decrypting the header data, the security and efficiency issues of traditional RPM software sources are solved, thereby improving distribution efficiency while ensuring security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CLOUD TECH CO LTD
- Filing Date
- 2024-11-26
- Publication Date
- 2026-04-28
AI Technical Summary
Traditional RPM software repositories suffer from security issues such as software package replacement, tampering, injection, deletion, and secondary distribution during third-party software deployment. Furthermore, the encryption and decryption processes consume significant system resources, resulting in insufficient distribution efficiency.
The software package is divided into header data and payload data. The header data is stored in an encrypted manner and managed by the summary and location information of the segmented data. When the user terminal requests a download, only the header data is decrypted and merged to obtain the complete software package.
While ensuring the security of the software package, the encryption and decryption time was reduced, thus improving the efficiency of software package distribution.
Smart Images

Figure CN119577040B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software package distribution technology, and in particular to a software package deployment method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] In the field of operating system distribution, software package distribution management is a crucial aspect. RPM (Red Hat Package Manager) provides a solution for packaging, distributing, and installing software based on structured file descriptions. Traditional open-source operating system distributors use RPM software distribution schemes, employing open file download services to build RPM software repositories for software distribution.
[0003] In the process of distributing software to third-party deployments using traditional RPM software repositories, the software packages are distributed to third-party devices or systems in the form of usable files. This may lead to security issues such as software package replacement, tampering, injection, deletion, and redistribution, which in turn may affect the security of the operating system.
[0004] In related technologies, open-source operating system distributors use file encryption and decryption to ensure file security during the distribution process. However, operating system software packages are extremely large, and the encryption and decryption process consumes a lot of system performance, resulting in insufficient distribution efficiency while ensuring software package security. Summary of the Invention
[0005] Therefore, it is necessary to provide a software package deployment method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve distribution efficiency while ensuring software package security, in order to address the aforementioned technical problems.
[0006] Firstly, this application provides a method for deploying software packages. The method includes:
[0007] Obtain basic information about the software package and the repository information to which the software package belongs; the basic information includes at least a complete file digest; the complete file digest is the digest corresponding to the software package;
[0008] If the basic information and repository information of the software package meet the deployment conditions, the software package is segmented to obtain the header data, payload data and segmentation record data of the software package; the segmentation record data includes the header digest of the header data, and the payload digest and payload data storage location of the payload data;
[0009] The header data is encrypted to obtain encrypted header data, and the encrypted header data and the corresponding encrypted header data digest are added to the segmented record data.
[0010] 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 of the software package is stored in the third database.
[0011] In one embodiment, obtaining the basic information of the software package and the repository information to which the software package belongs includes:
[0012] The system receives the software package and the repository information to which the software package belongs via the file upload interface.
[0013] The software package is parsed to obtain its basic information, which includes name, version, platform, header length, payload length, and signature information.
[0014] In one embodiment, segmenting the software package to obtain the package header data, payload data, and segmentation record data includes:
[0015] Based on the data structure of the software package or the preset segmentation byte size of the software package, the software package is segmented to obtain the header data and payload data of the software package;
[0016] The summary of the header data is determined to be the header summary;
[0017] The load data is written to a temporary file, and the summary of the temporary file is determined to be the load summary, and the storage path of the temporary file is determined to be the load data storage location;
[0018] The complete file summary in the basic information is anonymized to obtain an anonymized file summary, which is then added to the segmented record data.
[0019] Secondly, this application provides a method for restoring software packages. The method includes:
[0020] Based on the request information for the software package to be downloaded sent by the user terminal, and the repository information to which each software package belongs, the complete file digest corresponding to the software package to be downloaded is determined in the first database. Based on the complete file digest, the segmentation record data and payload data corresponding to the software package to be downloaded are obtained in the second database and the third database respectively. The complete file digest is stored in the basic information of the first database. The segmentation record data includes the header encrypted data, payload data storage location, header encrypted data digest, payload digest, and header digest corresponding to the software package to be downloaded.
[0021] The header encryption data corresponding to the software package to be downloaded is determined 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] After 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 the restore file corresponding to the software package to be downloaded, so that the user terminal can download and deploy the restore file.
[0023] In one embodiment, based on the request information of the software package to be downloaded sent by the user terminal and the repository information to which each software package belongs, the complete file digest corresponding to the software package to be downloaded is determined in the first database, and based on the complete file digest, the segmentation record data and payload data corresponding to the software package to be downloaded are obtained in the second database and the third database respectively, including:
[0024] Based on the request information for the software packages to be downloaded sent by the user terminal, and the repository information to which each software package belongs, a software record table matching the request information is determined in the first database; the request information includes at least the name of the software package to be downloaded;
[0025] In the software record table, determine the basic information that matches the request information, and obtain the complete file summary from the basic information;
[0026] The complete file digest is anonymized to obtain the anonymized file digest of the software package to be downloaded;
[0027] In the second database, segmentation record data containing the pre-stored de-identified file digest is identified as the segmentation record data of the software package to be downloaded;
[0028] Based on the location of the load data storage in the segmented record data, the load data of the software package to be downloaded is determined in the third database.
[0029] In one embodiment, after determining the payload data of the software package to be downloaded in a third database based on the payload data storage location in the segmented record data, the method further includes:
[0030] 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 header encrypted data digest in the segmented record data, then the header encrypted data is determined to have passed verification.
[0031] If the header encrypted data is verified, a second digest corresponding to the payload digest of the software package to be downloaded is calculated. If the second digest is the same as the payload digest in the segmented record data, the payload data is verified.
[0032] If the payload data passes verification and the encrypted header data is decrypted to obtain the decrypted header data, a third digest of the decrypted header data is calculated. If the third digest is the same as the header digest in the segmented record data, then the decrypted header data is determined to have passed verification.
[0033] In one embodiment, merging the decrypted header data with the payload data to obtain the restored file corresponding to the software package to be downloaded includes:
[0034] The decrypted header data is pre-filled into a pre-built byte buffer stream;
[0035] Obtain the file stream handle corresponding to the payload data, and input the payload data into the byte buffer stream based on the file stream handle;
[0036] The restore file corresponding to the software package to be downloaded is obtained through the byte buffer stream.
[0037] Thirdly, this application also provides a software package deployment apparatus. The apparatus includes:
[0038] An information acquisition module is used to acquire basic information about the software package and the repository information to which the software package belongs; the basic information includes at least a complete file digest; the complete file digest is the digest corresponding to the software package;
[0039] The software package segmentation module is used to segment the software package when the basic information and repository information of the software package meet the deployment conditions, and obtain the header data, payload data and segmentation record data of the software package; the segmentation record data includes the header digest of the header data, and the payload digest and payload data storage location of the payload data;
[0040] The data encryption module is used to encrypt the header data to obtain encrypted header data, and add the encrypted header data and the corresponding encrypted header data digest 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 segmented record data in a second database, and store the payload data of the software package in a third database.
[0042] Fourthly, this application also provides a software package restoration apparatus. The apparatus includes:
[0043] The data acquisition module, based on the request information of the software package to be downloaded sent by the user terminal and the repository information to which each software package belongs, determines the complete file digest corresponding to the software package to be downloaded in the first database, and obtains the segmented record data and payload data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file digest; the complete file digest is stored in the basic information of the first database; the segmented record data includes the header encrypted data, payload data storage location, header encrypted data digest, payload digest and header digest corresponding to the software package to be downloaded;
[0044] An encrypted data determination module 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 segmenting and encrypting the software package to be downloaded; the payload data is determined after segmenting the software package to be downloaded.
[0045] The data merging module is used to merge the decrypted header data with the payload data after the header encrypted data has been decrypted and the header encrypted data digest, payload digest and header digest have been verified, to obtain the restore file corresponding to the software package to be downloaded, so that the user terminal can download and deploy the restore file.
[0046] Fifthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method as described in the first or second aspect.
[0047] Sixthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method as described in the first or second aspect.
[0048] In a seventh aspect, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method as described in the first or second aspect.
[0049] The aforementioned software package deployment method, software package restoration method, apparatus, computer equipment, storage medium, and computer program product, by acquiring the basic information and repository information of the software packages, and after determining that the basic information and repository information meet the deployment conditions, segment the data of each software package to obtain the header data and payload data of the software packages, and use the data obtained in the segmentation process as segmentation record data. The segmentation record data includes the header digest, payload digest, and storage location of the payload data. Based on this, the header data is encrypted to obtain encrypted header data, and the corresponding encrypted header digest is determined. The obtained encrypted header data and encrypted header digest are added to the segmentation record data. Finally, the basic information and repository information are stored in a first database, the segmentation record data is stored in a second database, and the payload data is stored in a third database.
[0050] Because the complete software package is split into header data and payload data, and the header data is encrypted, the user terminal cannot locate the payload data corresponding to the requested package when requesting to download the package, and cannot directly identify and obtain the complete package through the request information. Encrypting the header data ensures security during the package distribution process. Furthermore, by encrypting only the header data, when the user terminal requests to download the package, it only needs to decrypt the header data to obtain the header data and its corresponding payload data, thereby reducing encryption and decryption time and achieving the technical effect of improving package distribution efficiency while ensuring package security. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is an application environment diagram of a software package deployment method in one embodiment;
[0053] Figure 2 This is a flowchart illustrating a software package deployment method in one embodiment;
[0054] Figure 3 This is a flowchart illustrating a software package restoration method in one embodiment;
[0055] Figure 4 This is a schematic diagram of the RPM software package data structure in one embodiment;
[0056] Figure 5 This is a schematic diagram of the structure of the restoration system deployed in one embodiment;
[0057] Figure 6 This is a flowchart illustrating the software package deployment method in another embodiment;
[0058] Figure 7 This is a flowchart illustrating the software package restoration method in another embodiment;
[0059] Figure 8 This is a structural block diagram of a software package deployment apparatus in one embodiment;
[0060] Figure 9 This is a structural block diagram of a software package restoration device in one embodiment;
[0061] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0063] The software package deployment method and software package restoration method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, software source 102 and user terminal 106 can communicate with server 104 via a network. Software source 102 can be deployed on server 104. A data storage system can store data that server 104 needs to process, such as the various software packages contained in the software source. The data storage system can be integrated on server 104, or it can be placed in the cloud or on other network servers.
[0064] Server 104 can obtain basic information about each software package and the repository information of the repository to which the software package belongs from the software source. Each repository can contain multiple software packages. The basic information and repository information of the software packages can be stored in a first database. Among them, the basic information includes a complete file digest, which can be used as the basis for user terminal 106 to request to find a certain software package. If the software package meets the deployment conditions, server 104 can segment the software package to obtain header data, payload data, and segmentation record data. The segmentation record data includes a header digest, a payload digest, and a payload storage location. The header digest is a digest of the header data, and the payload digest is a digest of the payload data. Server 104 encrypts the header data to obtain encrypted header data, determines the header encrypted data digest corresponding to the encrypted header data, and adds it to the segmentation record data. When the user terminal requests a software package, server 104 can determine the segmentation record data corresponding to the requested software package through the segmentation record table. In one example, the location information of the required encrypted header data and the payload storage location of the payload data can be obtained from the segmentation record data, and the encrypted header data can be obtained based on the location information, and the payload data can be obtained based on the payload storage location. In one example, the encrypted header data can be obtained directly from the segmentation record data. After obtaining the encrypted header data, server 104 can decrypt the encrypted header data to obtain the original header data. Server 104 can then integrate the original header data with the payload data to obtain the complete software package.
[0065] The user terminal 106 can be, but is not limited to, various personal computers, laptops, smartphones, and tablets. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers. The software source 102 can be a separate server independent of the server 104. The software source 102 can also be multiple software package repositories deployed internally by the server 104.
[0066] In one exemplary embodiment, such as Figure 2 As shown, a software package deployment method is provided, which is applied to Figure 1 Taking server 104 as an example, the explanation includes the following steps S202 to S208. Wherein:
[0067] Step S202: Obtain the basic information of the software package and the repository information to which the software package belongs; the basic information includes at least a complete file summary.
[0068] The complete file digest is the digest corresponding to the software package; it can be obtained by digesting the data of the entire software package. Basic information includes the basic information of the software package, such as its name, type, purpose, and unique identifier. Repository information indicates the repository to which each software package belongs, along with the basic information of each repository. For example, the basic information of a repository could be its name and type.
[0069] Specifically, the server sends a data request to the software source and receives the software packages returned by the source through a data interface. The server parses the software packages to determine the basic information of each package and the corresponding repository information.
[0070] Step S204: If the basic information and repository information of the software package meet the deployment conditions, the software package is segmented to obtain the header data, payload data and segmentation record data of the software package.
[0071] The segmented record data includes a header digest of the header data, and a payload digest and the payload data storage location. The header digest is obtained by performing a digest calculation on the header data; the payload digest is obtained by performing a digest calculation on the payload data. The header data and payload data are combined to form the complete software package. The payload data is the actual data of the software package, mainly including software artifacts, configuration files, services, or scripts installed on the system. The header data contains basic information about the critical package, the header digest, signature information, protocol version, etc.
[0072] Specifically, for each software package, the server checks the package's basic information and repository information to determine if they match the software repository requirements. If the process of parsing the basic information fails, or if the repository information does not match the software repository requirements (e.g., platform incompatibility, version dependency failure), then the software package is determined not to meet the deployment conditions.
[0073] If the basic information and repository information of the software package meet the deployment conditions, the server can split the software package into two parts: header data and payload data. During the splitting process, the server determines the header digest of the header data, the payload digest of the payload data, and the data storage location of the payload data, and adds the header digest, payload digest, and payload data storage location to the splitting record data.
[0074] Step S206: Encrypt the header data to obtain encrypted header data, and add the encrypted header data and the corresponding encrypted header data digest to the segmented record data.
[0075] Specifically, the encryption strategy used can be any encryption strategy. After the server encrypts the header data, it obtains the encrypted header data, at which point the unencrypted header data can be deleted. In order to verify the encrypted header data during the subsequent distribution of the software package, the server can determine the digest of the encrypted header data, obtain the encrypted header data digest, and store both the encrypted header data and the encrypted header data digest in the segmented record data.
[0076] Step S208: Store basic information and warehouse information in the first database, store segmentation record data in the second database, and store the payload data of the software package in the third database.
[0077] Specifically, the server can store the basic information and repository information of each software package in a first database, so that the first database contains basic information of multiple software packages and the repository information to which each software package belongs. A software record table can be created for each software repository, and the software record table can contain the basic information of each software package corresponding to that software repository. The first database can contain multiple software record tables.
[0078] The server can store the split record data in a second database, which can record the split record data for each software package. For example, the second database can contain split record tables for each software repository, and each split record table contains split record data for multiple software packages. The server can store the payload data in a third database or in a pre-configured folder.
[0079] In the above software package deployment method, by obtaining the basic information and repository information of the software packages, and ensuring that the basic information and repository information meet the deployment conditions, the data of each software package is segmented to obtain the header data and payload data of the software packages. The data obtained in the segmentation process is used as segmentation record data. The segmentation record data includes the header digest, payload digest, and the storage location of the payload data. Based on this, the header data is encrypted to obtain encrypted header data, and the corresponding encrypted header digest is determined. The obtained encrypted header data and encrypted header digest are added to the segmentation record data. Finally, the basic information and repository 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] Because the complete software package is split into header data and payload data, and the header data is encrypted, the user terminal cannot locate the payload data corresponding to the requested package when requesting to download the package, and cannot directly identify and obtain the complete package through the request information. Encrypting the header data ensures security during the package distribution process. Furthermore, by encrypting only the header data, when the user terminal requests to download the package, it only needs to decrypt the header data to obtain the header data and its corresponding payload data, thereby reducing encryption and decryption time and achieving the technical effect of improving package distribution efficiency while ensuring package security.
[0081] In an exemplary embodiment, the specific implementation process of the step "obtaining the basic information of the software package and the repository information to which the software package belongs" includes:
[0082] The system receives the software package and its repository information via the file upload interface; it then parses the software package to obtain its basic information.
[0083] The basic information also includes name, version, platform, header length, payload length, and signature information.
[0084] Specifically, the server provides file upload interfaces, such as those for local upload, network download, and synchronization from upstream software sources. Through these file upload interfaces, the server can obtain software packages and their associated repository information. The server can then parse the software packages to obtain basic information contained in the package header, such as name, version, platform, header length, payload length, signature information, and a complete file digest.
[0085] Optionally, after obtaining the basic information and repository information, the basic information and repository information of the software package can be recorded as a software and repository information record entry and recorded in the first database.
[0086] In this embodiment, the software package and its associated software repository can be obtained through the file upload interface. Furthermore, basic information about the software package can be obtained through parsing, which improves the accuracy of obtaining this basic information.
[0087] In an exemplary embodiment, the specific implementation process of the step "segmenting the software package to obtain the package header data, payload data, and segmentation record data" includes:
[0088] Based on the data structure of the software package or the preset segmentation byte size of the software package, the software package is segmented to obtain the header data and payload data; the digest of the header data is determined as the header digest; the payload data is written to a temporary file, and the digest of the temporary file is determined as the payload digest, and the storage path of the temporary file is determined as the payload data storage location; the complete file digest in the basic information is de-identified to obtain a de-identified file digest, and added to the segmentation record data.
[0089] Specifically, the server can split the software package according to its internal data structure to obtain header data and payload data. Alternatively, the server can use a preset segmentation byte size as a basis, determining the data within that preset segmentation byte size as header data and the remaining data as payload data. The server can read the header digest contained in the header data, or it can perform digest calculations on the header data to determine the header digest. The server writes the split payload data to a temporary file, calculates the digest of the temporary file, and determines it as the payload digest. The server can obtain the storage path of the temporary file and use it as the data storage location for the payload data corresponding to the software package. Based on this, the server can de-identify the complete file digest in the basic information to obtain a de-identified file digest, and add it to the segmentation record data. This allows subsequent user terminals to find the corresponding segmentation record data in the second database using the de-identified file digest. At this point, the segmentation record data contains the header digest, payload digest, payload data storage location, and de-identified file digest.
[0090] In this embodiment, by segmenting the software package and determining the load summary, load data storage location, and de-identified file summary corresponding to the complete file summary, the software package can be split into multiple sets of data. The connection between the segmented record data and the first database can be established through the de-identified file summary, thereby improving the security of deployment.
[0091] In one exemplary embodiment, such as Figure 3 As shown, a software package deployment method is provided, which is applied to Figure 1 Taking server 104 as an example, the explanation includes the following steps S302 to S306. Wherein:
[0092] Step S302: Based on the request information of the software package to be downloaded sent by the user terminal and the repository information to which each software package belongs, determine the complete file digest corresponding to the software package to be downloaded in the first database, and obtain the segmentation record data and payload data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file digest.
[0093] The complete file digest is stored in the basic information of the first database; the segmented record data includes the header encrypted data corresponding to the software package to be downloaded, the data storage location of the payload, the header encrypted data digest, the payload digest, and the header digest. The request information may contain some basic information, such as the name, version, and platform of the software package to be downloaded.
[0094] Specifically, after receiving a request from a user terminal for a software package to be downloaded, the server can determine the software repository corresponding to the package using the request information and the repository information stored on the server itself. Based on the software repository, the server can query a first database for basic information matching the software package to be downloaded, thereby obtaining a complete file digest of the package. The server can then query a second database using the complete file digest of the package to be downloaded to obtain segmented record data containing that complete file digest. Finally, based on the location of the payload data storage in the segmented record data, the server can retrieve the payload data corresponding to the software package to be downloaded from a third database.
[0095] Step S304: Determine the header encryption data corresponding to the software package to be downloaded from the segmented record data.
[0096] The header encryption 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 can determine the data corresponding to the field whose meaning is header encrypted data based on the meaning of each field in the segmented record data, and thus the header encrypted data.
[0098] Step S306: After the header encrypted data is decrypted and the header encrypted data digest, payload digest, and header digest are verified, the decrypted header data and payload data are merged to obtain the restore file corresponding to the software package to be downloaded, so that the user terminal can download and deploy the restore file.
[0099] The strategies and methods used for decryption can correspond to those used for encryption.
[0100] Specifically, the server can decrypt the encrypted header data using a decryption strategy to obtain the decrypted header data. Furthermore, the server can verify the obtained encrypted header digest, payload digest, and header digest to determine if any anomalies exist. Once the encrypted header data has been decrypted and the encrypted header digest, payload digest, and header digest have passed 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 point, the server already has the restored file, which can be directly downloaded and accessed. The user terminal can download the restored file from the server via the communication network and deploy the file on the user terminal.
[0101] In the aforementioned software package restoration method, the complete file digest of the software package to be downloaded can be determined in the first database using the request information and repository information. The segmented record data is then obtained from the second database using the complete file digest. The payload data can be obtained from the third database using the payload data storage location of the segmented record data. The encrypted header data in the segmented record data is decrypted, and the encrypted header data, payload data, and decrypted header data are verified. If verification is successful, the decrypted header data and payload data are merged to obtain the restored file for download by the user terminal. Because the software package to be downloaded on the server is split, encrypted, and stored in multiple databases, malicious actors cannot directly query or modify the software package on the server, ensuring the security of the software package. Subsequently, when the user terminal obtains the data, it only needs to decrypt the encrypted header data, without needing to decrypt the payload data, reducing the amount of decrypted data and improving the efficiency of obtaining the restored file. This achieves the technical effect of improving the efficiency of software package distribution while ensuring software package security.
[0102] In an exemplary embodiment, the specific implementation process of the step "based on the request information of the software package to be downloaded sent by the user terminal and the repository information to which each software package belongs, determine the complete file digest corresponding to the software package to be downloaded in the first database, and obtain the segmented record data and payload data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file digest" includes:
[0103] Based on the request information for the software packages to be downloaded sent by the user terminal, and the repository 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 the complete file digest in the basic information is obtained; the complete file digest is anonymized to obtain the anonymized file digest of the software package to be downloaded; in the second database, segmented record data containing pre-stored anonymized file digests is determined as the segmented record data of the software package to be downloaded; based on the data storage location of the payload data in the segmented record data, the payload data of the software package to be downloaded is determined in the third database.
[0104] The request information must include at least the name of the software package to be downloaded.
[0105] Specifically, the server can determine the software repository to which the software package to be downloaded belongs based on the name in the request information sent by the user terminal and the repository information to which the software package belongs. The server can retrieve the software record table corresponding to the software repository from the first database, traverse and query 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 digest from the basic information.
[0106] The server can de-identify the complete file digest to obtain a de-identified file digest of the software package to be downloaded. This de-identification process is identical to that used in the software package deployment method. Based on the de-identified file digest, the server can determine the segmentation record data containing the digest in a second database, thus obtaining the segmentation record data of the software package to be downloaded. Based on this, the server initiates a data retrieval request to a third database according to the payload data storage location in the segmentation record data, and retrieves the payload data of the software package to be downloaded from the third database.
[0107] In this embodiment, a complete file digest can be determined in the first database using request information and basic information. Then, de-identification processing is performed to obtain a de-identified file digest. This de-identified file digest allows retrieval of the corresponding segmented record data in the second database. Based on the location of the payload data storage within the segmented record data, the payload data can be determined, thus improving the security of obtaining both the segmented record data and the payload data.
[0108] In an exemplary embodiment, after the step "determining the payload data of the software package to be downloaded in a 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 encrypted header data of the software package to be downloaded. If the first digest is the same as the encrypted header data digest in the segmented record data, the encrypted header data is verified. If the encrypted header data is verified, 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, the payload data is verified. If the payload data is verified and the encrypted header data is decrypted, the decrypted header data is obtained. 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, the decrypted header data is verified.
[0110] Specifically, the server can calculate the first digest corresponding to the encrypted header data of the software package to be downloaded, and determine whether the first digest is the same as the encrypted header data digest stored in the segmented record data. If they are the same, the encrypted header data is deemed to have passed verification; if they are different, the encrypted header data is deemed to have failed verification, and the encrypted header data needs to be obtained again. After the encrypted header data passes 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, the payload data is deemed to have passed verification; if they are different, the payload data is deemed to have failed verification, and the payload data needs to be obtained again. After the payload data passes 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, the decrypted header data is deemed to have passed verification; if they are different, the decrypted header data is deemed to have failed verification.
[0111] In this embodiment, the header encrypted data digest, payload digest, and header digest can be used to verify whether the header encrypted data, payload data, and header data obtained by the server are correct, thereby improving the accuracy of software package restoration.
[0112] In an exemplary embodiment, the specific implementation process of the step "merging the decrypted header data with the payload data to obtain the 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; the 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; the restored file corresponding to the software package to be downloaded is obtained through the byte buffer stream.
[0114] Specifically, the server can create a byte buffer stream and first fill the decrypted header data into the byte buffer stream sequentially. The server can obtain a file stream handle for the payload data and append the payload data to the byte buffer stream using the file stream handle. The server can use this byte buffer stream as a source of file content and for digest calculation of the original file or as file data to provide for download to the terminal. For example, the server can store the data in the byte buffer stream in a storage file and use it as the recovery file corresponding to the software package to be downloaded.
[0115] Optionally, the server calculates a file digest from the restored package byte buffer stream to obtain a fourth digest. If the fourth digest is exactly the same as the complete file digest corresponding to the package to be downloaded in the first database, the restored file is verified. If the fourth digest is different from the complete file digest corresponding to the package to be downloaded in the first database, the restoration fails, and an error message is sent to the user terminal.
[0116] Optionally, if the byte buffer stream restoration fails, the digest of the encrypted header data and payload data is recalculated according to the segmentation record data in the segmentation record table and compared with the segmentation record data to identify corrupted data; if no data corruption is identified, the step of pre-filling the decrypted header data into the pre-built byte buffer stream is re-executed until the restored file passes verification; if data corruption is identified, the corresponding data entries are cleaned up and the package is re-introduced.
[0117] In this embodiment, the header data and payload data are merged by using a byte buffer stream to avoid generating intermediate files, thus avoiding the risk of file leakage and increasing the security of user terminals when requesting software packages.
[0118] The following describes in detail the execution process of the above-described software package deployment and restoration methods using a specific embodiment. The core of the software package deployment and restoration methods lies in:
[0119] By segmenting RPM package files, their structured header data is encrypted and stored using a database or similar method; while the main payload is stored as a regular file. Because the payload file lacks the standard RPM header, it cannot be recognized, processed, or used by package management tools such as RPM; thus avoiding the risks of package leakage, secondary distribution, and misuse. Figure 1 The image shows the data structure of an RPM software package file, including header data and payload data.
[0120] An RPM package original information record table and an RPM package segmentation information record table are maintained using methods such as encrypted databases. The original information record table records the basic information of the RPM package, including at least: package name, package version, platform, digest, header length, and payload length. The segmentation information record table records the header data storage information and payload data storage information of the RPM package after segmentation, including at least: the original package digest, header data storage information (including digest, encryption information, and storage path), and payload data storage information (digest and storage path).
[0121] When a terminal requests to download and use the RPM package, the system integrates resources according to the segmentation records through the RPM information record table and the segmentation information record table to restore the RPM package file. At the same time, the system calculates and confirms the digest of the RPM package to ensure the integrity and consistency of the file. After verification, the integrated RPM package is distributed to the terminal for use.
[0122] Based on this, such as Figure 5 As shown in the embodiments of this application, an RPM software source management system can be constructed. 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 repository information database (M3), an RPM software segmentation storage module (M4), an RPM header storage module (M5), an RPM payload file storage module (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, the (M1) software source RPM import module provides service interfaces (such as local upload, network download, synchronization from upstream software sources, etc.) and supports submitting RPM software files to the system; when importing RPM software into the system, it is necessary to specify that the software package is bound to a specific software repository.
[0124] (M2) RPM Software Information Parsing Module: Through RPM package parsing capabilities, the imported RPM package is parsed to obtain basic data of the RPM package (basic data may include name, version, platform, header length, payload length, signature information, RPM file summary, etc.); at the same time, based on the software repository information provided during import, RPM software and repository information record entries are generated and recorded in the RPM software and repository information database.
[0125] (M3) RPM Software and Repository Information Database: Records information on multiple software repositories within the system, as well as basic information on each RPM software package. This database provides complete resource retrieval information when a terminal requests an RPM file download.
[0126] (M4) RPM Software Segmentation and Storage Module: After the M2 module completes the parsing of the RPM, it can obtain the data distribution in the RPM software package. Based on this, the RPM file is segmented into two parts: header data (which may include protocol header, RPM information header, and RPM signature data) and payload data. The header data is encrypted and stored (the header data can be stored in a database or a file), and the storage information of the header data is recorded (the storage information may include the original digest, encrypted digest, storage path, storage index identifier, etc.). The payload data is stored in a file, and the storage information of the payload data (such as digest, storage path, etc.) is recorded.
[0127] (M5) RPM Header Storage Module: Stores encrypted RPM header information via a file or database. Crucially, this storage information needs to be recorded in the RPM segmentation record database for subsequent RPM file recovery.
[0128] (M6) RPM Payload Storage Module: Stores RPM payload data in files; the filename is a summary of the payload data. Crucially, this storage information needs to be recorded in the RPM partition database for subsequent RPM file recovery.
[0129] (M7) RPM Segment Record Database: This database stores the information of each RPM segment using data encryption, including at least: a summary of the complete RPM, header summary information, header storage location information, payload summary information, and payload storage location information. Crucially, segment record data entries must be encrypted during database storage to ensure that even if the database is accessed or viewed externally, the complete RPM reassembly information cannot be obtained.
[0130] (M8) RPM File Integration Module: This module utilizes the complete RPM digest information submitted by the RPM terminal processing module. Based on records in the RPM segmentation database, it obtains and decrypts the header data, then performs streaming concatenation with the payload data to reconstruct the original RPM packet file stream. Finally, it performs digest calculation on this file stream to ensure that the reconstructed RPM maintains the same integrity as the original RPM.
[0131] (M9) RPM Terminal Request Processing Module: This module retrieves RPM record information from the RPM software and repository information database based on the terminal request information (which may include software name, version, repository, etc.); and requests the RPM file integration module to restore the RPM file using the summary information of the RPM package in the record. After successful restoration, it performs data fragmentation or file stream proxying 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] This application embodiment stores RPM files in segments, encrypts critical data, and restores it when needed. This ensures that the RPM file cannot be identified or used independently during storage and transmission, preventing secondary distribution. Simultaneously, integrity verification ensures that the RPM file cannot be tampered with during transmission and storage, guaranteeing its security. This achieves a good balance between security and system overhead, making the method highly practical. This application embodiment encrypts only critical data such as the RPM header and segmentation information; because this data volume is small, it ensures that the implementation of this solution will not incur excessive system overhead.
[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 using a relational database (such as MySQL), employing a single database with multiple tables. Wherein:
[0135] The RPM software and repository information database contains two table structures (see Table 1 for table structure design): a repository table and a software record table to which a repository belongs. In the repository table, each record represents an RPM software repository service provided by the system to the terminal (e.g., centos7-x86, representing a software repository on the CentOS 7 x86 platform). Core fields include: repository name, platform, description, etc. In the software record table to which a repository belongs, each table is associated with a software repository. A software repository can contain multiple entries; each entry represents a software package record. Core fields include: package name, version, release number, digest, header length, payload length, signature, dependencies, file list, etc.
[0136] The RPM software partitioning information database and RPM header storage share a common table structure (see Table 1 for table structure design): the partition storage record table to which the repository belongs. Like the software record table, each partition storage record table is associated with a software repository. Each entry in the partition storage record table records information about a software package being partitioned and stored. Core fields include: original RPM file digest, original RPM file header data digest, encrypted RPM header data, encrypted RPM file header data digest, the path and file where the RPM payload data is stored, and a digest of the RPM payload data.
[0137] Table 1
[0138]
[0139] Furthermore, the functions of other modules are described below:
[0140] (M1) Software Source RPM Import Module: Provides capabilities and interfaces to support the import of RPM software packages into the system. There are various import methods, such as the HTTP (HTTPS) standard web interface, local copying, and disk mounting. In this embodiment, the more convenient and universal HTTP network interface method is used. During the RPM import process, it is necessary to synchronously configure the software repository information (e.g., CentOS 7-x86) to facilitate file association during subsequent terminal requests.
[0141] (M2) RPM Software Information Parsing Module: This module acquires RPM package parsing capabilities by integrating the librpm library, RPM-related middleware, or directly calling RPM-related tools. It parses imported RPM packages to obtain basic data (including software name, software version, platform, header length, payload length, signature information, and RPM file summary). Simultaneously, based on the software repository information provided during import, it generates RPM software and repository information records and records them in the RPM software and repository information database.
[0142] (M4) RPM software partitioning and storage module: After the RPM is parsed, the data distribution in the RPM software package can be obtained (see RPM file structure). Figure 4 RPM files can be segmented based on their file structure. There are two common segmentation methods: one is fixed-length segmentation (e.g., 1500 bytes, which must include some or all of the RPM Header segment data); the other is complete header segmentation (including the LEAD header segment, RPM Signature segment, and RPM Header segment). In this embodiment, a fixed-length segmentation of 1500 bytes is used.
[0143] After segmentation, the digest information of the payload portion (which may be part of the payload data or all the payload data plus part of the header data) is calculated first. Then, using this digest information as the filename, the payload data is saved to the file system as a binary file. The header data is encrypted using AES symmetric encryption to obtain the encrypted data. Digests are calculated for both the segmented header data and the encrypted header data. The encrypted header data, along with the header digest information before and after encryption, along with the payload file storage information and the payload digest information, are saved to the segmentation storage record table. In particular, during the process of saving to the segmentation storage record table, the digest information of the original RPM package (usually used as a KEY) needs to be recorded; and the digest information needs to be anonymized (e.g., 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 utilizes the complete RPM digest information submitted by the RPM terminal processing module. Based on records in the RPM segmentation database, it obtains and decrypts the header data, then performs streaming concatenation with the payload data to reconstruct the original RPM packet file stream. Finally, it performs digest calculation on this file stream to ensure that the reconstructed RPM maintains the same integrity as the original RPM.
[0145] (M9) RPM Terminal Request Processing Module: This module retrieves RPM record information from the RPM software and repository information database based on the terminal request information (which may include software name, version, repository, etc.); and requests the RPM file integration module to restore the RPM file using the summary information of the RPM package in the record. After successful restoration, it performs data fragmentation or file stream proxying 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; and second, the process of downloading and restoring RPM software packages.
[0148] The flowchart for importing RPM packages into the system stored procedure is as follows: Figure 6 As shown, the steps are as follows:
[0149] (s100) is the file upload interface of the software source RPM import module. It receives RPM files and submission parameters, and caches the files in a private directory in the workspace. The private directory prevents external access.
[0150] (s101) The RPM parsing module parses the file to obtain the basic information of the RPM package; it calculates the digest information (denoted as rpm_checksum) of the RPM package and confirms that it is consistent with the digest information in the import configuration; it combines the repository information submitted by s100 and the matching repository information in the database to confirm whether the package meets the software repository requirements; if the parsing fails, or the digest verification fails, or it does not match the repository requirements (such as platform mismatch, version dependency not met, etc.), the process is terminated and an error message is given.
[0151] (s102) After the basic information of the RPM package passes the verification, add a software record to the software record table of the repository and set its status to "new" and record its entry ID.
[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 bytes, read all of them.
[0153] (s104) Write the remaining file content to a new temporary file and calculate the summary of the temporary file, denoted as pld_checksum.
[0154] (s105) According to the system configuration, move the temporary file generated in s104 to the file storage location using its digest value as the name; record the complete path of the file storage location, denoted as pld_fname.
[0155] (s106) Calculate the digest of the header data, denoted as org_hd_checksum; perform AES data encryption on the header data, denoted as sec_hd_data; calculate the digest of the encrypted header data, denoted as sec_hd_checksum.
[0156] (s107) The original RPM package summary information rpm_checksum in step 101 is desensitized by adding salt HASH and is denoted as sec_rpm_checksum.
[0157] (s108) The split 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 split storage record table and saved to the split storage record table of the corresponding warehouse.
[0158] (s109) Based on the ID when the software record entry was added in step s102, update the entry status to "active". A software entry with a status of "active" indicates that it is available for download.
[0159] (s110) After the file is stored, clear the original RPM package cache file in the workspace and reply to the import interface that it was successful.
[0160] On the other hand, the process of restoring during RPM download is as follows: Figure 7 The process is as follows:
[0161] (s200) identifies the requested software repository based on the user's request information (system model, system version, requested RPM software name, requested RPM software version, etc.) and queries the corresponding software record table for matching software record entries. If no software repository is matched, or no software record entry is matched, a failure is returned.
[0162] (s201) Based on the original RPM digest information in the software entry information retrieved in step s200, the sec_rpm_checksum of the software package is calculated using the salted hash algorithm consistent with step s107; and using this as the key, the RPM segmentation storage record table corresponding to the software repository is queried to obtain the RPM package segmentation record data. If no record is found, a failure is returned.
[0163] (s202) Based on the segmented storage record information queried in step s201, obtain the encrypted header information and verify the digest; obtain the payload file path, confirm the payload file status (if the file status is that the file exists, it can be accessed), verify the digest of the payload file, and ensure the file integrity.
[0164] (s203) For the obtained encrypted header information, apply the decryption algorithm and key that are used in step s106 to decrypt the encrypted header data, and perform digest 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, thus 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 matches the digest of the original RPM file recorded in the software log table to ensure file integrity. Optionally, if the file integrity verification fails, the RPM package can be retrieved again through the upstream service, and the corrupted resources can be updated.
[0167] (s206) Repeat step s204 to rebuild the RPM file stream. This is because step s205 already consumed the buffer byte stream. Integrate the RPM file stream with the download request (as the HTTP payload) to distribute the file content to the user.
[0168] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0169] Based on the same inventive concept, this application also provides a software package deployment apparatus for implementing the software package deployment method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more software package deployment apparatus embodiments provided below can be found in the limitations of the software package deployment method described above, and will not be repeated here.
[0170] In one exemplary embodiment, such as Figure 8 As shown, a software package deployment apparatus 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 about the software package and the repository information to which the software package belongs; the basic information includes at least a complete file digest; the complete file digest is the digest corresponding to the software package;
[0172] The package segmentation module 802 is used to segment the package when the basic information and repository information of the package meet the deployment conditions, and obtain the package header data, payload data and segmentation record data; the segmentation record data includes the header digest of the header data, and the payload digest and payload data storage location of the payload data;
[0173] The data encryption module 803 is used to encrypt the header data to obtain encrypted header data, and add the encrypted header data and the corresponding encrypted header data digest to the segmented record data.
[0174] The data storage module 804 is used to store basic information and warehouse information in the first database, store segmented record data in the second database, and store the payload 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 repository information to which the software package belongs through the file upload interface; parse the software package to obtain the 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 for: segmenting the software package according to its data structure or a preset segmentation byte size to obtain header data and payload data; determining the header data digest as the header digest; writing the payload data to a temporary file, determining the temporary file digest as the payload digest, and determining the temporary file's storage path as the payload data storage location; and performing desensitization processing on the complete file digest in the basic information to obtain a desensitized file digest, and adding it to the segmentation record data.
[0177] Based on the same inventive concept, this application also provides a software package deployment apparatus for implementing the software package restoration method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more software package restoration apparatus embodiments provided below can be found in the limitations of the software package restoration method described above, and will not be repeated here.
[0178] In one exemplary embodiment, such as Figure 9 As shown, a software package deployment apparatus 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, based on the request information of the software package to be downloaded sent by the user terminal and the repository information to which each software package belongs, determines the complete file digest corresponding to the software package to be downloaded in the first database, and obtains the segmented record data and payload data corresponding to the software package to be downloaded in the second database and the third database respectively based on the complete file digest; the complete file digest is stored in the basic information of the first database; the segmented record data includes the header encrypted data corresponding to the software package to be downloaded, the payload data storage location, the header encrypted data digest, the payload digest, and the header digest;
[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 has been decrypted and the header encrypted data digest, payload digest and header digest have been verified, so as 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] Further, the data acquisition module 901 is specifically used for: determining a software record table matching the request information in a first database based on the request information of the software package to be downloaded sent by the user terminal and the repository information to which each software package belongs; the request information includes at least the name of the software package to be downloaded; determining the basic information matching the request information in the software record table and obtaining the complete file digest in the basic information; performing desensitization processing on the complete file digest to obtain the desensitized file digest of the software package to be downloaded; determining the segmented record data with the desensitized file digest stored in advance in a second database as the segmented record data of the software package to be downloaded; and determining the payload data of the software package to be downloaded in a third database based on the payload data storage location in the segmented record data.
[0183] Furthermore, the device also includes a data verification module, specifically configured to: calculate a first digest corresponding to the header encrypted data of the software package to be downloaded; if the first digest is the same as the header encrypted data digest in the segmented record data, then the header encrypted data is determined to have passed verification; if the header encrypted data is determined to have passed verification, calculate a 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, then the payload data is determined to have passed verification; if the payload data has passed verification and the header encrypted data has been decrypted to obtain decrypted header data, calculate a third digest of the decrypted header data; if the third digest is the same as the header digest in the segmented record data, then the decrypted header data is determined to have passed verification.
[0184] Furthermore, the data merging module 903 is specifically used for: pre-filling the decrypted header data into a pre-constructed byte buffer stream; obtaining the file stream handle corresponding to the payload data, and inputting the payload data into the byte buffer stream based on the file stream handle; and obtaining the restored file corresponding to the software package to be downloaded through the byte buffer stream.
[0185] Each module in the aforementioned software package deployment device and software package restoration device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0186] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores basic information, repository information, header data, payload data, and segmentation record data for each software package. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a software package deployment method and a software package restoration method.
[0187] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0188] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0189] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0190] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0191] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media 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), magnetic 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0192] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A software package deployment method, characterized in that, The method includes: Obtain basic information about the software package and the repository information to which the software package belongs; the basic information includes at least a complete file digest; the complete file digest is the digest corresponding to the software package; If the basic information and repository information of the software package meet the deployment conditions, the software package is segmented to obtain the header data, payload data, and segmentation record data of the software package; the segmentation record data includes the header digest of the header data, the de-identified file digest corresponding to the full file digest, and the payload digest and payload data storage location of the payload data; wherein, the de-identified file digest is obtained by de-identifying the full file digest; The header data is encrypted to obtain encrypted header data. The encrypted header data and its corresponding encrypted header data digest are added to the segmented record data. The encrypted header data digest, the payload digest, and the header digest are used for verification so that, if the verification passes, the data obtained from the package segmentation can be restored to obtain a restored file. The de-identified file digest is used to verify the restored file so that, if the verification passes, the restored file can be determined to be used for download. 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 of the software package is stored in the third database.
2. The method according to claim 1, characterized in that, The acquisition of basic information about the software package and the repository information to which the software package belongs includes: The system receives the software package and the repository information to which the software package belongs via the file upload interface. The software package is parsed to obtain its basic information, which includes name, version, platform, header length, payload length, and signature information.
3. The method according to claim 1, characterized in that, The process of segmenting the software package to obtain its header data, payload data, and segmentation record data includes: Based on the data structure of the software package or the preset segmentation byte size of the software package, the software package is segmented to obtain the header data and payload data of the software package; The summary of the header data is determined to be the header summary; The load data is written to a temporary file, and the summary of the temporary file is determined to be the load summary, and the storage path of the temporary file is determined to be the load data storage location; The complete file summary in the basic information is anonymized to obtain an anonymized file summary, which is then added to the segmented record data.
4. A software package restoration method, characterized in that, The method includes: Based on the request information for the software package to be downloaded sent by the user terminal, and the repository information to which each software package belongs, the complete file digest corresponding to the software package to be downloaded is determined in the first database. Based on the complete file digest, the segmentation record data and payload data corresponding to the software package to be downloaded are obtained in the second and third databases respectively. The complete file digest is stored in the basic information of the first database. The segmentation record data includes the header encrypted data, payload data storage location, header encrypted data digest, payload digest, de-identified file digest, and header digest corresponding to the complete file digest. The de-identified file digest is obtained by de-identifying the complete file digest. The header encryption data corresponding to the software package to be downloaded is determined 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. Calculate a first digest corresponding to the encrypted header data of the software package to be downloaded. If the first digest is the same as the encrypted header data digest in the segmented record data, then the encrypted header data is determined to have passed verification. If the encrypted header data is determined to have passed verification, calculate a 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, then the payload data is determined to have passed verification. If the payload data has passed verification and the encrypted header data has been decrypted to obtain decrypted header data, calculate a third digest of the decrypted header data. If the third digest is the same as the header digest in the segmented record data, then the decrypted header data is determined to have passed verification. After the header encrypted data is decrypted and the header encrypted data digest, payload digest, and header digest pass verification, the decrypted header data is merged with the payload data to obtain the restore file corresponding to the software package to be downloaded. The file digest of the restore file is calculated. If the file digest is the same as the complete file digest corresponding to the software package to be downloaded, the restore file is determined to have passed verification, so that the user terminal can download and deploy the restore file.
5. The method according to claim 4, characterized in that, Based on the request information for the software package to be downloaded sent by the user terminal and the repository information to which each software package belongs, the complete file digest corresponding to the software package to be downloaded is determined in the first database. Based on the complete file digest, the segmented record data and payload data corresponding to the software package to be downloaded are obtained in the second and third databases respectively, including: Based on the request information for the software packages to be downloaded sent by the user terminal, and the repository information to which each software package belongs, a software record table matching the request information is determined in the first database; the request information includes at least 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 from the basic information; The complete file digest is anonymized to obtain the anonymized file digest of the software package to be downloaded; In the second database, segmentation record data containing the pre-stored de-identified file digest is identified as the segmentation record data of the software package to be downloaded; Based on the location of the load data storage in the segmented record data, the load data of the software package to be downloaded is determined in the third database.
6. The method according to claim 4, characterized in that, The step of merging the decrypted header data with the payload data to obtain the restored file corresponding to the software package to be downloaded includes: The decrypted header data is pre-filled into a pre-built byte buffer stream; Obtain the file stream handle corresponding to the payload data, and input the payload data into the byte buffer stream based on the file stream handle; The restore file corresponding to the software package to be downloaded is obtained through the byte buffer stream.
7. A software package deployment apparatus, characterized in that, The device includes: An information acquisition module is used to acquire basic information about the software package and the repository information to which the software package belongs; the basic information includes at least a complete file digest; the complete file digest is the digest corresponding to the software package; The software package segmentation module is used to segment the software package when the basic information and repository information of the software package meet the deployment conditions, and obtain the header data, payload data and segmentation record data of the software package; the segmentation record data includes the header digest of the header data, the de-identified file digest corresponding to the full file digest, and the payload digest and payload data storage location of the payload data; wherein, the de-identified file digest is obtained by de-identifying the full file digest; A data encryption module is used to encrypt the header data to obtain encrypted header data, and to add the encrypted header data and its corresponding encrypted header data digest to the segmented record data. The encrypted header data digest, the payload digest, and the header digest are used for verification, so that if the verification passes, the data obtained from the package segmentation can be restored to obtain a restored file. The de-identified file digest is used to verify the restored file, so that if the verification passes, the restored file can be determined to be used for download. The data storage module is used to store the basic information and warehouse information in a first database, store the segmented record data in a second database, and store the payload data of the software package in a third database.
8. A software package restoration device, characterized in that, The device includes: The data acquisition module, based on the request information of the software package to be downloaded sent by the user terminal and the repository information to which each software package belongs, determines the complete file digest corresponding to the software package to be downloaded in the first database, and obtains the segmented record data and payload data corresponding to the software package to be downloaded in the second and third databases respectively based on the complete file digest; the complete file digest is stored in the basic information of the first database; the segmented record data includes the header encrypted data, payload data storage location, header encrypted data digest, payload digest, de-identified file digest and header digest corresponding to the complete file digest; wherein, the de-identified file digest is obtained by de-identifying the complete file digest; An encrypted data determination module 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 segmenting and encrypting the software package to be downloaded; the payload data is determined after segmenting the software package to be downloaded; A data merging module is used to calculate a first digest corresponding to the header encrypted data of the software package to be downloaded. If the first digest is the same as the header encrypted data digest in the segmented record data, the header encrypted data is determined to have passed verification. If the header encrypted data has passed verification, a second digest corresponding to the payload digest of the software package to be downloaded is calculated. If the second digest is the same as the payload digest in the segmented record data, the payload data is determined to have passed verification. If the payload data has passed verification and the header encrypted data has been decrypted to obtain decrypted header data, a third digest of the decrypted header data is calculated. If the third digest is the same as the header digest in the segmented record data, the decrypted header data is determined to have passed verification. If the header encrypted data has been decrypted and the header encrypted data digest, payload digest, and header digest have all passed verification, the decrypted header data is merged with the payload data to obtain a restored file corresponding to the software package to be downloaded. The file digest of the restored file is calculated. If the file digest is the same as the complete file digest corresponding to the software package to be downloaded, the restored file is determined to have passed verification, allowing the user terminal to download and deploy the restored file.
9. 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, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
File encryption method, file decrypton method, electronic device, and storage medium
US20180365434A1