A collaborative method and system for a cloud, a local server, and an edge device
By adopting a collaborative method between the cloud, local server and edge devices, and using adaptive acquisition intervals to update data, the problems of high long-link resource occupation and low data transmission efficiency in the existing technology are solved, and the effect of reducing the load of cloud servers and improving system scalability is achieved.
Patent Information
- Application Number
- CN202411428606.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2044-10-14
AI Technical Summary
In the data collaboration between edge devices and cloud servers, the long-link resource occupies high, resulting in low data transmission efficiency and consistent maintenance troubles. The increase in the number of edge devices will cause high load on cloud servers and affect scalability.
The collaborative method of cloud, local server and edge devices is adopted to send personal information to the cloud server through user terminals, and the cloud server is reviewed and processed and stored. The local server and edge devices use adaptive acquisition intervals to obtain the user information version number from the cloud server and update the database of local and edge devices.
It reduces the coupling between edge terminals, transfers the load of edge devices to the local server, reduces the load of cloud servers, improves the scalability of the system, and solves the problem of difficult instruction penetration in complex network environments.
Smart Images

Figure CN119383196B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of collaboration, and particularly to a collaboration method and system for a cloud, a local server, and an edge device. Background Art
[0002] With the development of IT technology and process manufacturing, the types of edge terminals are increasing, such as Internet of Things devices, embedded terminals, etc. In the field of access control and security, edge devices such as face device authentication terminals are usually used. When data collaboration is carried out between an edge device and a cloud server, the prior art usually uses a long connection method for data collaboration. However, the long connection occupies a relatively high resource. Keeping the connection for a long time will occupy the resources of the cloud server and the edge device, including bandwidth, memory, and processing power. Relying solely on the long connection results in low data transmission efficiency and troublesome consistency maintenance work. The increase in the number of edge devices will bring a high load problem to the cloud server, which is not conducive to later scale expansion. Summary of the Invention
[0003] The purpose of the present invention is to disclose a collaboration method and system for a cloud, a local server, and an edge device, so as to solve the technical problems proposed in the background art.
[0004] To achieve the above purpose, the present invention provides the following technical solutions:
[0005] On the one hand, the present invention provides a collaboration method for a cloud, a local server, and an edge device, which is applied to a system including a user terminal, a cloud server, a local server, and an edge device, and includes:
[0006] S1, the user terminal sends the input personal information to the cloud server;
[0007] S2, the cloud server obtains the audit processing result of the personal information, and stores the personal information according to the audit processing result. A first personnel information database is set in the cloud server, and the personnel information version number of the first personnel information database is stored;
[0008] S3, the local server obtains the personnel information version number of the first personnel information database from the cloud server at an adaptive acquisition interval, and updates the second personnel information database and the personnel information version number of the second personnel information database according to the obtained personnel information version number of the first personnel information database;
[0009] S4, the edge device obtains the personnel information version number of the second personnel information database from the cloud server at an adaptive acquisition interval, and updates the third personnel information database and the personnel information version number of the third personnel information database according to the obtained personnel information version number of the second personnel information database.
[0010] Preferably, the user terminal includes a smart phone, a tablet computer, and a desktop computer.
[0011] Preferably, the personal information includes a face photo, an ID card photo, and personal basic information;
[0012] The personal basic information includes a name and a mobile phone number.
[0013] Preferably, obtaining the review and processing result of personal information includes:
[0014] Calculate the similarity between the face photo in the personal information and the face area in the ID card photo pre-stored in the cloud server, and determine whether the similarity is greater than the set similarity threshold. If so, the review and processing result is passed; if not, the review and processing result is not passed.
[0015] Preferably, storing the personal information according to the review and processing result includes:
[0016] If the review and processing result is passed, store the personal information sent by the user terminal into the first personnel information database and update the personnel information version number of the first personnel information database.
[0017] Preferably, obtaining the personnel information version number of the first personnel information database from the cloud server at an adaptive acquisition interval includes:
[0018] Calculate the first acquisition interval;
[0019] Obtain the personnel information version number of the first personnel information database from the cloud server based on the first acquisition interval;
[0020] Preferably, obtaining the personnel information version number of the second personnel information database from the cloud server at an adaptive acquisition interval includes:
[0021] Calculate the second acquisition interval;
[0022] Obtain the personnel information version number of the second personnel information database from the local server based on the second acquisition interval.
[0023] Preferably, updating the second personnel information database and the personnel information version number of the second personnel information database according to the obtained personnel information version number of the first personnel information database includes:
[0024] Determine whether the personnel information version number of the first personnel information database is consistent with the personnel information version number of the second personnel information database. If not, send a first update request to the cloud server;
[0025] Receive the first update information pushed by the cloud server according to the first update request;
[0026] Update the second personnel information database according to the first update information;
[0027] Update the personnel information version number of the second personnel information database to the personnel information version number of the first personnel information database.
[0028] Preferably, calculating the first acquisition interval includes:
[0029] For the k-th first acquisition interval, calculate it in the following way:
[0030] Use t k,1 to represent the moment when calculating the k-th first acquisition interval starts, use N k,1 to represent the number of times the local server sends the first update request to the cloud server in the time interval [t k,1 , t k,1 -T], use M k,1 to represent the total number of times the local server obtains the personnel information version number of the first personnel information database from the cloud server in the time interval [t k,1 , t k,1 -T], and T represents the preset duration;
[0031] Calculate the k-th first acquisition interval based on N k,1 and M k,1 .
[0032] Preferably, updating the third personnel information database and the personnel information version number of the third personnel information database according to the obtained personnel information version number of the second personnel information database includes:
[0033] Judge whether the personnel information version number of the second personnel information database is consistent with the personnel information version number of the third personnel information database. If not, send a second update request to the local server;
[0034] Receive the second update information pushed by the local server according to the second update request;
[0035] Update the third personnel information database according to the second update information;
[0036] Update the personnel information version number of the third personnel information database to the personnel information version number of the second personnel information database.
[0037] On the other hand, the present invention provides a collaborative system for a cloud, a local server, and an edge device, including a user terminal, a cloud server, a local server, and an edge device;
[0038] The user terminal is used to send the input personal information to the cloud server;
[0039] The cloud server is used to obtain the review and processing results of personal information, and store the personal information according to the review and processing results. A first personnel information database is set up in the cloud server, and the personnel information version number of the first personnel information database is stored;
[0040] The local server is used to obtain the personnel information version number of the first personnel information database from the cloud server at an adaptive acquisition interval, and update the second personnel information database and the personnel information version number of the second personnel information database according to the obtained personnel information version number of the first personnel information database;
[0041] The edge device is used to obtain the personnel information version number of the second personnel information database from the cloud server at an adaptive acquisition interval, and update the third personnel information database and the personnel information version number of the third personnel information database according to the obtained personnel information version number of the second personnel information database.
[0042] Beneficial effects:
[0043] The traditional cloud server is used to maintain data consistency, which is changed to the edge terminal to maintain independently, reducing the coupling degree between edge terminals; the load pressure of the edge device is transferred from the cloud server to the local servers under each project scenario, reducing the cloud load and improving the scalability of the system; by using the method of the lower-level nodes actively querying the higher-level nodes, only the cloud server needs to have an Internet IP to communicate. The local server and the edge device interact through the IP addresses under the local area network. Moreover, it can also solve the problem of difficult instruction penetration in complex network environments. Description of the drawings
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.
[0045] Figure 1 It is a schematic diagram of a collaborative method for a cloud, a local server and an edge device of the present invention.
[0046] Figure 2 It is a schematic diagram of a collaborative system for a cloud, a local server and an edge device of the present invention. Detailed implementation manners
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0048] As Figure 1 shown, the present invention provides a collaborative method for a cloud, a local server, and an edge device, which is applied to a system including a user terminal, a cloud server, a local server, and an edge device, and includes:
[0049] S1. The user terminal sends the input personal information to the cloud server.
[0050] S2. The cloud server obtains the audit processing result of the personal information and stores the personal information according to the audit processing result. A first personnel information database is set in the cloud server, and the personnel information version number of the first personnel information database is stored.
[0051] S3. The local server obtains the personnel information version number of the first personnel information database from the cloud server at an adaptive acquisition interval, and updates the second personnel information database and the personnel information version number of the second personnel information database according to the obtained personnel information version number of the first personnel information database.
[0052] S4. The edge device obtains the personnel information version number of the second personnel information database from the cloud server at an adaptive acquisition interval, and updates the third personnel information database and the personnel information version number of the third personnel information database according to the obtained personnel information version number of the second personnel information database.
[0053] Preferably, the user terminal includes a smart phone, a tablet computer, and a desktop computer.
[0054] The user terminal is an electronic device capable of communicating with the cloud server.
[0055] For example, in the access control management system of a community, the user terminal is an electronic device such as a smart phone, a tablet computer, and a desktop computer used by the residents of the community and capable of communicating with the cloud server.
[0056] When a resident needs to apply for the permission to enter and exit the access control of the community, the personal information is input through the user terminal used by himself / herself, and the user terminal sends the personal information to the cloud server.
[0057] Specifically, the number of local servers can be multiple, and each local server communicates with multiple edge devices respectively.
[0058] For example, a local server is set up in each cell, and the access control devices at various locations in the cell act as edge devices.
[0059] Preferably, the personal information includes a face photo, an ID card photo, and personal basic information;
[0060] The personal basic information includes name and mobile phone number.
[0061] Preferably, obtaining the review and processing result of personal information includes:
[0062] Calculate the similarity between the face area in the face photo in the personal information and the face area in the pre-stored ID card photo in the cloud server, and determine whether the similarity is greater than the set similarity threshold. If so, the review and processing result is passed; if not, the review and processing result is not passed.
[0063] Specifically, the pre-stored ID card photo is uploaded by the administrator of the cloud server.
[0064] For example, in the access control management system of the cell, the pre-stored ID card photo is the ID card photo of the cell owner. At this time, the administrator of the cloud server can be the property management personnel of the cell.
[0065] By uploading the ID card photo in advance, when the cell owner applies for access control permission, the review can be automatically performed without manual review, improving the review efficiency.
[0066] Specifically, the set similarity threshold is 0.7.
[0067] Preferably, calculating the similarity between the face photo in the personal information and the face area in the pre-stored ID card photo in the cloud server includes:
[0068] Judge whether there is an ID card number in all the pre-stored ID card photos that is the same as the ID card number in the ID card photo of the personal information. If not, set the similarity to 0. If so, perform the following calculations:
[0069] Use A to represent the ID card number in the ID card photo of the personal information, and obtain the ID card photo P2 with the ID card number A from all the pre-stored ID card photos;
[0070] Use P1 to represent the face photo in the personal information;
[0071] Use the preset mask image to obtain the area BK from P2;
[0072] Use the image segmentation algorithm to segment BK to obtain the face area FC1 in BK;
[0073] Segment P1 to obtain the face region FC2 in BK;
[0074] Calculate the similarity between FC1 and FC2.
[0075] Preferably, obtaining the region BK from P2 using a preset mask image includes:
[0076] The size of the mask image is the same as that of P2;
[0077] Use PU to represent the set of coordinates of the pixel points belonging to the face head region in the ID card photo;
[0078] In the mask image, the gray values of the pixel points whose coordinates belong to PU are all set to 1, while the gray values of the remaining pixel points are set to 0;
[0079] Multiply the mask image by P2 to obtain the image P3;
[0080] The region in image P3 with a gray value greater than 0 is the region BK.
[0081] Specifically, when multiplying, P2 needs to be converted into a grayscale image, and then the multiplication operation is performed with the mask image. The multiplication operation calculates one by one for the pixel points with the same coordinates in the two images, and takes the product of the gray values of the two pixel points with the same coordinates as the gray value of the pixel point at the same coordinate in P3.
[0082] Preferably, using an image segmentation algorithm to segment BK to obtain the face region FC1 in BK includes:
[0083] Use the Otsu algorithm to segment BK to obtain the face region FC1 in BK.
[0084] Specifically, after the Otsu algorithm calculates the gray threshold, the pixel points greater than the gray threshold are the pixel points in FC1.
[0085] Preferably, segmenting P1 to obtain the face region FC2 in BK includes:
[0086] Perform graying processing on P1 to obtain the image G1;
[0087] Perform regionalization processing on G1, divide G1 into multiple connected regions, and store the obtained connected regions in the set CU;
[0088] Obtain the set FCU1 of the pixel points in P1 that conform to the skin detection model;
[0089] Filter the pixel points in FCU1 to obtain the set FCU2;
[0090] Obtain the set FCU3 of pixel points in G1 that have the same coordinates as FCU1; obtain the set FCU4 of pixel points in G1 that have the same coordinates as FCU2;
[0091] Obtain the set FCU5 based on FCU4;
[0092] Take the pixel points in FCU3 and FCU5 as the pixel points of FC2.
[0093] The segmentation process of the present invention is different from the existing segmentation process that is only based on the skin detection model. Because segmenting only based on the skin detection model, the image obtained after segmentation does not contain the complete face region, which will affect the validity of the results of subsequent similarity calculations. Therefore, after obtaining FCU1, the present invention obtains the set FCU2 of pixel points at the edge positions in the region composed of the pixel points in FCU1 through screening, and then performs subsequent patching calculations in G1, thereby improving the integrity of the finally obtained face region FC2.
[0094] Specifically, the pixel points in FCU3 are those obtained based on the skin detection model, while the pixel points in FCU5 are those obtained through patching calculations. Taking the pixel points in these two sets as the pixel points of FC2 realizes the acquisition of a more complete face region.
[0095] Preferably, obtaining the set FCU1 of pixel points in P1 that conform to the skin detection model includes:
[0096] For the pixel point px in P1, obtain the values H px , S px and V px of the H component, S component, and V component of px in the HSV color space;
[0097] Judge whether H px , S px and V px meet the following conditions:
[0098]
[0099] If they meet the conditions, deposit px into the set FCU1.
[0100] Preferably, perform regionalization processing on G1, divide G1 into multiple connected domains, and deposit the obtained connected domains into the set CU, including:
[0101] First step, initialize the gray value GR = 0;
[0102] Second step, in G1, only retain the pixel points with gray value equal to GR, obtain multiple connected domains, and deposit the obtained connected domains into the set CU;
[0103] In the third step, increment the value of GR by 1.
[0104] In the fourth step, determine whether GR is greater than 255. If it is, end the calculation; if not, go to the second step.
[0105] The regional processing of the present invention can make the subsequent patching calculation based on connected components. Each patching does not obtain only one pixel point, but a set of pixel points of a connected component, which greatly improves the efficiency of the patching process.
[0106] Specifically, store the obtained connected components in the set CU, including:
[0107] Determine whether the number of pixel points of the connected component is greater than or equal to 2. If it is, store the connected component in the set CU.
[0108] Preferably, screen the pixel points in FCU1 to obtain the set FCU2, including:
[0109] For the pixel point px1 in FCU1, determine whether all the pixel points in the 8-neighborhood of px1 are pixel points in FCU1 in P1. If not, store px1 in the set FCU2.
[0110] The above screening process is mainly to select the pixel points at the edge positions in the region composed of pixel points in FCU1. If all the pixel points in the 8-neighborhood of px1 are pixel points in FCU1, then px1 is inside the region composed of pixel points in FCU1.
[0111] Preferably, obtain the set FCU5 based on FCU4, including:
[0112] S10: Randomly select a pixel point px2 from FCU4;
[0113] S20: Obtain the connected component bk2 where px2 is located from CU, and use bk2 as the calculation region;
[0114] S30: Save the pixel points in the calculation region to the set FCU5, and obtain the set CNTU of all connected components adjacent to the calculation region in CU;
[0115] S40: Calculate the difference between the gray value of each connected component in CNTU and the gray value of the calculation region respectively;
[0116] S50: Obtain the minimum value of the absolute values of the multiple differences obtained in S40;
[0117] S60. Determine whether the minimum value obtained in S50 is less than the set grayscale value. If so, store the pixel points in the connected component corresponding to the minimum value obtained in S50 in CU into the set FCU5; if not, proceed to S90;
[0118] S70. Delete the connected component corresponding to the minimum value obtained in S50 from CU, and delete the calculation area from CU;
[0119] S80. Use the connected component corresponding to the minimum value obtained in S50 as the next calculation area;
[0120] S90. Delete the pixel points in FCU5 from FCU4;
[0121] S100. Determine whether FCU4 is an empty set. If so, end the calculation; if not, proceed to S10.
[0122] In the above patching process of the present invention, each time a pixel point is randomly selected from FCU4, and then the corresponding connected component is obtained based on this pixel point. After that, subsequent patching calculations can be performed based on the connected component. Since the grayscale values of the pixel points in the connected component are the same, the connected component can be regarded as a pixel point with a larger area for patching calculations, thus greatly improving the efficiency of the patching process. In addition, after obtaining the connected components with similar grayscale values and being interconnected in each calculation area, the pixel points in the calculation area and the pixel points of the connected components stored in FCU5 are calculated from FCU4, which can avoid repeated calculations of the pixel points in FCU4 and effectively improve the calculation efficiency.
[0123] Preferably, the set grayscale value is 5.
[0124] Since the grayscale values of the pixel points in each connected component are the same, the grayscale value of the connected component is the grayscale value of any one pixel point in the connected component, and the grayscale value of the calculation area is the grayscale value of any one pixel point in the calculation area.
[0125] Preferably, calculating the similarity between FC1 and FC2 includes:
[0126] Adjust FC2 to the same resolution as FC1 to obtain the image FC4;
[0127] Calculate the similarity between FC1 and FC4.
[0128] Specifically, the similarity can be calculated by using methods such as histogram similarity, SSIM, etc.
[0129] Preferably, storing personal information according to the audit processing result includes:
[0130] If the audit processing result is approved, the personal information sent by the user terminal is stored in the first personnel information database, and the personnel information version number of the first personnel information database is updated.
[0131] Preferably, the process of updating the personnel information version number of the first personnel information database is as follows:
[0132] Obtain the moment when the storage is completed during the process of storing the personal information sent by the user terminal to the first personnel information database, and convert the moment when the storage is completed into the personnel information version number of the first personnel information database.
[0133] Preferably, converting the moment when the storage is completed into the personnel information version number of the first personnel information database includes:
[0134] The moment when the storage is completed is a moment accurate to the second. The personnel information version number of the first personnel information database has a total of 14 digits. The 1st - 4th digits represent the year, the 5th - 6th digits represent the month, the 7th - 8th digits represent the day, the 9th - 10th digits represent the hour, the 11th - 12th digits represent the minute, and the 13th - 14th digits represent the second.
[0135] For example, when the moment when the storage is completed is 18:18:18 on September 29, 2024, the updated version number is represented by 20240929181818.
[0136] Preferably, obtaining the personnel information version number of the first personnel information database from the cloud server at an adaptive acquisition interval includes:
[0137] Calculate the first acquisition interval;
[0138] Based on the first acquisition interval, obtain the personnel information version number of the first personnel information database from the cloud server;
[0139] Obtaining the personnel information version number of the second personnel information database from the cloud server at an adaptive acquisition interval includes:
[0140] Calculate the second acquisition interval;
[0141] Based on the second acquisition interval, obtain the personnel information version number of the second personnel information database from the local server.
[0142] By obtaining the version number of the first personnel information database from the cloud server at an adaptive acquisition interval, when the number of local servers is large, the communication pressure on the cloud server can be reduced, and the amount of data sent and received can be reduced.
[0143] In addition, it is only necessary to know whether the data has changed through the version number, and only update the data when it has changed, without transmitting all the data for comparison, which can further reduce the communication pressure.
[0144] By obtaining the version number of the second personnel information database from the local server at an adaptive acquisition interval, the communication pressure on the local server can be reduced when the number of edge devices is large.
[0145] Preferably, obtaining the version number of the first personnel information database from the cloud server based on the first acquisition interval includes:
[0146] Starting from the completion of the calculation of the first acquisition interval, after a time length equal to the first acquisition interval, obtain the version number of the first personnel information database from the cloud server.
[0147] Preferably, obtaining the version number of the second personnel information database from the local server based on the second acquisition interval includes:
[0148] Starting from the completion of the calculation of the second acquisition interval, after a time length equal to the second acquisition interval, obtain the version number of the second personnel information database from the local server.
[0149] Preferably, updating the second personnel information database and the version number of the personnel information in the second personnel information database according to the obtained version number of the first personnel information database includes:
[0150] Judge whether the version number of the personnel information in the first personnel information database is consistent with the version number of the personnel information in the second personnel information database. If not, send a first update request to the cloud server;
[0151] Receive the first update information pushed by the cloud server according to the first update request;
[0152] Update the second personnel information database according to the first update information;
[0153] Update the version number of the personnel information in the second personnel information database to the version number of the personnel information in the first personnel information database.
[0154] Specifically, the first update request may include data such as URL, Cookie information stored in the local server, and the version number of the personnel information in the second personnel information database.
[0155] The Cookie information is used to verify the identity of the local server when the cloud server uses Cookies to identify the device.
[0156] Specifically, the process of obtaining the first update information is as follows:
[0157] The cloud server compares the data corresponding to the personnel information version number of the second personnel information database included in the first update request with the data stored in the first personnel information database to obtain the newly added data and the deleted data;
[0158] The newly added data and the deleted data are used as the first update information.
[0159] Specifically, updating the second personnel information database according to the first update information includes:
[0160] Deleting the deleted data from the second information database and adding the newly added data to the second information database.
[0161] Preferably, calculating the first acquisition interval includes:
[0162] For the k-th first acquisition interval, it is calculated in the following manner:
[0163] Use t k,1 to represent the moment when the calculation of the k-th first acquisition interval starts, use N k,1 to represent the number of times the local server sends the first update request to the cloud server in the time interval [t k,1 , t k,1 -T], use M k,1 to represent the total number of times the local server obtains the personnel information version number of the first personnel information database from the cloud server in the time interval [t k,1 , t k,1 -T], and T represents the preset duration;
[0164] Based on N k,1 and M k,1 calculate the k-th first acquisition interval.
[0165] Controlling the change of the first acquisition interval through historical update data can achieve the adaptive change of the first acquisition interval, thereby avoiding using a fixed value for the first acquisition interval. When the data is updated frequently, the personnel information can be synchronized more timely. On the contrary, the update interval is extended to reduce the communication pressure on the cloud server.
[0166] Specifically, after the (k - 1)-th acquisition interval ends, it enters the stage of calculating the k-th first acquisition interval. After the k-th first acquisition interval is calculated, it enters the k-th first acquisition interval.
[0167] Preferably, the preset duration is 24 hours.
[0168] Preferably, calculating the k-th first acquisition interval based on N k,1 and M k,1 includes:
[0169] The k-th first acquisition interval is calculated using the following formula:
[0170]
[0171] getitrf k represents the k-th first acquisition interval, and getitrf k-1 represents the (k - 1)-th first acquisition interval, η is the weight, tpre represents the set time length, Ψ represents the control score, and the value range of the control score is
[0172] Judge whether getitrf k is in the time interval [thsr, thed]. If so, keep getitrf k unchanged. If not, perform the following processing:
[0173] If getitrf k is less than thsr, then set the value of getitrf k to thsr. If getitrf k is greater than thed, then set the value of getitrf k to thed;
[0174] thsr is the minimum value of the set acquisition interval time length, and thed is the maximum value of the set acquisition interval time length.
[0175] The first acquisition interval of the present invention is not a fixed value because the data update interval in the first personnel information database is not fixed. If a fixed first acquisition interval is set, it is easy to cause too frequent requests to obtain the personnel information version number of the first personnel information database during a period when the data update interval in the first personnel information database is large. Obviously, this will cause excessive communication pressure on the cloud server and waste more bandwidth to return the personnel information version number of the first personnel information database to the local server. And during a period when the data update interval in the first personnel information database is small, it will cause the data in the second personnel information database to not be updated in time, affecting the data synchronization efficiency.
[0176] Therefore, the present invention calculates the k-th first acquisition interval based on the number of times the local server sends the first update request to the cloud server, the total number of times the local server obtains the personnel information version number of the first personnel information database from the cloud server, and the previous acquisition interval within a given time interval, improving the response ability of the k-th first acquisition interval to the data update intervals in different first personnel information databases, and can be at When, N k,1 and Mk,1 The greater the difference there is, the longer the duration of the k-th first acquisition interval. While at , N k,1 the greater the value is, the smaller the duration of the k-th first acquisition interval becomes. Thus, while data synchronization between the first personnel information database and the second personnel information database can be carried out in a timely manner, the communication pressure on the cloud server during the period when the data update interval in the first personnel information database is relatively small can be reduced.
[0177] Preferably, the minimum value of the time length of the acquisition interval is 1 hour, and the maximum value of the time length of the acquisition interval is 10 hours.
[0178] Preferably, tpre is 1 hour.
[0179] Preferably, the value of the control score is
[0180] Preferably, the value of the weight is
[0181] Preferably, the time length of the first first acquisition interval is Tlen 1 , and the value of k is greater than or equal to 2.
[0182] Tlen 1 is a preset first value.
[0183] Preferably, the preset first value is 1 hour.
[0184] Preferably, according to the personnel information version number of the obtained second personnel information database, the third personnel information database and the personnel information version number of the third personnel information database are updated, including:
[0185] Determine whether the personnel information version number of the second personnel information database is consistent with the personnel information version number of the third personnel information database. If not, send a second update request to the local server;
[0186] Receive the second update information pushed by the local server according to the second update request;
[0187] Update the third personnel information database according to the second update information;
[0188] Update the personnel information version number of the third personnel information database to the personnel information version number of the second personnel information database.
[0189] Specifically, the second update request may include the Cookie information stored in the edge device and the personnel information version number of the third personnel information database.
[0190] Specifically, the process of obtaining the second update information is as follows:
[0191] The local server compares the data corresponding to the version number of the personnel information in the third personnel information database included in the second update request with the data stored in the second personnel information database to obtain the newly added data and the deleted data;
[0192] The newly added data and the deleted data are used as the second update information.
[0193] Specifically, updating the third personnel information database according to the second update information includes:
[0194] Deleting the deleted data from the third information database and adding the newly added data to the third information database.
[0195] Preferably, calculating the second acquisition interval includes:
[0196] For the k-th second acquisition interval, it is calculated in the following manner:
[0197] Let t k,2 represent the moment when the calculation of the k-th second acquisition interval starts, and let N k,2 represent the number of times the edge device sends a second update request to the local server in the time interval [t k,2 , t k,2 - T], and let M k,2 represent the total number of times the edge device obtains the version number of the personnel information in the second personnel information database from the local server in the time interval [t k,2 , t k,2 - T], where T represents a preset duration;
[0198] Based on N k,2 and M k,2 calculate the k-th second acquisition interval.
[0199] Specifically, after the (k - 1)-th acquisition interval ends, it enters the stage of calculating the k-th second acquisition interval. After the k-th second acquisition interval is calculated, it enters the k-th second acquisition interval.
[0200] Preferably, calculating the k-th second acquisition interval based on N k,2 and M k,2 includes:
[0201] Use the following formula to calculate the k-th second acquisition interval:
[0202]
[0203] getitrs k represents the k-th second acquisition interval, getitrs k-1It represents the (k - 1)-th second acquisition interval, η is the weight, tpre represents the set time length, Ψ represents the control score, and the value range of the control score is
[0204] Judge getitrs k Whether it is in the time interval [thsr, thed]. If so, keep getitrs k unchanged. If not, perform the following processing:
[0205] If getitrs k is less than thsr, then set the value of getitrs k to thsr. If getitrs k is greater than thed, then set the value of getitrs k to thed;
[0206] thsr is the minimum value of the time length of the set acquisition interval, and thed is the maximum value of the time length of the set acquisition interval.
[0207] By the above method, it can make the second acquisition interval change with the change of the data update interval of the second personnel information database, so that when the data update interval of the second personnel information database is small, the third personnel information database can be updated in time, and when the data update interval of the second personnel information database is large, the value of the second acquisition interval can be expanded to reduce the communication pressure on the local server.
[0208] Preferably, the time length of the first second acquisition interval is Tlen 2 , and the value of k is greater than or equal to 2.
[0209] Tlen 2 is a preset second value.
[0210] Preferably, the preset second value is 1 hour.
[0211] On the other hand, the present invention provides a collaborative system for a cloud, a local server, and an edge device, including a user terminal, a cloud server, a local server, and an edge device;
[0212] The user terminal is used to send the input personal information to the cloud server;
[0213] The cloud server is used to obtain the audit processing result of the personal information and store the personal information according to the audit processing result. A first personnel information database is set in the cloud server, and the personnel information version number of the first personnel information database is stored;
[0214] The local server is used to obtain the version number of the personnel information in the first personnel information database from the cloud server at an adaptive acquisition interval, and update the second personnel information database and the version number of the personnel information in the second personnel information database according to the obtained version number of the personnel information in the first personnel information database;
[0215] The edge device is used to obtain the version number of the personnel information in the second personnel information database from the cloud server at an adaptive acquisition interval, and update the third personnel information database and the version number of the personnel information in the third personnel information database according to the obtained version number of the personnel information in the second personnel information database.
[0216] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the present invention, so that those skilled in the art in the relevant technical field can well understand and utilize the present invention. The present invention is only limited by the claims and their full scope and equivalents.
Claims
1. A collaborative method among cloud, local server and edge device, applied to a system including a user terminal, a cloud server, a local server and an edge device, characterized in that: include: S1, the user terminal sends the entered personal information to the cloud server; S2, the cloud server obtains the review and processing result of the personal information, and stores the personal information according to the review and processing result. The cloud server is provided with a first personal information database, and stores the personal information version number of the first personal information database; S3, the local server uses an adaptive acquisition interval to obtain the personnel information version number of the first personnel information database from the cloud server, and updates the second personnel information database and the personnel information version number of the second personnel information database according to the obtained personnel information version number of the first personnel information database; S4, the edge device uses an adaptive acquisition interval to obtain the personnel information version number of the second personnel information database from the local server, and updates the third personnel information database and the personnel information version number of the third personnel information database according to the obtained personnel information version number of the second personnel information database; Obtain the results of the review and processing of personal information, including: Calculate the similarity between the face photo in the personal information and the face area in the ID card photo stored in the cloud server, and determine whether the similarity is greater than the set similarity threshold. If so, the audit result is approved; if not, the audit result is unsuccessful; Calculate the similarity between the face photo in the personal information and the face area in the ID card photo stored in the cloud server, including: Determine whether there is an ID card number in all pre-stored ID card photos that is consistent with the ID card number in the ID card photo of the personal information. If not, set the similarity to 0. If so, perform the following calculation: A represents the ID card number in the ID card photo of the personal information, and from all pre-stored ID card photos, obtain the ID card photo P2 with the ID card number A; P1 represents the face photo in personal information; Use the preset mask image to obtain the area BK from P2; Use the image segmentation algorithm to segment BK and obtain the face region FC1 in BK; Segment P1 to obtain the face region FC2 in BK; Calculate the similarity between FC1 and FC2; Segment P1 to obtain the face region FC2 in BK, including: Perform grayscale processing on P1 to obtain image G1; Perform regional processing on G1, divide G1 into multiple connected domains, and store the obtained connected domains into the set CU; Obtain a set FCU1 of pixel points in P1 that conform to the skin detection model; Filter the pixels in FCU1 to obtain a set FCU2; Get a set FCU3 of pixel points in G1 that have the same coordinates as FCU1; get a set FCU4 of pixel points in G1 that have the same coordinates as FCU2; Get set FCU5 based on FCU4; The pixels in FCU3 and FCU5 are used as the pixels in FC2.
2. A collaborative method among a cloud, a local server and an edge device according to claim 1, characterized in that: User terminals include smartphones, tablets and desktop computers.
3. The collaborative method among cloud, local server and edge device according to claim 1, characterized in that: Personal information includes facial photos, ID card photos and basic personal information; Basic personal information includes name and mobile phone number.
4. The collaborative method among cloud, local server and edge device according to claim 1, characterized in that: Personal information is stored based on the review and processing results, including: If the audit processing result is that the audit is passed, the personal information sent by the user terminal is stored in the first personal information database, and the personal information version number of the first personal information database is updated.
5. The collaborative method among cloud, local server and edge device according to claim 1, characterized in that: Acquiring the personnel information version number of the first personnel information database from the cloud server at an adaptive acquisition interval includes: Calculate the first acquisition interval; Acquire a personnel information version number of a first personnel information database from a cloud server based on a first acquisition interval; Acquiring the personnel information version number of the second personnel information database from the local server using an adaptive acquisition interval includes: Calculate the second acquisition interval; The personnel information version number of the second personnel information database is obtained from the local server based on the second acquisition interval.
6. A collaborative method among a cloud, a local server and an edge device according to claim 5, characterized in that: The second personnel information database and the personnel information version number of the second personnel information database are updated according to the obtained personnel information version number of the first personnel information database, including: Determine whether the personnel information version number of the first personnel information database is consistent with the personnel information version number of the second personnel information database, and if not, send a first update request to the cloud server; Receiving first update information pushed by the cloud server according to the first update request; Updating the second personnel information database according to the first update information; The personnel information version number of the second personnel information database is updated to the personnel information version number of the first personnel information database.
7. A collaborative method among a cloud, a local server and an edge device according to claim 6, characterized in that: Calculate the first acquisition interval, including: For the kth first acquisition interval, the calculation is as follows: denoted by the time when the calculation of the kth first acquisition interval is started, denoted by the number of times the local server sends the first update request to the cloud server in the time interval, denoted by the total number of times the local server obtains the personnel information version number of the first personnel information database from the cloud server in the time interval, and T denotes a preset duration; Calculate the kth first acquisition interval based on and.
8. The method for collaboration among cloud, local server and edge device according to claim 5, characterized in that: The third personnel information database and the personnel information version number of the third personnel information database are updated according to the obtained personnel information version number of the second personnel information database, including: Determine whether the personnel information version number of the second personnel information database is consistent with the personnel information version number of the third personnel information database, and if not, send a second update request to the local server; Receiving second update information pushed by the local server according to the second update request; updating the third personnel information database according to the second update information; The personnel information version number of the third personnel information database is updated to the personnel information version number of the second personnel information database.
9. A collaborative system of cloud, local server and edge device, characterized in that: Includes user terminals, cloud servers, local servers, and edge devices; The user terminal is used to send the entered personal information to the cloud server; The cloud server is used to obtain the review and processing results of the personal information, and store the personal information according to the review and processing results. The cloud server is provided with a first personnel information database, and stores the personnel information version number of the first personnel information database; The local server is used to obtain the personnel information version number of the first personnel information database from the cloud server at an adaptive acquisition interval, and update the second personnel information database and the personnel information version number of the second personnel information database according to the obtained personnel information version number of the first personnel information database; The edge device is used to obtain the personnel information version number of the second personnel information database from the local server using an adaptive acquisition interval, and update the third personnel information database and the personnel information version number of the third personnel information database according to the obtained personnel information version number of the second personnel information database; Obtain the results of the review and processing of personal information, including: Calculate the similarity between the face photo in the personal information and the face area in the ID card photo stored in the cloud server, and determine whether the similarity is greater than the set similarity threshold. If so, the audit result is approved; if not, the audit result is unsuccessful; Calculate the similarity between the face photo in the personal information and the face area in the ID card photo stored in the cloud server, including: Determine whether there is an ID card number in all pre-stored ID card photos that is consistent with the ID card number in the ID card photo of the personal information. If not, set the similarity to 0. If so, perform the following calculation: A represents the ID card number in the ID card photo of the personal information, and from all pre-stored ID card photos, obtain the ID card photo P2 with the ID card number A; P1 represents the face photo in personal information; Use the preset mask image to obtain the area BK from P2; Use the image segmentation algorithm to segment BK and obtain the face region FC1 in BK; Segment P1 to obtain the face region FC2 in BK; Calculate the similarity between FC1 and FC2; Segment P1 to obtain the face region FC2 in BK, including: Perform grayscale processing on P1 to obtain image G1; Perform regional processing on G1, divide G1 into multiple connected domains, and store the obtained connected domains into the set CU; Obtain a set FCU1 of pixel points in P1 that conform to the skin detection model; Filter the pixels in FCU1 to obtain a set FCU2; Get a set FCU3 of pixel points in G1 that have the same coordinates as FCU1; get a set FCU4 of pixel points in G1 that have the same coordinates as FCU2; Get set FCU5 based on FCU4; The pixels in FCU3 and FCU5 are used as the pixels in FC2.
Citation Information
Patent Citations
Riding method and device
CN113269064A