Data synchronization method
By identifying data identification on the SIM card and using preset data structures to be simulated, the problem of limited flexibility in data synchronization between different business platforms or systems is solved, and an efficient data synchronization process is realized, which improves data synchronization. Flexibility and efficiency.
Patent Information
- Application Number
- CN202411077601.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-06
AI Technical Summary
The flexibility of data synchronization between different business platforms or systems is limited, resulting in inconvenient data synchronization process.
By identifying the data identifier on the SIM card and storing the data to be synchronized according to the preset data structure, and using different data structure formats (first data structure and second data structure) for storage and segmentation, ensuring that the data can be used during the synchronization process Flexible matching and processing to improve the efficiency and flexibility of data synchronization.
It realizes data synchronization between different business platforms or systems, improves the flexibility and efficiency of data synchronization, reduces the repeated acquisition and transmission processes, and ensures the accuracy and completeness of data.
Smart Images

Figure CN119052262A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and in particular, relates to a method for data synchronization. Background Art
[0002] With the popularity of mobile terminals and the development of social software, the data generated by users on mobile terminals is also increasing. Since the storage space of mobile terminals is limited, users can synchronize relevant important data to the cloud server through synchronization software to ensure that important data is not lost.
[0003] However, since different synchronization software can use different synchronization protocols or technologies, the flexibility of data synchronization between different business platforms or systems is limited. Therefore, how to improve the flexibility of data synchronization between different business platforms or systems is a technical problem that needs to be solved urgently by relevant technicians. Summary of the invention
[0004] An embodiment of the present application provides a method for data synchronization, which can improve the flexibility of data synchronization.
[0005] In a first aspect, an embodiment of the present application provides a method for data synchronization, which is applied to a user identifying a SIM card, and the method includes: receiving data to be synchronized sent by a service platform; storing the data to be synchronized according to a preset data structure; and sending data of a preset data structure to a cloud server, so that the cloud server can synchronize data based on the data of the preset data structure.
[0006] In one embodiment, the data to be synchronized also includes a data identifier; the preset data structure includes a first data structure and a second data structure; before storing the data to be synchronized according to the preset data structure, the method also includes: matching the data identifier with a data identifier in a list pre-stored in the SIM card; storing data according to the preset data structure includes: when it is determined that the data identifier matches the data identifier in the list, storing the data to be synchronized according to the first data structure; when it is determined that the data identifier does not match the data identifier in the list, storing the data to be synchronized according to the second data structure.
[0007] In one embodiment, the format of the second data structure includes second index information, a second hash value, and a second target data segment; when it is determined that the data identifier does not match the data identifier in the list, the data to be synchronized is stored according to the second data structure, including: dividing the data according to a first preset step size to obtain a plurality of second target data segments; respectively determining the second index information of each second target data segment and the second hash value corresponding to each second target data segment; storing the second target data segment, the second hash value, and the second index information.
[0008] In one embodiment, the format of the first data structure includes first index information, a first hash value and a first target data segment; when it is determined that the data identifier matches the data identifier in the list, the data to be synchronized is stored according to the first data structure, including: when it is determined that the data identifier matches the data identifier in the list, obtaining the historical storage data corresponding to the data identifier; determining the offset information between the data to be synchronized and the historical storage data; based on the offset information, dividing the data to be synchronized into a number of first target data segments, and determining the first index information and the first hash value corresponding to each first target data segment, the first index information including the starting index information and the ending index information; when it is determined that the data segment does not meet the first preset condition, storing the first target data segment, the starting index information, the ending index information and the first hash value.
[0009] In one embodiment, determining the offset information between the data to be synchronized and the historically stored data includes: determining the first offset information between the data to be synchronized and the historically stored data; dividing the data to be synchronized according to a second preset step size to obtain a plurality of third target data segments; respectively determining one or more offset information corresponding to each third target data segment; accumulating the offset information corresponding to each third target data segment to obtain second offset information; when the first offset information is equal to the second offset information, determining the target offset information corresponding to each third target data segment; when the third target data segment corresponding to the target offset information satisfies a second preset condition, using the target offset information as the offset information between the data to be synchronized and the historically stored data.
[0010] In one embodiment, the first preset condition includes at least one of the following: the data length corresponding to the data segment is the same as the data length corresponding to the historically stored data; or the hash value of the data segment is the same as the hash value of the historically stored data; or the starting index information of the data segment is the same as the index information of the historically stored data.
[0011] In one implementation, the method further includes: when it is determined that the data identifier does not match the data identifier in the list, storing the data identifier in the list.
[0012] In one implementation, before receiving the data to be synchronized sent by the service platform, the method further includes: receiving target data parameters corresponding to the data to be synchronized sent by the service platform; and receiving the data to be synchronized sent by the service platform when the target data parameters meet the SIM card data synchronization requirement information.
[0013] In one implementation, the target data parameters include the data volume of the data to be synchronized and an application identifier; when the target data parameters meet the SIM card data synchronization requirement information, before receiving the data to be synchronized sent by the service platform, the method also includes: determining the target application based on the application identifier; calculating the size of the available space on the SIM card using the target application; and when it is determined that the data volume of the data to be synchronized is less than or equal to the size of the available space on the SIM card, determining that the target data parameters meet the SIM card data synchronization requirement information.
[0014] In a second aspect, an embodiment of the present application provides a method for data synchronization, which is applied to a cloud server, and the method includes: receiving data of a preset data structure sent by a SIM card; and performing data synchronization based on the data of the preset data structure.
[0015] In a third aspect, an embodiment of the present application provides a data synchronization device, the device comprising:
[0016] A first receiving module, used for receiving data to be synchronized sent by the service platform;
[0017] A storage module, used for storing data to be synchronized according to a preset data structure;
[0018] The sending module is used to send data of a preset data structure to the cloud server, so that the cloud server can synchronize data based on the data of the preset data structure.
[0019] In a fourth aspect, an embodiment of the present application provides a data synchronization device, the device comprising:
[0020] A second receiving module, used for receiving data of a preset data structure sent by the SIM card;
[0021] The synchronization module is used to synchronize data based on a preset data structure.
[0022] In the fifth aspect, an embodiment of the present application provides a data synchronization device, the device comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the method for data synchronization in the first aspect or any one of the embodiments of the first aspect is implemented, or the method for data synchronization in the second aspect or any one of the embodiments of the second aspect is implemented.
[0023] In the sixth aspect, a computer-readable storage medium having computer program instructions stored thereon, wherein when the computer program instructions are executed by a processor, the method for data synchronization in the first aspect or any one of the embodiments of the first aspect is implemented, or the method for data synchronization in the second aspect or any one of the embodiments of the second aspect is implemented.
[0024] In the seventh aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a method for data synchronization such as the first aspect or any one of the embodiments of the first aspect, or implements a method for data synchronization in the second aspect or any one of the embodiments of the second aspect.
[0025] The data synchronization method of the embodiment of the present application stores the received data to be synchronized in the SIM card according to the preset data structure, and forwards it to the cloud server, so that the SIM card can be used as a transfer station for data synchronization, realizing data synchronization of different business platforms or systems. It provides a new solution for data synchronization of different business platforms or systems, and improves the flexibility of data synchronization. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0027] Figure 1 A schematic diagram of a data synchronization method provided by an embodiment of the present application is shown;
[0028] Figure 2 A schematic diagram showing an offset state diagram of each segment in the data to be synchronized provided by an embodiment of the present application is shown;
[0029] Figure 3 A schematic diagram showing a flow chart of another data synchronization method provided by an embodiment of the present application;
[0030] Figure 4 is a structural diagram of a data synchronization device provided by another embodiment of the present application;
[0031] Figure 5 is a structural diagram of a data synchronization device provided by another embodiment of the present application;
[0032] Figure 6 It is a structural diagram of a data synchronization device provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0033] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0034] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0035] With the popularity of mobile terminals and the development of social software, the data generated by users on mobile terminals is also increasing. Due to the limited storage space of mobile terminals, users can synchronize relevant important data to the cloud server through synchronization software. In related technologies, when synchronizing data, the synchronization software can use extended protocols such as FTPS (FileTransfer Protocol Secure) or secure protocols such as SFTP (Secure File Transfer Protocol) to transfer the data to be synchronized from the client to the cloud server. In addition, encryption protocols such as Secure Sockets Layer (SSL) and Transport Layer Security (TLS) can be used to protect the confidentiality and integrity of data during data transmission.
[0036] Furthermore, it is understandable that since different synchronization software may use different synchronization protocols or technologies, the flexibility of data synchronization between different business platforms or systems is limited. Therefore, how to improve the flexibility of data synchronization between different business platforms or systems is a technical problem that needs to be solved urgently by relevant technicians.
[0037] In order to solve the problems in the prior art, the embodiment of the present application provides a method for data synchronization. The method for data synchronization provided by the embodiment of the present application is introduced below.
[0038] Figure 1 FIG. 1 is a flow chart of a data synchronization method provided by an embodiment of the present application. Figure 1 As shown, the data synchronization method includes the following steps:
[0039] S110, the SIM card receives data to be synchronized sent by the service platform.
[0040] S120: The SIM card stores the data to be synchronized according to a preset data structure.
[0041] S130, the SIM card sends data in a preset data structure to the cloud server.
[0042] S140, the cloud server receives data of a preset data structure sent by the SIM card, and performs data synchronization based on the data of the preset data structure.
[0043] In some embodiments, in S110, before the SIM card receives the data to be synchronized sent by the service platform, the SIM card may first establish a data transmission channel with the service platform, so that the data to be synchronized can be transmitted through the data channel.
[0044] Exemplarily, before the service platform sends the data to be synchronized to the SIM card, it may first establish a BIP (Bearer Independent Protocol) transmission channel with the SIM card. The BIP channel establishment process between the service platform and the SIM card may include the following steps: the service platform initiates a BIP connection establishment request to the BIP gateway platform, wherein the connection establishment request may include user identity information and other information. The BIP gateway platform queries whether the service platform has the BIP link establishment authority. The BIP gateway platform responds to the BIP link establishment request to the service platform. The BIP gateway platform generates a BIP link establishment data SMS and sends the BIP link establishment data SMS to the mobile equipment (Mobile Equipment, ME). The ME sends a PP-Download instruction to the SIM card end, and the SIM card uses the key to parse the link establishment data SMS. The SIM card sends a Send-SMS instruction to the ME, and the ME sends a BIP link establishment SMS response to the BIP gateway platform. The SIM card sends an OPEN-CHANNEL instruction to the ME to open the BIP channel between the ME and the BIP gateway platform. A TCP connection and a TLS handshake are established between the ME and the BIP gateway platform. The SIM card sends an HTTP Request to the BIP gateway platform. After receiving the request, the BIP gateway platform sends a BIP connection notification to the business platform.
[0045] In the embodiment of the present application, the SIM card can receive the data to be synchronized sent by the service platform through the data transmission channel. The data to be synchronized can be file data. It can be understood that the specific content of the data to be synchronized that needs to be synchronized is limited in the embodiment of the present application.
[0046] Further, in some embodiments, in S120, after the SIM receives the data to be synchronized sent by the service platform, the SIM may store the data to be synchronized according to a preset data structure.
[0047] In the embodiment of the present application, the preset data structure may include the data structure and data content of the data to be synchronized. The preset data structure may include one or more data structures. Moreover, different types of data to be synchronized may be stored in different data structures.
[0048] In an embodiment of the present application, the data to be synchronized may include a data identifier, wherein the data identifier may be used to indicate the identity information of the data to be synchronized. In one example, when the data to be synchronized is file data, the identifier of the file data may be represented by a file identifier (File Identity Document, FID).
[0049] In one example, the business platform sends the application processing instructions of the data to be synchronized and the FID to the BIP gateway platform in the form of a BIP connection notification response. The BIP gateway platform generates the corresponding Hypertext Transfer Protocol Secure (HTTPS) format data and sends an HTTP response to the SIM card side. The SIM card side uses a key, such as SCP81, to parse the application processing instructions and send the application processing data instructions to the Supplementary Security Domain (SSD) of the corresponding card application. The auxiliary security domain SSD interacts with the data synchronization Applet through the corresponding instructions. The data synchronization Applet stores the synchronized data in an independent storage space and returns the instruction execution result to the SSD. Further, the SSD encapsulates the instruction execution result as an HTTP Request and sends it to the BIP gateway platform. The BIP gateway platform sends the execution result response to the business platform. If the business platform data transmission synchronization is not completed, repeat the above process; if the business platform data transmission synchronization is completed, send a BIP channel closing request to the BIP gateway platform, and the BIP gateway platform closes the HTTPS connection to the SIM card side. The SIM card sends a channel closing command (CLOSE CHANNEL) to the ME, and the ME closes the TCP connection to the BIP gateway platform.
[0050] In the embodiment of the present application, before the SIM card stores data according to different preset data structures, the data identifiers in the received data to be synchronized can be matched with the data identifiers in the list pre-stored in the SIM card to determine the type of the data to be synchronized.
[0051] In one example, the SIM card can match the data identifier with the data identifier in the list pre-stored in the SIM card by traversing the list. In one example, the list can be a file list (FID LIST) pre-stored in the SIM card, and the type of data to be synchronized can be determined by judging whether the FID is in the FID LIST.
[0052] In the embodiment of the present application, the data type to be synchronized may include the initial synchronization type and the non-initial synchronization type. Among them, the data to be synchronized of the non-initial synchronization type may be secondary synchronization data, or may also be multiple synchronization data. It is understandable that the data to be synchronized of the non-initial type may be a correction or update of the synchronized data.
[0053] In the embodiment of the present application, when the data identifier of the data to be synchronized matches the data identifier in the list of the SIM card, it can be determined that the data type to be synchronized is a non-initial synchronization type. When the data identifier of the data to be synchronized does not match the data identifier in the list of the SIM card, it can be determined that the data type to be synchronized is an initial synchronization type.
[0054] In the embodiment of the present application, for different types of data to be synchronized, the SIM card can use different formats to store the data to be synchronized. In one example, in the embodiment of the present application, a redundant data caching mechanism (RDCM) can be used to store the data to be synchronized sent by the business platform according to the corresponding data format, so that there is no need to repeatedly obtain data from the cloud server in the future, avoiding the process of repeated acquisition and improving convenience.
[0055] In the embodiment of the present application, when it is determined that the data identifier matches the data identifier in the list, the SIM card may store the data according to the first data structure.
[0056] In the embodiment of the present application, if the data identifier matches the data identifier in the list, it can be determined that there is a data identifier to be synchronized in the data list, that is, the data to be synchronized is not the initial type of data to be synchronized. At this time, the SIM card can store the data to be synchronized according to the first data structure.
[0057] In an embodiment of the present application, the format of the first data structure may include a first target data segment of the data to be synchronized, first index information, and a first hash value. It can be understood that the first target data segment may be one or more data segments in the data to be synchronized, and the one or more data segments may be data segments corresponding to data that are different from those stored historically. The first index information may be used to indicate that the first target data segment is located at the location of the data to be synchronized. The first hash value may be used as an identifier to characterize the first target data, so as to determine whether one or more data segments in the data to be synchronized can be used as the first target data.
[0058] In an embodiment of the present application, when it is determined that the data identifier matches the data identifier in the list, the data to be synchronized can be stored through the following steps: when it is determined that the data identifier matches the data identifier in the data list, the historical storage data corresponding to the data identifier is obtained; the offset information between the data corresponding to the data to be synchronized and the historical storage data is determined; based on the offset information, the data corresponding to the data to be synchronized is divided into a number of first target data segments, for example, it can be p first target data segments, where p is an integer, and the first index information and the first hash value corresponding to each first target data segment are determined, and the first index information includes the starting index information and the ending index information; when it is determined that the data segment does not meet the preset conditions, the first target data segment, the starting index information, the ending index information and the first hash value are stored.
[0059] In the embodiment of the present application, when it is determined that the data identifier matches the data identifier in the list, the SIM card can obtain the historical storage data corresponding to the data identifier from the storage space according to the data identifier. The historical storage data can be the data stored in the SIM card before obtaining the data to be synchronized.
[0060] In the embodiment of the present application, the SIM card can compare the data to be synchronized with the historically stored data to determine the offset between the data to be synchronized and the historically stored data. The offset can be used to indicate the offset state of the data to be synchronized and the data in the historically stored data, that is, it can be understood that when determining the offset between the data to be synchronized and the historically stored data, it is not necessary to pay attention to the actual data of the data to be synchronized and the historically stored data, but only to pay attention to the data change position relationship between the data to be synchronized and the historically stored data.
[0061] In an embodiment of the present application, the offset between the data to be synchronized and the historically stored data can be determined to determine how to segment the data to be synchronized. Specifically, the data to be synchronized can be pre-segmented to obtain multiple data segments of the data to be synchronized, and the offset corresponding to each data segment can be determined to determine the offset of the data to be synchronized, and the first target data segment after the data to be synchronized is segmented can be determined based on the offset, and the first index information of each first target data segment and the first hash value corresponding to each first target data segment can be determined.
[0062] In an embodiment of the present application, the offset information between the data to be synchronized and the historically stored data can be determined in the following manner: determine the first offset information between the data to be synchronized and the historically stored data. The first offset information may be the difference between the amount of data corresponding to the data to be synchronized and the amount of data corresponding to the historically stored data. The data to be synchronized is divided according to the second preset step length to obtain a plurality of third target data segments. The second preset step length may be consistent with the first preset step length, or the second step length may be set by a technician. Further, one or more offset information corresponding to each third target data segment is determined respectively, and the offset information corresponding to each third target data segment is accumulated to obtain the second offset information. When the first offset information is equal to the second offset information, the target offset information corresponding to each third target data segment is determined; when the third target data segment corresponding to the target offset information satisfies the second preset condition, the target offset information is used as the offset information between the data to be synchronized and the historically stored data.
[0063] In an example, if the length of the data to be synchronized Y is n', the length of the historical data X is n, and the total offset z in the data to be synchronized Y is n'-n, the number of insertions is θ1, the number of deletions is θ2, and z = θ1-θ2 = n'-n. The data to be synchronized Y is divided into p segments, where the data to be synchronized Y can be divided equally or unevenly. Establish a state diagram that describes all possible offset states in p segments, such as Figure 2 As shown, Figure 2 A schematic diagram of an offset state diagram of each segment in the data to be synchronized provided by an embodiment of the present application is shown. Figure 2 It can be used to estimate the number of inserted or deleted data in each segment of the data to be synchronized Y. Figure 2 In the example, rows and columns can represent the fragments of the data to be synchronized and the offset status of each fragment, respectively. The variable σ i,j represents the offset state of the i-th row and j-th column. Each edge μ in the state diagram i,α→β (σ i-1,α , σ i,β ) indicates that the offset of the i-th segment is (β-α). Figure 2As shown, the offset of the first segment is -m, the offset of the second segment is 0, and the offset of the pth segment is m.
[0064] Furthermore, a dynamic programming algorithm can be used to Figure 2 In the state diagram shown, all paths whose total offset is z are determined by the following formula (1):
[0065]
[0066] Among them, ε i =(β-α),α,β∈μ i,α→β , and it can be understood that the offset vector of each path offset can be represented by ε, and ε=(ε1, ε2, ε3, ..., ε p ).
[0067] Furthermore, the segmentation method that best matches the historical storage data can be determined by the Longest Common Subsequence (LCS) algorithm. That is, the segment offset vector with the longest common subsequence can be selected, denoted as ε max =(ε1,ε2,ε3,...,ε p ). In this segmentation mode, the p segments of the data to be synchronized Y are most matched with the historical data X, and the smallest difference sequence can be obtained. In one example, the most suitable segmentation process of the data to be synchronized by the LCS algorithm may include the following steps: first, determine the traversal offset, each segment of the data to be synchronized, and the segment of the historical data. Use the LCS algorithm to calculate X i The longest common subsequence with Yi, denoted as dp i [], record the matching sequence of historical data X and data to be synchronized Y as dp(dp1[], dp2[], ..., dp p []). Further, find the longest matching sequence with historical data X, denoted as dp max (dp1[], dp2[], ..., dp p []), the corresponding segment offset vector is denoted as ε max =(ε1,ε2,ε3,...,ε p ). According to the offset vector ε=(ε1,ε2,ε3,...,ε p ) Divide Y into p segments Y1, Y2, ..., Y p , where each segment of data to be synchronized Y can be expressed by the following formula (2):
[0068]
[0069] Among them, Y jcan represent the jth segment of the data Y to be synchronized; k can represent the amount of data in each segment, that is, formula (2) can be understood as, the starting position of the jth segment is (j-1)k+ε j-1 , the end bit is jk+ε j In this way, the starting index information index of each fragment can be marked i is (j-1)k+ε j-1 ; End index information index i+1 is jk+ε j .
[0070] In the embodiment of the present application, the first hash value corresponding to each first target data segment can be determined through a hash function.
[0071] In an embodiment of the present application, after obtaining the starting index information, ending index information and first hash value corresponding to each first target data segment in the data to be synchronized, the SIM card can determine whether the first target data segment meets the first preset condition by obtaining the starting index information, ending index information and the first hash value. If the first target data segment does not meet the first preset condition, the first target data segment, the starting index information, the ending index information and the first hash value are stored.
[0072] The first preset condition can be used to determine whether the first target data segment matches the data segment corresponding to the historical data. The first preset condition can include any one of the following: the data length corresponding to the data segment is the same as the data length corresponding to the historical stored data; or the hash value of the data segment is the same as the hash value of the historical stored data; or the starting index information of the data segment is the same as the index information of the historical stored data. In an example, the historical data can be divided into p segments, each segment is q in length, and each data segment is denoted by X. i Among them, X i Including X1, X2, ..., X p For each X i , build the basic structure of the message M i =(S i , H i ), where S i is the starting index of the i-th sequence, H i is the hash value of the i-th data segment. If the SIM card determines the index information S of the data segment of the historical data i Not equal to index i , or S i+1 Not equal to index i+1 , then the first target data segment Y i The data segment of the first target data segment does not match the data segment of the historical data, that is, the first target data segment is an unsynchronized data segment. In another example, if Y iThe length of q is , and the SIM card data synchronization applet calculates Y i The hash value H′ i and compare it with X i The hash value H i Compare, if H′ i Not equal to H i , then the first target data segment Y i Data segment X with historical data i does not match, that is, the first target data segment is an unsynchronized data segment. In another example, if Y i The length of the first target data segment Y is not equal to q, then i Data segment X with historical data i Mismatch, that is, the first target data segment is an unsynchronized data segment.
[0073] In the embodiment of the present application, when it is determined that the first target data segment does not meet the first preset condition, the first target data segment, the start index information, the end index information and the first hash value are stored. In one example, for the unsynchronized first target data segment, the SIM card constructs a synchronization message E i =(index i , index i+1 , Y i , H′ i ), construct message E for the synchronized data segment i =(S i ); and set the data synchronization format to data type=1, and the data synchronization content to data content=E.
[0074] In an embodiment of the present application, by obtaining the historical storage data of the data to be synchronized, and by obtaining the offset information between the data to be synchronized and the historical storage data, the data to be synchronized can be divided into parts that are consistent with the historical storage data to the greatest extent, thereby obtaining the difference data segments between the data to be synchronized and the historical storage data, and storing the data to be synchronized in a first data format according to the starting index information, the ending index information, and the first hash value.
[0075] In the embodiment of the present application, the segmentation of the longest common subsequence is predicted by using offset information, thereby replacing the fixed-length segmentation algorithm in conventional data synchronization, and dividing the data to be synchronized into data segments that match the historical stored data as much as possible, greatly reducing the difference data transmitted and improving the speed of synchronous transmission. In addition, the SIM card end can locate the difference data segment through the check value of the data segment, that is, the hash value, instead of rolling and calculating the check value of the data segment to be synchronized byte by byte, thereby optimizing the efficiency of the synchronization optimization processing of the SIM card.
[0076] In the embodiment of the present application, when it is determined that the data identifier does not match the data identifier in the list, the SIM card may store the data according to the second data structure and store the data identifier in the list.
[0077] In the embodiment of the present application, if the data identifier does not match the data identifier in the list, it can be determined that the data identifier of the data to be synchronized does not exist in the data list, that is, the data to be synchronized is the initial type of data to be synchronized.
[0078] In an embodiment of the present application, the format of the second data structure may include second index information, a second hash value, and a second target data segment. It is understood that the second target data segment may be one or more data segments in the data to be synchronized. The second index information may be used to indicate that the second target data segment is located at the position of the data to be synchronized. The second hash value may be used as an identifier to characterize the second target data, and it is understood that different second target data segments correspond to different second hash values.
[0079] In an embodiment of the present application, when it is determined that the data identifier does not match the data identifier in the list, the data to be synchronized can be stored by the following steps: the data is divided according to the first preset step length to obtain n second target data segments. The length of the first preset step length can be q. The second index information of each second target data segment and the second hash value corresponding to each second target data segment are determined respectively. The second target data segment, the second hash value and the second index information are stored. In one example, the SIM card can divide the data K to be synchronized with a length of f into n second target data segments (K1, K2, ..., K n ), each segment is of length q, satisfying f = pq, for each K i , build the basic structure of the message M i =(S i , H i ), where S i is the starting index of the i-th sequence, H i is the hash value of the i-th fragment. For each K i Add index content (FID, M). FID is the data identifier; M is the basic structure M i The SIM card sets the data synchronization format data type=0, and the data synchronization content data content=K.
[0080] In the embodiment of the present application, the SIM card may store data identifiers that do not match the data identifiers in the data list in the data list in the SIM card.
[0081] In an embodiment of the present application, the data segment of the data to be synchronized is stored in a second data format according to the second index information and the second hash value, so that in the subsequent process, there is no need to obtain the corresponding data from the server, which improves the data synchronization efficiency and can also reduce problems such as data loss and errors during the interaction process.
[0082] In the embodiment of the present application, the data type of the data to be synchronized is determined by matching the data identifier of the data to be synchronized with the list in the SIM card. After determining the different types of data, the data to be synchronized is stored according to the corresponding data structure, so that the data to be synchronized can be analyzed and processed on the SIM side, and the SIM card side can flexibly access multiple business platforms, providing a synchronization data transfer station with good compatibility and scalability for the business platform.
[0083] In the embodiment of the present application, after storing the data in different data structures, the SIM card can send data in different data structures to the cloud server.
[0084] In some embodiments, in S130, the SIM card may send data of a preset data structure to the cloud server, and the preset data structure includes a first data structure and a second data structure. It is understandable that before the SIM card sends data to the cloud server, a data transmission channel between the SIM card and the cloud server needs to be established. Among them, the data transmission channel between the SIM card and the cloud server may be a BIP transmission channel. In one example, the process of establishing a BIP data channel between the SIM card and the cloud server may include the following steps: First, the SIM card sends a data synchronization response to the service platform, and after receiving the response, the service platform notifies the cloud server to initiate a BIP link establishment request to the SIM card end. The cloud server initiates a BIP link establishment request to the BIP gateway; the BIP gateway platform initiates an SMS data message to the ME, including a BIP link establishment request; the ME sends a PP-Download instruction to the SIM card data synchronization Applet; the SIM card data synchronization Applet parses the SMS data message and interacts with the SSD through corresponding instructions, including the ConnectionServer.createSCP81Connection() instruction and the SCP81Connection.open() instruction; the SSD sends an OPEN-CHANNEL instruction to the ME to open the BIP transmission channel from the SIM card to the ME; a TCP connection is established between the ME and the BIP gateway platform; the SSD and the BIP gateway platform complete a TLS handshake; the SIM card data synchronization Applet interacts with the SSD through the eventObserved() instruction and the SCP81Connection.sendData() instruction; the SSD sends an HTTPS Request (carrying a task identifier) to the BIP gateway platform. Further, the BIP gateway platform sends a BIP link establishment request response to the cloud server, and the BIP transmission channel between the BIP gateway platform and the SIM card is established. Furthermore, the cloud server sends application processing data instructions to the SIM card side through the BIP gateway platform, realizing encrypted transmission of data from the SIM card side to the synchronization server.In one example, the cloud server sends the application processing instruction to the BIP gateway platform in the form of a BIP connection notification response, and the BIP gateway platform generates the corresponding HTTPS format data and sends an HTTP Response to the SIM card side; the SSD on the SIM card side uses the SCP81 key to parse the application instruction; the SSD on the SIM card side and the data synchronization Applet realize the transmission of synchronization data (including parameters such as data type and data content) through instructions such as eventObserved(DataReceived), DataReceived.copyReceivedData(), and SCP81Connection.sendData(); the SIM card side encapsulates the synchronization data as an HTTPS Request and sends it to the BIP gateway platform, which transmits it to the cloud server; the cloud server receives the synchronization data and determines whether it has been received. If not, the above steps are repeated; otherwise, the cloud server sends a BIP channel closing instruction to the BIP gateway platform, and the BIP gateway platform closes the HTTPS connection with the SIM card side; the SIM card side sends a CLOSECHANNEL instruction to close the BIP channel between it and the ME; and the TCP connection between the ME and the BIP gateway platform is closed.
[0085] In the embodiment of the present application, the communication between the SIM card and the cloud server or the service platform has good stability and security. That is, it can be understood that the data transmission channel established by the SIM card and the cloud server and the service platform has high stability. Therefore, it can be ensured that during the data synchronization process, the three parties among the service platform, the SIM card and the cloud server can transmit data in a relatively stable manner. Thus, the stability of data synchronization can be guaranteed.
[0086] In some embodiments, in S140, the cloud server may receive data of a preset data structure sent by the SIM card, and perform data synchronization based on the data of the preset data structure.
[0087] In an embodiment of the present application, when the cloud server determines that the data structure of the data is the first structure, it can determine that the data to be synchronized is a non-initial type of data to be synchronized; when the cloud server determines that the data structure of the data to be synchronized is the second structure, it can determine that the data to be synchronized is the initial type of data to be synchronized.
[0088] In the embodiment of the present application, the cloud server can synchronize the data to be synchronized based on different data types.
[0089] In one example, the cloud server can determine whether the data to be synchronized is the data of the initial synchronization type based on the data type. If the data to be synchronized is determined to be the data of the initial synchronization type, the data data content = K is stored in the server data system, and the data ID is updated to the list. If the data to be synchronized is determined to be the data of the non-initial synchronization type, the corresponding old version data can be found in the cloud server data system based on the data ID to be synchronized, and recorded as data Z. And determine the data content = E in the data i The element length of (1≤i≤v) is E_i.length. If E i .length=1, then Z i Already synchronized, determine the next data segment; if E i .length=4, then Z i Not synchronized, the cloud server locates the index corresponding to data Z i , index i+1 Position, insert data segment Y i .
[0090] In the embodiment of the present application, it can be understood that the SIM card is used as an intermediate carrier for data synchronization, and data can be synchronized to the cloud server without installing additional application software, saving storage space of the mobile terminal. In addition, different types of data, including initial synchronization data and non-initial synchronization data, are stored in different data structures, that is, it can be understood that the present application can synchronize data for analysis and optimization processing, thereby improving the efficiency and stability of data transmission and reducing losses and errors during data transmission.
[0091] Furthermore, in the embodiment of the present application, before receiving the data to be synchronized sent by the service platform, the SIM card can determine whether it meets the data synchronization requirements.
[0092] In order to ensure that the SIM card can receive the data to be synchronized, as another implementation method of the present application, the present application also provides another implementation method of data synchronization, please refer to the following embodiments for details.
[0093] Figure 3 FIG. 2 is a flow chart of another data synchronization method provided by an embodiment of the present application. Figure 3 As shown, before receiving the data to be synchronized sent by the business platform, the data synchronization method further includes the following steps:
[0094] S150, the SIM card receives target data parameters corresponding to the data to be synchronized sent by the service platform.
[0095] In the embodiment of the present application, the target data parameter may include data volume information corresponding to the data to be synchronized, for example, the data size of the data to be synchronized.
[0096] In the embodiment of the present application, the target data parameter may also include an application identifier corresponding to the applet application. The application identifier (Applet Identity Document, AID) may be used to represent the identity information corresponding to the applet application in the SIM card. It is understood that there may be one or more Applets in the SIM card, and each Applet may perform different functions.
[0097] In the embodiment of the present application, the SIM card can receive the target data parameters corresponding to the data to be synchronized sent by the service platform through the data transmission channel established with the service platform. It can be understood that after the service platform and the SIM establish a BIP channel, the service platform can send the target data parameters corresponding to the data to be synchronized to the SIM card. Among them, the target data parameters can enable the SIM to determine whether it can receive the data to be synchronized.
[0098] S160, when the target data parameter meets the SIM card data synchronization requirement information, receive the data to be synchronized sent by the service platform. In the embodiment of the present application, the SIM can call the corresponding Applet according to the application identifier in the target data parameter, for example, it can be a data synchronization Applet, and the data synchronization Applet queries the size of the available space on the SIM card. And according to the amount of data in the target data parameter and the size of the available space on the SIM card, it is determined whether the SIM card meets the data synchronization requirement information, that is, whether there is enough space in the SIM card to store the information to be synchronized.
[0099] In one example, the service platform can encapsulate the application identifier corresponding to the SIM card Applet for data synchronization, as well as information such as the data size of the data to be synchronized, into an Application Protocol Data Unit (APDU) instruction and send it to the SIM card end through the BIP channel. The SIM card selects the data synchronization applet according to the AID. The SIM card end sends the APDU instruction to the data synchronization applet, and the data synchronization applet parses the APDU instruction, queries the size of the available space on the SIM card, and determines whether the size of the available space on the SIM card meets the requirements of this data synchronization transmission.
[0100] In the embodiment of the present application, when the target data parameter meets the SIM card data synchronization requirement information, the SIM card receives the data to be synchronized sent by the service platform. That is, when there is enough space in the SIM card, the SIM card can receive the data to be synchronized sent by the service platform.
[0101] In the embodiment of the present application, the SIM card determines whether it meets the data synchronization requirements through the target data parameters, thereby ensuring that the data to be synchronized can be transmitted when the SIM card meets the data synchronization requirements, ensuring the integrity of the data to be synchronized during transmission.
[0102] Based on the data synchronization method provided in the above embodiment, the present application also provides a specific implementation of a data synchronization device. Please refer to the following embodiment.
[0103] See first Figure 4 , Figure 4 4 is a schematic diagram of the structure of a file synchronization device provided by another embodiment of the present application. The file synchronization device 400 provided by the embodiment of the present application includes the following units:
[0104] The first receiving module 401 is used to receive data to be synchronized sent by the service platform.
[0105] The storage module 402 is used to store data according to a preset data structure.
[0106] The sending module 403 is used to send data of a preset data structure to the cloud server, so that the cloud server can perform data synchronization based on the data of the preset data structure.
[0107] In one embodiment, the data to be synchronized also includes a data identifier; the preset data structure includes a first data structure and a second data structure; before storing the data according to the preset data structure, the storage module 402 is also used to: match the data identifier with the data identifier in the list pre-stored in the SIM card; the storage module 402 stores the data according to the preset data structure in the following manner: when it is determined that the data identifier matches the data identifier in the list, the data is stored according to the first data structure; when it is determined that the data identifier does not match the data identifier in the list, the data is stored according to the second data structure.
[0108] In one embodiment, the format of the second data structure includes second index information, a second hash value, and a second target data segment; the storage module 402 stores data according to the second data structure in the following manner when it is determined that the data identifier does not match the data identifier in the list: the data is divided to obtain n second target data segments; the second index information of each second target data segment and the second hash value corresponding to each second target data segment are determined respectively; and the second target data segment, the second hash value, and the second index information are stored.
[0109] In one embodiment, the format of the first data structure includes first index information, a first hash value and a first target data segment; the storage module 402 stores data according to the first data structure in the following manner when it is determined that the data identifier matches the data identifier in the list: when it is determined that the data identifier matches the data identifier in the list, obtain the historical storage data corresponding to the data identifier; determine the offset information between the data corresponding to the data to be synchronized and the historical storage data; based on the offset information, divide the data corresponding to the data to be synchronized into p first target data segments, and determine the first index information and the first hash value corresponding to each first target data segment, the first index information including the starting index information and the ending index information; when it is determined that the data segment does not meet the preset conditions, store the first target data segment, the starting index information, the ending index information and the first hash value.
[0110] In one implementation, the storage module 402 is further configured to: when it is determined that the data identifier does not match the data identifier in the list, store the data identifier in the list.
[0111] In one implementation, before receiving the data to be synchronized sent by the service platform, the first receiving module 401 is further used to: receive target data parameters corresponding to the data to be synchronized sent by the service platform; determine whether the target data parameters meet the SIM card data synchronization requirement information; and receive the data to be synchronized sent by the service platform when the target data parameters meet the SIM card data synchronization requirement information.
[0112] Based on the data synchronization method provided in the above embodiment, the present application also provides a specific implementation of a data synchronization device. Please refer to the following embodiment.
[0113] See first Figure 5 , Figure 5 1 is a schematic diagram of the structure of a data synchronization device provided by another embodiment of the present application. The data synchronization device 500 provided by the embodiment of the present application includes the following units:
[0114] The second receiving module 501 is used to receive data of a preset data structure sent by a SIM card.
[0115] The synchronization module 502 is used to synchronize data based on the data in the preset data structure.
[0116] Figure 6 A schematic diagram of the hardware structure of the data synchronization method provided in an embodiment of the present application is shown.
[0117] The data synchronization device may include a processor 601 and a memory 602 storing computer program instructions.
[0118] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0119] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.
[0120] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0121] The processor 601 implements any one of the data synchronization methods in the above embodiments by reading and executing computer program instructions stored in the memory 602 .
[0122] In one example, the data synchronization device may further include a communication interface 603 and a bus 610. Figure 6 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.
[0123] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0124] Bus 610 includes hardware, software or both, and the parts of the equipment of data synchronization are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 610 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0125] The data synchronization device can be used to synchronize the data of the SIM card in the embodiment of the present application, thereby realizing the combination of Figure 1 , Figure 4 and Figure 5 A method and apparatus for data synchronization are described.
[0126] In addition, in combination with the data synchronization method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the data synchronization methods in the above embodiment is implemented.
[0127] An embodiment of the present application also provides a computer program product, including a computer program, which implements any one of the data synchronization methods in the above embodiments when the computer program is processed and executed.
[0128] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0129] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0130] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0131] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0132] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for data synchronization, characterized in that: Applied to user identification of SIM card, the method comprises: Receive the data to be synchronized sent by the business platform; Storing the data to be synchronized according to a preset data structure; The data of the preset data structure is sent to the cloud server, so that the cloud server performs data synchronization based on the data of the preset data structure.
2. The method according to claim 1, characterized in that The data to be synchronized also includes a data identifier; the preset data structure includes a first data structure and a second data structure; Before storing the data to be synchronized according to the preset data structure, the method further includes: Matching the data identifier with data identifiers in a list pre-stored in the SIM card; The storing the data to be synchronized according to a preset data structure includes: When it is determined that the data identifier matches the data identifier in the list, storing the data to be synchronized according to the first data structure; When it is determined that the data identifier does not match the data identifier in the list, the data to be synchronized is stored according to the second data structure.
3. The method according to claim 2, characterized in that The format of the second data structure includes second index information, a second hash value, and a second target data segment; When it is determined that the data identifier does not match the data identifier in the list, storing the data to be synchronized according to the second data structure includes: Segmenting the data to be synchronized according to a first preset step length to obtain a plurality of second target data segments; Respectively determine the second index information of each second target data segment and the second hash value corresponding to each second target data segment; The second target data segment, the second Hash value and the second index information are stored.
4. The method according to claim 2, characterized in that: The format of the first data structure includes first index information, a first hash value and a first target data segment; When it is determined that the data identifier matches the data identifier in the list, storing the data to be synchronized according to the first data structure includes: When it is determined that the data identifier matches the data identifier in the list, acquiring historical storage data corresponding to the data identifier; Determine the offset information between the data to be synchronized and the historical storage data; Based on the offset information, the data to be synchronized is divided into a plurality of first target data segments, and first index information and a first hash value corresponding to each first target data segment are determined, where the first index information includes start index information and end index information; When it is determined that the data segment does not satisfy the first preset condition, the first target data segment, the start index information, the end index information, and the first Hash value are stored.
5. The method according to claim 4, characterized in that The determining the offset information between the data to be synchronized and the historically stored data includes: Determine first offset information between the data to be synchronized and the historical stored data; Dividing the data to be synchronized according to a second preset step length to obtain a plurality of third target data segments; respectively determining one or more offset information corresponding to each third target data segment; Accumulating the offset information corresponding to each third target data segment to obtain second offset information; When the first offset information is equal to the second offset information, determining target offset information corresponding to each third target data segment; When the third target data segment corresponding to the target offset information satisfies the second preset condition, the target offset information is used as the offset information between the data to be synchronized and the historical storage data.
6. The method according to claim 4, characterized in that The first preset condition includes at least one of the following: The data length corresponding to the data segment is the same as the data length corresponding to the historical storage data; or The hash value of the data segment is the same as the hash value of the historical storage data; or The starting index information of the data segment is the same as the index information of the historical storage data.
7. The method according to claim 2, characterized in that Also includes: In the case where it is determined that the data identifier does not match the data identifiers in the list, the data identifier is stored in the list.
8. The data synchronization method according to claim 1, characterized in that: Before receiving the data to be synchronized sent by the service platform, the method further includes: Receive target data parameters corresponding to the data to be synchronized sent by the business platform; When the target data parameter meets the SIM card data synchronization requirement information, the data to be synchronized sent by the service platform is received.
9. The method according to claim 8, characterized in that The target data parameters include the data volume of the data to be synchronized and an application identifier; When the target data parameter satisfies the SIM card data synchronization requirement information, before receiving the data to be synchronized sent by the service platform, the method further includes: determining a target application based on the application identifier; Calculating the available space of the SIM card using the target application; When it is determined that the amount of the data to be synchronized is less than or equal to the size of the available space of the SIM card, it is determined that the target data parameter meets the SIM card data synchronization requirement information.
10. A method for data synchronization, characterized in that: Applied to a cloud server, the method comprises: Receiving data of a preset data structure sent by a SIM card; Data synchronization is performed based on the data in the preset data structure.
Citation Information
Patent Citations
Synchronizing method for set-card separate type domestic gateway business configuration data
CN104125300A
Realization method for optimizing file reading / writing speed and frequency of USIM card
CN105930100A
Synchronizing method, device and system for mobile terminal data
CN106375478A
Data synchronization method, system, computer device, and readable storage medium
CN109254997A
Mobile service access method, device and system, storage medium and electronic device
CN111065087A
