Supervision object data updating method and equipment
By adopting the incremental update method and AES key encryption technology in the supervision system, the incremental upgrade of supervision object data is automatically processed, solving the problems of data coverage and low efficiency caused by manual updates at the supervision desk, and achieving efficient and accurate data renew.
Patent Information
- Application Number
- CN202410686243.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-05-30
AI Technical Summary
In the existing supervision system, the supervision desk needs to manually update the supervision object data, resulting in a large amount of data and a long update time. Some on-site object data are overwritten, affecting the normal use of the supervision desk.
Adopting the supervision object data update method, by sending a version update request to the data server, receiving and filtering incremental data, determining the operation type according to the incremental attributes for incremental updates, and using AES key encryption and decryption to achieve automatic increment of data. upgrade.
It reduces manual operations, improves upgrade efficiency and accuracy, reduces the risk of operational errors, solves the problem of data coverage, and enables regular data updates for dispersed supervision locations.
Smart Images

Figure CN118689883A
Abstract
Description
Background Art
[0002] The current supervision system includes a supervision platform and a service provider. The service provider's database stores upgraded object data of different versions. The object data of different objects are usually stored in the form of information tables. Each object data in the information table is the data of a supervision object. The supervision platform stores the supervision object data locally, and supervises the objects of the supervision platform through the stored supervision object data, such as implementing security checks.
[0003] When the supervision station needs to synchronize the supervision object data from the service provider, the current object data update of the supervision station adopts the method of manual update and full coverage. The new data of some supervision sites will be overwritten, and the amount of data will gradually increase. The update time is long, and there is a defect of overwriting some supervision site data, which affects the normal use of the supervision station. Summary of the invention
[0004] The purpose of this application is to provide a method and device for updating supervision object data, which is used to solve the problems of the existing supervision object data updating method using manual update and full replacement, which has the defects of large data volume and overwriting part of the on-site object data.
[0005] In a first aspect, an embodiment of the present application provides a method for updating supervision object data, the method comprising:
[0006] In response to the supervision object data update request, send a version update request to the data service provider;
[0007] Receive target supervision object data belonging to incremental data filtered out by the data service provider based on the current version and the updated target version and the incremental attributes of each supervision object data in the database, wherein the incremental attributes are used to indicate each operation performed on the object data in the database and the corresponding version;
[0008] Determine the operation type of incremental update on the current version according to the incremental attribute of the target supervision object data;
[0009] The target supervision object data is utilized to perform incremental updates based on the current version according to the determined operation type.
[0010] In some possible embodiments, the incremental attributes include:
[0011] an insert operation performed on the object data in the database and a corresponding first version;
[0012] An update operation performed on the object data in the database and a corresponding second version;
[0013] The update field corresponding to the update operation is executed;
[0014] A deletion operation performed on the object data in the database and the corresponding third version.
[0015] In some possible embodiments, determining the operation type of incremental update on the current version according to the incremental attribute of the target supervision object data includes at least one of the following steps:
[0016] If the version numbers of the first version and the second version are both greater than the version number of the current version, and the third version does not exist, or if the version number of the first version is greater than the current version, and the second version and the third version do not exist, determine that the operation type of incremental update on the current version is an insert operation;
[0017] If the version number of the first version is not greater than the version number of the current version, the version number of the second version is greater than the version number of the current version, and the third version does not exist, determining that the operation type of the incremental update on the current version is an update operation;
[0018] If the version number of the first version is not greater than the version number of the current version, and the third version exists and its version number is greater than the version number of the current version, it is determined that the operation type of the incremental update on the current version is a delete operation.
[0019] In some possible embodiments, the target supervision object data is data encrypted using an AES key, the AES key is encrypted in advance using an RSA public key, and the obtained AES key ciphertext is added with obfuscated characters and then split and stored in a first file and a second file respectively, further comprising:
[0020] Concatenate the contents of the first file and the second file, remove the confusing characters and obtain the AES key ciphertext;
[0021] Decrypt the AES key ciphertext using the RSA private key to obtain the AES key;
[0022] The target supervision object data is decrypted using the AES key.
[0023] In some possible embodiments, the supervision object data is an information list, and the method further includes at least one step:
[0024] Read the index item information in the incrementally updated supervision object data, match the read index item information with the pre-set index item information, and write the object identifier and corresponding version number of the successfully matched supervision object data into the index file;
[0025] Read the image path in the incrementally updated supervision object data, request the data service provider to obtain the image under the corresponding image path according to the image path, and use the obtained image to update according to the corresponding incremental update operation type;
[0026] For pictures whose incremental update operation type is insert or update, the picture feature vectors are extracted respectively, and the pictures are updated according to the insert or update operation type.
[0027] In some possible embodiments, in response to a supervision object data update request, sending a version update request to a data service provider includes:
[0028] In response to a data update request from a regulated object, send a data update request to a data service provider according to a set update cycle;
[0029] Receive a list of version numbers returned by the data service provider, the version numbers of which are greater than the current version;
[0030] According to the highest version number allowed to be updated, a target version number is selected from the version number list, and a version update request carrying the target version number is sent to the data service provider.
[0031] In some possible embodiments, the method further includes at least one of the following steps:
[0032] When the incremental update based on the current version fails according to the determined operation type, a version rollback operation is performed to return to the current version before the upgrade;
[0033] When the update fails according to the corresponding incremental update operation type using the acquired image, a picture rollback operation is performed to return to the picture before the incremental update;
[0034] For pictures whose incremental update operation type is insert or update, picture feature vectors are extracted respectively. When the incremental update of the picture feature vector fails, a picture feature vector rollback operation is performed to return to the picture feature vector before the incremental update.
[0035] In a second aspect, an embodiment of the present application provides a method for updating supervision object data, the method comprising:
[0036] Receive version update requests sent by the supervisory station;
[0037] Filter out target supervision object data belonging to incremental data based on the current version of the supervision station and the updated target version, and the incremental attributes of each supervision object data in the local database, wherein the incremental attributes are used to indicate each operation performed on the object data in the database and the corresponding version;
[0038] The target supervision object data is sent to the supervision station.
[0039] In some possible embodiments, the incremental attributes include: an insert operation performed on the object data in the database and the corresponding first version; an update operation performed on the object data in the database and the corresponding second version; an update field corresponding to the update operation; a delete operation performed on the object data in the database and the corresponding third version. Based on the current version of the supervision station and the updated target version, and the incremental attributes of each supervision object data in the local database, the target supervision object data belonging to the incremental data is screened out, including:
[0040] Filter out the target supervision object data whose first version is greater than the current version of the supervision station and not greater than the updated target version;
[0041] Filter out the target supervision object data whose second version is greater than the current version of the supervision station and not greater than the updated target version;
[0042] Filter out target supervision object data whose third version is greater than the current version of the supervision station and not greater than the updated target version.
[0043] In the third aspect, another embodiment of the present application also provides a regulatory object data update device, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any regulatory object data update method provided in the embodiment of the present application.
[0044] In a fourth aspect, another embodiment of the present application further provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is used to enable a computer to execute any of the supervision object data updating methods provided in the embodiments of the present application.
[0045] The supervision object data update method provided in the embodiment of the present application realizes the automation of the incremental upgrade process through online incremental update of supervision object data, reduces manual operations, improves upgrade efficiency and accuracy, and reduces the risk of operational errors.
[0046] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 is a schematic diagram of an application environment according to an embodiment of the present application;
[0049] Figure 2 A flowchart of a method for updating data of a supervision object according to an embodiment of the present application is shown;
[0050] Figure 3 A schematic diagram of a corresponding flow chart showing that the operation type is determined to be insertion according to an embodiment of the present application;
[0051] Figure 4 A schematic diagram of a corresponding flow chart showing that the operation type is determined to be insertion according to another embodiment of the present application;
[0052] Figure 5 A flowchart for updating the data of a supervision object according to an embodiment of the present application according to insert increments;
[0053] Figure 6 A schematic diagram of a process flow corresponding to an update according to an embodiment of the present application in which the operation type is determined;
[0054] Figure 7 According to an embodiment of the present application, the operation type is determined to be a corresponding flow chart of deletion;
[0055] Figure 8 A schematic diagram of a process for sending a version update request according to an embodiment of the present application;
[0056] Fig. 9 A schematic diagram of a process of pre-storing an encrypted AES key according to an embodiment of the present application;
[0057] Fig.10 The following is an overall flow chart of AES key encryption and decryption according to one embodiment of the present application;
[0058] Fig.11 A specific flow chart of decrypting an AES key according to an embodiment of the present application;
[0059] Fig.12 A schematic diagram of the composition of a commodity library according to an embodiment of the present application;
[0060] Fig.13 A flowchart of incrementally updating a supervision object image according to one embodiment of the present application;
[0061] Fig.14 A flowchart of incrementally updating a picture feature vector according to an embodiment of the present application;
[0062] Fig.15 A flowchart of rollback when update of supervision object data fails according to one embodiment of the present application;
[0063] Fig.16 A flowchart of rollback when a supervision object image update fails according to an embodiment of the present application;
[0064] Fig.17 A flowchart of rollback when update failure of a picture feature vector of a supervision object according to an embodiment of the present application;
[0065] Fig.18 A flow chart of a method for updating supervision object data applied to a data service provider according to an embodiment of the present application;
[0066] Fig.19 This is an overall flow chart of a method for updating supervision object data according to an embodiment of the present application;
[0067] Fig. 20 This is a structural diagram of a supervision object data update device according to an embodiment of the present application. DETAILED DESCRIPTION
[0068] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application. The method can be executed in the order of the method shown in the embodiment or drawings or in parallel during the actual processing process or when the control device is executed.
[0069] In view of the fact that the data updating method of the supervision object using manual update and full replacement in the related art has the problem of large data volume and the defect of covering part of the on-site object data, the present application proposes a supervision object data updating method and device.
[0070] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings.
[0071] The following is a detailed description of the supervision object data updating method in the embodiment of the present application with reference to the accompanying drawings.
[0072] See also Figure 1 , is a schematic diagram of an application environment according to an embodiment of the present application.
[0073] like Figure 1 As shown, the application environment may include, for example, a supervision station 10 and a data service provider 20 .
[0074] The above-mentioned supervision station can be a supervision station in various supervision scenarios, which is dispersedly distributed in various supervision locations. The local database of the supervision station stores the supervision object data, and uses the supervision object data to supervise the supervision object. Specifically, the supervision object is photographed by a camera device, and data supervision is achieved based on the photographed supervision object using the supervision object data. Possible application scenarios are security inspection scenarios, such as customs security inspection scenarios, and the supervision objects are commodities. With the upgrade of the database version, different versions of the supervision object data are stored in the database of the data service provider. In order to achieve more accurate data supervision, the supervision station needs to obtain the updated version of the supervision object data from the data service provider. At present, the supervision object data update of the supervision station adopts the method of full coverage. The newly added data at some customs sites will be overwritten, and the amount of data will gradually increase. The update time is long, which affects the normal use of the supervision station.
[0075] Figure 2 A schematic diagram of a method for updating data of a supervision object provided by an embodiment of the present application is shown. The method is applied to a supervision station and includes:
[0076] Step 201: In response to a supervision object data update request, a version update request is sent to a data service provider.
[0077] In the embodiment of the present application, the supervision station can periodically send a version update request to the data service provider through a supervision object data update request. The version update request carries target version information to indicate to the data service provider the version to which the supervision station expects to upgrade. Of course, the target version information may not be carried.
[0078] For the supervisory station, the highest version information allowed for upgrade is usually limited by version restriction information, and the supervisory station can determine the target version information according to the version restriction information.
[0079] Step 202, receiving target supervision object data belonging to incremental data screened by the data service provider based on the current version and the updated target version and the incremental attributes of each supervision object data in the database, wherein the incremental attributes are used to indicate each operation performed on the object data in the database and the corresponding version;
[0080] In the embodiment of the present application, an incremental attribute is added to the supervision object data in the database of the data service provider, and the incremental attribute is used to indicate the various operations performed on the supervision object data in the database and the corresponding versions, so as to map the generation and update trajectory of the data. After receiving the version update request sent by the supervision station, the data service provider can filter out the target supervision object data whose target version is incremental data relative to the current version of the supervision station according to the target version and the incremental attribute of the supervision object data, and send the target supervision object data to the supervision station. The data service provider can determine the target version based on the version in the version update request of the supervision station, and can also determine the target version based on the current version of the supervision station.
[0081] In the embodiment of the present application, the regulatory object data of different regulatory objects are stored in the database in the form of tables. Taking the regulatory object as a commodity as an example, the commodity information mainly includes commodity code, vector code, name, brand, specification, price, category, tax number and other text information, which is stored in the MySQL database of the data service provider. It can be stored in the form of a table, for example, it can be stored in the form of an information table and a price table, and the two tables are linked with the commodity code as a condition.
[0082] Step 203, determining the operation type of incremental update on the current version according to the incremental attribute of the target supervision object data;
[0083] The target supervision object data received by the supervision station carries incremental attributes. The supervision station can determine which operations have been performed on which versions of each supervision object data based on the incremental attributes, and combine the current version information to determine the type of operation performed when upgrading using the target supervision object data.
[0084] Step 204: using the target supervision object data, incrementally update based on the current version according to the determined operation type.
[0085] The method for updating the data of the supervised object provided in the embodiment of the present application realizes the automation of the incremental upgrade process through the online incremental update of the supervised object database, reduces manual operations, improves the upgrade efficiency and accuracy, and reduces the risk of operational errors. It solves the problem of full update data coverage and realizes the regular update of the latest commodity database for the supervision stations scattered in various supervision locations such as customs.
[0086] In some possible embodiments, the above incremental attributes include:
[0087] The insertion operation performed on the object data in the database and the corresponding first version, i.e., the version corresponding to the first entry of the supervision object data into the database;
[0088] The update operation performed on the object data in the database and the corresponding second version, that is, the version corresponding to the most recent update of the conditional supervision object data;
[0089] Execute the update operation corresponding to the update field, that is, update the specific corresponding field;
[0090] The deletion operation performed on the object data in the database and the corresponding third version, that is, on which versions the supervision object data is deleted.
[0091] Incremental attributes can be added to the regulatory object data in the form of new fields in the database. Four new fields are added to each regulatory object data, as shown in Table 1.
[0092] Table 1
[0093]
[0094] Each object data is a piece of data, including multiple fields. The above-mentioned newly added fields can be used to determine the version of the regulatory object's regulatory object data when it enters the database, the version and updated fields corresponding to the most recent update, and the version corresponding to the regulatory object data when it is deleted from the database.
[0095] The data service provider can determine the target supervision object data that is filtered out as incremental data based on the incremental attributes and target version of each supervision object data. The supervision station determines the operation type of incremental update on the current version based on the incremental attributes of the target supervision object data. One possible implementation method is as follows: Figure 3 As shown, including:
[0096] Step 301, determine that the version numbers of the first version and the second version are both greater than the version number of the current version, and the third version does not exist;
[0097] If the version numbers of the first version and the second version are both greater than the version number of the current version, it means that the supervision object data is newly added in the version after the current version, and an update operation is performed afterwards.
[0098] Step 302, determining that the operation type of the incremental update on the current version is an insert operation;
[0099] The supervision platform determines the operation type of incremental update on the current version according to the incremental attribute of the target supervision object data. Another possible implementation method is as follows: Figure 4 As shown, including:
[0100] Step 401, determine that the version number of the first version is greater than the current version, and the second version and the third version do not exist;
[0101] Step 402: Determine that the operation type of the incremental update on the current version is an insert operation.
[0102] If the version number of the first version is greater than the current version, and the second and third versions do not exist, it means that the piece of supervision object data is object data newly added to the current version, and the incremental update type is to insert the piece of supervision object data.
[0103] When the supervision station determines that the operation type is an insert operation, the supervision object data is inserted into the local storage database as new data. The specific insertion method is as follows Figure 5 As shown, including:
[0104] Step 501, determining that the operation type of incremental update on the current version is an insert operation;
[0105] Step 502: insert the supervision object data into the local database as a new supervision object data.
[0106] The following is a corresponding example in combination with Table 1. Assuming that the database version of the current on-site supervision station is 1.16, the corresponding version of a supervision object data returned by the data service provider is shown in Table 1 above, insert_version is 1.17 which is greater than 1.16, and update_version is 1.18 which is also greater than 1.16. It is judged that the data was inserted in version 1.17 and updated in version 1.18. At this time, only the insert operation needs to be executed to insert the supervision object data.
[0107] The supervision platform determines the operation type of incremental update on the current version according to the incremental attribute of the target supervision object data. Another possible implementation method is as follows: Figure 6 As shown, including:
[0108] Step 601, determine that the version number of the first version is not greater than the version number of the current version, the version number of the second version is greater than the version number of the current version, and the third version does not exist;
[0109] Step 602: Determine that the operation type of the incremental update on the current version is an update operation.
[0110] If the version number of the first version is not greater than the version number of the current version, it means that the supervision object data is the supervision object data inserted in the previous version or the current version. If the version number of the second version is greater than the version number of the current version, it means that the supervision object data has been updated, and therefore the corresponding update operation needs to be performed.
[0111] The following is a corresponding example in combination with Table 2. Assume that the incremental attributes of a piece of regulatory object data belonging to incremental data returned by the data service provider are as shown in Table 2, the insert_version is 1.16 which is the same as the current version of the regulatory station, and the update_version is 1.17 which is greater than 1.16. Then it is judged that the regulatory object data is updated in version 1.17. At this time, the update operation needs to be executed to update the regulatory object data.
[0112] Table 2
[0113] Fields Remark Example insert_version On which version to insert data 1.16 update_version On which version is the data updated? 1.17 update_content Which field to update barcode delete_version On which version do you delete data? Null
[0114] The supervision platform determines the operation type of incremental update on the current version according to the incremental attribute of the target supervision object data. Another possible implementation method is as follows: Figure 7 As shown, including:
[0115] Step 701, determine that the version number of the first version is not greater than the version number of the current version, and that the third version exists and has a version number greater than the version number of the current version;
[0116] Step 702: Determine that the operation type of the incremental update on the current version is a delete operation.
[0117] If the version number of the first version is not greater than that of the current version, it means that the piece of regulatory object data may exist in the current version. If the third version exists and its version number is greater than that of the current version, it means that the subsequent upgraded version deleted the piece of regulatory object data. Therefore, the corresponding incremental update operation type is a deletion operation.
[0118] A specific example is given below in conjunction with Table 3. As shown in Table 3, if the delete_version is found to be 1.19, which is greater than 1.16, the delete operation is directly performed.
[0119] Table 3
[0120]
[0121] In the embodiment of the present application, in response to the supervision object data update request, a version update request is sent to the data service provider, such as Figure 8 As shown, including:
[0122] Step 801, in response to a data update request of a supervision object, sending a data update request to a data service provider according to a set update cycle;
[0123] For example, the supervisory station may send a data update request to the data service provider at monthly intervals to obtain the latest version number. The data update request may carry the version number of the current version of the supervisory station's local database, or may not carry the version number of the current version.
[0124] Step 802, receiving the version number list returned by the data service provider;
[0125] The above version number list must contain at least one version number.
[0126] After the data service provider receives a data update request, if the update request carries the version number of the current version, the data service provider calculates the difference between the current version and the latest version number of the data service provider's database, and returns a list of version numbers that can be updated. For example, if the version number of the supervisory station database is 1.16 and the latest version number of the data service provider is 1.20, the returned version number list includes 1.17, 1.18, 1.19, and 1.20. Of course, the version number of the index can also be returned.
[0127] Step 803: Select a target version number from the version number list according to the highest version number allowed to be updated, and send a version update request carrying the target version number to the data service provider.
[0128] When the supervisory station determines that the version number list includes multiple version numbers, it compares the multiple version numbers with the version number of the current version. If the version number of the current version is lower than the latest version number in the version number list, it can select a target version number that is not higher than the highest version number allowed to be updated locally according to the needs, and send a version update request carrying the target version number to the data service provider. For example, it can be updated to the latest version 1.20, or only updated to version 1.19.
[0129] Optionally, the version update request carries the host serial number of the supervisory station.
[0130] In the embodiment of the present application, the data service provider records the highest version number allowed to be updated by each supervisory station. If the highest version number allowed to be updated is higher than the latest version number of the data service provider's database, the request is approved; otherwise, the version update request issued by the supervisory station is rejected.
[0131] In the embodiment of the present application, the data service provider adopts DMZ service. DMZ, also known as "demilitarized zone", is a network security architecture used to create a buffer zone between an untrusted external network and a trusted internal network. Its main function is to isolate and protect the internal network.
[0132] After performing an incremental update based on the current version according to a determined operation type, the embodiment of the present application records the identification of the successfully updated supervision objects, such as the product code and the total number.
[0133] Through the above implementation, non-cross-version upgrade and cross-version upgrade can be achieved, wherein:
[0134] 1) Non-cross-version upgrade: assuming that the database version number of the current supervision site supervision station is 1.19, and the database version number of the data service provider is 1.20, the returned version number list includes version number 1.20. The supervision station selects 1.20 as the target version, and the data service provider returns the added, deleted, and modified supervision object data required to update to version 1.20. The supervision station performs incremental updates based on the returned incremental data.
[0135] 2) Cross-version upgrade: Assuming that the current version number of the on-site supervisory station database is 1.16, the highest version number allowed by the supervisory station is 1.20, and the database version number of the data service provider is 1.20, the returned version number list includes 1.17-1.20. The supervisory station can select one of the version numbers 1.20 as the target version, and the data service provider will return the corresponding supervisory object data belonging to incremental data according to the target version.
[0136] The current supervisory station database is in plain text, with low data security and a high risk of data theft. To this end, based on the product characteristics of the supervisory station's centralized deployment, the present application embodiment proposes a data encryption transmission and reading solution to ensure the uniqueness of the key and its association with the host, improve the security of data encryption, and achieve efficient encryption and decryption of large amounts of data.
[0137] The target supervision object data described in the embodiment of the present application is data encrypted using an AES key, such as Fig. 9 As shown, it also includes:
[0138] Step 901, pre-encrypting the AES key using an RSA public key;
[0139] Step 902: Add obfuscated characters to the obtained AES key ciphertext and then split it into a first file and a second file.
[0140] In the embodiment of the present application, when the data service returns the target supervision object data to the supervision station, the target supervision object data is encrypted in plain text using the AES key. In order to ensure that the AES key is not stolen, the embodiment of the present application performs an encryption process on the AES key in advance, such as Fig.10 As shown, the host serial number (e.g., 24 bytes) and random number (e.g., 8 bytes) of the control station are used as AES key plaintext to ensure the uniqueness of the key and its association with the host. The AES key ciphertext is obtained by encrypting with the RAS public key, and the AES key ciphertext is split into two parts after adding obfuscated characters and stored in two files respectively.
[0141] like Fig.11As shown, after receiving the target supervision object data belonging to the incremental data screened out by the data service provider based on the current version and the updated target version and the incremental attributes of each supervision object data in the database, the supervision object data updating method of the embodiment of the present application further includes:
[0142] Step 1101, concatenate the contents of the first file and the second file, remove obfuscated characters and obtain an AES key ciphertext;
[0143] Step 1102, decrypting the AES key ciphertext using the RSA private key to obtain the AES key;
[0144] Step 1103: Decrypt the target supervision object data using the AES key.
[0145] After receiving the encrypted data of the target supervision object, the supervision station starts to execute the decryption process. For specific examples, see Fig.10 The decryption process in .
[0146] The embodiment of the present application customizes the encryption scheme according to the data sensitivity and security requirements, improves the flexibility of the encryption strategy, and improves the security of the data while ensuring the data reading speed.
[0147] In the embodiment of the present application, the data service provider's database may store the data of the supervised object in the form of information table and price table, and may also store the supervised object data related information in other forms, such as Fig.12 As shown, for example, the information related to the supervision object data may also include a supervision object image, a picture feature vector, etc. In addition, index item information may be pre-established to index a supervision object corresponding to a certain type or keyword, as follows:
[0148] 1) Pictures of regulated objects
[0149] The images of the regulatory objects are stored in the object storage. Each regulatory object, such as a product, has several images. The storage path is in the folder of the regulatory object type, such as the product brand folder, and the complete storage path is saved in the MySQL image table of the data service provider. The regulatory object identifier, such as the product code, is used as a condition to associate the information table of the regulatory object.
[0150] like Fig.13 As shown, the supervision object data is an information list, and the method further includes:
[0151] Step 1301, reading the image path in the incrementally updated supervision object data;
[0152] In the embodiment of the present application, the supervision object data also includes the image path of the supervision object image in the data service provider database.
[0153] Step 1302: Request the data service provider to obtain the image under the corresponding image path according to the image path;
[0154] Step 1303: Use the acquired image to perform an update according to the corresponding incremental update operation type.
[0155] As mentioned above, the operation types for incremental update of supervision object data include insert, update and delete. If the operation type is insert and update, the supervision station will perform the image insertion and update operations after obtaining the corresponding image. If the operation type is delete, the image will be deleted.
[0156] 2) Image feature vector
[0157] The image feature vectors of the regulated objects are stored in the vector library. The vector library is mainly used for image search, which performs vector retrieval based on similarity according to the image information of the goods to achieve price recommendations for related goods. The id of the image feature vector in the vector library corresponds to the id in the image table, and is associated with the regulated object identifier.
[0158] The method for updating the data of the supervision object in the embodiment of the present application is as follows: Fig.14 As shown, it also includes:
[0159] Step 1401, extracting picture feature vectors for pictures whose incremental update operation type is insert or update respectively;
[0160] Step 1402: Update the image feature vector according to insert or update.
[0161] If the operation type for incremental update of target object data is insert or update, then the corresponding picture is inserted or updated. The embodiment of the present application extracts the picture feature vector of the inserted or updated picture and performs the insertion or update to realize the incremental update of the picture feature vector.
[0162] 3) Index item information
[0163] The index item information in the MySQL database of the data service provider may include brands and keywords. Specifically, a brand index table and a keyword index table may be pre-established. The brand index table stores the English name of the brand and its corresponding txt file name; the keyword index table stores the keywords of the high-frequency supervision object names such as the product name and its corresponding txt file name. The txt document records all the product codes corresponding to a certain brand name or keyword.
[0164] In the embodiment of the present application, the supervision station reads the index item information in the incrementally updated supervision object data, matches the read index item information with the pre-set index item information, and writes the object identifier and corresponding version number of the successfully matched supervision object data into the index file.
[0165] The embodiment of the present application updates the index file for all newly added and modified supervision object data. Taking the supervision object as a commodity as an example, read the brand English name and commodity English name fields in all newly added and modified commodity information tables, match them with the brands in the brand index table and the keywords in the keyword index table, and if the match is successful, write the commodity code goods_id and the corresponding version number of the data into the txt document corresponding to the brand and keyword in the algorithm's index folder.
[0166] As another possible embodiment, if the read index item information fails to match the preset index item information, the information table of the supervision object data is written into a specified txt document.
[0167] During the incremental update process based on the current version according to the determined operation type, the incremental update may fail. If the update process fails, open the updated index file and delete the regulatory object data corresponding to the identifier of the regulatory object that has been updated. After checking and confirming that there are no errors, you can re-execute the update operation.
[0168] like Fig.15 As shown, the method for updating the data of the supervision object in the embodiment of the present application includes:
[0169] Step 1501, incremental update based on the current version according to the determined operation type fails;
[0170] Step 1502, performing a version rollback operation to return to the current version before the upgrade;
[0171] During the update process, the regulatory object ID and total number corresponding to each updated regulatory object data are recorded. If the update is successful, the update result and updated regulatory object ID and other information are obtained. If the update fails, the database will perform a rollback operation and return to the version before the update to ensure that the database can operate normally.
[0172] like Fig.16 As shown, the method for updating the data of the supervision object in the embodiment of the present application further includes:
[0173] Step 1601, using the acquired picture to update according to the corresponding incremental update operation type fails;
[0174] Step 1602, perform a picture rollback operation to return to the picture before the incremental update.
[0175] like Fig.17 As shown, the method for updating the data of the supervision object in the embodiment of the present application further includes:
[0176] Step 1701, extracting picture feature vectors for pictures whose incremental update operation type is insert or update, respectively, and performing incremental update on the picture feature vector fails;
[0177] Step 1702, performing a picture feature vector rollback operation to return to the picture feature vector before the incremental update.
[0178] Since Minio itself does not provide native rollback function for storing image objects, object storage is usually designed to be highly available and durable, and data will not be deleted easily. Minio supports object versioning, which can be enabled at the bucket level, so that each modification to the object will generate a new version, and you can roll back to the previous version at any time, which can achieve a similar effect to the rollback operation.
[0179] During the update process of Minio, the algorithm service will record the number of the supervision object data currently updated and the updated image identifier image_id. If an exception occurs during the update process, the updated data in Minio will be deleted according to the record. To ensure normal use, you can first roll back to the bucket-level backup version mentioned above, and then re-execute the update operation after checking and confirming that it is correct.
[0180] The present application also provides a method for updating supervision object data. Fig.18 As shown, the method is applied to a data service provider, and the method includes:
[0181] Step 1801, receiving a version update request sent by a supervisory station;
[0182] Step 1802, based on the current version of the supervision platform and the updated target version, and the incremental attributes of each supervision object data in the local database, the target supervision object data belonging to the incremental data are filtered out, and the incremental attributes are used to indicate each operation performed on the object data in the database and the corresponding version;
[0183] Step 1803: Send the target supervision object data to the supervision station.
[0184] In the embodiment of the present application, a table needs to be established in the MySQL database of the data service provider, as shown in Table 4, to store the host serial number of each on-site inspection station of the customs, the corresponding AES key and the current latest product library version number for data encryption and maintenance.
[0185] Table 4
[0186]
[0187] The above-mentioned incremental attributes include: the insert operation performed on the object data in the database and the corresponding first version; the update operation performed on the object data in the database and the corresponding second version; the update field corresponding to the update operation; the delete operation performed on the object data in the database and the corresponding third version. Based on the current version of the supervision station and the updated target version, and the incremental attributes of each supervision object data in the local database, the target supervision object data belonging to the incremental data is screened out, including:
[0188] Filter out the target supervision object data whose first version is greater than the current version of the supervision station and not greater than the updated target version;
[0189] Filter out the target supervision object data whose second version is greater than the current version of the supervision station and not greater than the updated target version;
[0190] Filter out target supervision object data whose third version is greater than the current version of the supervision station and not greater than the updated target version.
[0191] Refer to Table 1, that is, find the supervision object data with a value of any one of the fields of insert_version, update_version, and delete_version greater than 1.16 and send it to the supervision station.
[0192] In some possible embodiments, after determining the target supervision object data belonging to the incremental data, the data service provider uses the AES key to encrypt the target supervision object data. As mentioned above, the AES key can be specifically generated by adding a random number to the host serial number of the supervision station.
[0193] In some possible embodiments, in order to facilitate synchronization of deleted data, the supervised object data to be deleted on the DMZ service is not physically deleted. If the delete_version field is not empty, the algorithm part needs to restrict when reading, and does not read if the field is not empty.
[0194] like Fig.19 The figure shows a schematic diagram of the interaction process between the supervision platform and the data service provider in an embodiment of the present application. The supervision platform is divided into a front-end supervision platform and a back-end algorithm service. Taking the supervision object as a commodity as an example, it mainly includes:
[0195] Step 1901, the supervisory station sends a commodity library update request to the data service provider, and the request carries the host serial number;
[0196] Step 1902, the data service provider returns the version number list that the current supervisory station allows to update;
[0197] Step 1903: The supervisory station selects a target version from the version number list and initiates a version update request to the data service provider to update to the target version;
[0198] Step 1904: The data service provider calculates the incremental commodity data of the supervision station according to the above implementation mode, encrypts it with AES and returns it to the supervision station. The data can be returned in batches according to the size of the data.
[0199] Step 1905: The supervisory station receives the incremental commodity data, calls the commodity library update interface of the algorithm service, and hands the incremental commodity data to the algorithm service for incremental update;
[0200] Step 1906, the algorithm service updates the information table in the commodity data using the above-mentioned insertion, update and deletion logic, and returns the update result of whether the update is successful to the supervision station;
[0201] Step 1907, the algorithm service initiates a proxy request to the supervision station to obtain product images;
[0202] Step 1908, the supervision station forwards the image acquisition request of the background algorithm service to the data service provider;
[0203] Step 1909: The data service provider obtains the product image and returns it to the supervision station;
[0204] Step 1910, the supervision station returns the product image to the algorithm service;
[0205] Step 1911, the algorithm service updates the product image according to the determined incremental update method, and saves the product image to the object storage;
[0206] Step 1912, the algorithm service updates the image feature vector according to the corresponding incremental update method and saves it to the vector database;
[0207] Step 1913, the algorithm service notifies the supervision platform that the backend product library has been updated;
[0208] Step 1914: After the algorithm service updates the local product library version of the supervisory station, the supervisory station notifies the data service provider that the update is complete;
[0209] Step 1915: The data service provider records the latest upgraded version of the supervision station.
[0210] Based on the same inventive concept, the present application also provides a device for updating data of a supervision object, the device comprising:
[0211] An update request module, used to send a version update request to a data service provider in response to a supervision object data update request;
[0212] An incremental data acquisition module, used to receive target supervision object data belonging to incremental data filtered out by the data service provider based on the current version and the updated target version and the incremental attributes of each supervision object data in the database, wherein the incremental attributes are used to indicate each operation performed on the object data in the database and the corresponding version;
[0213] An operation type determination module, used to determine the operation type of incremental update on the current version according to the incremental attribute of the target supervision object data;
[0214] The incremental update module is used to utilize the target supervision object data to perform incremental updates based on the current version according to the determined operation type.
[0215] In some possible embodiments, the incremental attributes include:
[0216] an insert operation performed on the object data in the database and a corresponding first version;
[0217] An update operation performed on the object data in the database and a corresponding second version;
[0218] The update field corresponding to the update operation is executed;
[0219] A deletion operation performed on the object data in the database and the corresponding third version.
[0220] In some possible embodiments, the operation type determination module determines the operation type of incremental update on the current version according to the incremental attribute of the target supervision object data, including at least one of the following steps:
[0221] If the version numbers of the first version and the second version are both greater than the version number of the current version, and the third version does not exist, or if the version number of the first version is greater than the current version, and the second version and the third version do not exist, determine that the operation type of incremental update on the current version is an insert operation;
[0222] If the version number of the first version is not greater than the version number of the current version, the version number of the second version is greater than the version number of the current version, and the third version does not exist, determining that the operation type of the incremental update on the current version is an update operation;
[0223] If the version number of the first version is not greater than the version number of the current version, and the third version exists and its version number is greater than the version number of the current version, it is determined that the operation type of the incremental update on the current version is a delete operation.
[0224] In some possible embodiments, the target supervision object data is data encrypted using an AES key, the AES key is encrypted in advance using an RSA public key, and the obtained AES key ciphertext is added with obfuscated characters and then split and stored in a first file and a second file respectively, further comprising:
[0225] The decryption module is used to concatenate the contents of the first file and the second file, remove the confusing characters to obtain the AES key ciphertext; use the RSA private key to decrypt the AES key ciphertext to obtain the AES key; and use the AES key to decrypt the target supervision object data.
[0226] In some possible embodiments, the supervision object data is an information list, and the incremental update module is further used to perform at least one of the following steps:
[0227] Read the index item information in the incrementally updated supervision object data, match the read index item information with the pre-set index item information, and write the object identifier and corresponding version number of the successfully matched supervision object data into the index file;
[0228] Read the image path in the incrementally updated supervision object data, request the data service provider to obtain the image under the corresponding image path according to the image path, and use the obtained image to update according to the corresponding incremental update operation type;
[0229] For pictures whose incremental update operation type is insert or update, the picture feature vectors are extracted respectively, and the pictures are updated according to the insert or update operation type.
[0230] In some possible embodiments, the update request module sends a version update request to the data service provider in response to the supervision object data update request, including:
[0231] In response to a data update request from a regulated object, send a data update request to a data service provider according to a set update cycle;
[0232] Receive a list of version numbers returned by the data service provider, the version numbers of which are greater than the current version;
[0233] According to the highest version number allowed to be updated, a target version number is selected from the version number list, and a version update request carrying the target version number is sent to the data service provider.
[0234] In some possible embodiments, the incremental update module is further configured to perform at least one of the following steps:
[0235] When the incremental update based on the current version fails according to the determined operation type, a version rollback operation is performed to return to the current version before the upgrade;
[0236] When the update fails according to the corresponding incremental update operation type using the acquired image, a picture rollback operation is performed to return to the picture before the incremental update;
[0237] For pictures whose incremental update operation type is insert or update, picture feature vectors are extracted respectively. When the incremental update of the picture feature vector fails, a picture feature vector rollback operation is performed to return to the picture feature vector before the incremental update.
[0238] After introducing the supervision object data updating method and apparatus according to the exemplary embodiment of the present application, next, a supervision object data updating device according to another exemplary embodiment of the present application is introduced.
[0239] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0240] In some possible implementations, the regulatory object data updating device according to the present application may include at least one processor and at least one memory. The memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the regulatory object data updating method according to various exemplary implementations of the present application described above in this specification.
[0241] Refer to the following Fig. 20 The supervision object data updating device 200 according to this embodiment of the present application is described. Fig. 20 The displayed supervision object data updating device 200 is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0242] like Fig. 20 As shown, the supervision object data update device 200 is in the form of a general electronic device. The components of the supervision object data update device 200 may include but are not limited to: at least one processor 201, at least one memory 202, and a bus 203 connecting different system components (including the memory 202 and the processor 201).
[0243] Bus 203 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
[0244] The memory 202 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 2021 and / or a cache memory 2022 , and may further include a read-only memory (ROM) 2023 .
[0245] The memory 202 may also include a program / utility 2025 having a set (at least one) of program modules 2024, such program modules 2024 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0246] The regulatory object data update device 200 may also communicate with one or more external devices 204 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the regulatory object data update device 200, and / or communicate with any device that enables the regulatory object data update device 200 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 205. In addition, the regulatory object data update device 200 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 206. As shown in the figure, the network adapter 206 communicates with other modules of the regulatory object data update device 200 via a bus 203. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the regulatory object data update device 200, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0247] In some possible implementations, various aspects of a method for updating regulatory object data provided by the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of a method for updating regulatory object data according to various exemplary implementations of the present application described above in this specification.
[0248] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for updating data of a supervision object, the method being applied to a supervision station, It is characterized in that The method comprises: In response to the supervision object data update request, send a version update request to the data service provider; Receive target supervision object data belonging to incremental data filtered out by the data service provider based on the current version and the updated target version and the incremental attributes of each supervision object data in the database, wherein the incremental attributes are used to indicate each operation performed on the object data in the database and the corresponding version; Determine the operation type of incremental update on the current version according to the incremental attribute of the target supervision object data; The target supervision object data is utilized to perform incremental updates based on the current version according to the determined operation type.
2. The method according to claim 1, It is characterized in that The incremental attributes include: an insert operation performed on the object data in the database and a corresponding first version; An update operation performed on the object data in the database and a corresponding second version; The update field corresponding to the update operation is executed; A deletion operation performed on the object data in the database and the corresponding third version.
3. The method according to claim 2, It is characterized in that Determining the operation type of incremental update on the current version according to the incremental attribute of the target supervision object data includes at least one of the following steps: If the version numbers of the first version and the second version are both greater than the version number of the current version, and the third version does not exist, or if the version number of the first version is greater than the current version, and the second version and the third version do not exist, determine that the operation type of incremental update on the current version is an insert operation; If the version number of the first version is not greater than the version number of the current version, the version number of the second version is greater than the version number of the current version, and the third version does not exist, determining that the operation type of the incremental update on the current version is an update operation; If the version number of the first version is not greater than the version number of the current version, and the third version exists and its version number is greater than the version number of the current version, it is determined that the operation type of the incremental update on the current version is a delete operation.
4. The method according to claim 1, It is characterized in that The target supervision object data is data encrypted by using an AES key, the AES key is encrypted in advance by using an RSA public key, and the obtained AES key ciphertext is added with obfuscated characters and then split and stored in a first file and a second file respectively, further comprising: Concatenate the contents of the first file and the second file, remove the confusing characters and obtain the AES key ciphertext; Decrypt the AES key ciphertext using the RSA private key to obtain the AES key; The target supervision object data is decrypted using the AES key.
5. The method according to claim 1, It is characterized in that The supervision object data is an information list, and the method further comprises at least one step: Read the index item information in the incrementally updated supervision object data, match the read index item information with the pre-set index item information, and write the object identifier and corresponding version number of the successfully matched supervision object data into the index file; Read the image path in the incrementally updated supervision object data, request the data service provider to obtain the image under the corresponding image path according to the image path, and use the obtained image to update according to the corresponding incremental update operation type; For pictures whose incremental update operation type is insert or update, the picture feature vectors are extracted respectively, and the pictures are updated according to the insert or update operation type.
6. The method according to claim 1, It is characterized in that In response to the supervision object data update request, a version update request is sent to the data service provider, including: In response to a data update request from a regulated object, send a data update request to a data service provider according to a set update cycle; Receive a list of version numbers returned by the data service provider, the version numbers of which are greater than the current version; According to the highest version number allowed to be updated, a target version number is selected from the version number list, and a version update request carrying the target version number is sent to the data service provider.
7. The method according to claim 5, It is characterized in that It also includes at least one of the following steps: When the incremental update based on the current version fails according to the determined operation type, a version rollback operation is performed to return to the current version before the upgrade; When the update fails according to the corresponding incremental update operation type using the acquired image, a picture rollback operation is performed to return to the picture before the incremental update; For pictures whose incremental update operation type is insert or update, picture feature vectors are extracted respectively. When the incremental update of the picture feature vector fails, a picture feature vector rollback operation is performed to return to the picture feature vector before the incremental update.
8. A method for updating data of a supervision object, It is characterized in that The method is applied to a data service provider, and the method comprises: Receive version update requests sent by the supervisory station; Filter out target supervision object data belonging to incremental data based on the current version of the supervision station and the updated target version, and the incremental attributes of each supervision object data in the local database, wherein the incremental attributes are used to indicate each operation performed on the object data in the database and the corresponding version; The target supervision object data is sent to the supervision station.
9. The method according to claim 8, It is characterized in that The incremental attributes include: the insert operation performed on the object data in the database and the corresponding first version; the update operation performed on the object data in the database and the corresponding second version; the update field corresponding to the update operation; the delete operation performed on the object data in the database and the corresponding third version. Based on the current version of the supervision station and the updated target version, and the incremental attributes of each supervision object data in the local database, the target supervision object data belonging to the incremental data is screened out, including: Filter out the target supervision object data whose first version is greater than the current version of the supervision station and not greater than the updated target version; Filter out the target supervision object data whose second version is greater than the current version of the supervision station and not greater than the updated target version; Filter out target supervision object data whose third version is greater than the current version of the supervision station and not greater than the updated target version.
10. A device for updating data of a supervision object, It is characterized in that It includes at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 6, or execute the method according to any one of claims 7 to 9.
Citation Information
Patent Citations
Data updating method, client, and server
CN106302439A
Method and system for updating client program incrementally
CN106302753A
Data incrementally pulling method and device, storage medium, terminal device and server
CN107819870A
Database encryption and decryption methods and devices, storage medium and terminal
CN108712412A
Method and device for obtaining incremental data, server and storage medium
CN110309122A
Cited By
Point cloud mapping method and system based on distributed storage and storage medium
CN120451421A
