Method, device and equipment for checking data between network hierarchies, medium and product
By calculating the resource data version encoding of the network layer and comparing it, the problem of low data reconciliation efficiency between network levels is solved, and efficient data reconciliation and business stability are achieved.
Patent Information
- Application Number
- CN202411667296.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-11-20
AI Technical Summary
The prior art is inefficient in data verification between network levels, resulting in increased server burden and impact on business traffic.
By calculating the digital encoding of resource data versions of each network layer, if the encoding information is equal, the verification will be passed, otherwise detailed data verification and modification will be carried out to improve the data reconciliation efficiency.
It significantly improves the efficiency of data reconciliation between network levels, reduces CPU computing volume and operation and maintenance costs, and avoids the impact of business traffic.
Smart Images

Figure CN119766391A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data communication network programming, and in particular to a method, device, equipment, medium and product for verifying data between network levels. Background Art
[0002] Cloud computing is a network-based computing model that provides computing resources, storage resources, and applications to users through the Internet, allowing users to quickly deploy and expand services. It has been widely used in various fields. Among them, cloud network is one of the cores of cloud computing. Cloud network controls the SDN (Software Defined Network) controller through the cloud operating system to configure and manage network element devices, realizing the programmability and easy operation and maintenance of network element devices. For cloud computing users, the stability of the cloud network control architecture is crucial. The SDN controller needs to manage many types of resources. Due to the hierarchical management architecture of the network, the control components of the SDN controller will be divided into multiple layers of control components, and each layer of components will record resource data through a database or cache. Based on the above scenarios, when a resource needs to be operated, the resource needs to be transmitted between the various layers of the network, and finally mapped to one or more configurations of the network element. The current network environment will inevitably encounter abnormal scenarios occasionally, such as network shocks or version problems in abnormal scenarios, which will lead to inconsistent resource data managed by the upper and lower layer control components of the network, resulting in missing or residual network element configurations, affecting business traffic. In order to ensure the consistency of network resources at each layer, a traversal comparison method is often used to verify each piece of data between different network layers, find out the different data and then correct it, which seriously increases the burden on the server. Summary of the invention
[0003] In view of this, the present invention provides a method, device, equipment and medium for data verification between network architecture layers to solve the problem of low efficiency of data verification between network layers.
[0004] In a first aspect, the present invention provides a method for verifying data between network layers, the method comprising: obtaining first coding information of a current network layer and second coding information of an upper network layer, the first coding information and the second coding information being digital codes calculated using resource data versions of corresponding network layers; comparing the first coding information and the second coding information; if the first coding information and the second coding information are equal, the verification passes; if the first coding information and the second coding information are not equal, the verification fails; when the verification fails, verifying the resource data of the current network layer and the upper network layer, and modifying the resource data of the current network layer according to the verification result.
[0005] In some optional implementations, the step of calculating the coding information of each network layer includes: dividing the resource data of the current network layer into multiple data blocks; setting a unique key value for each data block; assigning a version number to each data block according to the version of the resource data in each data block; and calculating the coding information of the current network layer based on all key values and all version numbers of the current network layer.
[0006] In some optional implementations, the encoding information of the current network layer is calculated based on all key values and all version numbers of the current network layer, including: encrypting all key values and all version numbers of the current network layer through an information summary algorithm to obtain the encoding information of the current network layer.
[0007] In some optional implementations, when the verification fails, the resource data of the current network layer and the upper network layer are compared, and before the resource data of the current network layer is modified according to the verification result, the method also includes: checking whether the version numbers of the same key value between the current network layer and the upper network layer are consistent; if the comparison indicates that the version numbers are consistent, the verification passes; if inconsistent target version numbers are found, the verification fails, and the resource data of the current network layer and the upper network layer are compared, and the resource data of the current network layer is modified according to the verification result.
[0008] In some optional implementations, the resource data of the current network layer and the upper network layer are checked, and the resource data of the current network layer is modified according to the check result, including: determining the target key value through the target version number; extracting the first target detailed data from the data block corresponding to the current network layer through the target key value; extracting the second target detailed data from the data block corresponding to the upper network layer through the target key value; checking the first target detailed data and the second target detailed data, and updating the first target detailed data using the checked difference data.
[0009] In some optional implementations, the first encoded information and the second encoded information are compared, including: comparing the first encoded information and the second encoded information through a first thread; checking whether the version numbers of the same key value between the current network layer and the upper network layer are consistent, including: checking the version numbers of the same key value between the current network layer and the upper network layer through the first thread; checking the resource data of the current network layer and the upper network layer, including: checking the resource data of the current network layer and the upper network layer through a second thread.
[0010] In a second aspect, the present invention provides a data verification device between network layers, the device comprising: a coding information acquisition module, used to obtain first coding information of the current network layer and second coding information of the upper network layer, the first coding information and the second coding information are digital codes calculated using the resource data version of the corresponding network layer; a coding comparison module, used to compare the first coding information and the second coding information; a verification pass module, used to verify if the first coding information and the second coding information are equal; a verification failure module, used to verify if the first coding information and the second coding information are not equal; a data verification module, used to verify the resource data of the current network layer and the upper network layer when the verification fails, and modify the resource data of the current network layer according to the verification result.
[0011] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing any one of the methods in the first aspect by executing the computer instructions.
[0012] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to execute any one of the methods in the first aspect.
[0013] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to cause a computer to execute any one of the methods in the first aspect.
[0014] The technical solution provided by the present invention has the following advantages:
[0015] The present invention calculates the corresponding digital code based on the version of resource data in each network layer. If the data versions between network layers are the same, the calculated codes are the same, so that the coding information between network layers is compared. If the first coding information and the second coding information are equal, the verification passes; if the first coding information and the second coding information are not equal, the verification fails; when the verification fails, it indicates that there is a problem of different data between network layers, and detailed data verification and modification are performed. There is no need to traverse and compare all data for each verification, which significantly improves the efficiency of data reconciliation between network levels. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 is a schematic diagram of a layered structure of a cloud computing network architecture according to an embodiment of the present invention;
[0018] Figure 2 is a flow chart of a method for checking data between network layers according to an embodiment of the present invention;
[0019] Figure 3 is a schematic diagram of a structure of data block division according to an embodiment of the present invention;
[0020] Figure 4 is another flow chart of a method for checking data between network layers according to an embodiment of the present invention;
[0021] Figure 5 is a schematic diagram of a flow chart of a device for checking data between network layers according to an embodiment of the present invention;
[0022] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0024] Since the network controller manages network data based on a hierarchical management architecture, the control components are divided into multiple layers of control components. Each layer of control components records resource data through a database or cache, such as Figure 1As shown in the figure, it includes four network layers: virtual network service Neutron, SDN controller, TGW-agent (tenant gatewayagent) and TGW (tenantgateway). Based on the above scenarios, when a certain resource data is to be operated, the resource needs to be interactively transmitted between multiple components and finally mapped to one or more configurations of the network element. In the current network environment, abnormal scenarios are inevitable, such as network oscillation or version problems in abnormal scenarios, which lead to inconsistent resource data of upper and lower control components, resulting in missing or residual network element configurations, affecting business traffic, and then causing abnormal customer traffic. In addition, the current upper and lower layer components lack reconciliation logic, and problems can only be restored by manual intervention, which increases the labor cost of operation and maintenance. The data reconciliation between some components is rough, and data reconciliation is performed by pulling all resource data for traversal comparison. Since the control component needs to manage many types of resources, such as port, subnet, router, etc., this verification method is inefficient, consumes a lot of CPU resources, and may even affect the delivery of normal business logic.
[0025] According to an embodiment of the present invention, an embodiment of a method for verifying data between network layers is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0026] In this embodiment, a method for checking data between network layers is provided, which can be used for a network controller. Figure 2 1 is a flow chart of a method for verifying data between network layers according to an embodiment of the present invention, the flow chart comprising the following steps:
[0027] Step S101, obtaining first coding information of the current network layer and second coding information of the upper network layer, where the first coding information and the second coding information are digital codes calculated using resource data versions of corresponding network layers;
[0028] Step S102, comparing the first coding information and the second coding information;
[0029] Step S103, if the first coding information and the second coding information are equal, the verification is passed;
[0030] Step S104, if the first coding information and the second coding information are not equal, the verification fails;
[0031] Step S105, when the verification fails, the resource data of the current network layer and the upper network layer are checked, and the resource data of the current network layer is modified according to the checking result.
[0032] Specifically, when each layer of the network is transmitting data, the data of the lower layer of the network comes from the upper layer of the network. If the data synchronization is successful, the data of the lower layer of the network will be consistent with the upper layer of the network, and the corresponding data version will be updated to the same. Based on this, the embodiment of the present invention uses the version information of each layer of the network to perform coding calculations, thereby calculating the coding information of each network layer. For example, the coding algorithms that can be used include but are not limited to non-return-to-zero coding, Manchester coding, differential Manchester coding, hash coding, etc. After the present invention calculates the corresponding digital code based on the version of the resource data in each network layer, if the data versions between the network layers are the same, the calculated codes should be the same, so that the coding information between the network layers is compared. If the first coding information of the current network layer is equal to the second coding information of the previous layer, the verification is passed, indicating that the data of the current network layer is the same as the data of the previous network layer, and is the correct data after update; if the first coding information and the second coding information are not equal, the verification fails; when the verification fails, it indicates that there is a problem of different data between the network layers. At this time, the two network layers are subjected to detailed data verification and modification. Through this scheme, there is no need to traverse and compare all the data each time to verify the data consistency between the network layers. Only a simple comparison of the codes is required, which significantly improves the efficiency of data reconciliation between network levels.
[0033] In some optional implementations, the step of calculating the coding information of each network layer includes:
[0034] Step a1, dividing the resource data of the current network layer into multiple data blocks;
[0035] Step a2, setting a unique key value for each data block, wherein the key values corresponding to data blocks with the same division standard between different network layers are the same;
[0036] Step a3, assigning a version number to each data block according to the version of the resource data in each data block, wherein if the versions of the resource data in the data blocks between different network layers are the same, the data blocks between different network layers have the same version number;
[0037] Step a4, calculating and obtaining the encoding information of the current network layer based on all key values and all version numbers of the current network layer.
[0038] Specifically, in order to improve the uniqueness of the coding calculation and reduce the amount of tasks in the subsequent verification of detailed data, the present invention first divides the resource data of each network layer into data blocks. Specifically, the resource data of the network layer can be divided into multiple data blocks according to different data types. This embodiment is only taken as an example and is not limited to this. The resource data of each network layer can also be divided into multiple data blocks according to other standards. Then, for the same type of data blocks, a unique key value key is set for each data block, and then the version of the resource data in each data block is analyzed, and a version number is assigned to each data block according to the corresponding version. If the version of the resource data in the data blocks between different network layers is the same, the data blocks between different network layers have the same version number. If the version of the resource data in the data blocks between different network layers is different, the version number of the data blocks between different network layers is also different. The key values corresponding to the data blocks with the same division standard between different network layers are the same. For example, network layer 1 and network layer 2 divide data blocks according to data types, so that the number of data blocks divided by network layer 1 and network layer 2 and the internal data should be the same one-to-one, so that the completely identical data blocks are assigned the same key value in network layer 1 and network layer 2.
[0039] For specific division methods, please refer to Figure 3 ,exist Figure 3 In the above, recordx_x indicates the specific data in each data block, m1, m2, m3... indicate the key value of each data block. In the upper and lower networks, data blocks of the same type have the same key value. In other words, data block m1 in network layer 1 and data block m2 in network layer 2 should theoretically have exactly the same data. Ver1, Ver2, Ver3... indicate the version number corresponding to each data block. If the data versions in the data blocks corresponding to the same key value in the upper and lower networks are exactly the same, the version numbers of the corresponding data blocks in the upper and lower networks are also the same. If the data versions in the data blocks corresponding to the same key value in the upper and lower networks are different, the version numbers of the corresponding data blocks in the upper and lower networks are also different. This may be caused by the failure of successful synchronization during data transmission.
[0040] Based on this, when calculating the coding information of the current network layer in the embodiment of the present invention, all key values and all version numbers in the current network layer can be directly used to calculate the coding information. For example, in a specific embodiment, the information digest algorithm can be used to encrypt and calculate all key values and all version numbers of the current network layer to obtain the coding information of the current network layer. In this way, a unique code representing the identity of all data in the network layer can be calculated using less data. In actual application, after the data of the upper network layer is changed, the version number of the corresponding data block will be modified, and then a change request will be sent to the next network layer. After receiving the change request, the next network layer will also modify the data of this layer according to the change data of the upper layer, and then the version number of the data of this layer will be updated. If the resource data in each network layer is successfully changed, the data will be exactly the same as the previous layer, and the corresponding coding information will also be exactly the same as the previous layer, so that the coding information of the two network layers can be compared to determine whether the data of the next network layer is successfully changed, thereby improving the efficiency of data proofreading. If the coding information of the two layers is different, it can be directly determined which data block has a problem according to the version number of each data block, and there is no need to traverse and verify all resource data, thereby reducing the calculation amount of the CPU.
[0041] In addition, the information digest algorithm used in the embodiment of the present invention may be the MD5 information digest algorithm. MD5 has many properties:
[0042] Compressibility: For any length of input, the output length is always the same.
[0043] Easy to compute: linear time complexity.
[0044] Anti-modification: Even a small modification to the original data will lead to a huge change in the final result.
[0045] Anti-collision: Given the original data and MD5 value, it is difficult to generate data that is different from the original data but has the same MD5 value.
[0046] Through this algorithm, even a small change in any data in the network layer will directly lead to a huge change in the encoded information, which helps to improve the accuracy of data verification between network layers.
[0047] In some optional implementation manners, before the above step S105, the method further includes:
[0048] Step b1, checking whether the version numbers of the same key value between the current network layer and the upper network layer are consistent;
[0049] Step b2: If the comparison shows that the version numbers are consistent, the verification is successful;
[0050] Step b3: if inconsistent target version numbers are found, the verification fails, and the resource data of the current network layer and the upper network layer are checked, and the resource data of the current network layer is modified according to the check result.
[0051] Specifically, when the first coding information of the current network layer is different from the second coding information of the previous network layer, it is highly likely that the data between the two network layers is different. The present invention uses the version numbers of the divided data blocks for further comparison. If the version numbers of the data blocks with the same key value between the upper and lower network layers are the same, it means that the information summary algorithm may be calculated incorrectly. In fact, the data of the lower two layers are the same, thus passing the verification. If the target version numbers of some or a certain data block between the upper and lower network layers are found to be inconsistent between the upper and lower layers, it can not only determine that there is a problem of data asynchrony between the upper and lower network layers, but also find the corresponding key values according to different version numbers, thereby determining which data block the difference data exists in. In the later stage, only one or several data blocks with problematic version numbers need to be checked, which can significantly improve the efficiency of data checking.
[0052] In some optional implementations, the above step S105 includes:
[0053] Step c1, determining the target key value through the target version number;
[0054] Step c2, extracting first target detailed data from the data block corresponding to the current network layer through the target key value;
[0055] Step c3, extracting the second target detailed data from the data block corresponding to the upper network layer through the target key value;
[0056] Step c4, comparing the first target detailed data with the second target detailed data, and updating the first target detailed data using the compared difference data.
[0057] Specifically, the target version number determined by the above steps in the embodiment of the present invention can locate the target key value, and the data block corresponding to the target key value is the data block with data problems, so it will cause inconsistent target version numbers in the upper and lower network layers, thereby locating the target data block with data problems. Afterwards, the corresponding data is extracted from the upper and lower network layers for the data block of the target key value, and then the detailed data is traversed and compared. Through this solution, it is only necessary to perform detailed data comparison on the problematic data block, and there is no need to traverse and compare all the detailed data between the two network layers, which can significantly reduce the amount of tasks, reduce the amount of CPU calculations, and improve data verification efficiency.
[0058] In some optional implementations, the above step S102 includes:
[0059] Step d1, comparing the first encoding information and the second encoding information through the first thread.
[0060] In some optional implementations, the above step b1 includes:
[0061] Step e1, checking the version numbers of the same key value between the current network layer and the upper network layer through the first thread;
[0062] In some optional implementations, the above step S105 further includes:
[0063] Step f1, checking resource data of the current network layer and the upper network layer through the second thread.
[0064] Specifically, Figure 4 As shown, in an embodiment of the present invention, two threads are used to perform data verification tasks, wherein the first thread is only responsible for verifying the coding information and version number, and the second thread is only responsible for verifying the detailed data in the data block. If only the first thread is used for data verification, it may take a long time to perform the task of verifying the detailed data in the data block. If the verification has a periodic requirement, when the next verification is required, the first thread has not completed the detailed data verification in this data block, resulting in the next verification not being able to start. Verifying the detailed data by the second thread can make the verification cycle of each problem unaffected. The first thread is only responsible for discovering the problem, and the second thread is responsible for slowly correcting the problem. The two threads are performed simultaneously, thereby significantly improving the data verification efficiency. The solution provided by the present invention can avoid the problem that the next verification needs to be started when the verification cycle is up, but the verification of the detailed data has not been completed.
[0065] Through the technical solution provided by the present invention, (1) the version number, MD5, and multi-threading technology are applied simultaneously to efficiently complete the data reconciliation task of the upper and lower layer components. Data inconsistency is an occasional scenario. In most normal scenarios, the reconciliation task only needs to pull the MD5 value, and there is no need to pull a large amount of specific resource data for comparison. If the MD5 is inconsistent with the data, the business module with inconsistent data can be further accurately located through the version number in the data block, and then the data can be reconciled according to the key value of the business module, avoiding the problem of large-scale data interaction between the upper and lower components, and finally the resource data reconciliation can be completed very lightly and accurately.
[0066] In this embodiment, a network layer data verification device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0067] This embodiment provides a network layer data verification device, such as Figure 5 As shown, including:
[0068] The coding information acquisition module 501 is used to acquire the first coding information of the current network layer and the second coding information of the upper network layer, where the first coding information and the second coding information are digital codes calculated using the resource data version of the corresponding network layer;
[0069] A coding comparison module 502, used to compare the first coding information with the second coding information;
[0070] A verification pass module 503, configured to verify that the first coded information and the second coded information are equal;
[0071] A verification failure module 504, configured to fail the verification if the first coding information and the second coding information are not equal;
[0072] The data checking module 505 is used to check the resource data of the current network layer and the upper network layer when the check fails, and to modify the resource data of the current network layer according to the check result.
[0073] In some optional embodiments, it also includes:
[0074] A data block division module is used to divide the resource data of the current network layer into multiple data blocks;
[0075] A key value determination module, used to set a unique key value for each data block, wherein the key values corresponding to data blocks with the same division standard between different network layers are the same;
[0076] A version number assignment module, used to assign a version number to each data block according to the version of the resource data in each data block, wherein if the versions of the resource data in the data blocks between different network layers are the same, the data blocks between different network layers have the same version number;
[0077] The encoding calculation module is used to calculate the encoding information of the current network layer based on all key values and all version numbers of the current network layer.
[0078] In some optional implementations, the encoding calculation module includes:
[0079] The digest encryption calculation module is used to encrypt and calculate all key values and all version numbers of the current network layer through an information digest algorithm to obtain the encoding information of the current network layer.
[0080] In some optional implementation manners, before the data checking module 505, the following is further included:
[0081] The version number comparison module is used to check whether the version numbers of the same key value between the current network layer and the upper network layer are consistent;
[0082] The version number verification module is used to verify that if the comparison shows that the version numbers are consistent, the verification is passed;
[0083] The verification module, if an inconsistent target version number is found, the verification fails, and the resource data of the current network layer and the upper network layer are verified, and the resource data of the current network layer is modified according to the verification result.
[0084] In some optional implementations, the data checking module 505 includes:
[0085] A data block location module is used to determine the target key value through the target version number;
[0086] A first data extraction module, used to extract first target detailed data from a data block corresponding to the current network layer through a target key value;
[0087] A second data extraction module, used to extract second target detailed data from a data block corresponding to an upper network layer through a target key value;
[0088] The detailed comparison module is used to check the first target detailed data and the second target detailed data, and update the first target detailed data using the checked difference data.
[0089] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0090] In this embodiment, the data verification device between network layers is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0091] The embodiment of the present invention also provides a computer device having the above Figure 5 The data checking device between network layers is shown.
[0092] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0093] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0094] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0095] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0096] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0097] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0098] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0099] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0100] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for checking data between network layers, characterized in that: The method comprises: Acquire first coding information of the current network layer and second coding information of the upper network layer, wherein the first coding information and the second coding information are digital codes calculated using resource data versions of corresponding network layers; Comparing the first coded information with the second coded information; If the first coding information and the second coding information are equal, the verification passes; If the first coding information and the second coding information are not equal, the verification fails; When the verification fails, the resource data of the current network layer and the upper network layer are checked, and the resource data of the current network layer is modified according to the checking result.
2. The method according to claim 1, characterized in that: The steps to calculate the encoding information of each network layer include: Dividing the resource data of the current network layer into a plurality of data blocks; A unique key value is set for each data block, wherein the key values corresponding to data blocks with the same division standard between different network layers are the same; Assigning a version number to each data block according to the version of the resource data of each data block, wherein if the versions of the resource data in the data blocks between different network layers are the same, the data blocks between different network layers have the same version number; The encoding information of the current network layer is calculated based on all key values and all version numbers of the current network layer.
3. The method according to claim 2, characterized in that The calculating and obtaining the encoding information of the current network layer based on all key values and all version numbers of the current network layer includes: All key values and all version numbers of the current network layer are encrypted and calculated using an information digest algorithm to obtain the encoding information of the current network layer.
4. The method according to claim 2, characterized in that Before the step of comparing the resource data of the current network layer and the upper network layer when the verification fails and modifying the resource data of the current network layer according to the comparison result, the method further comprises: Check whether the version numbers of the same key value between the current network layer and the upper network layer are consistent; If the comparison shows that the version numbers are consistent, the verification passes; If inconsistent target version numbers are found, the verification fails, and the step of comparing the resource data of the current network layer and the upper network layer and modifying the resource data of the current network layer according to the comparison result is executed.
5. The method according to claim 4, characterized in that The checking the resource data of the current network layer and the upper network layer, and modifying the resource data of the current network layer according to the checking result, includes: Determine the target key value by using the target version number; Extracting first target detailed data from the data block corresponding to the current network layer by using the target key value; Extracting second target detailed data from the data block corresponding to the upper network layer through the target key value; The first target detailed data and the second target detailed data are compared, and the first target detailed data is updated using the compared difference data.
6. The method according to claim 4, characterized in that The comparing the first coded information with the second coded information includes: Comparing the first encoding information with the second encoding information through a first thread; The checking whether the version numbers of the same key value between the current network layer and the upper network layer are consistent includes: Verifying, by a first thread, version numbers of the same key value between the current network layer and the upper network layer; The checking of the resource data of the current network layer and the upper network layer includes: The resource data of the current network layer and the upper network layer are checked through the second thread.
7. A data checking device between network layers, characterized in that: The device comprises: A coding information acquisition module, used to acquire first coding information of a current network layer and second coding information of an upper network layer, wherein the first coding information and the second coding information are digital codes calculated using a resource data version of a corresponding network layer; A coding comparison module, used for comparing the first coding information with the second coding information; A verification pass module, configured to verify that the first coding information and the second coding information are equal; A verification failure module, configured to fail the verification if the first coding information and the second coding information are not equal; The data checking module is used to check the resource data of the current network layer and the upper network layer when the check fails, and to modify the resource data of the current network layer according to the check result.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device and equipment of strategy consistency auditing
CN103067203A
Method for high-security network data storage
CN105516204A
Network address management and data transmission method of equipment
CN115190101A
File verification method and device, storage medium and electronic equipment
CN118916332A
Impeding data access
US20200220714A1