A data synchronization method, apparatus, electronic device, and storage medium
By utilizing the mapping relationship between cache addresses and qubit identifiers in quantum computing, automatic data synchronization from cloud storage to the client is achieved, solving the problem of low data synchronization efficiency between different users and improving the efficiency of quantum computing and the accuracy of data synchronization.
Patent Information
- Application Number
- CN202311177351.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-12
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-09-12
AI Technical Summary
In quantum computing, the low efficiency of data synchronization between different users means that clients need to perform quantum computing tasks individually to obtain data, wasting time and resources.
By obtaining the cache address information in the synchronization task, the data is stored in the preset cloud storage space, and the target client is identified by using the mapping relationship between the quantum bit identifier and user information, and the automatic data retrieval function is enabled to achieve data synchronization.
It improves the efficiency of quantum computing, avoids the time spent by clients performing data acquisition alone, enables data synchronization and updates across multiple clients, and improves the efficiency and accuracy of data synchronization.
Smart Images

Figure CN119623658B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quantum computing technology, and in particular to a data synchronization method, apparatus, electronic device and storage medium. Background Technology
[0002] Quantum computing is a computational paradigm that utilizes the fundamental properties of quantum mechanics to solve problems. By constructing precisely operable quantum physics hardware systems and running quantum computing software to implement quantum algorithms, computational problems can be solved, enabling the application of quantum computing in specific problems or fields.
[0003] In quantum computing, considering the interrelationships between different quantum computing tasks, data synchronization between different users is necessary. For example, the output data of a quantum computing task executed by user A might be the input data of another quantum computing task executed by user B. If user A can synchronize its output data with user B, this can effectively avoid the time-consuming process of user B executing the quantum computing task corresponding to user A, thus improving the efficiency of quantum computing. Summary of the Invention
[0004] The purpose of this invention is to provide a data synchronization method, apparatus, electronic device, and storage medium to achieve data synchronization between different clients, thereby improving quantum computing efficiency. The specific technical solution is as follows:
[0005] This application provides a data synchronization method, the method comprising:
[0006] Obtain the first synchronization task, which includes the cache address information of the first data;
[0007] Based on the cache address information, the first data cached in the preset cache space is stored in the preset cloud storage space;
[0008] Based on the preset mapping relationship between the quantum bit identifier and the user information, the first user information corresponding to the first quantum bit identifier in the first data is determined.
[0009] When the first client corresponding to the first user information enables the automatic data retrieval function, the first data in the preset cloud storage space is stored in the local storage space of the first client.
[0010] This application embodiment also provides a data synchronization device, the device comprising:
[0011] The first acquisition module is used to acquire the first synchronization task, the first synchronization task including the cache address information of the first data;
[0012] The first storage module is used to store the first data cached in the preset cache space to the preset cloud storage space based on the cache address information;
[0013] The first determining module is used to determine the first user information corresponding to the first quantum bit identifier in the first data according to the preset mapping relationship between the quantum bit identifier and the user information;
[0014] The second storage module is used to store the first data in the preset cloud storage space to the local storage space of the first client when the first client corresponding to the first user information enables the automatic data retrieval function.
[0015] This application also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0016] Memory, used to store computer programs;
[0017] When a processor executes a program stored in memory, it implements any of the data synchronization method steps described above.
[0018] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the data synchronization method steps described above.
[0019] This invention also provides a computer program product containing instructions that, when run on a computer, causes the computer to execute any of the data synchronization methods described above.
[0020] This application also provides a quantum computer system, including any of the data synchronization devices described above.
[0021] Beneficial effects of the embodiments of the present invention:
[0022] The technical solution provided by this invention can, after obtaining a first synchronization task, store the first data cached in a preset cache space to a preset cloud storage space based on the cache address information carried in the first synchronization task. Through a preset mapping relationship between qubit identifiers and user information, the first user information corresponding to the first qubit identifier in the first data is determined, i.e., the first client that can synchronously store the first data is identified. When the first client enables the automatic data retrieval function, the first data stored in the preset cloud storage space is stored to the first client's local storage space, achieving synchronous storage of the first data in the first client's local storage space. Therefore, data generated in different clients can be synchronized through the preset cloud storage space, avoiding the time required for clients to independently execute quantum computing processes to obtain data, effectively improving quantum computing efficiency.
[0023] In addition, when there are multiple first user information corresponding to the first quantum bit identifier, that is, when there are multiple first clients, the local storage space corresponding to each first client that enables the automatic data retrieval function will synchronously store the first data, realizing the synchronous storage of the first data in multiple clients and improving the efficiency of data synchronization.
[0024] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.
[0026] Figure 1 This is a schematic diagram of a first flowchart of a data synchronization method provided in an embodiment of this application;
[0027] Figure 2 This is a second flowchart illustrating the data synchronization method provided in the embodiments of this application;
[0028] Figure 3 This is a schematic diagram of a third process for the data synchronization method provided in the embodiments of this application;
[0029] Figure 4 This is a schematic diagram of the fourth process of the data synchronization method provided in the embodiments of this application;
[0030] Figure 5 A fifth flowchart illustrating the data synchronization method provided in this application embodiment;
[0031] Figure 6 A sixth flowchart illustrating the data synchronization method provided in this application embodiment;
[0032] Figure 7 A seventh flowchart illustrating the data synchronization method provided in this application embodiment;
[0033] Figure 8 An eighth flowchart illustrating the data synchronization method provided in this application embodiment;
[0034] Figure 9 A ninth flowchart illustrating the data synchronization method provided in this application embodiment;
[0035] Figure 10 A schematic diagram of a data synchronization device provided in an embodiment of this application;
[0036] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] To address the problems in related technologies, embodiments of this application provide a data synchronization method. For example... Figure 1 As shown, Figure 1 This is a schematic diagram of a first flowchart of a data synchronization method provided in an embodiment of this application. The method can be applied to any electronic device and includes the following steps.
[0039] Step S101: Obtain the first synchronization task, which includes the cache address information of the first data.
[0040] Step S102: Based on the cache address information, store the first cached data in the preset cache space to the preset cloud storage space.
[0041] Step S103: Determine the first user information corresponding to the first qubit identifier in the first data according to the preset mapping relationship between the qubit identifier and the user information.
[0042] Step S104: When the first client corresponding to the first user information enables the automatic data retrieval function, the first data in the preset cloud storage space is stored in the local storage space of the first client.
[0043] In this embodiment, the electronic device can be a server or other device that communicates with clients. The electronic device can connect to multiple clients simultaneously. Here, no specific limitation is made on the electronic device or the number of clients connected to it.
[0044] Steps S101-S104 above can be executed by the electronic device calling its own asynchronous thread. For ease of understanding, the following explanation only uses the electronic device as the execution subject and does not serve as any limitation.
[0045] Furthermore, the number of asynchronous threads in the aforementioned electronic devices can be one or more, and can be adjusted in real time based on the number of current synchronous tasks, the number of clients connected to the electronic devices, etc. The specific details of the real-time adjustment process are not provided here.
[0046] The method provided in this application embodiment allows for the storage of cached first data in a preset cache space to a preset cloud storage space after obtaining a first synchronization task, based on the cache address information carried in the first synchronization task. By using a preset mapping relationship between qubit identifiers and user information, the first user information corresponding to the first qubit identifier in the first data is determined, i.e., the first client that can synchronously store the first data is identified. When the first client enables the automatic data retrieval function, the first data stored in the preset cloud storage space is stored in the first client's local storage space, achieving synchronous storage of the first data in the first client's local storage space. Therefore, data generated in different clients can be synchronized through the preset cloud storage space, avoiding the time required for clients to independently execute quantum computing processes to obtain data, effectively improving quantum computing efficiency.
[0047] In addition, when there are multiple first user information corresponding to the first quantum bit identifier, that is, when there are multiple first clients, the local storage space corresponding to each first client that enables the automatic data retrieval function will synchronously store the first data, realizing the synchronous storage of the first data in multiple clients and improving the efficiency of data synchronization.
[0048] The embodiments of this application will be described below through specific examples.
[0049] Step S101: Obtain the first synchronization task, which includes the cache address information of the first data.
[0050] In one optional embodiment, the electronic device may have a preset queue for caching data synchronization tasks. Whenever a client sends data to be synchronized to the electronic device, the electronic device generates a data synchronization task corresponding to each piece of data and caches the generated data synchronization task in the preset queue.
[0051] The data to be synchronized can be quantum computing-related data in the client, such as the computation results corresponding to a quantum computing task. This data can be newly generated data or updated data corresponding to existing data in the client (denoted as the original data). No specific limitations are imposed on the data to be synchronized here.
[0052] In an optional embodiment, the data synchronization task described above may include cache address information of the data to be synchronized and user information corresponding to the client sending the data to be synchronized. The cache address information may be a cache address or identification information corresponding to the cache address. The user information may be a username or user identifier. Here, no specific limitations are made on the data to be synchronized, the cache address information, and the user information included in the data synchronization task.
[0053] Electronic devices can select the data synchronization task with the longest cache time from the aforementioned preset queue as the first synchronization task.
[0054] The aforementioned preset queue follows a first-in-first-out (FIFO) rule, and the first synchronization task mentioned above is the data synchronization task that is prioritized in the preset queue.
[0055] For ease of understanding, the data to be synchronized corresponding to the first synchronization task mentioned above is denoted as the first data. The client that sends the first data to the electronic device is denoted as the third client. The first synchronization task mentioned above may include the cache address information corresponding to the first data, and the user information of the user corresponding to the third client.
[0056] In this embodiment, the data to be synchronized may include qubit data and configuration data. The qubit data may include qubit identifiers, qubit power, and frequency, among other things. The configuration data may include qubit crosstalk data, criterion data, etc. No specific limitations are placed on the data included in this embodiment.
[0057] In an optional embodiment, when multiple asynchronous threads exist in the aforementioned electronic device, the electronic device can invoke an asynchronous thread that is currently idle to retrieve a first synchronization task from a preset queue. That is, whenever an idle asynchronous thread appears, the electronic device can invoke that thread to perform data synchronization processing. Compared to the method where each asynchronous thread handles a data synchronization task corresponding to a specific client, or handles a data synchronization task corresponding to a fixed set of data, utilizing idle asynchronous threads for data synchronization effectively improves the resource utilization of each asynchronous thread, thereby shortening the waiting time of all data synchronization tasks and improving data synchronization efficiency.
[0058] In an optional embodiment, the aforementioned preset queue can be set not only in the electronic device, but also in other devices that are communicatively connected to the electronic device, such as a remote dictionary server (Redis).
[0059] Step S102: Based on the cache address information, store the first cached data in the preset cache space to the preset cloud storage space.
[0060] In this step, after the third client sends the first data to the electronic device, the electronic device can cache the first data in a preset cache space. When the electronic device receives the first synchronization task, it can retrieve the first data from the preset cache space according to the cache address information in the first synchronization task, and store the first data in a preset cloud storage space.
[0061] In one optional embodiment, each client has a corresponding storage space within the aforementioned preset cloud storage space. When the electronic device stores the first data in the preset cloud storage space, it can cache the first data in the storage space corresponding to the third client within the preset cloud storage space.
[0062] In this embodiment, the preset cloud storage space may or may not store the original data corresponding to the first data. When the preset cloud storage space does not cache the original data of the first data, the electronic device can directly cache the first data in the preset cloud storage space. When the preset cloud storage space caches the original data of the first data, the electronic device can update the cached original data in the preset cloud storage space with the first data. Here, the method of storing the first data in the preset cloud storage space is not specifically limited.
[0063] Step S103: Determine the first user information corresponding to the first qubit identifier in the first data according to the preset mapping relationship between the qubit identifier and the user information.
[0064] In this embodiment, a mapping relationship between qubit identifiers and user information is pre-set (denoted as the preset mapping relationship). This preset mapping relationship can be stored in the Redis along with the aforementioned preset queue.
[0065] In an optional embodiment, the aforementioned preset mapping relationship may include a first mapping relationship and a second mapping relationship. The first mapping relationship indicates one or more qubit identifiers corresponding to each user information, representing all qubits allocated to each user. The second mapping relationship indicates one or more user information entries corresponding to each qubit identifier, representing all users allocating and using each qubit.
[0066] To facilitate understanding, examples of the first and second mapping relationships described above will be provided using user 1 and quantum bit 1, respectively.
[0067] The first mapping relationship corresponding to user 1 can be represented as: user1[q1, q2, q3, q4], where user1 is the username of user 1, q1, q2, q3, and q4 are the qubit identifiers corresponding to qubits 1 through qubit 4, and user1[q1, q2, q3, q4] indicates that user 1 is allocated qubits 1 through qubit 4. That is, user 1 can use any one or more qubits from qubits 1 through qubit 4 for quantum computing.
[0068] The second mapping relationship corresponding to the above-mentioned qubit 1 can be expressed as: q1[user1, user2, user3], where q1 is the qubit identifier of qubit 1, user1, user2, and user3 are the usernames corresponding to users 1 to 3, and q1[user1, user2, user3] indicates that qubit 1 is allocated to users 1 to 3 for use, that is, qubit 1 can be used by any one or more users 1 to 3 for quantum computing.
[0069] In an optional embodiment, based on the second mapping relationship described above, the electronic device can determine all user information (denoted as first user information) corresponding to the quantum bit identifier (denoted as first quantum bit identifier) in the first data.
[0070] For ease of understanding, the second mapping relationship q1[user1, user2, user3] mentioned above will be used as an example. If the quantum bit identifier carried in the first data is q1, then according to the second mapping relationship, it can be determined that the user information corresponding to q1 includes user1, user2, and user3. At this time, the electronic device can determine that user1, user2, and user3 are all the first user information.
[0071] In another optional embodiment, based on the second mapping relationship described above, the electronic device can determine all user information corresponding to the first qubit identifier in the first data, and select other user information besides the second user information as the first user information. The second user information is the user information corresponding to the third client described above.
[0072] For ease of understanding, we will still use the second mapping relationship q1[user1, user2, user3] as an example. When the quantum bit identifier carried in the first data is q1, the electronic device can determine that the user information corresponding to q1 includes user1, user2, and user3. Considering that the first synchronization task carries the second user information of the third client, such as user1, that is, the first data is sent to the electronic device by the user corresponding to user1 through the client, the electronic device can then determine that the first user information is recorded as user2 and user3, excluding user1.
[0073] In this embodiment of the application, the number of first user information items determined in step S103 can be empty, or one or more. The first user information may or may not include the second user information. Here, the determined first user information is not specifically limited. For ease of understanding, the following explanation only uses the example of the first user information not including the second user information, and does not serve any limiting purpose.
[0074] In an optional embodiment, when the quantity of the aforementioned first user information is empty, the electronic device can determine that the aforementioned first data does not need to be synchronized to other clients. In this case, the electronic device may not perform any synchronization operation. For example, the electronic device may directly discard the first data cached in the aforementioned preset cache space.
[0075] In another optional embodiment, when there are one or more instances of the aforementioned first user information, the electronic device can determine that the first data needs to be synchronized to the clients corresponding to one or more instances of the first user information. In this case, the electronic device can perform a synchronization operation, such as step S104.
[0076] Step S104: When the first client corresponding to the first user information enables the automatic data retrieval function, the first data in the preset cloud storage space is stored in the local storage space of the first client.
[0077] In this embodiment of the application, for the data stored in the preset cloud storage space, the client can synchronize the data in the preset cloud storage space by automatically pulling or manually pulling.
[0078] In an optional embodiment, for each client corresponding to the first user information (referred to as the first client), when it is determined that the first client has enabled the automatic data retrieval function, the electronic device can obtain the first data stored in the preset cloud storage space and synchronously store the obtained first data in the local storage space of the first client.
[0079] pass Figure 1The method shown allows the first data, when it is the updated data corresponding to the original data, to be synchronously updated in the local storage space of the third client to each first client. This achieves data synchronization and data update between the third client and the first client, improving both the efficiency and accuracy of data updates.
[0080] In an optional embodiment, according to the above... Figure 1 The method shown in this application embodiment also provides a data synchronization method. For example... Figure 2 As shown, Figure 2 This is a schematic diagram of a second flowchart illustrating the data synchronization method provided in an embodiment of this application. Figure 2 The method shown has been augmented with the following step, namely step S105.
[0081] Step S105: Send a second notification message to the first client. The second notification message is used to indicate that there is a data update in the local storage space of the first client.
[0082] In this step, after the electronic device stores the first data in the local storage space of the first client, it can send a second notification message to the first client. Upon receiving the second notification message, the first client can determine that the data stored in its local storage space has been updated.
[0083] In an optional embodiment, after receiving the second notification message, the first client can display the second notification message in the form of a message pop-up or a prompt message, so that the user corresponding to the first client can determine that there is a data update in the local storage space based on the displayed second notification message.
[0084] In an optional embodiment, considering that there may be multiple first clients and multiple asynchronous threads for sending the second notification message, the electronic device can send the second notification message to each first client through a proxy thread when sending the second notification message, thereby improving the convenience of sending the second notification message.
[0085] Through the above step S105, the electronic device sends a second notification message to the first client, enabling the user corresponding to the first client to promptly and accurately determine whether the data stored in the local storage space has been updated based on the received second notification message. This facilitates the user to understand the data update status of the local storage space in a timely manner and to synchronize the data promptly, ensuring the accuracy and validity of the data stored in the client.
[0086] In an optional embodiment, according to the above... Figure 1 The method shown in this application embodiment also provides a data synchronization method. For example... Figure 3 As shown, Figure 3 This is a third flowchart illustrating the data synchronization method provided in this application embodiment. The method includes the addition of the following step, namely step S106.
[0087] Step S106: When the first client corresponding to the first user information has not enabled the automatic data retrieval function, a first notification message is sent to the first client. The first notification message is used to indicate that there is data to be synchronized in the preset cloud storage space.
[0088] In this step, if it is determined that the first client has not enabled the automatic data retrieval function, the electronic device can determine that the first data needs to be synchronized to the first client, but the first client has not enabled the corresponding function. At this time, the electronic device can send a notification message (denoted as the first notification message) to the first client to indicate that there is data to be synchronized in the preset cloud storage space. The method of sending the first notification message can refer to the method of sending the second notification message described above, and will not be specifically described here.
[0089] In an optional embodiment, to facilitate the first client's subsequent retrieval of the first data cached in the preset cloud storage space, when the electronic device sends a first notification message to the first client, the first notification message may carry the storage address information of the first data in the preset cloud storage space, or carry the first quantum bit identifier in the first data, so as to facilitate the subsequent retrieval of the first data in the preset cloud storage space.
[0090] Steps S104 and S106 described above are respectively executed by the electronic device when the first client enables the automatic data retrieval function and when the first client does not enable the automatic data retrieval function. Here, the execution of steps S104 and S106 is not specifically limited.
[0091] In this embodiment, after the electronic device stores the first data in a preset cloud storage space, it can promptly remind the user of the first client that there is data that can be synchronized in the preset cloud storage space by sending a first notification message to the first client that the automatic data retrieval function has not been enabled. This allows the user to choose whether to retrieve the synchronized data from the preset cloud storage space, ensuring user selectivity while facilitating timely understanding of data updates and selective data synchronization according to their own needs, thus ensuring the accuracy and validity of the data stored in the client.
[0092] In an optional embodiment, according to the above... Figure 1 The method shown in this application embodiment also provides a data synchronization method. For example... Figure 4 As shown, Figure 4This is a schematic diagram of a fourth data synchronization method provided in an embodiment of this application. The method includes the following steps.
[0093] Step S401: Obtain the first synchronization task, which includes the cache address information of the first data.
[0094] Step S402: Based on the cache address information, store the first cached data in the preset cache space to the preset cloud storage space.
[0095] Step S403: Determine the first user information corresponding to the first qubit identifier in the first data according to the preset mapping relationship between the qubit identifier and the user information.
[0096] Step S404: When the first client corresponding to the first user information enables the automatic data retrieval function, the first data in the preset cloud storage space is stored in the local storage space of the first client.
[0097] Steps S401-S404 are the same as steps S101-S104.
[0098] Step S405: Receive the second data sent by the second client.
[0099] In this step, when updated data exists in the local storage space of the second client, or when the user of the second client chooses to synchronize certain data with other users, the second client can send the updated data or the data to be synchronized (denoted as the second data) to the aforementioned electronic device after obtaining the updated data or the data to be synchronized.
[0100] In this embodiment of the application, the second client can push the second data to the electronic device by means of automatic push or manual push.
[0101] In an optional embodiment, if the second data is data automatically pushed by the second client, then the above step S405, i.e., receiving the second data sent by the second client, can be specifically expressed as follows:
[0102] The electronic device receives second data sent by the second client through the first interface.
[0103] In this step, when the second client enables the automatic data push function, it can push the second data to the electronic device through the first interface. At this time, the electronic device can obtain the second data sent by the second client through the first interface.
[0104] In one optional embodiment, to facilitate the second client to actively push the second data to the electronic device, the second client can set a fixed storage space in the local storage space. Once the data is stored in the fixed storage space, the data can be identified as the second data, and the second client can directly send the second data to the electronic device.
[0105] In another optional embodiment, if the second data is data manually pushed by the user corresponding to the second client, then step S405 above, receiving the second data sent by the second client, can be specifically expressed as:
[0106] The electronic device receives second data sent by the second client through the second interface.
[0107] In this step, when the second client enables the manual data push function, the user of the second client can manually push the second data to the electronic device through the second interface. At this time, the electronic device can obtain the second data sent by the second client through the second interface.
[0108] In this embodiment, the first interface and the second interface are different data transmission interfaces. Each client communicates with the electronic device through both the first and second interfaces. When a client sends data to the electronic device, if the client enables the automatic data push function, the data is sent to the electronic device through the first interface; if the client enables the manual data push function and the user selects to manually push a specific piece of data, the data is sent to the electronic device through the second interface.
[0109] Through the first and second interfaces mentioned above, depending on whether the client has enabled the automatic data push function or the client has enabled the manual data push function, the client will use different data transmission interfaces to push data to the electronic device. This allows the electronic device to determine whether the data was automatically pushed by the client or manually pushed by the client user based on the interface through which the data is received. As a result, different processing methods are adopted for data with different push methods. For specific processing methods, please refer to the description below, which will not be explained in detail here.
[0110] In one optional embodiment, to facilitate the differentiation of data received through different pushing methods, the electronic device may include different function flags in the synchronization task when generating the synchronization task corresponding to each piece of data to be synchronized. For example, a function flag of 1 may indicate that the corresponding data to be synchronized was automatically pushed by the client; a function flag of 2 may indicate that the corresponding data to be synchronized was manually pushed by the client user.
[0111] Step S406: Send a response message for the second data to the second client and cache the second data in a preset cache space.
[0112] In this embodiment of the application, after receiving the second data sent by the second client, the electronic device can send a response message to the second client regarding the second data.
[0113] The aforementioned response message can be used to indicate that the electronic device has received the second data, or it can be used to indicate that the electronic device is processing the second data. Upon receiving this response message, the second client can determine that the electronic device has received the second data, or that the electronic device is processing the second data. At this point, the second client can perform other tasks.
[0114] In related technologies, during data synchronization between different clients, the client's resources are constantly occupied. For example, when client 1 synchronizes data A to client 2, client 1 needs to send data A to client 2. After client 2 stores the received data A, it will send a response message for data A back to client 1. Client 1 can only confirm that data synchronization is complete after receiving this response message. Only then can client 1 process other tasks. Therefore, during the data synchronization process of related technologies, client 1's computing resources are occupied until data synchronization is complete. Especially for quantum computing-related data, which has a relatively large data volume and requires a relatively long synchronization time, this will lead to client 1's computing resources being occupied for a long time, resulting in synchronization timeouts, and even page lag on client 1, affecting the normal operation of client 1.
[0115] Compared to related technologies, the aforementioned electronic device immediately sends a response message back to the client after receiving data sent by the client. This timely releases the client's computing resources, allowing the client to use these resources to handle other tasks. This effectively improves the utilization rate of the client's computing resources and avoids synchronization timeouts and page lag caused by long waiting times.
[0116] In this embodiment of the application, after receiving the second data sent by the second client, the electronic device can not only send back the response message, but also cache the second data to a preset cache space.
[0117] Step S407: Generate a second synchronization task based on the cache address of the second data in the preset cache space.
[0118] In this step, after the electronic device caches the second data into the preset cache space, it can generate a second synchronization task including cache address information based on the cache address of the second data in the preset cache space.
[0119] The second synchronization task mentioned above may also include other information, such as the user information corresponding to the second client mentioned above. For details, please refer to the description of the first synchronization task mentioned above, which will not be repeated here.
[0120] In this embodiment, steps S405-S407 are executed after step S404. Alternatively, steps S405-S407 can be executed before or after any of steps S401-S404. The execution time of steps S405-S407 is not specifically limited here.
[0121] In an optional embodiment, the second client can be the third client, and the second data can be the first data. In this case, steps S405-S407 are executed before step S401.
[0122] Through steps S405-S407 above, after the client sends data to the electronic device, in addition to sending a response message back to the client, the electronic device can also generate a synchronization task corresponding to the data. This allows the electronic device to process the data sent by the client without affecting the normal operation of the client, thus improving the resource utilization of the client.
[0123] In an optional embodiment, if the first data is sent by a third client through the first interface, then according to the above... Figure 1 The method shown in this application embodiment also provides a data synchronization method. For example... Figure 5 As shown, Figure 5 This is a fifth flowchart illustrating the data synchronization method provided in this application embodiment. The method includes the following steps.
[0124] Step S501: Obtain the first synchronization task, which includes the cache address information of the first data.
[0125] The above step S501 is the same as the above step S101.
[0126] Step S502: Determine the second qubit identifier corresponding to the second user information of the third client according to the preset mapping relationship.
[0127] In this step, the electronic device can determine all the qubit identifiers (denoted as the second qubit identifiers) corresponding to the second user information of the third client based on the first mapping relationship mentioned above, that is, one or more qubit identifiers corresponding to each user information.
[0128] For ease of understanding, the first mapping relationship corresponding to user 1 above will be used for explanation. If the second user information above is user1 above, based on user1[q1, q2, q3, q4], the electronic device can determine that all the qubit identifiers corresponding to user1 are q1, q2, q3, and q4. That is, q1, q2, q3, and q4 are all the second qubit identifiers mentioned above.
[0129] In this embodiment, the preset mapping relationship can be set according to user needs, the number of qubits on the quantum chip, etc. Therefore, the number of qubits corresponding to different user information in the first mapping relationship will also be different. Here, the number of second qubit identifiers determined in step S502 is not specifically limited.
[0130] Step S503: When the second qubit identifier includes the first qubit identifier in the first data, determine whether the third client has enabled the automatic data push function.
[0131] In this embodiment of the application, after determining the second quantum bit identifier, the electronic device can compare the determined second quantum bit identifier with the first quantum bit identifier in the first data to determine whether the second quantum bit identifier includes the first quantum bit identifier.
[0132] When the second qubit identifier includes the first qubit identifier, the electronic device can determine that the third client can use the qubit corresponding to the first qubit identifier to perform quantum computing. Therefore, the electronic device can determine that the first data including the first qubit identifier is valid data.
[0133] After determining that the second quantum bit identifier includes the first quantum bit identifier, the electronic device can determine whether the third client has enabled the automatic data push function.
[0134] In one optional embodiment, for each client communicating with the electronic device, when the user enables or disables the automatic data push function, manual data push function, automatic data retrieval function, or manual data retrieval function corresponding to that client, the electronic device will synchronously display the corresponding function icon.
[0135] When determining whether the third client has enabled the automatic data push function, the electronic device can determine this based on the icon currently displayed. For example, if the currently displayed icon corresponds to the automatic data push function, the electronic device can then determine that the third client has enabled the automatic data push function.
[0136] Step S504: When the third client enables the automatic data push function, the first data cached in the preset cache space is stored in the preset cloud storage space based on the cache address information.
[0137] In this step, when the third client is confirmed to have enabled the automatic data push function in step S503, the electronic device can determine that the first data needs to be synchronized. At this time, the electronic device can store the first data in a preset cloud storage space, as described in step S102 above, and will not be repeated here.
[0138] In this embodiment of the application, when the first data is automatically pushed to the third client, the electronic device can determine the validity of the first data based on the above mapping relationship, thereby ensuring the accuracy and effectiveness of data synchronization.
[0139] In addition, after determining that the first data is valid, the electronic device can determine whether the third client has enabled the automatic data push function, and can improve the flexibility of data synchronization based on whether the user corresponding to the third client has selected to synchronize the first data.
[0140] Step S505: Determine the first user information corresponding to the first qubit identifier in the first data according to the preset mapping relationship between the qubit identifier and the user information.
[0141] Step S506: When the first client corresponding to the first user information enables the automatic data retrieval function, the first data in the preset cloud storage space is stored in the local storage space of the first client.
[0142] The above steps S505-S506 and S103-S104.
[0143] In an optional embodiment, according to the above... Figure 5 The method shown in this application embodiment also provides a data synchronization method. For example... Figure 6 As shown, Figure 6 This is a sixth flowchart illustrating the data synchronization method provided in this application embodiment. Figure 6 The method shown has been augmented with the following steps, namely steps S507-S508.
[0144] Step S507: When the third client does not enable the automatic data push function, the first data cached in the preset storage space is discarded based on the cache address information.
[0145] In this step, when the electronic device determines that the third client has not enabled the automatic data push function, it can determine that the user of the third client has abandoned the synchronization of the first data. At this time, the electronic device can determine the cache location of the first data in the preset cache space based on the cache address information carried in the first synchronization task, and thus discard the first data.
[0146] In this embodiment of the application, when the electronic device determines that the third client has not enabled the automatic data push function, it discards the first data in the preset cache space, which can release the cache resources of the preset cache space in a timely manner and effectively improve the resource utilization of the preset cache space.
[0147] Steps S504 and S507 described above are executed by the electronic device when the automatic data push function is enabled on the third client and when the automatic data push function is not enabled on the third client, respectively. The execution of steps S504 and S507 is not specifically limited here.
[0148] In step S508, when the second qubit identifier does not include the first qubit identifier, the first data cached in the preset cache space is discarded based on the cache address information.
[0149] In this step, if the first qubit identifier is not included in the determined second qubit identifier, the electronic device can determine that the first data is not valid data. In this case, the electronic device may not perform synchronization processing on the first data. For example, the electronic device can discard the first data cached in a preset cache space based on the cache address information carried by the first synchronization task.
[0150] Steps S503 and S508 described above are executed respectively depending on whether the second qubit identifier includes the first qubit identifier. Here, the execution of steps S503 and S508 is not specifically limited.
[0151] In this embodiment of the application, when the electronic device determines that the first data is not valid data, it promptly discards the first data cached in the preset cache space, which effectively improves the resource utilization of the preset cache space.
[0152] In an optional embodiment, if the first data is sent by a third client through a second interface, then according to the above... Figure 1 The method shown in this application embodiment also provides a data synchronization method. For example... Figure 7 As shown, Figure 7 This is a seventh flowchart illustrating a data synchronization method provided in an embodiment of this application. The method includes the following steps.
[0153] Step S701: Obtain the first synchronization task, which includes the cache address information of the first data.
[0154] The above step S701 is the same as the above step S101.
[0155] Step S702: Determine the second qubit identifier corresponding to the second user information of the third client according to the preset mapping relationship.
[0156] The above step S702 can be referred to the description of step S502 above, and will not be repeated here.
[0157] Step S703: When the second qubit identifier includes the first qubit identifier in the first data, the first data cached in the preset cache space is stored in the preset cloud storage space based on the cache address information.
[0158] In this step, when the determined second qubit identifier includes the aforementioned first qubit identifier, the electronic device can determine that the aforementioned first data is valid data. At this time, the electronic device can store the first data in a preset cloud storage space.
[0159] In this embodiment of the application, since the first data is manually pushed by the user of the third client when the manual data push function is enabled, the electronic device can directly determine the function currently enabled by the third client. As long as the first data is determined to be valid, data synchronization can be performed on the first data.
[0160] Step S704: Determine the first user information corresponding to the first qubit identifier in the first data according to the preset mapping relationship between the qubit identifier and the user information.
[0161] Step S705: When the first client corresponding to the first user information enables the automatic data retrieval function, the first data in the preset cloud storage space is stored in the local storage space of the first client.
[0162] Steps S704-S705 are the same as steps S103-S104.
[0163] In an optional embodiment, according to the above... Figure 7 The method shown in this application embodiment also provides a data synchronization method. For example... Figure 8 As shown, Figure 8 This is an eighth flowchart illustrating the data synchronization method provided in this application embodiment. The method includes the addition of the following step, namely step S706.
[0164] Step S706: When the second qubit identifier does not include the first qubit identifier, the first data cached in the preset cache space is discarded based on the cache address information.
[0165] In this step, if the first qubit identifier is not included in the determined second qubit identifier, the electronic device can determine that the first data is not valid data. In this case, the electronic device may not perform synchronization processing on the first data. For example, the electronic device can discard the first data cached in a preset cache space based on the cache address information carried by the first synchronization task.
[0166] Steps S703 and S706 described above are steps performed by the electronic device when determining whether the determined second qubit identifier includes the first qubit identifier. Here, the execution of steps S703 and S706 is not specifically limited.
[0167] In this embodiment of the application, when the electronic device determines that the first data is not valid data, it promptly discards the first data cached in the preset cache space, which effectively improves the resource utilization of the preset cache space.
[0168] In the above Figures 5-8 In the embodiment shown, after obtaining the first synchronization task, the electronic device can determine whether the first data corresponding to the first synchronization task was sent through the first interface or the second interface according to the function flag in the first synchronization task, thereby realizing the identification of different synchronization tasks and using different execution steps to realize data synchronization.
[0169] In an optional embodiment, according to the above... Figure 1 The method shown in this application embodiment also provides a data synchronization method. For example... Figure 9 As shown, Figure 9 This is a ninth flowchart illustrating a data synchronization method provided in an embodiment of this application. The method includes the following steps.
[0170] Step S901: Obtain the first synchronization task, which includes the cache address information of the first data.
[0171] Step S902: Based on the cache address information, store the first cached data in the preset cache space to the preset cloud storage space.
[0172] Step S903: Determine the first user information corresponding to the first qubit identifier in the first data according to the preset mapping relationship between the qubit identifier and the user information.
[0173] Step S904: When the first client corresponding to the first user information enables the automatic data retrieval function, the first data in the preset cloud storage space is stored in the local storage space of the first client.
[0174] The steps S901-S904 described above are the same as the steps S101-S104 described above.
[0175] Step S905: Receive a data retrieval instruction carrying third user information sent by the fourth client. The data retrieval instruction is sent when the user corresponding to the third user information triggers the manual data retrieval function.
[0176] In this step, the user of the fourth client can trigger the manual data retrieval function. For example, the user of the fourth client can choose to enable the manual data retrieval function. At this time, the fourth client will send a data retrieval command carrying user information (denoted as the third user information) to the electronic device. The electronic device will also receive this data retrieval command.
[0177] In this embodiment, besides choosing to enable the manual data retrieval function as described above, users can trigger the automatic data retrieval function in other ways. For example, when the automatic data retrieval function is enabled, a data retrieval button can be deployed on the client's display page, allowing users to trigger the manual data retrieval function by clicking it. Here, the specific triggering method for the manual data retrieval function is not limited.
[0178] Step S906: Based on the preset mapping relationship, determine the identifier of the third quantum bit corresponding to the third user information.
[0179] In this step, after receiving the data retrieval instruction, the electronic device can determine all the qubit identifiers (denoted as the third qubit identifiers) corresponding to the third user information carried in the data retrieval instruction according to the first mapping relationship.
[0180] In this embodiment of the application, depending on the different user information and the different first mapping relationships corresponding to each user information, the number of third qubit identifiers determined in step S906 can be one or more. Here, the number of third qubit identifiers is not specifically limited.
[0181] Step S907: For each third qubit identifier, obtain the third data including the third qubit identifier from the preset cloud storage space.
[0182] In this step, for each third qubit identifier determined in step S906 above, the electronic device can determine whether data including the third qubit identifier (denoted as third data) is stored in the preset cloud storage space. After the third data with the third qubit identifier is stored in the preset cloud storage space, the electronic device can acquire the third data.
[0183] In one optional embodiment, for each third qubit identifier, if the third data of the third qubit identifier is not stored in the preset cloud storage space, the electronic device may not perform any processing, or the electronic device may send feedback information carrying the third qubit identifier to the fourth client, which is used to indicate that the third data is not stored in the preset cloud storage space.
[0184] Step S908: The third data is stored in the local storage space of the fourth client.
[0185] In one optional embodiment, for each third qubit identifier, the electronic device can store the third data corresponding to that third qubit identifier into the local storage space of the fourth client after obtaining the third data. That is, the electronic device stores the third data into its local storage space after obtaining each piece of third data.
[0186] In another alternative embodiment, for each third qubit identifier, the electronic device can store all the third data together in the local storage space of the fourth client after obtaining all the third data.
[0187] Through steps S905-S908 above, when the user of the fourth client triggers the manual data retrieval function, the electronic device can synchronously store the third data stored in the preset cloud storage space to the local storage space of the fourth client, thereby achieving data synchronization.
[0188] In the above Figure 9 In the illustrated embodiment, steps S905-S908 are executed after step S904. Alternatively, steps S905-S908 may be executed before or after any of steps S901-S904. The execution time of steps S905-S908 is not specifically limited here.
[0189] In the above Figure 9 In the illustrated embodiment, the manual data retrieval process is explained by taking the example of a user triggering the manual data retrieval function to obtain all data that can be synchronized to the local storage space from the preset cloud storage space. In addition, users can also trigger the manual data retrieval function for specific data to be synchronized.
[0190] For example, after receiving a first notification message carrying the identifier of the first qubit, the user can trigger a manual data retrieval function for the first data. At this time, the first client can send a data retrieval command carrying the first user information and the identifier of the first qubit to the electronic device.
[0191] After receiving a data retrieval instruction from the first client, the electronic device can store the data including the identifier of the first quantum bit (i.e., the aforementioned first data) stored in the preset cloud storage space to the local storage space of the first client.
[0192] In an optional embodiment, in order to further improve the accuracy of data synchronization, after receiving the data retrieval instruction sent by the first client, the electronic device can refer to step S906 above to determine the quantum bit identifier (denoted as the fourth quantum bit identifier) corresponding to the first user information.
[0193] When the fourth quantum bit identifier includes the aforementioned first quantum bit identifier, the electronic device can store the data including the first quantum bit identifier stored in the preset cloud storage space to the local storage space of the first client.
[0194] Based on the same inventive concept, and according to the data synchronization method provided in the above embodiments of this application, this application also provides a data synchronization device. For example... Figure 10 As shown, Figure 10 This is a schematic diagram of a data synchronization device provided in an embodiment of this application. The device includes the following modules.
[0195] The first acquisition module 1001 is used to acquire the first synchronization task, which includes the cache address information of the first data.
[0196] The first storage module 1002 is used to store the first data cached in the preset cache space to the preset cloud storage space based on the cache address information.
[0197] The first determining module 1003 is used to determine the first user information corresponding to the first quantum bit identifier in the first data according to the preset mapping relationship between the quantum bit identifier and the user information;
[0198] The second storage module 1004 is used to store the first data in the preset cloud storage space to the local storage space of the first client when the first client corresponding to the first user information enables the automatic data retrieval function.
[0199] Optionally, the above-mentioned data synchronization device may further include:
[0200] The first receiving module is used to receive the second data sent by the second client;
[0201] The first sending module is used to send a response message for the second data to the second client and cache the second data in a preset cache space;
[0202] The generation module is used to generate a second synchronization task based on the cache address of the second data in the preset cache space.
[0203] Optionally, the first receiving module described above can be specifically used to receive the second data sent by the second client through the first interface if the second data is data automatically pushed by the second client.
[0204] Optionally, the above-mentioned data synchronization device may further include:
[0205] The second determining module is used to determine the second quantum bit identifier corresponding to the second user information of the third client according to a preset mapping relationship before storing the first data cached in the preset cache space to the preset cloud storage space based on the cache address information, if the first data is sent by the third client through the first interface.
[0206] The third determining module is used to determine whether the third client has enabled the automatic data push function when the second quantum bit identifier includes the first quantum bit identifier in the first data.
[0207] The first calling module is used to call the first storage module 1002 to execute the step of storing the first data cached in the preset cache space to the preset cloud storage space based on the cache address information when the third client enables the automatic data push function.
[0208] Optionally, the above-mentioned data synchronization device may further include:
[0209] The first discard module is used to discard the first data cached in the preset storage space based on the cache address information when the third client does not enable the automatic data push function.
[0210] Optionally, the second receiving module described above can be used to receive the second data sent by the second client through the second interface if the second data is data manually pushed by the user corresponding to the second client.
[0211] Optionally, the above-mentioned data synchronization device may further include:
[0212] The fourth determining module is used to determine the second quantum bit identifier corresponding to the second user information of the third client according to a preset mapping relationship before storing the first data cached in the preset cache space to the preset cloud storage space based on the cache address information, if the first data is sent by the third client through the second interface.
[0213] The second calling module is used to call the first storage module 1002 to perform the step of storing the first data cached in the preset cache space to the preset cloud storage space based on the cache address information when the second quantum bit identifier includes the first quantum bit identifier in the first data.
[0214] Optionally, the above-mentioned data synchronization device may further include:
[0215] The second discard module is used to discard the first data cached in the preset cache space based on the cache address information when the second qubit identifier does not include the first qubit identifier.
[0216] Optionally, the above-mentioned data synchronization device may further include:
[0217] The second receiving module is used to receive a data retrieval instruction sent by the fourth client, which carries the third user information. The data retrieval instruction is sent when the user corresponding to the third user information triggers the manual data retrieval function.
[0218] The fifth determining module is used to determine the third quantum bit identifier corresponding to the third user information based on a preset mapping relationship;
[0219] The second acquisition module is used to acquire third data including the third quantum bit identifier from a preset cloud storage space for each third quantum bit identifier;
[0220] The third storage module is used to store the third data in the local storage space of the fourth client.
[0221] Optionally, the above-mentioned data synchronization device may further include:
[0222] The second sending module is used to send a first notification message to the first client when the first client corresponding to the first user information has not enabled the automatic data retrieval function. The first notification message is used to indicate that there is data to be synchronized in the preset cloud storage space.
[0223] Optionally, the above-mentioned data synchronization device may further include:
[0224] The third sending module is used to send a second notification message to the first client after storing the first data in the preset cloud storage space to the local storage space of the first client. The second notification message is used to indicate that there is a data update in the local storage space of the first client.
[0225] The apparatus provided in this application embodiment allows for the storage of cached first data in a preset cache space to a preset cloud storage space after obtaining a first synchronization task, based on the cache address information carried in the first synchronization task. By using a preset mapping relationship between qubit identifiers and user information, the first user information corresponding to the first qubit identifier in the first data is determined, i.e., the first client that can synchronously store the first data is identified. When the first client enables the automatic data retrieval function, the first data stored in the preset cloud storage space is stored in the first client's local storage space, achieving synchronous storage of the first data in the first client's local storage space. Therefore, data generated in different clients can be synchronized through the preset cloud storage space, avoiding the time required for clients to independently execute quantum computing processes to obtain data, effectively improving quantum computing efficiency.
[0226] In addition, when there are multiple first user information corresponding to the first quantum bit identifier, that is, when there are multiple first clients, the local storage space corresponding to each first client that enables the automatic data retrieval function will synchronously store the first data, realizing the synchronous storage of the first data in multiple clients and improving the efficiency of data synchronization.
[0227] Based on the same inventive concept and according to the data synchronization method provided in the above embodiments of this application, this application also provides an electronic device, such as... Figure 11 As shown, it includes a processor 1101, a communication interface 1102, a memory 1103, and a communication bus 1104. The processor 1101, communication interface 1102, and memory 1103 communicate with each other via the communication bus 1104.
[0228] Memory 1103 is used to store computer programs;
[0229] When processor 1101 executes the program stored in memory 1103, it performs the following steps:
[0230] Obtain the first synchronization task, which includes the cache address information of the first data;
[0231] Based on the cache address information, the first cached data in the preset cache space is stored in the preset cloud storage space;
[0232] Based on the preset mapping relationship between the quantum bit identifier and the user information, the first user information corresponding to the first quantum bit identifier in the first data is determined.
[0233] When the first client corresponding to the first user information enables the automatic data retrieval function, the first data in the preset cloud storage space will be stored in the local storage space of the first client.
[0234] The electronic device provided in this application embodiment can, after obtaining a first synchronization task, store the first data cached in a preset cache space to a preset cloud storage space based on the cache address information carried in the first synchronization task. Through a preset mapping relationship between qubit identifiers and user information, the first user information corresponding to the first qubit identifier in the first data is determined, i.e., the first client that can synchronously store the first data is identified. When the first client enables the automatic data retrieval function, the first data stored in the preset cloud storage space is stored in the first client's local storage space, achieving synchronous storage of the first data in the first client's local storage space. Therefore, data generated in different clients can be synchronized through the preset cloud storage space, avoiding the time required for each client to perform a separate quantum computing process to obtain data, effectively improving quantum computing efficiency.
[0235] In addition, when there are multiple first user information corresponding to the first quantum bit identifier, that is, when there are multiple first clients, the local storage space corresponding to each first client that enables the automatic data retrieval function will synchronously store the first data, realizing the synchronous storage of the first data in multiple clients and improving the efficiency of data synchronization.
[0236] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0237] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0238] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0239] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0240] Based on the same inventive concept, and according to the data synchronization method provided in the above embodiments of this application, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above data synchronization methods.
[0241] Based on the same inventive concept, and according to the data synchronization method provided in the above embodiments of this application, this application also provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute any of the data synchronization methods in the above embodiments.
[0242] Based on the same inventive concept, and according to the data synchronization method provided in the above embodiments of this application, this application also provides a quantum computer system, including any of the data synchronization devices described above.
[0243] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0244] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0245] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, embodiments such as apparatuses, electronic devices, computer-readable storage media, computer program products, and quantum computer systems are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0246] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A data synchronization method, characterized by, The method comprises: obtaining a first synchronization task, the first synchronization task comprising cache address information of first data; storing the first data cached in a preset cache space to a preset cloud storage space based on the cache address information; determining first user information corresponding to a first qubit identifier in the first data according to a preset mapping relationship between qubit identifiers and user information; storing the first data in the preset cloud storage space to a local storage space of a first client when a data automatic pulling function of the first client corresponding to the first user information is enabled; if the first data is sent by a third client through a second interface, before storing the first data cached in a preset cache space to a preset cloud storage space based on the cache address information, the method further comprises: determining a second qubit identifier corresponding to second user information of the third client according to a preset mapping relationship; when the second qubit identifier comprises the first qubit identifier in the first data, performing the step of storing the first data cached in a preset cache space to a preset cloud storage space based on the cache address information. The second interface is a data manual pushing function enabled by the client, and a data transmission interface when a user selects to manually push data.
2. The method of claim 1, wherein, The method further comprises: receiving second data sent by a second client; sending a response message to the second data to the second client, and caching the second data to a preset cache space; generating a second synchronization task based on a cache address of the second data in the preset cache space.
3. The method of claim 2, wherein, If the second data is automatically pushed by the second client, the step of receiving second data sent by a second client comprises: receiving second data sent by a second client through a first interface.
4. The method of claim 3, wherein, If the first data is sent by a third client through a first interface, before storing the first data cached in a preset cache space to a preset cloud storage space based on the cache address information, the method further comprises: determining a second qubit identifier corresponding to second user information of the third client according to a preset mapping relationship; when the second qubit identifier comprises the first qubit identifier in the first data, determining whether the third client enables a data automatic pushing function; when the third client enables the data automatic pushing function, performing the step of storing the first data cached in a preset cache space to a preset cloud storage space based on the cache address information.
5. The method of claim 4, wherein, The method further comprises: when the third client does not enable the data automatic pushing function, discarding the first data cached in a preset storage space based on the cache address information.
6. The method of claim 2, wherein, If the second data is manually pushed by the user corresponding to the second client, the step of receiving second data sent by a second client comprises: receiving second data sent by a second client through a second interface.
7. The method according to claim 1 or 4, characterized in that, The method further comprises: When the second quantum bit identifier does not include the first quantum bit identifier, the first data cached in the preset cache space is discarded based on the cache address information.
8. The method of claim 1, wherein, The method further includes: receiving a data pulling instruction carrying third user information sent by a fourth client, the data pulling instruction being sent when a user corresponding to the third user information triggers a manual data pulling function; determining a third quantum bit identifier corresponding to the third user information based on the preset mapping relationship; for each third quantum bit identifier, obtaining third data including the third quantum bit identifier from the preset cloud storage space; storing the third data to a local storage space of the fourth client.
9. The method of claim 1, wherein, The method further includes: when the first client corresponding to the first user information does not start the data automatic pulling function, sending a first notification message to the first client, the first notification message being used to indicate that there is data to be synchronized in the preset cloud storage space.
10. The method of claim 1, wherein, After storing the first data in the preset cloud storage space to the local storage space of the first client, the method further includes: sending a second notification message to the first client, the second notification message being used to indicate that there is data update in the local storage space of the first client.
11. A data synchronization apparatus, characterized by comprising: The device includes: a first obtaining module configured to obtain a first synchronization task, the first synchronization task including cache address information of first data; a first storage module configured to store the first data cached in a preset cache space to a preset cloud storage space based on the cache address information; a first determining module configured to determine first user information corresponding to a first quantum bit identifier in the first data according to a preset mapping relationship between quantum bit identifiers and user information; a second storage module configured to store the first data in the preset cloud storage space to a local storage space of the first client when the first client corresponding to the first user information starts a data automatic pulling function; The device further includes: a fourth determining module configured to, if the first data is sent by a third client through a second interface, determine a second quantum bit identifier corresponding to second user information of the third client according to a preset mapping relationship before storing the first data cached in a preset cache space to a preset cloud storage space based on the cache address information; a second calling module configured to, when the second quantum bit identifier includes the first quantum bit identifier in the first data, call the first storage module to execute the step of storing the first data cached in the preset cache space to the preset cloud storage space based on the cache address information. The second interface is a data transmission interface when a client starts a data manual pushing function and a user selects to manually push data.
12. An electronic device, comprising: The device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete mutual communication through the communication bus; The memory is used to store a computer program; The processor is used to execute the program stored on the memory to implement the method steps of any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps in any one of claims 1-10.
Citation Information
Patent Citations
Message synchronization method and device, computer device and computer readable storage medium
CN110365739A
Systems and methods for quantum caching
CN116663667A