Two-dimensional code generation, two-dimensional code application method and system
Patent Information
- Application Number
- CN202611015295.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-09-25
AI Technical Summary
[0004]本发明提供一种二维码生成、二维码应用方法及系统,以解决当下须依赖数据线与调试权限、无法面向线上真实安装包提取问题现场、难以完整同步本地沙盒中间态数据以及导入过程缺乏安全控制的技术问题
[0009]上述二维码生成、二维码应用方法及系统的方案中,可以实现将沙盒数据导出、局域网传输、目标设备端恢复以及安全校验能力内嵌于应用自身的受控流程之中,使得源设备上的应用在满足授权条件时能够主动打包本地沙盒数据,并通过临时传输服务生成二维码,向目标设备提供同步途径;目标设备上第二应用的调试包或者问题排查包可以在业务正式启动前进入导入模式,通过扫描二维码获取源设备端的连接信息,完成数据包的数据下载、校验、清理、覆盖与恢复,以实现问题现场向可调试环境的快速迁移。因此,通过上述方案可以将原本存在于测试包、灰度包或者正式发布包中的真实问题现场,以较低操作门槛迁移到可调试环境之中,显著提升复杂线上问题的复现效率,而且目标设备上恢复后的运行环境更接近故障发生时的真实状态,有助于减少“业务账号一致但问题无法复现”的情况,提高问题定位的准确性与稳定性。同时,本方案进行兼容性检查,完整性校验及同步清单约束,使得整个导入过程具备较强的安全性与一致性,降低了直接覆盖应用沙盒所带来的数据损坏、版本冲突、状态污染及敏感信息失控风险。例如在金融领域、医疗领域、教育领域的APP出现问题,需要进行问题锁定与程序调试时,均可应用本申请方案,应用范围广泛。
Smart Images

Figure CN122819281A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and system for generating and applying QR codes. Background Technology
[0002] Currently, QR code generation and application are widespread, but technical solutions for mobile application data migration, online problem reproduction, and test environment restoration are not covered. Industry-standard technical solutions for mobile application data migration, online problem reproduction, and test environment restoration typically employ the following methods: Firstly, the application sandbox can be read through relevant simulator device management tools, and the application container data can be directly exported using development and debugging tools. For example, in iOS and Android scenarios, the application directory can be exported through adb, manufacturer debugging bridging tools, or root access. Secondly, business data is synchronized based on the server-side account system, which involves uploading some business data to the cloud and then restoring the data by logging into the same account on another terminal device; Third, use whole-machine backup, system-level migration, or enterprise equipment management methods to migrate the application data from the source device to the target device.
[0003] The existing solutions mentioned above are usable to a certain extent in routine R&D, testing, or equipment replacement scenarios, but they still have significant limitations when dealing with online problem localization, gray-scale environment reproduction, and specific user state migration. Moreover, in actual applications, the process is complex, requires the use of specialized tools, and has a heavy data migration load, generally involving the migration of all data, resulting in poor flexibility and low migration efficiency. Summary of the Invention
[0004] This invention provides a QR code generation, QR code application method and system to solve the current technical problems of relying on data cables and debugging permissions, being unable to extract problem scenarios from real online installation packages, having difficulty fully synchronizing local sandbox intermediate data, and lacking security control during the import process.
[0005] Firstly, a QR code generation method is provided, applied to a source device, the method comprising: In response to the synchronization trigger command, it enters the synchronization preparation state and scans the sandbox of the first local application; The synchronization list is determined based on the scan data. The synchronization list includes mandatory synchronization data, optional synchronization data, prohibited synchronization data, and data that needs to be anonymized. Based on the synchronization list, the data allowed to migrate in the sandbox is packaged into data packets, and metadata description information corresponding to the data packets is generated; A temporary file transfer service is invoked for the data packet and metadata description information to generate a QR code containing connection information. The QR code is used to enable the target device to download the data packet by scanning it and write it into a second application that matches the first application.
[0006] Secondly, a method for applying a QR code to a target device is provided, the method comprising: The QR code is parsed to obtain connection information and metadata description information. The connection information is the download link information of the data packet. The data packet contains sandbox data of the first application in the source device. The QR code is generated based on the QR code generation method described above. A compatibility check is performed based on the connection information, and an integrity check is performed based on the metadata description information, which corresponds to the data packet. When the compatibility check results indicate compatibility and the integrity check results indicate completeness, the sandbox of the local second application is backed up and cleaned up, and the first application matches the second application. The data packets downloaded based on the connection information are written into the cleaned sandbox of the second application.
[0007] Thirdly, a QR code generation system is provided for use in a source device, the system comprising: The scanning module is used to respond to the synchronization trigger command, enter the synchronization preparation state, and scan the sandbox of the first local application. The determination module is used to determine the synchronization list based on the scanned data. The synchronization list includes mandatory synchronization data, optional synchronization data, prohibited synchronization data, and data that needs to be anonymized regarding the sandbox. The packaging module is used to package the data allowed to migrate in the sandbox into data packets based on the synchronization list, and generate metadata description information corresponding to the data packets; The generation module is used to call a temporary file transfer service for the data packet and metadata description information to generate a QR code containing connection information. The QR code is used to enable the target device to download the data packet by scanning it and write it into a second application that matches the first application.
[0008] Fourthly, a QR code application system is provided for use on a target device, the system comprising: The parsing module is used to parse the QR code to obtain connection information and metadata description information. The connection information is the download link information of the data packet. The data packet contains sandbox data of the first application in the source device. The QR code is generated based on the QR code generation method described above. The inspection and verification module is used to perform compatibility checks based on the connection information and integrity checks based on the metadata description information, wherein the metadata description information corresponds to the data packet. The backup and cleanup module is used to back up and clean up the sandbox of the local second application when the compatibility check result indicates compatibility and the integrity check result indicates completeness. The first application and the second application are matched. The writing module is used to write the data packets downloaded based on the connection information into the cleaned sandbox of the second application.
[0009] The aforementioned QR code generation, application, and system solutions embed sandbox data export, LAN transmission, target device recovery, and security verification capabilities into the application's controlled processes. This allows the application on the source device to proactively package local sandbox data when authorization conditions are met and generate a QR code via a temporary transmission service, providing a synchronization path to the target device. The debug package or troubleshooting package of the second application on the target device can enter import mode before the business officially starts. By scanning the QR code, it obtains the connection information from the source device, completing data download, verification, cleanup, overwriting, and recovery of the data packet, thus enabling rapid migration of the problem scenario to a debuggable environment. Therefore, this solution allows for the migration of real problem scenarios, originally existing in test packages, gray-scale packages, or official release packages, to a debuggable environment with a low operational threshold, significantly improving the reproduction efficiency of complex online problems. Moreover, the restored operating environment on the target device more closely resembles the actual state at the time of the fault, helping to reduce situations where "business accounts are consistent but the problem cannot be reproduced," and improving the accuracy and stability of problem localization. Meanwhile, this solution performs compatibility checks, integrity verification, and synchronized manifest constraints, ensuring strong security and consistency throughout the import process. This reduces the risks of data corruption, version conflicts, state contamination, and loss of control of sensitive information that can result from directly overwriting the application sandbox. For example, this solution can be applied to address issues in apps in the financial, medical, and educational sectors, requiring problem identification and program debugging; its application scope is wide. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a flowchart illustrating a QR code generation method in one embodiment of the present invention; Figure 2This is a schematic diagram of an application process of a QR code generation method in one embodiment of the present invention; Figure 3 This is a schematic diagram of another application process of the QR code application method in one embodiment of the present invention; Figure 4 This is a flowchart illustrating a QR code application method in another embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a QR code generation system in one embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a QR code application system in another embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 8 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0012] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings, but these are not intended to limit the scope of the invention.
[0013] It should be understood that various modifications can be made to the embodiments disclosed herein. Therefore, the following description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope of this disclosure will be apparent to those skilled in the art.
[0014] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present disclosure and, together with the general description of the disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the disclosure.
[0015] These and other features of the invention will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0016] It should also be understood that although the invention has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of the invention.
[0017] The above and other aspects, features and advantages of this disclosure will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0018] Specific embodiments of the present disclosure are described thereafter with reference to the accompanying drawings; however, it should be understood that the disclosed embodiments are merely examples of the present disclosure and can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the present disclosure. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but are merely representative of the present disclosure and are intended to teach those skilled in the art to use the present disclosure in a variety of substantially any suitable detailed structures.
[0019] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in still another embodiment,” all of which may refer to one or more of the same or different embodiments according to this disclosure.
[0020] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0021] like Figure 1 As shown, this embodiment of the invention provides a QR code generation method, including: S1: In response to the synchronization trigger command, enter the synchronization preparation state and scan the sandbox of the first local application; S2: Determine the synchronization list based on the scan data. The synchronization list includes mandatory synchronization data, optional synchronization data, prohibited synchronization data, and data that needs to be anonymized for the sandbox. S3: Based on the synchronization list, package the data allowed to migrate in the sandbox into data packets, and generate metadata description information corresponding to the data packets; S4: Invoke the temporary file transfer service for the data packet and metadata description information to generate a QR code containing connection information. The QR code is used to enable the target device to download the data packet by scanning it and write it into a second application that matches the first application.
[0022] The solution described in this embodiment has a wide range of applications, including but not limited to apps in the financial, medical, and educational fields, to assist in sandbox data migration and app troubleshooting and debugging. For example, this solution can be applied to online transaction failure reproduction, audit evidence collection, emergency response to security incidents, and multi-environment test data migration in the financial field. Similarly, it can be applied to online consultation failure reproduction, medical audit tracing, and locating data synchronization issues with medical devices in the medical field.
[0023] In this embodiment, the source device represents the side where the APP encounters a problem, while the target device is equivalent to the device used by staff to troubleshoot and debug the program. Of course, the source and target devices can be any devices that require sandbox data migration; the specific choice is not unique. For example, when running this embodiment, the source device can set up a data synchronization entry point before the main application business process starts. When the first application receives a synchronization trigger command, it first pauses normal business initialization, switches to a synchronization preparation state, and scans the sandbox of the first application to obtain the scanned sandbox data. Then, the scanned sandbox data is analyzed to determine which data can be migrated / synchronized, which cannot be migrated / synchronized, and which data is sensitive and requires de-identification processing, thereby generating a synchronization list of the sandbox data. After generating the synchronization list, the source device can package the data that is allowed to be migrated into a specified directory according to the list and generate metadata description information corresponding to the data package. The metadata description information mainly includes relevant characteristics of the data package, such as formal characteristics and data characteristics. Subsequently, the source device initiates a temporary file transfer service, using a QR code to carry data packets and connection information. This service provides the target device with data download capabilities in a local area network environment, allowing the target device to obtain connection information simply by scanning the QR code, without needing to manually enter the address or select the file.
[0024] In one embodiment, scanning the sandbox of the local first application includes: S101: Perform a directory-level scan on the sandbox of the local first application. The directory-level scan includes at least one of the following: database directory scan, configuration directory scan, cache directory scan, file storage directory scan, log directory scan, and intermediate directory scan related to business operation.
[0025] Specifically, the scan involves scanning one or more of the following directories within the sandbox: database directory, configuration directory, cache directory, file storage directory, log directory, and intermediate directories related to business operations. This scan traverses the directory structure of the first application's sandbox, identifies all files and subdirectories, and obtains metadata information for each object, such as path, size, type, modification time, and permission attributes. In this embodiment, the aforementioned directories are filtered directories containing valid data. When performing directory-level scanning, a scan scope boundary can be established, and then scanning can be performed sequentially based on this boundary.
[0026] Furthermore, such as Figure 2 As shown, determining the synchronization list based on scan data includes: S201: The scanned data is classified by recursive traversal, index scanning or event-driven discovery algorithm. The classification results include data that must be synchronized, optional data that can be synchronized, data that is prohibited from being synchronized and data that needs to be de-identified. S202: Generate the synchronization list based on the classification results.
[0027] In this embodiment, the source device analyzes and processes the scanned data using recursive traversal, index scanning, or event-driven discovery algorithms. Based on the analysis results, the data is categorized to identify mandatory synchronization data, optional synchronization data, prohibited synchronization data, and data requiring anonymization. For example, mandatory synchronization includes database files, crash logs, and configuration files; optional synchronization includes image caches; prohibited synchronization includes fingerprints and keys; and anonymization is required for configuration files containing phone numbers and ID numbers. Once these data categories are identified, the source device can generate a synchronization list. This synchronization list ensures that data highly relevant to problem reproduction is fully preserved while excluding content strongly bound to hardware or unsuitable for migration, such as device fingerprints, system key references, and encrypted indexes bound to the local security environment, preventing sensitive data leakage.
[0028] Furthermore, generating the synchronization list based on the classification results includes: S203: Determine the data attributes of each type of data in the classification results, wherein the data attributes include the functional module to which the data belongs and the data dependencies; S204: Using a rule engine, determine a synchronization strategy for each type of data based on the data attributes. The synchronization strategy includes direct data inclusion, compressed inclusion, block inclusion, de-identified inclusion, reference replacement, placeholder retention, and exclusion from synchronization. S205: Generate the synchronization list by combining the classification results and the synchronization strategy.
[0029] For example, the relative path, object type, size, modification time, module, dependency, and summary of each type of data in the classification results are determined. Then, a rule engine is used to match synchronization strategies based on the determined data characteristics, that is, to determine the operations that need to be applied to the data, including direct inclusion, compressed inclusion, chunked inclusion, anonymized inclusion, reference replacement, placeholder retention, or exclusion from synchronization. Afterwards, the source device combines the data classification results, data attribute characteristics, and synchronization strategies to generate a synchronization list that may include, but is not limited to, object identifiers, verification summaries, and overwrite permissions determined based on the classification results and attribute characteristics, as well as target mapping paths and recovery order determined based on the synchronization strategy.
[0030] In one embodiment, generating metadata description information corresponding to the data packet includes: S301: Generate the application version number, data structure version number, user identifier digest, packaging time, file hash digest, synchronization batch number, one-time access token, and optional encryption parameters corresponding to the data packet.
[0031] The metadata description information is not limited to the information listed above, and may also include other information, such as encryption parameters. When data is transmitted in encrypted form, encryption parameters may be included for decryption.
[0032] In one embodiment, after data packaging and metadata description information generation are completed, the source device invokes a temporary file transfer service to obtain the IP address, port number, generate a one-time token, and a synchronization batch number. Then, it combines this information to generate connection information, and finally, a QR code is generated based on this connection information. Specifically, in this embodiment, the connection information includes synchronization session information, as well as the source device's transmission address, access port, synchronization batch number, token information, verification digest, application major version number, and data structure version number. Through this configuration, the target device can scan the QR code to obtain the required information, complete the full download of the data packet, and realize the data migration of the sandbox data of the first application.
[0033] like Figure 3 As shown, another embodiment of the present invention also provides a QR code application method, applied to a target device, the method comprising: S1: Parse the QR code to obtain connection information and metadata description information. The connection information is the download link information of the data packet. The data packet contains sandbox data of the first application in the source device. The QR code is generated based on the QR code generation method described in any of the above embodiments. S2: Perform a compatibility check based on the connection information and an integrity check based on the metadata description information, wherein the metadata description information corresponds to the data packet; S3: When the compatibility check result indicates compatibility and the integrity check result indicates completeness, back up and clean up the sandbox of the local second application, and the first application matches the second application; S4: Write the data packet downloaded based on the connection information into the cleaned sandbox of the second application.
[0034] For example, on the target device side, this embodiment also places the data import action before the application service startup process. When the debug package, test package, or dedicated troubleshooting package on the target device enters import mode, it first scans the QR code generated by the source device to parse the connection information of the source device, and then initiates a compatibility check based on the connection information. Only when the compatibility check passes will the target device allow data download. This design directly addresses the problem in the prior art where "direct overwriting easily leads to version conflicts and import failures." During the download phase, the target device obtains the source package file, i.e., the data packet and the corresponding metadata description information, by scanning the QR code. After the download is completed, the target device performs integrity verification of the data packet based on the metadata description information to prevent data corruption, data tampering, or unauthorized access during transmission. After the verification passes, the target device does not immediately overwrite the existing sandbox, but first performs a data backup of the second application's sandbox, then cleans up the sandbox data, and then overwrites the sandbox data of the first application into the sandbox of the second application.
[0035] When running sandbox data of the first application based on the second application, the system may perform the following operations to achieve data repair: For database files, consistency checks and version repairs can be performed after closing the relevant access handles; for local parameters that are not allowed to be overwritten, the current values of the sandbox in the second application can be retained; for cache files, configuration files, and log files, they can be written to the target path according to the migration rules in the manifest; for each of the above files, secondary repairs can be performed again during the recovery phase.
[0036] During application deployment, an atomic switchover mechanism can be used to complete the recovery process. This means that the application's business entry point is only switched to the new, recovered sandbox environment after all files for the first application have been written to disk, the core index has been successfully rebuilt, and critical consistency checks have passed. If any stage of the check or check fails, the original sandbox on the target device remains unchanged, or the application is rolled back to the backup state, thus avoiding the application being in a mixed state of partially new and partially old data. This solution directly improves upon the problem of insufficient consistency control during the import process, which can easily lead to application crashes or state pollution.
[0037] As mentioned above, the connection information includes synchronization session information, as well as the source device's transmission address, access port, synchronization batch number, token information, verification digest, application major version number, and data structure version number; When the system performs a compatibility check based on the connection information, it includes: S201: Based on the connection information, determine whether the application main version meets the migration conditions, whether the database structure version is compatible, whether the synchronization batch is within the validity period, and whether the access token is valid. S202: Determine whether to allow overwriting based on the current login status of the second application; S203: Determine whether to support sandbox data synchronization of the first application based on the current remaining storage space of the target device.
[0038] For example, the target device initiates a compatibility check based on the obtained connection information. It determines whether the second application supports running that version of data based on the application's main version number in the connection information, thus determining if the migration conditions are met. Next, it determines whether the second application is compatible based on the database structure version number in the connection information, and whether the synchronization batch number and token information in the connection information are valid. It also needs to determine whether the second application's current login status allows for data overwriting during this synchronization, and whether the target device's current remaining storage space supports this data synchronization. Only when all conditions are met is the compatibility check result determined to be compatible, and data synchronization can continue.
[0039] Furthermore, such as Figure 4 As shown, after completing the above compatibility check, the target device continues to perform integrity verification based on the metadata description information, including: S204: When the compatibility check result indicates compatibility, the integrity of the data packet is verified based on the metadata information. The integrity verification includes at least one of the following: file hash verification, synchronization batch verification, token validity verification, and optional data packet signature verification. S205: Upon successful verification, the data packet is decompressed to the temporary recovery area; The target device backs up and cleans up the sandbox of the local second application, including: S301: If the target device passes the verification, it will back up the data of the sandbox of the local second application. S302: The target device cleans up the sandbox of the second application according to a preset directory mapping relationship, wherein the directory mapping relationship includes the overlay position of each data in the data packet in the sandbox of the second application.
[0040] In this embodiment, integrity verification simultaneously performs file hash verification, synchronization batch verification, token validity verification, and optional data packet signature verification. Failure of any one verification indicates integrity verification failure. Integrity verification is considered successful only if all verifications pass. In practice, encryption algorithms can also be combined for digital signature, HMAC, and Merkle tree verification.
[0041] When both checks and verifications pass, the target device writes the downloaded data packet into the cleaned sandbox of the second application, including: S401: According to the target mapping relationship, retrieve the data in the temporary recovery area and write it into the cleaned sandbox of the second application.
[0042] For example, the target mapping relationship describes the correspondence between files / directories in the source device sandbox and target locations in the target device sandbox. It may also include additional operations that need to be performed during this process, such as exclusion, de-identification, and merging. During data overwriting, the target device retrieves sandbox data from the temporary recovery area and, following the guidance of the target mapping relationship, writes this sandbox data to the corresponding location in the second application's sandbox. This configuration ensures that the data is written to the correct location, that the second application can read all the sandbox data from the first application, and avoids writing unnecessary data, thus preventing wasted storage space.
[0043] The method further includes: S5: If the integrity check fails, keep the sandbox data of the second application unchanged.
[0044] In other words, as mentioned above, if any of the above verifications fail, the target device will not overwrite the sandbox data of the first application, and will keep the sandbox data of the second application unchanged.
[0045] Based on the solutions disclosed in the above embodiments, it can be seen that the solution in this embodiment can restore the fault scene to the greatest extent by synchronizing local databases, caches, intermediate files and logs, thus solving the problem of "incomplete cloud synchronization"; This embodiment limits the synchronization scope to within a single application sandbox, enabling rapid migration without requiring system-level backup permissions, thus solving the problem of "excessive burden in the whole machine migration process"; This embodiment bypasses the limitations of traditional debugging tools by applying an internal controlled export mechanism, thus solving the problem of "the official package cannot be exported"; This solution introduces token, batch, hash, and version verification mechanisms, and reduces the risk of failure through atomic recovery, thus solving the problem of "insecure import process".
[0046] In one application embodiment, the interaction process between the source device and the target device regarding the QR code includes: When a problem occurs in the first application on the source device, the QR code generation scheme of this embodiment is implemented. The source device can set up a data synchronization entry point before the main application business process starts. When the first application receives a synchronization trigger command, it first pauses normal business initialization, switches to synchronization preparation state, and scans the sandbox of the first application to obtain the scanned sandbox data. Then, the scanned sandbox data is analyzed to determine which data can be migrated / synchronized, which cannot be migrated / synchronized, and which data is sensitive and needs to be de-identified, and a synchronization list of sandbox data is generated accordingly. After generating the synchronization list, the source device can package the data that can be migrated to a specified directory according to the list and generate metadata description information corresponding to the data package. Subsequently, the source device starts a temporary file transfer service, uses a QR code to carry the data package and connection information, and displays it to the target device of the application. When the debug package, test package, or special problem-solving package on the target device enters the import mode, the source device connection information is first parsed by scanning the QR code, and then a compatibility check is initiated based on the connection information. Only when the compatibility check passes is the target device allowed to initiate data download. This design directly addresses the problem in existing technologies where "direct overwriting easily leads to version conflicts and import failures." During the download phase, the target device obtains the source package file (data packet) and corresponding metadata description information by scanning a QR code. After downloading, the target device performs integrity verification on the data packet based on the metadata description information to prevent data corruption, data tampering, or unauthorized access during transmission. Upon successful verification, the target device does not immediately overwrite the existing sandbox. Instead, it first performs a data backup of the second application's sandbox, then cleans up the sandbox data, and finally overwrites the first application's sandbox data into the second application's sandbox.
[0047] The QR code generation and application methods described in this embodiment can embed sandbox data export, local area network transmission, target device recovery, and security verification capabilities into the application's controlled process. This allows the application on the source device to proactively package local sandbox data when authorized conditions are met, and generate a QR code through a temporary transmission service to provide a synchronization path to the target device. The debug package or troubleshooting package of the second application on the target device can enter import mode before the business officially starts. By scanning the QR code, the connection information of the source device is obtained, and the data packet is downloaded, verified, cleaned, overwritten, and restored, so as to achieve rapid migration of the problem scene to the debuggable environment. Therefore, the above solution can migrate the real problem scene originally existing in the test package, gray package, or official release package to the debuggable environment with a low operational threshold, significantly improving the reproduction efficiency of complex online problems. Moreover, the restored operating environment on the target device is closer to the real state when the fault occurred, which helps to reduce the situation of "business accounts are the same but the problem cannot be reproduced", and improves the accuracy and stability of problem location. Meanwhile, this solution performs compatibility checks, integrity verification, and synchronized list constraints, ensuring strong security and consistency throughout the import process and reducing the risks of data corruption, version conflicts, state contamination, and loss of control of sensitive information caused by directly overwriting the application sandbox.
[0048] like Figure 5 As shown, another embodiment of the present invention also provides a QR code generation system applied in a source device, the system comprising: The scanning module is used to respond to the synchronization trigger command, enter the synchronization preparation state, and scan the sandbox of the first local application. The determination module is used to determine the synchronization list based on the scanned data. The synchronization list includes mandatory synchronization data, optional synchronization data, prohibited synchronization data, and data that needs to be anonymized regarding the sandbox. The packaging module is used to package the data allowed to migrate in the sandbox into data packets based on the synchronization list, and generate metadata description information corresponding to the data packets; The generation module is used to call a temporary file transfer service for the data packet and metadata description information to generate a QR code containing connection information. The QR code is used to enable the target device to download the data packet by scanning it and write it into a second application that matches the first application.
[0049] In one embodiment, scanning the sandbox of the local first application includes: Perform a directory-level scan on the sandbox of the local first application. The directory-level scan includes at least one of the following: database directory scan, configuration directory scan, cache directory scan, file storage directory scan, log directory scan, and intermediate directory scan related to business operation.
[0050] In one embodiment, determining the synchronization list based on scan data includes: The scanned data is classified using recursive traversal, index scanning, or event-driven discovery algorithms. The classification results include data that must be synchronized, optional data that can be synchronized, data that is prohibited from being synchronized, and data that needs to be de-identified. The synchronization list is generated based on the classification results.
[0051] In one embodiment, generating the synchronization list based on the classification results includes: Determine the data attributes of each type of data in the classification results, including the functional module to which the data belongs and the data dependencies; Using a rule engine, a synchronization strategy is determined for each type of data based on the data attributes. The synchronization strategy includes direct data inclusion, compressed inclusion, block inclusion, de-identified inclusion, reference replacement, placeholder retention, and exclusion from synchronization. The synchronization list is generated by combining the classification results and the synchronization strategy.
[0052] like Figure 6 As shown, another embodiment of the present invention also provides a QR code application system applied to a target device, the system comprising: The parsing module is used to parse the QR code to obtain connection information and metadata description information. The connection information is the download link information of the data packet. The data packet contains sandbox data of the first application in the source device. The QR code is generated based on the QR code generation method described above. The inspection and verification module is used to perform compatibility checks based on the connection information and integrity checks based on the metadata description information, wherein the metadata description information corresponds to the data packet. The backup and cleanup module is used to back up and clean up the sandbox of the local second application when the compatibility check result indicates compatibility and the integrity check result indicates completeness. The first application and the second application are matched. The writing module is used to write the data packets downloaded based on the connection information into the cleaned sandbox of the second application.
[0053] In one embodiment, the connection information includes synchronization session information, as well as the source device's transport address, access port, synchronization batch number, token information, verification digest, application major version number, and data structure version number; The compatibility check based on the connection information includes: Based on the connection information, determine whether the application main version meets the migration conditions, whether the database structure version is compatible, whether the synchronization batch is within the validity period, and whether the access token is valid. Determine whether to allow overwriting based on the current login status of the second application; Whether sandbox data synchronization for the first application is supported is determined based on the current remaining storage space of the target device.
[0054] In one embodiment, the integrity verification based on the metadata description information includes: When the compatibility check result indicates compatibility, the integrity of the data packet is verified based on the metadata information. The integrity verification includes at least one of the following: file hash verification, synchronization batch verification, token validity verification, and optional data packet signature verification. Upon successful verification, the data packet is decompressed to the temporary recovery area; Back up and clean up the sandbox of the local second application, including: If the verification passes, back up the data of the local second application's sandbox; The sandbox of the second application is cleaned up according to a preset directory mapping relationship, wherein the directory mapping relationship includes the overlay position of each data in the data packet in the sandbox of the second application.
[0055] In one embodiment, writing the downloaded data packet into the cleaned sandbox of the second application includes: The target device retrieves the data from the temporary recovery area according to the target mapping relationship and writes it into the cleaned sandbox of the second application. Also includes: A retention module is used to keep the sandbox data of the second application unchanged when the integrity check fails.
[0056] In one embodiment, a computer device is provided, which may be a server, such as forming a target device, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements a server-side function or step based on an in-application sandbox data synchronization method.
[0057] In one embodiment, a computer device is provided, which may be a client, such as forming a source device, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. 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 and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the client-side functions or steps of an in-application sandbox data synchronization method.
[0058] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program implementing the steps of a QR code generation method when executed by a processor.
[0059] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of a QR code application method. It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0060] Those skilled in the art will understand that all or part of the processes in the methods of 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 of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0061] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0062] It should be noted that any software tools or components appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application is authorized (with the knowledge and consent) by the relevant parties or fully authorized by all parties, and the executing entity can obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0063] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for generating a QR code, characterized in that, Applied to a source device, the method includes: In response to the synchronization trigger command, it enters the synchronization preparation state and scans the sandbox of the first local application; The synchronization list is determined based on the scan data. The synchronization list includes mandatory synchronization data, optional synchronization data, prohibited synchronization data, and data that needs to be de-identified. Based on the synchronization list, the data allowed to migrate in the sandbox is packaged into data packets, and metadata description information corresponding to the data packets is generated; A temporary file transfer service is invoked for the data packet and metadata description information to generate a QR code containing connection information. The QR code is used to enable the target device to download the data packet by scanning it and write it into a second application that matches the first application.
2. The QR code generation method according to claim 1, characterized in that, The scanning of the sandbox of the local first application includes: Perform a directory-level scan on the sandbox of the local first application. The directory-level scan includes at least one of the following: database directory scan, configuration directory scan, cache directory scan, file storage directory scan, log directory scan, and intermediate directory scan related to business operation.
3. The QR code generation method according to claim 1, characterized in that, The process of determining the synchronization list based on scan data includes: The scanned data is classified using recursive traversal, index scanning, or event-driven discovery algorithms. The classification results include data that must be synchronized, optional data that can be synchronized, data that is prohibited from being synchronized, and data that needs to be de-identified. The synchronization list is generated based on the classification results.
4. The QR code generation method according to claim 3, characterized in that, The process of generating the synchronization list based on the classification results includes: Determine the data attributes of each type of data in the classification results, including the functional module to which the data belongs and the data dependencies; Using a rule engine, a synchronization strategy is determined for each type of data based on the data attributes. The synchronization strategy includes direct data inclusion, compressed inclusion, block inclusion, de-identified inclusion, reference replacement, placeholder retention, and exclusion from synchronization. The synchronization list is generated by combining the classification results and the synchronization strategy.
5. A method for applying QR codes, characterized in that, Applied to a target device, the method includes: Parse the QR code to obtain connection information and metadata description information. The connection information is the download link information of the data packet. The data packet contains sandbox data of the first application in the source device. The QR code is generated based on the QR code generation method of any one of claims 1-4. A compatibility check is performed based on the connection information, and an integrity check is performed based on the metadata description information, which corresponds to the data packet. When the compatibility check results indicate compatibility and the integrity check results indicate completeness, the sandbox of the local second application is backed up and cleaned up, and the first application matches the second application. The data packets downloaded based on the connection information are written into the cleaned sandbox of the second application.
6. The QR code application method according to claim 5, characterized in that, The connection information includes synchronization session information, as well as the source device's transmission address, access port, synchronization batch number, token information, verification digest, application major version number, and data structure version number; The compatibility check based on the connection information includes: Based on the connection information, determine whether the application main version meets the migration conditions, whether the database structure version is compatible, whether the synchronization batch is within the validity period, and whether the access token is valid. Determine whether to allow overwriting based on the current login status of the second application; Whether sandbox data synchronization for the first application is supported is determined based on the current remaining storage space of the target device.
7. The QR code application method according to claim 5, characterized in that, The integrity verification based on the metadata description information includes: When the compatibility check result indicates compatibility, the integrity of the data packet is verified based on the metadata information. The integrity verification includes at least one of the following: file hash verification, synchronization batch verification, token validity verification, and optional data packet signature verification. Upon successful verification, the data packet is decompressed to the temporary recovery area; The backup and cleanup of the sandbox for the local second application includes: If the verification passes, back up the data of the local second application's sandbox; The sandbox of the second application is cleaned up according to a preset directory mapping relationship, wherein the directory mapping relationship includes the overlay position of each data in the data packet in the sandbox of the second application.
8. The QR code application method according to claim 7, characterized in that, The step of writing the data packet downloaded based on the connection information into the cleaned sandbox of the second application includes: According to the target mapping relationship, the data in the temporary recovery area is retrieved and written into the cleaned sandbox of the second application. The method further includes: If the integrity check fails, the sandbox data of the second application remains unchanged.
9. A QR code generation system, characterized in that, The system, applied in a source device, includes: The scanning module is used to respond to the synchronization trigger command, enter the synchronization preparation state, and scan the sandbox of the first local application. The determination module is used to determine the synchronization list based on the scan data. The synchronization list includes mandatory synchronization data, optional synchronization data, prohibited synchronization data, and data that needs to be de-identified regarding the sandbox. The packaging module is used to package the data allowed to migrate in the sandbox into data packets based on the synchronization list, and generate metadata description information corresponding to the data packets; The generation module is used to call a temporary file transfer service for the data packet and metadata description information to generate a QR code containing connection information. The QR code is used to enable the target device to download the data packet by scanning it and write it into a second application that matches the first application.
10. A QR code application system, characterized in that, The system, applied to a target device, includes: A parsing module is used to parse the QR code to obtain connection information and metadata description information. The connection information is the download link information of the data packet. The data packet contains sandbox data of the first application in the source device. The QR code is generated based on the QR code generation method according to any one of claims 1-4. The inspection and verification module is used to perform compatibility checks based on the connection information and integrity checks based on the metadata description information, wherein the metadata description information corresponds to the data packet. The backup and cleanup module is used to back up and clean up the sandbox of the local second application when the compatibility check result indicates compatibility and the integrity check result indicates completeness. The first application and the second application are matched. The writing module is used to write the data packets downloaded based on the connection information into the cleaned sandbox of the second application.