Cinema data synchronization method and system
By using terminal and cloud version number management in the theater data synchronization system, the problem of data consistency between cloud and terminal is solved, real-time consistent synchronization of theater user data operations is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202510592526.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-08-12
AI Technical Summary
In the prior art, the data consistency between the cloud and the terminal during the theater data synchronization process cannot be guaranteed, especially when the network is delayed or unstable, resulting in poor user experience and failure to effectively determine whether the terminal data is up-to-date during data synchronization.
By maintaining version records in the terminal and cloud, using the terminal version number and cloud version number to mark data changes, and using the consistency service to judge and update the version number when adding, modifying or deleting data to ensure data consistency and synchronization.
It realizes real-time consistent synchronization between terminal and cloud data when cinema users operate data, avoids data version conflicts and improves user experience.
Smart Images

Figure CN120475038A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data synchronization, and in particular to a method and system for synchronizing theater data. Background Art
[0002] With the advancement of technology, cinema projection and management techniques have also evolved. Traditionally, film projection and management relied primarily on offline manual methods. Today, film projection and management utilizes an internet-connected computer device, logged into the cinema's cloud to manage the cinema's terminals. This allows staff to monitor the cinema's projection status, screening failures, and attendance at any time, anywhere, and to select additional schedules or reschedule popular films based on viewing results. Furthermore, users can use the cloud to calculate the attendance and box office revenue of recent screenings and transmit films to terminals across the cinema via the cloud.
[0003] Since cinemas are located in different cities and regions, and the amount of data in the cinemas is large, the effect of accessing the cinema data from the cloud and then reading the data back from the cinema's terminal is not very good, and the reading time is long. Once there is a network delay or network instability, the user will have to wait even longer, which greatly affects the user experience.
[0004] Although related technologies can also achieve the synchronization of cinema data, the cloud and the terminal are completely separated during the data synchronization process. That is, when the data on the cloud changes, it will not be synchronized to the terminal, but will be synchronized when the user reads it. Moreover, when the changes in cloud data are synchronized to the terminal, it will not judge whether the terminal data is the latest, but will directly overwrite it to modify it. Therefore, it is impossible to achieve consistent synchronization of cloud and terminal data. Summary of the Invention
[0005] The purpose of this application is to provide a cinema data synchronization method and system, which can achieve consistent synchronization of terminal and cloud data when cinema users add, modify or delete data.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] In a first aspect, the present application provides a method for synchronizing theater data, the method comprising:
[0008] When a theater user adds new data, the terminal updates the terminal database and creates a new terminal version record in the terminal version library. After receiving the new data request sent by the terminal, the cloud updates the cloud database and creates a new cloud version record in the cloud version library that is consistent with the terminal version record. The terminal version record and the cloud version record both include the terminal version number and the cloud version number. The terminal version number in the newly created terminal version record is 1 and the cloud version number is 0.
[0009] When a cinema user modifies data, the terminal updates the terminal database and determines whether there is a terminal version record corresponding to the modified data in the terminal version library. After the cloud receives the data modification request sent by the terminal, it successively determines whether there is a cloud version record corresponding to the modified data in the cloud version library, whether the terminal version record and the cloud version record meet the first condition, the second condition and the third condition, and updates the cloud database and the cloud version library according to different judgment results; wherein, when there is a terminal version record corresponding to the modified data in the terminal version library, the terminal increases the terminal version number in the terminal version record by 1, and the cloud version number remains unchanged; the first condition is that the terminal version number in the terminal version record is greater than the terminal version number in the cloud version record, and the cloud version number in the terminal version record is equal to the cloud version number in the cloud version record; the second condition is that the terminal version number in the terminal version record is less than the terminal version number in the cloud version record; the third condition is that the terminal version number in the terminal version record is greater than the terminal version number in the cloud version record, and the cloud version number in the terminal version record is less than the cloud version number in the cloud version record;
[0010] When a cinema user deletes data, the terminal updates the terminal database and determines whether there is a terminal version record corresponding to the deleted data in the terminal version library. After the cloud receives the data deletion request sent by the terminal, it first determines whether there is a cloud version record corresponding to the deleted data in the cloud version library, whether the terminal version record and the cloud version record meet the first condition, the second condition and the third condition, and updates the cloud database and cloud version library according to different judgment results.
[0011] In a second aspect, the present application further provides a computer system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the theater data synchronization method described in the first aspect.
[0012] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0013] In order to clearly mark the data changes between the terminal and the cloud, this application creates or updates the terminal version record in the terminal version library and creates or updates the cloud version record in the cloud version library when the theater user adds, modifies or deletes data. This is because the terminal version record and the cloud version record are both marked with the terminal version number and the cloud version number. The changes in these two version numbers can intuitively reflect the changes made by the theater user to the data. At the same time, since the cloud version record and the terminal version record are consistent, the final versions of the cloud and terminal data are also consistent, and there will be no problem of inconsistent cloud and terminal data versions. In addition, this application also introduces the comparison of the terminal version number of the terminal with the terminal version number of the cloud, and the cloud version number of the terminal with the cloud version number of the cloud when querying the cloud version record, avoiding conflicts in data priority and effectively ensuring the consistent synchronization of terminal and cloud data. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0015] Figure 1 This is a flowchart of a theater data synchronization method in an embodiment of the present application;
[0016] Figure 2 This is a flowchart of terminal-cloud data synchronization after a cinema user adds new data in an embodiment of the present application;
[0017] Figure 3 This is a flowchart of terminal-cloud data synchronization after a theater user modifies data in an embodiment of the present application;
[0018] Figure 4 This is a flowchart of terminal-cloud data synchronization after a theater user deletes data in an embodiment of the present application;
[0019] Figure 5 This is a flowchart of terminal-cloud data synchronization after a cloud user adds new data in an embodiment of the present application;
[0020] Figure 6 This is a flowchart of terminal-cloud data synchronization after a cloud user modifies data in an embodiment of the present application;
[0021] Figure 7 This is a flowchart of terminal-cloud data synchronization after a cloud user deletes data in an embodiment of the present application;
[0022] Figure 8This is a diagram of the internal structure of the computer system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0024] Generally, a cinema's projection data synchronization system consists of terminals and the cloud. The terminal is a device deployed in the cinema, which is mainly used to collect cinema data and manage cinema equipment. The terminal runs terminal consistency services, terminal basic services, etc. The cloud is mainly deployed in the service provider's computer room. It manages all registered cinemas and controls the equipment of each cinema. The cloud runs cloud consistency services, cloud basic services, etc. The following is a specific explanation of the terms:
[0025] Terminal: The server that manages cinema equipment and processes cinema data.
[0026] Cloud: A cloud platform that manages multiple cinema devices and processes data from multiple cinemas.
[0027] Terminal consistency service: A service running on the terminal that ensures data consistency between the terminal and the cloud, and is responsible for assigning data IDs.
[0028] Cloud consistency service: A service running on the cloud that ensures data consistency between the cloud and the terminal and is responsible for allocating data IDs.
[0029] Terminal basic services: Services running on the terminal, used to complete the basic functions of the terminal and communicate with the device and terminal consistency services.
[0030] Cloud infrastructure services: Services that run on the cloud and are used to complete basic cloud functions and communicate with devices and cloud consistency services.
[0031] Terminal adds / modifies / deletes data: Terminal users add / modify / delete equipment and other data on the cinema terminal platform.
[0032] Add / modify / delete data in the cloud: Cloud users add / modify / delete device and other data on the cloud platform.
[0033] Record: Every piece of data in all databases on the terminal and the cloud is called a record.
[0034] Data ID: This uniquely identifies the data, marking the uniqueness of the terminal data. A record with the same ID as the terminal exists in the cloud, and the data content of this record is consistent with that of the terminal. This ID is unique across both the terminal and the cloud. Furthermore, the Data ID is generated using a snowflake algorithm. The machine ID in the snowflake algorithm is provided by the cloud consistency service and is unique, thus preventing duplicate Data ID generation. Once a record is generated, its Data ID remains unchanged.
[0035] Version number: Each record has two version numbers, one for the terminal and one for the cloud. Each record starts at 0 when it is first generated. If the record is first generated in the cloud, the initial cloud version is 1 and the terminal version is 0. After the data is synchronized to the terminal, the terminal version is the same as the cloud version, i.e., the cloud version is 1 and the terminal version is 0. If the record is first generated on the terminal, the initial terminal version is 1 and the cloud version is 0. After the terminal data is synchronized to the cloud, the cloud version is the same as the terminal version, i.e., the terminal version is 1 and the cloud version is 0. After that, the record will only be modified or deleted, and the record version number will increment based on the initial version number. If the record is manipulated in the cloud, the cloud version number will increase by 1, and the terminal version number in the cloud will remain unchanged. If the record is manipulated on the terminal, the terminal version number will increase by 1, and the cloud version number in the terminal will remain unchanged.
[0036] Version library: Records the current version of the terminal data. The version library contains the database table ID field, the cloud version number, and the terminal version number. The cloud and terminal each have a version table to record their respective data versions. When the cloud operates on data, the cloud version number on the cloud increases by 1, while the terminal version number on the cloud remains unchanged. When the terminal operates on data, the terminal version number on the terminal increases by 1, while the cloud version number on the terminal remains unchanged. When data is synchronized, if there is no version conflict: when the cloud is synchronized to the terminal, the terminal's cloud version number and terminal version number will be modified to be consistent with the cloud; when the terminal is synchronized to the cloud, the cloud version number and terminal version number on the cloud will be modified to be consistent with the terminal.
[0037] Dataset table: Each record corresponds to a database table, including the table name and the priority between the cloud and the terminal. That is, if the cloud and the terminal modify data at the same time and a conflict occurs during synchronization, the data modified on the cloud will be used if the cloud has a higher priority, and the data modified on the terminal will be used if the terminal has a higher priority.
[0038] The purpose of this application is to provide a cinema data synchronization method and system, which can achieve consistent synchronization of terminal and cloud data when cinema users add, modify or delete data.
[0039] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0040] In an exemplary embodiment, Figure 1 As shown, a theater data synchronization method is provided, the theater data synchronization method comprising:
[0041] Step S1: When a cinema user adds new data, the terminal updates the terminal database and creates a new terminal version record in the terminal version library. After receiving the new data request sent by the terminal, the cloud updates the cloud database and creates a new cloud version record in the cloud version library that is consistent with the terminal version record.
[0042] In this embodiment, both the terminal version record and the cloud version record include the terminal version number and the cloud version number; in the newly created terminal version record, the terminal version number is 1 and the cloud version number is 0.
[0043] like Figure 2 As shown, step S1 specifically includes:
[0044] When a cinema user adds new data, the terminal basic service applies to the terminal consistency service for the ID of the new data. The terminal consistency service allocates the ID of the new data, and the terminal basic service saves the new data and the corresponding ID in the terminal database.
[0045] The terminal basic service determines whether the new data is saved successfully; if so, the terminal consistency service creates a new terminal version record in the terminal version library, marks the terminal version number in the terminal version record as 1 and the cloud version number as 0, and sends a new data request to the cloud consistency service; if not, the terminal basic service prompts the theater user that the new data saving failed.
[0046] After receiving the request for new data, the cloud consistency service requests the cloud basic service to save the new data. The cloud basic service saves the new data to the cloud database. The cloud consistency service creates a new cloud version record in the cloud version library, marks the cloud version number in the cloud version record as 0 and the terminal version number as 1, and sends the processing result to the terminal consistency service.
[0047] The terminal consistency service determines whether the data synchronization is successful based on the processing results; if so, the terminal basic service prompts the theater user that the data synchronization is successful; if not, the terminal basic service prompts the theater user that the data synchronization fails.
[0048] Step S2: When the theater user modifies the data, the terminal updates the terminal database and determines whether there is a terminal version record corresponding to the modified data in the terminal version library. After the cloud receives the data modification request sent by the terminal, it successively determines whether there is a cloud version record corresponding to the modified data in the cloud version library, whether the terminal version record and the cloud version record meet the first condition, the second condition and the third condition, and updates the cloud database and cloud version library according to different judgment results.
[0049] In this embodiment, when there is a terminal version record corresponding to the modified data in the terminal version library, the terminal increases the terminal version number in the terminal version record by 1, and the cloud version number remains unchanged; the first condition is that the terminal version number in the terminal version record is greater than the terminal version number in the cloud version record, and the cloud version number in the terminal version record is equal to the cloud version number in the cloud version record; the second condition is that the terminal version number in the terminal version record is less than the terminal version number in the cloud version record; the third condition is that the terminal version number in the terminal version record is greater than the terminal version number in the cloud version record, and the cloud version number in the terminal version record is less than the cloud version number in the cloud version record.
[0050] like Figure 3 As shown, step S2 specifically includes:
[0051] When a cinema user modifies data, the terminal basic service modifies the terminal database, and the terminal consistency service searches the terminal version library for a corresponding terminal version record based on the ID of the modified data. If so, the terminal consistency service adds 1 to the terminal version number in the terminal version record, keeps the cloud version number unchanged, and sends a modification data request to the cloud consistency service. If not, the terminal consistency service creates a new terminal version record in the terminal version library, marks the terminal version number in the terminal version record as 1, marks the cloud version number as 0, and sends a modification data request to the cloud consistency service.
[0052] After receiving the request to modify data, the cloud consistency service will search the cloud version library for the corresponding cloud version record based on the ID of the modified data; if so, the cloud consistency service will determine whether the first condition is met; if not, the cloud basic service will add the modified data to the cloud database, and the cloud consistency service will create a new cloud version record in the cloud version library and make the new cloud version record consistent with the terminal version record. The terminal basic service will prompt the theater user that the data synchronization is successful.
[0053] When the first condition is met, the cloud basic service modifies the cloud database, the cloud consistency service updates the cloud version library, and makes the cloud version record corresponding to the modified data consistent with the terminal version record. The terminal basic service prompts the theater user that the data synchronization is successful.
[0054] When the first condition is not met, the cloud consistency service determines whether the second condition is met; if so, the terminal basic service prompts the theater user that data synchronization has failed; if not, the cloud consistency service determines whether the third condition is met.
[0055] When the third condition is met, the cloud consistency service will query the data priority in the cloud dataset table and determine whether the terminal is prioritized based on the data priority; if so, the cloud basic service will modify the cloud database, the cloud consistency service will update the cloud version library, and make the cloud version record corresponding to the modified data consistent with the terminal version record, and the terminal basic service will prompt the theater user that the data synchronization is successful; if not, the terminal basic service will prompt the theater user that the data synchronization has failed.
[0056] Step S3: When the theater user deletes data, the terminal updates the terminal database and determines whether there is a terminal version record corresponding to the deleted data in the terminal version library. After the cloud receives the data deletion request sent by the terminal, it successively determines whether there is a cloud version record corresponding to the deleted data in the cloud version library, whether the terminal version record and the cloud version record meet the first condition, the second condition and the third condition, and updates the cloud database and cloud version library according to different judgment results.
[0057] like Figure 4 As shown, step S3 specifically includes:
[0058] When a theater user deletes data, the terminal basic service deletes the corresponding data from the terminal database. The terminal consistency service searches the terminal version library for the corresponding terminal version record based on the ID of the deleted data. If so, the terminal consistency service increments the terminal version number in the terminal version record by 1, leaves the cloud version number unchanged, and sends a data deletion request to the cloud consistency service. If not, the terminal consistency service creates a new terminal version record in the terminal version library, marks the terminal version number in the terminal version record as 1, marks the cloud version number as 0, and sends a data deletion request to the cloud consistency service.
[0059] After receiving the data deletion request, the cloud consistency service will check whether the corresponding cloud version record exists in the cloud version library based on the ID of the deleted data. If so, the cloud consistency service will determine whether the first condition is met. If not, the terminal basic service will notify the theater user that the data synchronization has failed.
[0060] When the first condition is met, the cloud basic service deletes the corresponding data from the cloud database, the cloud consistency service updates the cloud version library, and makes the cloud version record corresponding to the deleted data consistent with the terminal version record. The terminal basic service notifies the theater user that the data synchronization is successful;
[0061] When the first condition is not met, the cloud consistency service determines whether the second condition is met; if so, the terminal basic service prompts the theater user that the data synchronization has failed; if not, the cloud consistency service determines whether the third condition is met;
[0062] When the third condition is met, the cloud consistency service will query the data priority in the cloud dataset table and determine whether it is terminal priority based on the data priority; if so, the cloud basic service will delete the corresponding data from the cloud database, the cloud consistency service will update the cloud version library, and make the cloud version record corresponding to the deleted data consistent with the terminal version record, and the terminal basic service will prompt the theater user that the data synchronization is successful; if not, the terminal basic service will prompt the theater user that the data synchronization has failed.
[0063] Furthermore, the above-mentioned theater data synchronization method further includes the following steps:
[0064] like Figure 5 As shown, when a cloud user adds new data, the cloud basic service applies to the cloud consistency service for the ID of the new data, the cloud consistency service allocates the ID of the new data, and the cloud basic service saves the new data and the corresponding ID in the cloud database.
[0065] The cloud basic service determines whether the newly added data is saved successfully; if so, the cloud consistency service creates a new cloud version record in the cloud version library, marks the cloud version number in the cloud version record as 1 and the terminal version number as 0, and sends a new data request to the terminal consistency service; if not, the cloud basic service prompts the cloud user that the new data saving failed.
[0066] After receiving the request for new data, the terminal consistency service requests the terminal basic service to save the new data. The terminal basic service saves the new data to the terminal database. The terminal consistency service creates a new terminal version record in the terminal version library, marks the terminal version number in the terminal version record as 0 and the cloud version number as 1, and sends the processing result to the cloud consistency service.
[0067] The cloud consistency service determines whether the data synchronization is successful based on the processing results; if so, the cloud basic service prompts the cloud user that the data synchronization is successful; if not, the cloud basic service prompts the cloud user that the data synchronization fails.
[0068] like Figure 6As shown, when a cloud user modifies data, the cloud basic service modifies the cloud database, and the cloud consistency service searches the cloud version library for a corresponding cloud version record based on the ID of the modified data; if so, the cloud consistency service increases the cloud version number in the cloud version record by 1, keeps the terminal version number unchanged, and sends a modification data request to the terminal consistency service; if not, the cloud consistency service creates a new cloud version record in the cloud version library, marks the cloud version number in the cloud version record as 1, marks the terminal version number as 0, and sends a modification data request to the terminal consistency service.
[0069] After receiving the request to modify data, the terminal consistency service will search the terminal version library for the corresponding terminal version record based on the ID of the modified data; if so, the terminal consistency service will determine whether the fourth condition is met; the fourth condition is that the cloud version number in the cloud version record is greater than the cloud version number in the terminal version record, and the terminal version number in the cloud version record is equal to the terminal version number in the terminal version record; if not, the terminal basic service will add the modified data to the terminal database, the terminal consistency service will create a new terminal version record in the terminal version library, and make the newly created terminal version record consistent with the cloud version record, and the cloud basic service will prompt the cloud user data synchronization is successful.
[0070] When the fourth condition is met, the terminal basic service modifies the terminal database, the terminal consistency service updates the terminal version library, and makes the terminal version record corresponding to the modified data consistent with the cloud version record. The cloud basic service prompts the cloud user data synchronization success.
[0071] When the fourth condition is not met, the terminal consistency service determines whether the fifth condition is met; if so, the cloud basic service prompts that the cloud user data synchronization has failed; the fifth condition is that the cloud version number in the cloud version record is smaller than the cloud version number in the terminal version record; if not, the terminal consistency service determines whether the sixth condition is met; the sixth condition is that the cloud version number in the cloud version record is greater than the cloud version number in the terminal version record, and the terminal version number in the cloud version record is smaller than the terminal version number in the terminal version record.
[0072] When the sixth condition is met, the terminal consistency service will query the data priority in the terminal data set table and determine whether the cloud is prioritized based on the data priority; if so, the terminal basic service will modify the terminal database, the terminal consistency service will update the terminal version library, and make the terminal version record corresponding to the modified data consistent with the cloud version record, and the cloud basic service will prompt the cloud user data synchronization is successful; if not, the cloud basic service will prompt the cloud user data synchronization failure.
[0073] like Figure 7As shown, when a cloud user deletes data, the cloud basic service deletes the corresponding data from the cloud database, and the cloud consistency service searches the cloud version library for the corresponding cloud version record based on the ID of the deleted data; if so, the cloud consistency service adds 1 to the cloud version number in the cloud version record, keeps the terminal version number unchanged, and sends a data deletion request to the terminal consistency service; if not, the cloud consistency service creates a new cloud version record in the cloud version library, marks the cloud version number in the cloud version record as 1 and the terminal version number as 0, and sends a data deletion request to the terminal consistency service.
[0074] After receiving the request to delete data, the terminal consistency service will search the terminal version library for the corresponding terminal version record based on the ID of the deleted data; if so, the terminal consistency service will determine whether the fourth condition is met; if not, the cloud basic service will prompt the cloud user data synchronization failure.
[0075] When the fourth condition is met, the terminal basic service deletes the corresponding data from the terminal database, the terminal consistency service updates the terminal version library, and makes the terminal version record corresponding to the deleted data consistent with the cloud version record, and the cloud basic service prompts the cloud user data synchronization successful.
[0076] When the fourth condition is not met, the terminal consistency service determines whether the fifth condition is met; if so, the cloud basic service prompts the cloud user data synchronization failure; if not, the terminal consistency service determines whether the sixth condition is met.
[0077] When the sixth condition is met, the terminal consistency service will query the data priority in the terminal data set table and determine whether the cloud is prioritized based on the data priority; if so, the terminal basic service will delete the corresponding data from the terminal database, the terminal consistency service will update the terminal version library, and make the terminal version record corresponding to the deleted data consistent with the cloud version record, and the cloud basic service will prompt the cloud user data synchronization is successful; if not, the cloud basic service will prompt the cloud user data synchronization failure.
[0078] In addition, the data priority in the cloud dataset table and the terminal dataset table is the same.
[0079] In another exemplary embodiment, a computer system is provided. The computer system may be a server or a terminal, and its internal structure diagram may be as follows: Figure 8As shown. The computer system includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer system is used to provide computing and control capabilities. The memory of the computer system includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer system is used to exchange information between the processor and an external device. The communication interface of the computer system is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above-mentioned cinema data synchronization method is implemented.
[0080] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer system to which the solution of the present application is applied. The specific computer system may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0081] To summarize, in this application, when users operate (add, delete, modify) theater data on the terminal or cloud, they will operate the database accordingly. When the basic service of the cloud or terminal operates (add, delete, modify) a record in the database, the consistency service of the cloud or terminal will write the operation into the version library, that is, write the version of the record. The version library has a table number, which is defined in the data table and is the primary key of the data table. When the version library is written, it will request data synchronization from the consistency service of the cloud or terminal. The consistency service of the cloud or terminal will perform certain logical processing. When it is determined that there is no version conflict, it will request the basic service of the cloud or terminal to save, update, and delete the data. After completing the basic data update, the consistency service of the cloud or terminal will write the version into the version library and return the result to the requester of data synchronization. In addition, this application also has the following advantages:
[0082] (1) Uniqueness is determined by data ID, and duplicate data will not be generated.
[0083] (2) Data priority is accurate to the table level, meeting the requirements of different data priorities in the cloud and terminal.
[0084] (3) Data priority can be configured and changed at any time according to needs.
[0085] (4) Data consistency: New tables can be added at any time to meet the requirements of changing needs.
[0086] (5) The historical version library can track data version changes at any time.
[0087] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0088] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0089] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.
[0090] All actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0091] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0092] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A cinema data synchronization method, characterized in that: The theater data synchronization method includes: When a theater user adds new data, the terminal updates the terminal database and creates a new terminal version record in the terminal version library. After receiving the new data request sent by the terminal, the cloud updates the cloud database and creates a new cloud version record in the cloud version library that is consistent with the terminal version record. The terminal version record and the cloud version record both include the terminal version number and the cloud version number. The terminal version number in the newly created terminal version record is 1 and the cloud version number is 0. When a cinema user modifies data, the terminal updates the terminal database and determines whether there is a terminal version record corresponding to the modified data in the terminal version library. After the cloud receives the data modification request sent by the terminal, it successively determines whether there is a cloud version record corresponding to the modified data in the cloud version library, whether the terminal version record and the cloud version record meet the first condition, the second condition and the third condition, and updates the cloud database and the cloud version library according to different judgment results; wherein, when there is a terminal version record corresponding to the modified data in the terminal version library, the terminal increases the terminal version number in the terminal version record by 1, and the cloud version number remains unchanged; the first condition is that the terminal version number in the terminal version record is greater than the terminal version number in the cloud version record, and the cloud version number in the terminal version record is equal to the cloud version number in the cloud version record; the second condition is that the terminal version number in the terminal version record is less than the terminal version number in the cloud version record; the third condition is that the terminal version number in the terminal version record is greater than the terminal version number in the cloud version record, and the cloud version number in the terminal version record is less than the cloud version number in the cloud version record; When a cinema user deletes data, the terminal updates the terminal database and determines whether there is a terminal version record corresponding to the deleted data in the terminal version library. After the cloud receives the data deletion request sent by the terminal, it first determines whether there is a cloud version record corresponding to the deleted data in the cloud version library, whether the terminal version record and the cloud version record meet the first condition, the second condition and the third condition, and updates the cloud database and cloud version library according to different judgment results.
2. The theater data synchronization method according to claim 1, characterized in that: The terminal includes terminal basic services and terminal consistency services; the cloud includes cloud basic services and cloud consistency services.
3. The theater data synchronization method according to claim 2, characterized in that: When a theater user adds new data, the terminal updates the terminal database and creates a new terminal version record in the terminal version library. After receiving the new data request sent by the terminal, the cloud updates the cloud database and creates a new cloud version record in the cloud version library that is consistent with the terminal version record. Specifically, When a theater user adds new data, the terminal basic service requests the ID of the new data from the terminal consistency service. The terminal consistency service allocates the ID of the new data, and the terminal basic service saves the new data and the corresponding ID in the terminal database. The terminal basic service determines whether the newly added data has been successfully saved. If so, the terminal consistency service creates a new terminal version record in the terminal version library, marks the terminal version number in the terminal version record as 1 and the cloud version number as 0, and sends a new data request to the cloud consistency service. If not, the terminal basic service notifies the theater user that the newly added data has failed to be saved. After receiving the new data request, the cloud consistency service requests the cloud basic service to save the new data. The cloud basic service saves the new data to the cloud database. The cloud consistency service creates a new cloud version record in the cloud version library, marks the cloud version number in the cloud version record as 0 and the terminal version number as 1, and sends the processing result to the terminal consistency service. The terminal consistency service determines whether the data synchronization is successful based on the processing results; if so, the terminal basic service prompts the theater user that the data synchronization is successful; if not, the terminal basic service prompts the theater user that the data synchronization fails.
4. The theater data synchronization method according to claim 2, characterized in that: When a theater user modifies data, the terminal updates the terminal database and determines whether there is a terminal version record corresponding to the modified data in the terminal version library. After receiving the data modification request sent by the terminal, the cloud determines whether there is a cloud version record corresponding to the modified data in the cloud version library, and whether the terminal version record and the cloud version record meet the first, second, and third conditions. The cloud database and cloud version library are updated based on different judgment results, specifically including: When a theater user modifies data, the terminal basic service modifies the terminal database, and the terminal consistency service searches the terminal version library for a corresponding terminal version record based on the ID of the modified data. If so, the terminal consistency service increments the terminal version number in the terminal version record by 1, leaves the cloud version number unchanged, and sends a modification data request to the cloud consistency service. If not, the terminal consistency service creates a new terminal version record in the terminal version library, marks the terminal version number in the terminal version record as 1, marks the cloud version number as 0, and sends a modification data request to the cloud consistency service. After receiving the data modification request, the cloud consistency service will check whether there is a corresponding cloud version record in the cloud version library based on the ID of the modified data. If so, the cloud consistency service will determine whether the first condition is met. If not, the cloud basic service will add the modified data to the cloud database, and the cloud consistency service will create a new cloud version record in the cloud version library and make it consistent with the terminal version record. The terminal basic service will notify the theater user that the data synchronization is successful. When the first condition is met, the cloud basic service modifies the cloud database, the cloud consistency service updates the cloud version library, and makes the cloud version record corresponding to the modified data consistent with the terminal version record. The terminal basic service notifies the theater user that the data synchronization is successful; When the first condition is not met, the cloud consistency service determines whether the second condition is met; if so, the terminal basic service prompts the theater user that the data synchronization has failed; if not, the cloud consistency service determines whether the third condition is met; When the third condition is met, the cloud consistency service will query the data priority in the cloud dataset table and determine whether the terminal is prioritized based on the data priority; if so, the cloud basic service will modify the cloud database, the cloud consistency service will update the cloud version library, and make the cloud version record corresponding to the modified data consistent with the terminal version record, and the terminal basic service will prompt the theater user that the data synchronization is successful; if not, the terminal basic service will prompt the theater user that the data synchronization has failed.
5. The theater data synchronization method according to claim 2, characterized in that: When a theater user deletes data, the terminal updates the terminal database and determines whether there is a terminal version record corresponding to the deleted data in the terminal version library. After receiving the data deletion request sent by the terminal, the cloud determines whether there is a cloud version record corresponding to the deleted data in the cloud version library, and whether the terminal version record and the cloud version record meet the first, second, and third conditions. The cloud database and cloud version library are updated according to different judgment results, specifically including: When a theater user deletes data, the terminal basic service deletes the corresponding data from the terminal database. The terminal consistency service searches the terminal version library for the corresponding terminal version record based on the ID of the deleted data. If so, the terminal consistency service increments the terminal version number in the terminal version record by 1, leaves the cloud version number unchanged, and sends a data deletion request to the cloud consistency service. If not, the terminal consistency service creates a new terminal version record in the terminal version library, marks the terminal version number in the terminal version record as 1, marks the cloud version number as 0, and sends a data deletion request to the cloud consistency service. After receiving the data deletion request, the cloud consistency service will check whether the corresponding cloud version record exists in the cloud version library based on the ID of the deleted data. If so, the cloud consistency service will determine whether the first condition is met. If not, the terminal basic service will notify the theater user that the data synchronization has failed. When the first condition is met, the cloud basic service deletes the corresponding data from the cloud database, the cloud consistency service updates the cloud version library, and makes the cloud version record corresponding to the deleted data consistent with the terminal version record. The terminal basic service notifies the theater user that the data synchronization is successful; When the first condition is not met, the cloud consistency service determines whether the second condition is met; if so, the terminal basic service prompts the theater user that the data synchronization has failed; if not, the cloud consistency service determines whether the third condition is met; When the third condition is met, the cloud consistency service will query the data priority in the cloud dataset table and determine whether it is terminal priority based on the data priority; if so, the cloud basic service will delete the corresponding data from the cloud database, the cloud consistency service will update the cloud version library, and make the cloud version record corresponding to the deleted data consistent with the terminal version record, and the terminal basic service will prompt the theater user that the data synchronization is successful; if not, the terminal basic service will prompt the theater user that the data synchronization has failed.
6. The theater data synchronization method according to claim 2, characterized in that: The theater data synchronization method further includes: When a cloud user adds new data, the cloud basic service requests the ID of the new data from the cloud consistency service. The cloud consistency service assigns the ID of the new data, and the cloud basic service saves the new data and the corresponding ID in the cloud database. The cloud basic service determines whether the newly added data has been successfully saved. If so, the cloud consistency service creates a new cloud version record in the cloud version library, marks the cloud version number in the cloud version record as 1 and the terminal version number as 0, and sends a new data request to the terminal consistency service. If not, the cloud basic service notifies the cloud user that the newly added data has failed to be saved. After receiving the new data request, the terminal consistency service requests the terminal basic service to save the new data. The terminal basic service saves the new data to the terminal database. The terminal consistency service creates a new terminal version record in the terminal version library, marks the terminal version number in the terminal version record as 0 and the cloud version number as 1, and sends the processing result to the cloud consistency service. The cloud consistency service determines whether the data synchronization is successful based on the processing results; if so, the cloud basic service prompts the cloud user that the data synchronization is successful; if not, the cloud basic service prompts the cloud user that the data synchronization fails.
7. The theater data synchronization method according to claim 4, characterized in that: The theater data synchronization method further includes: When a cloud user modifies data, the cloud basic service modifies the cloud database. The cloud consistency service searches the cloud version library for a corresponding cloud version record based on the ID of the modified data. If so, the cloud consistency service increments the cloud version number in the cloud version record by 1, leaves the terminal version number unchanged, and sends a modification data request to the terminal consistency service. If not, the cloud consistency service creates a new cloud version record in the cloud version library, marks the cloud version number in the cloud version record as 1 and the terminal version number as 0, and sends a modification data request to the terminal consistency service. After receiving the request to modify data, the terminal consistency service will search the terminal version library for a corresponding terminal version record based on the ID of the modified data; if so, the terminal consistency service will determine whether the fourth condition is met; the fourth condition is that the cloud version number in the cloud version record is greater than the cloud version number in the terminal version record, and the terminal version number in the cloud version record is equal to the terminal version number in the terminal version record; if not, the terminal basic service will add the modified data to the terminal database, the terminal consistency service will create a new terminal version record in the terminal version library, and make the newly created terminal version record consistent with the cloud version record, and the cloud basic service will prompt the cloud user that the data synchronization is successful; When the fourth condition is met, the terminal basic service modifies the terminal database, the terminal consistency service updates the terminal version library, and makes the terminal version record corresponding to the modified data consistent with the cloud version record. The cloud basic service prompts the cloud user data synchronization success; When the fourth condition is not met, the terminal consistency service determines whether the fifth condition is met; if so, the cloud basic service prompts the cloud user data synchronization failure; the fifth condition is that the cloud version number in the cloud version record is less than the cloud version number in the terminal version record; if not, the terminal consistency service determines whether the sixth condition is met; the sixth condition is that the cloud version number in the cloud version record is greater than the cloud version number in the terminal version record, and the terminal version number in the cloud version record is less than the terminal version number in the terminal version record; When the sixth condition is met, the terminal consistency service will query the data priority in the terminal data set table and determine whether the cloud is prioritized based on the data priority; if so, the terminal basic service will modify the terminal database, the terminal consistency service will update the terminal version library, and make the terminal version record corresponding to the modified data consistent with the cloud version record, and the cloud basic service will prompt the cloud user data synchronization is successful; if not, the cloud basic service will prompt the cloud user data synchronization failure.
8. The theater data synchronization method according to claim 7, characterized in that: The theater data synchronization method further includes: When a cloud user deletes data, the cloud basic service deletes the corresponding data from the cloud database. The cloud consistency service searches the cloud version library for the corresponding cloud version record based on the ID of the deleted data. If so, the cloud consistency service increments the cloud version number in the cloud version record by 1, leaves the terminal version number unchanged, and sends a data deletion request to the terminal consistency service. If not, the cloud consistency service creates a new cloud version record in the cloud version library, marks the cloud version number in the cloud version record as 1 and the terminal version number as 0, and sends a data deletion request to the terminal consistency service. After receiving the request to delete data, the terminal consistency service will search the terminal version library for the corresponding terminal version record based on the ID of the deleted data. If so, the terminal consistency service will determine whether the fourth condition is met. If not, the cloud basic service will prompt the cloud user data synchronization failure. When the fourth condition is met, the terminal basic service deletes the corresponding data from the terminal database, the terminal consistency service updates the terminal version library, and makes the terminal version record corresponding to the deleted data consistent with the cloud version record. The cloud basic service prompts the cloud user that the data synchronization is successful; When the fourth condition is not met, the terminal consistency service determines whether the fifth condition is met; if so, the cloud basic service prompts the cloud user data synchronization failure; if not, the terminal consistency service determines whether the sixth condition is met; When the sixth condition is met, the terminal consistency service will query the data priority in the terminal data set table and determine whether the cloud is prioritized based on the data priority; if so, the terminal basic service will delete the corresponding data from the terminal database, the terminal consistency service will update the terminal version library, and make the terminal version record corresponding to the deleted data consistent with the cloud version record, and the cloud basic service will prompt the cloud user data synchronization is successful; if not, the cloud basic service will prompt the cloud user data synchronization failure.
9. The theater data synchronization method according to claim 8, characterized in that: The data priority in the cloud dataset table and the terminal dataset table is the same.
10. A computer system comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the cinema data synchronization method according to any one of claims 1 to 9.