A numerical synchronization method, device, computer equipment and storage medium
By amplifying non-integer values into integer values and calculating the difference before sending, the problem of high storage and transmission pressure in high-frequency data synchronization is solved, achieving more efficient data synchronization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-04-10
AI Technical Summary
During high-frequency data synchronization, the large amount of data increases the processing pressure on computer equipment and the transmission pressure on communication links, affecting the user experience.
By amplifying non-integer values to integer values and calculating the difference before sending the difference, storage space requirements are reduced, ensuring the accuracy of data synchronization.
While ensuring the accuracy of data synchronization, it reduces the storage space occupied during data transmission, thereby reducing the processing pressure on computer equipment and the transmission pressure on communication links.
Smart Images

Figure CN116166189B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and specifically to a numerical synchronization method, apparatus, computer equipment, and storage medium. Background Technology
[0002] With the rapid development of internet technology, data synchronization has become a crucial part of communication transmission. For example, in games, data synchronization is needed to ensure that the position, world scene, status attributes, and other data of every game unit seen by players on the same screen remain consistent. In other words, the behavior across multiple clients must be consistent, and the data between the client and the server must be consistent.
[0003] In scenarios like gaming, the frequency of numerical synchronization directly impacts the user experience. Therefore, a relatively high synchronization frequency is generally used during user interaction. However, with high-frequency synchronization, if the data volume is too large, it will increase the processing load on computer equipment and the transmission load on communication links. Summary of the Invention
[0004] This invention provides a numerical synchronization method, apparatus, computer equipment, and storage medium, which can reduce the storage space occupied by numerical data during numerical transmission, and reduce the processing pressure on computer equipment and the transmission pressure on communication links, while ensuring the accuracy of data synchronization.
[0005] This invention provides a numerical synchronization method for a numerical sender, wherein the numerical sender stores a synchronization reference integer value, and the method includes:
[0006] Obtain the non-integer value to be synchronized, and amplify the non-integer value to be synchronized by a preset amplification ratio to obtain the amplified value to be synchronized.
[0007] The amplified value to be synchronized is converted into an integer value to obtain the amplified integer value;
[0008] Calculate the difference between the amplified integer value and the synchronous reference integer value to obtain the integer value difference;
[0009] If the difference between the amplified value to be synchronized and the integer value satisfies a preset integer value synchronization interval, the integer value difference is sent to the value receiver so that the value receiver can restore the non-integer value based on the stored synchronization reference integer value and the integer value difference. The storage space required for any integer value within the integer value synchronization interval is not greater than the storage space required for the non-integer value.
[0010] Accordingly, embodiments of the present invention also provide another numerical synchronization method, applied to a numerical receiver, wherein the numerical receiver stores synchronized numerical values and synchronization reference integer numerical values, the method comprising:
[0011] Receive synchronization values sent by the data sender;
[0012] Determine the data type of the synchronization value. If the synchronization value is an integer value, calculate the sum of the synchronization reference integer value and the synchronization value to obtain a new synchronization reference integer value.
[0013] Based on the new synchronous reference integer value and the preset reduction ratio, a reduction calculation is performed to obtain the reduced non-integer value;
[0014] The synchronized value is updated based on the reduced non-integer value to obtain a new synchronized value.
[0015] Accordingly, embodiments of the present invention also provide a numerical synchronization device applied to a numerical transmitter, wherein the numerical transmitter stores a synchronization reference integer value, and the device includes:
[0016] The amplification calculation unit is used to obtain the non-integer value to be synchronized, and to amplify the non-integer value to be synchronized by a preset amplification ratio to obtain the amplified value to be synchronized.
[0017] A type conversion unit is used to convert the amplified value to be synchronized into an integer value to obtain the amplified integer value;
[0018] The difference calculation unit is used to calculate the difference between the amplified integer value and the synchronous reference integer value to obtain the integer value difference;
[0019] A value sending unit is used to send the integer value difference to a value receiver if the difference between the amplified value to be synchronized and the integer value satisfies a preset integer value synchronization interval, so that the value receiver can restore the non-integer value based on the stored synchronization reference integer value and the integer value difference, and the storage space required for any integer value within the integer value synchronization interval is not greater than the storage space required for the non-integer value.
[0020] Accordingly, embodiments of the present invention also provide another numerical synchronization device, applied to a numerical receiver, wherein the numerical receiver stores synchronized numerical values and synchronization reference integer numerical values, the device comprising:
[0021] The value receiving unit is used to receive the synchronization values sent by the value sender;
[0022] The type determination unit is used to determine the data type of the synchronization value. If the synchronization value is an integer value, the unit calculates the sum of the synchronization reference integer value and the synchronization value to obtain a new synchronization reference integer value.
[0023] The scaling calculation unit is used to perform scaling calculations based on the new synchronous reference integer value and the preset scaling ratio to obtain the scaled-down non-integer value.
[0024] The value update unit is used to update the synchronized value based on the reduced non-integer value to obtain a new synchronized value.
[0025] Accordingly, embodiments of the present invention also provide a computer device, including a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to perform the steps in any of the numerical synchronization methods provided in the embodiments of the present invention.
[0026] Accordingly, embodiments of the present invention also provide a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the numerical synchronization methods provided in the embodiments of the present invention.
[0027] Furthermore, embodiments of the present invention also provide a computer program product, including a computer program or instructions, wherein when the computer program or instructions are executed by a processor, they implement the steps in any of the numerical synchronization methods provided in the embodiments of the present invention.
[0028] The solution adopted in this embodiment of the invention can be applied to a data sender that stores a synchronization reference integer value. It obtains a non-integer value to be synchronized, amplifies it by a preset amplification ratio to obtain an amplified value to be synchronized, converts the amplified value to an integer value, and calculates the difference between the amplified integer value and the synchronization reference integer value. If the magnitude of the amplified value to be synchronized and the integer difference satisfy a preset integer synchronization interval, the integer difference is sent to the data receiver. This allows the data receiver to restore the non-integer value based on the stored synchronization reference integer value and the integer difference. The storage space required for any integer value within the integer synchronization interval is no greater than the storage space required for the non-integer value. Since this embodiment of the invention converts non-integer values requiring larger storage space into integer differences requiring smaller storage space, it can reduce the storage space occupied by numerical data during data transmission while ensuring the accuracy of data synchronization, thereby reducing the processing pressure on computer equipment and the transmission pressure on communication links. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a schematic diagram of a scenario for the numerical synchronization method provided in an embodiment of the present invention;
[0031] Figure 2 This is a flowchart of the numerical synchronization method provided in an embodiment of the present invention;
[0032] Figure 3 This is a flowchart of another numerical synchronization method provided in an embodiment of the present invention;
[0033] Figure 4 This is another flowchart of the numerical synchronization method provided in the embodiments of the present invention;
[0034] Figure 5 This is a schematic diagram of the numerical synchronization device provided in an embodiment of the present invention;
[0035] Figure 6 This is another structural schematic diagram of the numerical synchronization device provided in the embodiment of the present invention;
[0036] Figure 7 This is a schematic diagram of another numerical synchronization device provided in an embodiment of the present invention;
[0037] Figure 8 This is another structural schematic diagram of another numerical synchronization device provided in an embodiment of the present invention;
[0038] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0039] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] This invention provides a numerical synchronization method, apparatus, computer device, and computer-readable storage medium. Specifically, this invention provides a numerical synchronization method suitable for a numerical synchronization apparatus that can be integrated into a computer device.
[0041] The computer device can be a terminal or other device, including but not limited to mobile terminals and fixed terminals. For example, mobile terminals include but are not limited to smartphones, smartwatches, tablets, laptops, smart vehicles, etc., while fixed terminals include but are not limited to desktop computers, smart TVs, etc.
[0042] The computer device can also be a server or other similar device. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but it is not limited to these.
[0043] The numerical synchronization method of this invention can be implemented by a server or by a terminal and a server together.
[0044] The following example illustrates this method, using both the terminal and the server to implement the numerical synchronization.
[0045] like Figure 1 As shown, the numerical synchronization system provided in this embodiment of the invention includes a terminal 10 and a server 20, etc. The terminal 10 and the server 20 are connected through a network, such as through a wired or wireless network. The server 20 can exist as a computer device to synchronize the values sent by the terminal 10.
[0046] The terminal 10 can be used as a value sender storing a synchronization reference integer value, to obtain a non-integer value to be synchronized, to amplify the non-integer value to be synchronized by a preset amplification ratio, to obtain an amplified value to be synchronized, to convert the amplified value to be synchronized into an integer value, to obtain an amplified integer value, to calculate the difference between the amplified integer value and the synchronization reference integer value, to obtain the integer value difference, and if the size of the amplified value to be synchronized and the integer value difference meets the preset integer value synchronization interval, the terminal 10 sends the integer value difference to the server 20 so that the server 20 can restore the non-integer value according to the stored synchronization reference integer value and the integer value difference, and the storage space required for any integer value within the integer value synchronization interval is not greater than the storage space required for the non-integer value.
[0047] Server 20 can act as a value receiver storing synchronized values and synchronization reference integer values. It receives synchronized values sent by terminal 10, determines the data type of the synchronized values, and if the synchronized values are integer values, calculates the sum of the synchronization reference integer values and the synchronized values to obtain a new synchronization reference integer value. Based on the new synchronization reference integer value and a preset reduction ratio, it performs a reduction calculation to obtain a reduced non-integer value. The synchronized values are then updated based on the reduced non-integer value to obtain a new synchronized value.
[0048] It is understood that in some embodiments, terminal 10 may also act as a data receiver, server 20 may also act as a data sender, or the data receiver and data sender may also be the same computer device. This embodiment of the invention does not limit this.
[0049] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.
[0050] The embodiments of the present invention will be described from the perspective of a numerical synchronization device, which is applied to a numerical sender. The numerical sender stores a synchronization reference integer value, which can be integrated into a server or terminal.
[0051] like Figure 2 As shown, the specific process of the numerical synchronization method in this embodiment can be as follows:
[0052] 201. Obtain the non-integer value to be synchronized, and amplify the non-integer value to be synchronized by a preset amplification ratio to obtain the amplified value to be synchronized.
[0053] Among them, the non-integer values to be synchronized are the non-integer values that the current value sender needs to synchronize to the value sender.
[0054] It is understood that a non-integer type is a data type that uses both an integer part and a decimal part to represent a value. For example, a non-integer type can be of type float, double float, decimal, etc. This embodiment of the invention does not limit the specific non-integer data type of the non-integer value to be synchronized.
[0055] Specifically, the magnification ratio is a pre-set value that amplifies the non-integer value to be synchronized. For example, the magnification ratio can be 10, 50, 100, 1000, etc. Technicians can set the magnification ratio according to the actual synchronization accuracy requirements.
[0056] The amplified value to be synchronized is the result of multiplying the non-integer value to be synchronized by the amplification ratio. It can be understood that the amplified value to be synchronized is also a non-integer value.
[0057] In practical applications, by amplifying the amplified value to be synchronized, the accuracy of the data conversion result can be guaranteed when converting the data type of the amplified value to be synchronized.
[0058] For example, if the value to be synchronized is magnified by 1000 times, the resulting magnified integer value will contain the three digits after the decimal point of the magnified value to be synchronized; if the value to be synchronized is magnified by 10 times, the resulting magnified integer value will contain the one digit after the decimal point of the magnified value to be synchronized, and so on.
[0059] By multiplying a floating-point number by a magnification factor (e.g., 1000) to convert it to an integer, several decimal places of the floating-point number are preserved, and the integer calculation is not affected by different operating environments, thus avoiding the cumulative error caused by calculations during synchronization.
[0060] 202. Convert the amplified value to be synchronized into an integer value to obtain the amplified integer value.
[0061] The amplified integer value is an integer value obtained by converting the amplified value to be synchronized to an integer. For example, the amplified integer value can be a value that retains the integer part of the amplified value to be synchronized.
[0062] Optionally, when converting the amplified value to be synchronized into an integer value, a forced type conversion method or an automatic type conversion method can be used. This embodiment of the invention does not limit the method.
[0063] For example, when the non-integer value to be synchronized is nv and the amplification ratio is 1000, the amplified value to be synchronized can be forcibly converted to an amplified integer value by using int(nv*1000).
[0064] In some examples, when converting the magnified value to be synchronized into an integer value, methods such as rounding up, rounding to the nearest integer, and rounding down can also be used.
[0065] 203. Calculate the difference between the amplified integer value and the synchronous reference integer value to obtain the integer value difference.
[0066] The synchronization reference integer value can be used to represent the synchronization status when the data sender synchronized the data with the data receiver most recently. The synchronization reference integer value can be an integer.
[0067] Specifically, if the most recent value sender synchronized the value to the value receiver by synchronizing the integer value difference, then the synchronization reference integer value is the non-integer value to be synchronized that the most recent value sender wanted to synchronize to the value receiver.
[0068] For example, the integer numerical difference diff_v = int(nv*1000) - fix_v.
[0069] 204. If the difference between the amplified value to be synchronized and the integer value meets the preset integer value synchronization interval, send the integer value difference to the value receiver so that the value receiver can restore the non-integer value according to the stored synchronization reference integer value and the integer value difference. The storage space required for any integer value within the integer value synchronization interval is not greater than the storage space required for the non-integer value.
[0070] Optionally, the non-integer values to be synchronized sent by the value sender can be values with a certain continuity in value change, so that the magnitude of the integer value difference can generally meet the preset integer value synchronization interval.
[0071] In practical applications, msgpack's compression mechanism for int types can be used to reduce the storage space occupied during value synchronization. Generally, the smaller the integer value, the fewer bytes msgpack will use for compression. For example, the different types of values and the corresponding storage space required can be shown in the table below:
[0072]
[0073]
[0074] For example, for small floating-point numbers, multiplying by 1000 and retaining three decimal places can convert them to integer values (int). If the value can be represented by Int16 or lower, the original 5-byte floating-point number is optimized to 3 bytes or even less.
[0075] The integer value synchronization interval is a range of values, where the storage space required for any integer value within this interval is no greater than the storage space required for any non-integer value. For example, the integer value synchronization interval could be (-2...). 31 ,2 31 ).
[0076] In some optional embodiments, the data sender may also store actual synchronized values, which represent the values that actually need to be synchronized during data synchronization. The data synchronization method provided in this embodiment of the invention further includes:
[0077] The real synchronized value is updated based on the non-integer value to be synchronized, and a new real synchronized value is obtained.
[0078] The synchronization reference integer value is updated based on the synchronization reference integer value and the difference between the integer values, resulting in a new synchronization reference integer value.
[0079] The truly synchronized value is the actual value that the data sender wanted to synchronize with the data receiver during the most recent data synchronization. In other words, the truly synchronized value is the non-integer value to be synchronized at the time of the last data synchronization.
[0080] In other words, if the non-integer value to be synchronized is nv, then the new real synchronized value ov = nv; the new synchronization reference integer value fix_v = fix_v + diff_v, where diff_v is the difference in integer values.
[0081] In some examples, if the difference between the new synchronization reference integer value and the new actual synchronized value is greater than a preset threshold, it can be specified that the non-integer value to be synchronized will be sent directly to the value receiver during the next synchronization to avoid excessive error.
[0082] It is understood that if the difference between the amplified value to be synchronized or the integer value is greater than the storage space required for the non-integer value, the non-integer value to be synchronized can be used for synchronization. That is, the value synchronization method provided in this embodiment of the invention may further include:
[0083] If the difference between the amplified value to be synchronized or the integer value does not meet the integer value synchronization range, a non-integer value to be synchronized is sent to the value receiver so that the value receiver can synchronize the value based on the non-integer value to be synchronized.
[0084] In some optional embodiments, the data sender also stores the actual synchronized values. The data synchronization method provided in this embodiment of the invention further includes:
[0085] The real synchronized value is updated based on the non-integer value to be synchronized, and a new real synchronized value is obtained.
[0086] The synchronization reference integer value is modified to the preset full synchronization flag value to obtain a new synchronization reference integer value.
[0087] In other words, if a non-integer value to be synchronized is sent to the value receiver, the synchronization reference integer value in the value sender will be modified to the full synchronization flag value.
[0088] The full synchronization flag indicates that the non-integer value to be synchronized will be used during synchronization. Specifically, the full synchronization flag can be 0, or other values or identifiers.
[0089] Taking a full synchronization flag value of 0 as an example, that is, the new actual synchronized value ov = nv; the new synchronization reference integer value fix_v = 0.
[0090] As can be seen from the above, the embodiments of the present invention can be applied to a data sender that stores a synchronization reference integer value, obtains a non-integer value to be synchronized, amplifies the non-integer value to be synchronized by a preset amplification ratio to obtain an amplified value to be synchronized, converts the amplified value to be synchronized into an integer value to obtain an amplified integer value, calculates the difference between the amplified integer value and the synchronization reference integer value to obtain an integer value difference, and if the size of the amplified value to be synchronized and the integer value difference meets a preset integer value synchronization interval, the integer value difference is sent to the data receiver so that the data receiver can restore the non-integer value according to the stored synchronization reference integer value and the integer value difference. The storage space required for any integer value within the integer value synchronization interval is not greater than the storage space required for the non-integer value. Since the embodiments of the present invention convert the non-integer value to be synchronized that requires more storage space into an integer value difference that requires less storage space, the storage space occupied by numerical data during the data transmission process can be reduced while ensuring the accuracy of data synchronization, thereby reducing the processing pressure of computer equipment and the transmission pressure of communication links.
[0091] like Figure 3 As shown in the figure, this embodiment of the invention provides another numerical synchronization method. This numerical synchronization device can be applied to a numerical receiver, which stores synchronized values and synchronization reference integer values. Specifically, it can be integrated into a server or terminal. The specific process is as follows:
[0092] 301. Receive the synchronization value sent by the value sender.
[0093] The synchronization value is the value sent by the data sender. The synchronization value may be an integer or a non-integer value.
[0094] 302. Determine the data type of the synchronization value. If the synchronization value is an integer value, calculate the sum of the synchronization reference integer value and the synchronization value to obtain a new synchronization reference integer value.
[0095] The definitions of terms used in this embodiment can be found in the previous embodiment, and will not be repeated here.
[0096] If the synchronization value is an integer, it means that the sender used the difference in integer values as the synchronization value.
[0097] At this point, the new synchronization reference integer value is fixed_v = fix_v + diff_v.
[0098] 303. Based on the new synchronous reference integer value and the preset reduction ratio, perform reduction calculation to obtain the reduced non-integer value.
[0099] Specifically, the reduction ratio is a pre-set value that reduces the non-integer value to be synchronized. For example, the reduction ratio can be 10, 50, 100, 1000, etc. Technicians can set the reduction ratio according to the actual synchronization accuracy requirements. Generally, the reduction factor is the same as the magnification factor.
[0100] In other words, ov = fix_v * reduction ratio. For example, the reduction factor can be 1000, in which case ov = fix_v * 0.001.
[0101] 304. Update the synchronized values based on the reduced non-integer values to obtain new synchronized values.
[0102] The reduced non-integer value is a non-integer value. Optionally, the new synchronized value can be directly a reduced non-integer value.
[0103] In some optional embodiments, if the synchronization value is a non-integer value, it indicates that the value sender used the non-integer value to be synchronized as the synchronization value. Accordingly, the value synchronization method provided in this embodiment of the invention may further include:
[0104] If the synchronized value is a non-integer value, update the already synchronized value based on the synchronized value to obtain the new synchronized value;
[0105] The synchronization reference integer value is modified to the preset full synchronization flag value to obtain a new synchronization reference integer value.
[0106] That is, the new synchronization reference integer value fix_v = 0, and the new synchronized value ov = diff_v (the non-integer value to be synchronized).
[0107] As can be seen from the above, the embodiments of the present invention can receive the synchronization value sent by the value sender, determine the data type of the synchronization value, if the synchronization value is an integer value, calculate the sum of the synchronization reference integer value and the synchronization value to obtain a new synchronization reference integer value, perform a reduction calculation based on the new synchronization reference integer value and a preset reduction ratio to obtain a reduced non-integer value, and update the synchronized value according to the reduced non-integer value to obtain a new synchronized value. Since the integer value can be restored to the reduced non-integer value in the embodiments of the present invention, the storage space occupied by numerical data during the data transmission process can be reduced while ensuring the accuracy of data synchronization, thereby reducing the processing pressure of computer equipment and the transmission pressure of communication links.
[0108] Based on the methods described in the preceding embodiments, the following examples will provide further detailed explanations.
[0109] In this embodiment, the combination Figure 1The system will be explained.
[0110] like Figure 4 As shown, the numerical synchronization method in this embodiment can be described in the following specific steps:
[0111] 401. The value sender obtains the non-integer value to be synchronized, amplifies the non-integer value to be synchronized by a preset amplification ratio, and obtains the amplified value to be synchronized. The value sender stores the synchronization reference integer value and the actual synchronized value.
[0112] The value sender stores a synchronization reference integer value fix_v and a real synchronized value ov.
[0113] 402. The value sender converts the amplified value to be synchronized into an integer value, obtains the amplified integer value, calculates the difference between the amplified integer value and the synchronization reference integer value, and obtains the integer value difference.
[0114] When the non-integer value to be synchronized is nv and the amplification ratio is 1000, the amplified value to be synchronized can be forcibly converted to an amplified integer value by using int(nv*1000).
[0115] The integer numerical difference diff_v = int(nv*1000) - fix_v.
[0116] 403. If the difference between the amplified value to be synchronized and the integer value meets the preset integer value synchronization interval, the value sender sends the integer value difference to the value receiver.
[0117] For example, the integer value synchronization interval can be (-2). 31 ,2 31 ).
[0118] 404. The value sender updates the actual synchronized value based on the non-integer value to be synchronized, and obtains a new actual synchronized value. The value sender then updates the synchronization reference integer value based on the difference between the synchronization reference integer value and the integer value, and obtains a new synchronization reference integer value.
[0119] If the non-integer value to be synchronized is nv, then the new real synchronized value ov = nv; the new synchronization reference integer value fix_v = fix_v + diff_v, where diff_v is the difference in integer values.
[0120] 405. If the amplified value to be synchronized or the difference between integer values does not meet the integer value synchronization range, the sender shall send the non-integer value to be synchronized to the receiver.
[0121] 406. The value sender updates the actual synchronized value based on the non-integer value to be synchronized, obtains the new actual synchronized value, modifies the synchronization reference integer value to the preset full synchronization flag value, and obtains the new synchronization reference integer value.
[0122] Taking a full synchronization flag value of 0 as an example, that is, the new actual synchronized value ov = nv; the new synchronization reference integer value fix_v = 0.
[0123] 407. The value receiver receives the synchronized value sent by the value sender. The value receiver stores the synchronized value and the synchronization reference integer value.
[0124] The value receiver stores the synchronized value ov and the synchronization reference integer value fix_v.
[0125] The new synchronization reference integer value is fix_v = fix_v + diff_v.
[0126] 408. The data receiver determines the data type of the synchronized data. If the synchronized data is an integer, it calculates the sum of the synchronized reference integer and the synchronized data to obtain a new synchronized reference integer. Based on the new synchronized reference integer and the preset reduction ratio, it performs a reduction calculation to obtain a reduced non-integer value. The synchronized data is updated according to the reduced non-integer value to obtain a new synchronized value.
[0127] ov = fix_v * reduction ratio. For example, the reduction factor can be 1000, in which case ov = fix_v * 0.001.
[0128] 409. If the value receiver is a non-integer value, it updates the synchronized value according to the synchronized value to obtain a new synchronized value, and modifies the synchronization reference integer value to the preset full synchronization flag value to obtain a new synchronization reference integer value.
[0129] At this point, the new synchronization reference integer value fix_v = 0, and the new synchronized value ov = diff_v (the non-integer value to be synchronized).
[0130] As can be seen from the above, the embodiments of the present invention can convert non-integer values that require more storage space to be synchronized into integer values that require less storage space at the value sender, and restore the integer values to the reduced non-integer values at the value receiver. Therefore, while ensuring the accuracy of data synchronization, it can reduce the storage space occupied by numerical data during the value transmission process, and reduce the processing pressure of computer equipment and the transmission pressure of communication links.
[0131] To better implement the above methods, this embodiment of the invention also provides a numerical synchronization device. The meanings of the terms used are the same as in the numerical synchronization method described above, and specific implementation details can be found in the descriptions within the method embodiments.
[0132] refer to Figure 5 This device can be applied to a data sender that stores a synchronization reference integer value. The device may include:
[0133] The amplification calculation unit 501 can be used to obtain the non-integer value to be synchronized, amplify the non-integer value to be synchronized by a preset amplification ratio, and obtain the amplified value to be synchronized.
[0134] The type conversion unit 502 can be used to convert the amplified value to be synchronized into an integer value to obtain the amplified integer value;
[0135] The difference calculation unit 503 can be used to calculate the difference between the amplified integer value and the synchronous reference integer value to obtain the integer value difference;
[0136] The value sending unit 504 can be used to send the integer value difference to the value receiver if the difference between the amplified value to be synchronized and the integer value meets the preset integer value synchronization interval, so that the value receiver can restore the non-integer value according to the stored synchronization reference integer value and the integer value difference. The storage space required for any integer value within the integer value synchronization interval is not greater than the storage space required for the non-integer value.
[0137] In some alternative embodiments, such as Figure 6 As shown, the numerical synchronization device provided in this embodiment of the invention may further include a first update unit 505, which can be used to update the real synchronized value according to the non-integer value to be synchronized, so as to obtain a new real synchronized value.
[0138] The synchronization reference integer value is updated based on the synchronization reference integer value and the difference between the integer values, resulting in a new synchronization reference integer value.
[0139] In some optional embodiments, the numerical synchronization device provided in this invention may further include a full synchronization unit 506, which can be used to send a non-integer value to be synchronized to the numerical receiver if the amplified value to be synchronized or the difference between integer values does not meet the integer value synchronization range, so that the numerical receiver can perform numerical synchronization based on the non-integer value to be synchronized.
[0140] In some optional embodiments, the numerical synchronization device provided in this embodiment of the invention may further include a second update unit 507, which can be used to update the real synchronized value according to the non-integer value to be synchronized, so as to obtain a new real synchronized value.
[0141] The synchronization reference integer value is modified to the preset full synchronization flag value to obtain a new synchronization reference integer value.
[0142] As can be seen from the above, the numerical synchronization device can be applied to a data sender that stores a synchronization reference integer value, obtain a non-integer value to be synchronized, amplify the non-integer value to be synchronized by a preset amplification ratio to obtain an amplified value to be synchronized, convert the amplified value to be synchronized into an integer value to obtain an amplified integer value, calculate the difference between the amplified integer value and the synchronization reference integer value to obtain the integer value difference, and if the size of the amplified value to be synchronized and the integer value difference meets a preset integer value synchronization interval, the integer value difference is sent to the data receiver so that the data receiver can restore the non-integer value according to the stored synchronization reference integer value and the integer value difference. The storage space required for any integer value within the integer value synchronization interval is no greater than the storage space required for the non-integer value. Since in this embodiment of the invention, the non-integer value to be synchronized that requires more storage space is converted into an integer value difference that requires less storage space, the storage space occupied by numerical data during the numerical transmission process can be reduced while ensuring the accuracy of data synchronization, thereby reducing the processing pressure of computer equipment and the transmission pressure of communication links.
[0143] To better implement the numerical synchronization method provided in the embodiments of this application, another numerical synchronization device is also provided in one embodiment, wherein the meanings of the terms are the same as those in the numerical synchronization method described above, and the specific implementation details can be found in the description in the method embodiments.
[0144] refer to Figure 7 The device should be usable as a data receiver, which stores synchronized values and a synchronization reference integer value. The device may include:
[0145] The value receiving unit 701 can be used to receive synchronized values sent by the value sender;
[0146] The type determination unit 702 can be used to determine the data type of the synchronization value. If the synchronization value is an integer value, the sum of the synchronization reference integer value and the synchronization value is calculated to obtain a new synchronization reference integer value.
[0147] The reduction calculation unit 703 can be used to perform reduction calculations based on a new synchronous reference integer value and a preset reduction ratio to obtain a reduced non-integer value.
[0148] The value update unit 704 can be used to update the synchronized value based on the reduced non-integer value to obtain a new synchronized value.
[0149] In some alternative embodiments, such as Figure 8As shown, the numerical synchronization device provided in this embodiment of the invention may further include a full numerical update unit 705, which can be used to update the synchronized value according to the synchronized value if the synchronized value is a non-integer value, so as to obtain a new synchronized value.
[0150] The synchronization reference integer value is modified to the preset full synchronization flag value to obtain a new synchronization reference integer value.
[0151] As can be seen from the above, the numerical synchronization device can receive the synchronized values sent by the data sender, determine the data type of the synchronized values, and if the synchronized values are integer values, calculate the sum of the synchronized reference integer values and the synchronized values to obtain a new synchronized reference integer value. Based on the new synchronized reference integer value and a preset reduction ratio, a reduction calculation is performed to obtain a reduced non-integer value. The synchronized values are then updated based on the reduced non-integer value to obtain a new synchronized value. Since the integer values can be restored to reduced non-integer values in this embodiment of the invention, the storage space occupied by numerical data during the numerical transmission process can be reduced while ensuring the accuracy of data synchronization, thereby reducing the processing pressure on computer equipment and the transmission pressure on communication links.
[0152] Furthermore, correspondingly, embodiments of this application also provide a computer device, which can be a terminal. For example... Figure 9 As shown, Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 900 includes a processor 901 with one or more processing cores, a memory 902 with one or more computer-readable storage media, and a computer program stored on the memory 902 and executable on the processor. The processor 901 and the memory 902 are electrically connected. Those skilled in the art will understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0153] The processor 901 is the control center of the computer device 900. It connects various parts of the computer device 900 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 902, and calling data stored in the memory 902, it performs various functions of the computer device 900 and processes data, thereby monitoring the computer device 900 as a whole.
[0154] In this embodiment, the computer device 900 can act as a data sender, storing synchronization reference integer values. The processor 901 in the computer device 900 loads the instructions corresponding to the processes of one or more application programs into the memory 902 according to the following steps, and the processor 901 runs the application programs stored in the memory 902 to achieve various functions:
[0155] Obtain the non-integer value to be synchronized, and amplify the non-integer value to be synchronized by a preset amplification ratio to obtain the amplified value to be synchronized.
[0156] Convert the amplified value to be synchronized into an integer value to obtain the amplified integer value;
[0157] Calculate the difference between the amplified integer value and the synchronous reference integer value to obtain the integer value difference;
[0158] If the difference between the amplified value to be synchronized and the integer value meets the preset integer value synchronization interval, the integer value difference is sent to the value receiver so that the value receiver can restore the non-integer value based on the stored synchronization reference integer value and the integer value difference. The storage space required for any integer value within the integer value synchronization interval is no greater than the storage space required for the non-integer value.
[0159] In some optional embodiments, the data sender also stores the actual synchronized values. The data synchronization method provided in this embodiment of the invention further includes:
[0160] The real synchronized value is updated based on the non-integer value to be synchronized, and a new real synchronized value is obtained.
[0161] The synchronization reference integer value is updated based on the synchronization reference integer value and the difference between the integer values, resulting in a new synchronization reference integer value.
[0162] In some optional embodiments, the numerical synchronization method provided by the embodiments of the present invention further includes:
[0163] If the difference between the amplified value to be synchronized or the integer value does not meet the integer value synchronization range, a non-integer value to be synchronized is sent to the value receiver so that the value receiver can synchronize the value based on the non-integer value to be synchronized.
[0164] In some optional embodiments, the data sender also stores the actual synchronized values. The data synchronization method provided in this embodiment of the invention further includes:
[0165] The real synchronized value is updated based on the non-integer value to be synchronized, and a new real synchronized value is obtained.
[0166] The synchronization reference integer value is modified to the preset full synchronization flag value to obtain a new synchronization reference integer value.
[0167] This solution can be applied to a data sender that stores a synchronization reference integer value. It obtains the non-integer value to be synchronized, amplifies it by a preset amplification ratio, and converts it into an integer value. The difference between the amplified integer value and the synchronization reference integer value is calculated. If the difference between the amplified integer value and the integer value satisfies a preset integer value synchronization interval, the integer value difference is sent to the data receiver. This allows the receiver to restore the non-integer value based on the stored synchronization reference integer value and the integer value difference. The storage space required for any integer value within the integer value synchronization interval is no greater than the storage space required for the non-integer value. Because this embodiment converts non-integer values requiring more storage space into integer value differences requiring less, it reduces the storage space occupied by numerical data during data transmission while ensuring data synchronization accuracy, thus reducing the processing pressure on computer equipment and the transmission pressure on communication links.
[0168] In this embodiment, the computer device 900 can also act as a data receiver. The data receiver stores synchronized values and synchronization reference integer values. The processor 901 in the computer device 900 loads the instructions corresponding to the processes of one or more application programs into the memory 902 according to the following steps, and the processor 901 runs the application programs stored in the memory 902 to achieve various functions:
[0169] Receive synchronization values sent by the data sender;
[0170] Determine the data type of the synchronization value. If the synchronization value is an integer, calculate the sum of the synchronization reference integer value and the synchronization value to obtain a new synchronization reference integer value.
[0171] The reduction calculation is performed based on the new synchronous reference integer value and the preset reduction ratio to obtain the reduced non-integer value;
[0172] The synchronized values are updated based on the reduced non-integer values to obtain new synchronized values.
[0173] In some optional embodiments, the numerical synchronization method provided by the embodiments of the present invention may further include:
[0174] If the synchronized value is a non-integer value, update the already synchronized value based on the synchronized value to obtain the new synchronized value;
[0175] The synchronization reference integer value is modified to the preset full synchronization flag value to obtain a new synchronization reference integer value.
[0176] This solution can receive synchronized values sent by the data sender, determine the data type of the synchronized values, and if the synchronized values are integer values, calculate the sum of the synchronized reference integer value and the synchronized values to obtain a new synchronized reference integer value. Based on the new synchronized reference integer value and a preset reduction ratio, a reduction calculation is performed to obtain a reduced non-integer value. The synchronized values are then updated based on the reduced non-integer value to obtain a new synchronized value. Since integer values can be restored to reduced non-integer values in this embodiment of the invention, the storage space occupied by numerical data during data transmission can be reduced while ensuring the accuracy of data synchronization, thereby reducing the processing pressure on computer equipment and the transmission pressure on communication links.
[0177] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0178] Optional, such as Figure 9 As shown, the computer device 900 also includes: a touch screen 903, a radio frequency circuit 904, an audio circuit 905, an input unit 906, and a power supply 907. The processor 901 is electrically connected to the touch screen 903, the radio frequency circuit 904, the audio circuit 905, the input unit 906, and the power supply 907. Those skilled in the art will understand that... Figure 9 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0179] The touch display screen 903 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 903 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 901. It can also receive and execute commands from the processor 901. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 901 to determine the type of touch event. Subsequently, the processor 901 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 903 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 903 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 903 can also be used as part of the input unit 906 to achieve input functions.
[0180] The radio frequency circuit 904 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.
[0181] Audio circuitry 905 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuitry 905 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 905, converted back into audio data, and then processed by processor 901 before being transmitted via radio frequency circuitry 904 to, for example, another computer device, or output to memory 902 for further processing. Audio circuitry 905 may also include an earphone jack to facilitate communication between peripheral headphones and computer devices.
[0182] The input unit 906 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0183] Power supply 907 is used to supply power to various components of computer device 900. Optionally, power supply 907 can be logically connected to processor 901 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 907 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0184] although Figure 9 As not shown in the diagram, the computer device 900 may also include a camera, sensors, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0185] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0186] As can be seen from the above, the computer device provided in this embodiment can acquire non-integer values to be synchronized, amplify the non-integer values to be synchronized by a preset amplification ratio to obtain amplified values to be synchronized, convert the amplified values to be synchronized into integer values to obtain amplified integer values, calculate the difference between the amplified integer values and the synchronization reference integer values to obtain integer value difference, and if the size of the amplified values to be synchronized and the integer value difference meets the preset integer value synchronization interval, the integer value difference is sent to the value receiver so that the value receiver can restore the non-integer values according to the stored synchronization reference integer values and integer value difference. The storage space required for any integer value within the integer value synchronization interval is not greater than the storage space required for the non-integer values. Since in this embodiment of the invention, non-integer values to be synchronized that require more storage space are converted into integer value differences that require less storage space, the storage space occupied by numerical data during the data transmission process can be reduced while ensuring the accuracy of data synchronization, thereby reducing the processing pressure of the computer device and the transmission pressure of the communication link.
[0187] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0188] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute steps in any of the numerical synchronization methods provided in embodiments of this application. For example, the computer program can execute the following steps:
[0189] Obtain the non-integer value to be synchronized, and amplify the non-integer value to be synchronized by a preset amplification ratio to obtain the amplified value to be synchronized.
[0190] Convert the amplified value to be synchronized into an integer value to obtain the amplified integer value;
[0191] Calculate the difference between the amplified integer value and the synchronous reference integer value to obtain the integer value difference;
[0192] If the difference between the amplified value to be synchronized and the integer value meets the preset integer value synchronization interval, the integer value difference is sent to the value receiver so that the value receiver can restore the non-integer value based on the stored synchronization reference integer value and the integer value difference. The storage space required for any integer value within the integer value synchronization interval is no greater than the storage space required for the non-integer value.
[0193] In some optional embodiments, the data sender also stores the actual synchronized values. The data synchronization method provided in this embodiment of the invention further includes:
[0194] The real synchronized value is updated based on the non-integer value to be synchronized, and a new real synchronized value is obtained.
[0195] The synchronization reference integer value is updated based on the synchronization reference integer value and the difference between the integer values, resulting in a new synchronization reference integer value.
[0196] In some optional embodiments, the numerical synchronization method provided by the embodiments of the present invention further includes:
[0197] If the difference between the amplified value to be synchronized or the integer value does not meet the integer value synchronization range, a non-integer value to be synchronized is sent to the value receiver so that the value receiver can synchronize the value based on the non-integer value to be synchronized.
[0198] In some optional embodiments, the data sender also stores the actual synchronized values. The data synchronization method provided in this embodiment of the invention further includes:
[0199] The real synchronized value is updated based on the non-integer value to be synchronized, and a new real synchronized value is obtained.
[0200] The synchronization reference integer value is modified to the preset full synchronization flag value to obtain a new synchronization reference integer value.
[0201] This solution can be applied to a data sender that stores a synchronization reference integer value. It obtains the non-integer value to be synchronized, amplifies it by a preset amplification ratio, and converts it into an integer value. The difference between the amplified integer value and the synchronization reference integer value is calculated. If the difference between the amplified integer value and the integer value satisfies a preset integer value synchronization interval, the integer value difference is sent to the data receiver. This allows the receiver to restore the non-integer value based on the stored synchronization reference integer value and the integer value difference. The storage space required for any integer value within the integer value synchronization interval is no greater than the storage space required for the non-integer value. Because this embodiment converts non-integer values requiring more storage space into integer value differences requiring less, it reduces the storage space occupied by numerical data during data transmission while ensuring data synchronization accuracy, thus reducing the processing pressure on computer equipment and the transmission pressure on communication links.
[0202] Alternatively, the computer program can perform the following steps:
[0203] Receive synchronization values sent by the data sender;
[0204] Determine the data type of the synchronization value. If the synchronization value is an integer, calculate the sum of the synchronization reference integer value and the synchronization value to obtain a new synchronization reference integer value.
[0205] The reduction calculation is performed based on the new synchronous reference integer value and the preset reduction ratio to obtain the reduced non-integer value;
[0206] The synchronized values are updated based on the reduced non-integer values to obtain new synchronized values.
[0207] In some optional embodiments, the numerical synchronization method provided by the embodiments of the present invention may further include:
[0208] If the synchronized value is a non-integer value, update the already synchronized value based on the synchronized value to obtain the new synchronized value;
[0209] The synchronization reference integer value is modified to the preset full synchronization flag value to obtain a new synchronization reference integer value.
[0210] This solution can receive synchronized values sent by the data sender, determine the data type of the synchronized values, and if the synchronized values are integer values, calculate the sum of the synchronized reference integer value and the synchronized values to obtain a new synchronized reference integer value. Based on the new synchronized reference integer value and a preset reduction ratio, a reduction calculation is performed to obtain a reduced non-integer value. The synchronized values are then updated based on the reduced non-integer value to obtain a new synchronized value. Since integer values can be restored to reduced non-integer values in this embodiment of the invention, the storage space occupied by numerical data during data transmission can be reduced while ensuring the accuracy of data synchronization, thereby reducing the processing pressure on computer equipment and the transmission pressure on communication links.
[0211] This solution can be applied to a data sender that stores a synchronization reference integer value. It obtains the non-integer value to be synchronized, amplifies it by a preset amplification ratio, and converts it into an integer value. The difference between the amplified integer value and the synchronization reference integer value is calculated. If the difference between the amplified integer value and the integer value satisfies a preset integer value synchronization interval, the integer value difference is sent to the data receiver. This allows the receiver to restore the non-integer value based on the stored synchronization reference integer value and the integer value difference. The storage space required for any integer value within the integer value synchronization interval is no greater than the storage space required for the non-integer value. Because this embodiment converts non-integer values requiring more storage space into integer value differences requiring less, it reduces the storage space occupied by numerical data during data transmission while ensuring data synchronization accuracy, thus reducing the processing pressure on computer equipment and the transmission pressure on communication links.
[0212] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0213] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0214] Since the computer program stored in the storage medium can execute the steps of any of the numerical synchronization methods provided in the embodiments of this application, the beneficial effects that any of the numerical synchronization methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0215] The numerical synchronization method, apparatus, storage medium, and computer device provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method of numerically synchronizing, comprising: The method is applied to a numerical sender, the numerical sender stores a synchronization reference integer value, and the method comprises the following steps: An unsynchronized non-integer value is obtained, the unsynchronized non-integer value is amplified by a preset amplification ratio to obtain an amplified unsynchronized value; The amplified unsynchronized value is converted into an integer value to obtain an amplified integer value; A difference between the amplified integer value and the synchronization reference integer value is calculated to obtain an integer value difference; If the size of the amplified unsynchronized value and the integer value difference meets a preset integer value synchronization interval, the integer value difference is sent to a numerical receiver, so that the numerical receiver restores a non-integer value according to the stored synchronization reference integer value and the integer value difference, and the storage space required by any integer value in the integer value synchronization interval is not greater than the storage space required by a non-integer value; The numerical sender also stores a real synchronized value, and the method further comprises the following steps: The real synchronized value is updated according to the unsynchronized non-integer value to obtain a new real synchronized value; The synchronization reference integer value is updated according to the synchronization reference integer value and the integer value difference to obtain a new synchronization reference integer value.
2. The numerical synchronization method of claim 1, wherein, The method further comprises the following steps: If the size of the amplified unsynchronized value or the integer value difference does not meet the integer value synchronization interval, the unsynchronized non-integer value is sent to the numerical receiver, so that the numerical receiver synchronizes the value according to the unsynchronized non-integer value.
3. The method of claim 2, wherein, The numerical sender also stores a real synchronized value, and the method further comprises the following steps: The real synchronized value is updated according to the unsynchronized non-integer value to obtain a new real synchronized value; The synchronization reference integer value is modified into a preset full-amount synchronization identifier value to obtain a new synchronization reference integer value.
4. A data synchronization method, characterized by, The method is applied to a numerical receiver, the numerical receiver stores a synchronized value and a synchronization reference integer value, and the method comprises the following steps: A synchronization value sent by a numerical sender is received; The data type of the synchronization value is determined, if the synchronization value is an integer value, the sum of the synchronization reference integer value and the synchronization value is calculated to obtain a new synchronization reference integer value; Based on the new synchronization reference integer value and a preset reduction ratio, a reduction calculation is performed to obtain a reduced non-integer value; The synchronized value is updated according to the reduced non-integer value to obtain a new synchronized value; The method further comprises the following steps: If the synchronization value is a non-integer value, the synchronized value is updated according to the synchronization value to obtain a new synchronized value; The synchronization reference integer value is modified into a preset full-amount synchronization identifier value to obtain a new synchronization reference integer value.
5. A numerical synchronization apparatus, characterized by comprising: The method is applied to a numerical sender, the numerical sender stores a synchronization reference integer value, and the numerical sender also stores a real synchronized value, and the device comprises: An amplification calculation unit is configured to obtain an unsynchronized non-integer value, amplify the unsynchronized non-integer value by a preset amplification ratio to obtain an amplified unsynchronized value; An integer value conversion unit is configured to convert the amplified unsynchronized value into an integer value to obtain an amplified integer value; A difference calculation unit is configured to calculate a difference between the amplified integer value and the synchronization reference integer value to obtain an integer value difference; An integer value difference sending unit is configured to send the integer value difference to a numerical receiver if the size of the amplified unsynchronized value and the integer value difference meets a preset integer value synchronization interval, so that the numerical receiver restores a non-integer value according to the stored synchronization reference integer value and the integer value difference, and the storage space required by any integer value in the integer value synchronization interval is not greater than the storage space required by a non-integer value; a type conversion unit, configured to convert the amplified to-be-synchronized value into an integer value to obtain an amplified integer value; a difference calculation unit, configured to calculate a difference between the amplified integer value and the synchronized reference integer value to obtain an integer value difference; a value sending unit, configured to send the integer value difference to a value receiving party if a size of the amplified to-be-synchronized value and the integer value difference meets a preset integer value synchronization interval, so that the value receiving party restores a non-integer value according to the stored synchronized reference integer value and the integer value difference, and a storage space required by any integer value in the integer value synchronization interval is not greater than a storage space required by a non-integer value; a first updating unit, configured to update the real synchronized value according to the to-be-synchronized non-integer value to obtain a new real synchronized value, and update the synchronized reference integer value according to the synchronized reference integer value and the integer value difference to obtain a new synchronized reference integer value.
6. A numerical synchronization apparatus, characterized by comprising: applied to a value receiving party, the value receiving party storing a synchronized value and a synchronized reference integer value, and the device comprising: a value receiving unit, configured to receive a synchronized value sent by a value sending party; a type determination unit, configured to determine a data type of the synchronized value, and if the synchronized value is an integer value, calculate a sum of the synchronized reference integer value and the synchronized value to obtain a new synchronized reference integer value; a reduction calculation unit, configured to perform reduction calculation based on the new synchronized reference integer value and a preset reduction ratio to obtain a reduced non-integer value; a value updating unit, configured to update the synchronized value according to the reduced non-integer value to obtain a new synchronized value; a full-amount value updating unit, configured to if the synchronized value is a non-integer value, update the synchronized value according to the synchronized value to obtain a new synchronized value, and modify the synchronized reference integer value into a preset full-amount synchronization identifier value to obtain a new synchronized reference integer value.
7. A computer device, comprising: a memory and a processor; the memory stores an application program, and the processor is configured to run the application program in the memory to perform steps in the value synchronization method in any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a plurality of instructions, which are suitable for being loaded by the processor to perform steps in the value synchronization method in any one of claims 1 to 4.
9. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions, when executed by the processor, implement steps in the value synchronization method in any one of claims 1 to 4.
Citation Information
Patent Citations
Model data compression method and system and related equipment
CN112054805A