Business resource service method, device, electronic device and storage medium
By performing encryption and decryption operations on business resource numbers at the framework layer, using different keys and encryption and decryption algorithms, combined with CRC algorithm signature verification, the security problem of the client traversing to obtain business resources is solved, and the security and safety of business resource services are improved. efficiency.
Patent Information
- Application Number
- CN202110263830.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-11
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-03-11
AI Technical Summary
In the existing technology, the client traverses and obtains all business resources by exhaustively requesting business resource numbers, resulting in significant commercial property losses, and there is a lack of effective encryption and decryption operations to improve data transmission security.
The framework layer performs data transmission between the client and the business layer, processes unencrypted and encrypted business resource numbers through encryption and decryption operations, uses different keys and encryption and decryption algorithms to improve the efficiency and security of data encryption and decryption, and through The CRC algorithm performs data signature and decryption verification to prevent tampering and cracking.
It improves the security and efficiency of business resource service methods, reduces the possibility of being cracked, avoids the risk of obtaining business resources through exhaustive requests, simplifies the coupling between the business layer and encryption and decryption operations, and facilitates software upgrades and maintenance. .
Smart Images

Figure CN112883400B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a business resource service method, device, electronic equipment and storage medium. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the application that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] In Internet applications, most business resources need to be marked, distinguished and tracked using business resource numbers, such as user information, comment information, order information, address information, product information, video information, etc. When a client needs to use a business resource, it needs to request the server according to the corresponding business resource number to obtain the real business resource. These business resources are the core resource data assets of the enterprise and need to be prevented from being obtained in large quantities by other organizations or individuals.
[0004] For a normal client, it generally only has a small number of business resource numbers, and can only obtain a small number of business resources. However, it can obtain all business resources by exhaustively requesting business resource numbers from the server. This will cause significant commercial property losses. Summary of the invention
[0005] In view of the above technical problems, an improved method is currently needed to efficiently implement encryption and decryption operations on business resource numbers in the business resource service process, avoiding the client from traversing and obtaining all business resources by exhaustively requesting business resource numbers from the server.
[0006] In a first aspect, an embodiment of the present application provides a business resource service method, including:
[0007] Perform data transmission between the client and the business layer at the framework layer;
[0008] When the framework layer determines that the transmitted data is an unencrypted service resource number, the unencrypted service resource number is encrypted before transmission;
[0009] When the framework layer determines that the transmitted data is an encrypted service resource number, the encrypted service resource number is decrypted before transmission.
[0010] Optionally, the method further comprises:
[0011] When the framework layer determines that the transmitted data is a business resource, it performs data transparent transmission between the client and the business layer;
[0012] The business resources include business resources uploaded by the client and business resources stored in the database.
[0013] In this way, the transmitted data is judged through the framework layer, and different data are processed differently, thereby improving the efficiency of data encryption and decryption.
[0014] Optionally, the data transmitted between the client and the business layer includes:
[0015] The business resources uploaded by the client to the business layer;
[0016] The business layer stores the business resources in a database and returns the business resource number to the client;
[0017] The encrypted service resource number transmitted by the client to the service layer;
[0018] The service layer returns the service resource corresponding to the encrypted service resource number to the client.
[0019] In this way, data is transmitted between the client and the business layer through the framework layer, thereby improving the efficiency of bidirectional transmission between the client and the business layer.
[0020] Optionally, the framework layer encrypts the unencrypted service resource number, or decrypts the encrypted service resource number, including:
[0021] Determine the target business resource number group to which the unencrypted / encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups;
[0022] According to the key groups corresponding to different business resource number groups, a target key is selected from the key group corresponding to the target business resource number group;
[0023] The unencrypted service resource number is encrypted using the target key, or the encrypted service resource number is decrypted.
[0024] In this way, using different keys to encrypt the service resource number can improve the security of the encrypted service resource number and reduce the possibility of being cracked.
[0025] Optionally, the framework layer encrypts the unencrypted service resource number, or decrypts the encrypted service resource number, including:
[0026] Determine the target business resource number group to which the unencrypted / encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups;
[0027] Determine the target encryption and decryption algorithm corresponding to the target business resource number group according to the encryption and decryption algorithms corresponding to different business resource number groups;
[0028] The target encryption and decryption algorithm is used to encrypt the unencrypted service resource number, or to decrypt the encrypted service resource number.
[0029] In this way, the service resource number is encrypted using different encryption algorithms, which can improve the security of the encrypted service resource number and reduce the possibility of being cracked.
[0030] Optionally, encrypting the unencrypted service resource number by using the target key includes:
[0031] The unencrypted service resource number is signed using a cyclic redundancy check (CRC) algorithm to obtain a verification signature;
[0032] Using the target key to encrypt the verification signature and the unencrypted service resource number to obtain a ciphertext;
[0033] Constructing a ciphertext data packet including the target service resource number group number and the ciphertext, or constructing a ciphertext data packet including the target service resource number group number, the ciphertext and the target key number;
[0034] The ciphertext data packet is encoded using a coding algorithm and then transmitted.
[0035] Optionally, decrypting the encrypted service resource number using the target key includes:
[0036] Decoding the encrypted service resource number using a decoding algorithm to obtain a target service resource number group number and a ciphertext, or to obtain a ciphertext data packet including the target service resource number group number, the ciphertext and the target key number;
[0037] Determine the target key according to the target service resource number group number, or according to the target service resource number group number and the target key number;
[0038] Decrypting the ciphertext using the target key to obtain a verification signature and the service resource number;
[0039] A cyclic redundancy check (CRC) algorithm is used to calculate the service resource number obtained by decryption. If the calculation result is consistent with the verification signature, the decryption is determined to be successful.
[0040] In this way, by performing a verification signature on the unencrypted business resource number, encrypting the verification signature together with the business resource number, the verification signature can be used to perform integrity verification on the business resource number during decryption, thereby ensuring the correctness of the business resource number obtained by decryption and preventing tampering. After encoding the ciphertext data packet, the difficulty of traversing the ciphertext is greatly increased, thereby avoiding exhaustive requests to the server to obtain the corresponding business resource by traversing the ciphertext, and improving the security of the business resource service method.
[0041] Optionally, if the key group includes one key, the ciphertext data packet includes the target service resource number group number and the ciphertext;
[0042] If the key group includes multiple keys, the ciphertext data packet includes the target service resource number group number, the ciphertext and the target key number.
[0043] Optionally, if the key group includes multiple keys, selecting a target key from the key group corresponding to the target service resource number group, and using the target key to encrypt the unencrypted service resource number includes:
[0044] Randomly select a key number from the key numbers corresponding to the multiple keys, and determine the target key corresponding to the selected key number; or select a key number according to the key configuration information, and determine the target key corresponding to the selected key number;
[0045] The unencrypted service resource number is encrypted using the target key.
[0046] In this way, by using a different target key in the same key group to encrypt different service resource numbers, the security of the encryption algorithm can be improved and the possibility of being cracked can be reduced.
[0047] Optionally, an encryption and decryption algorithm corresponding to at least one service resource numbering group is pre-deployed at the framework layer;
[0048] The method further comprises:
[0049] When the framework layer determines that the business resource number returned by the business layer after storing the business resource in the database reaches a preset number, the encryption and decryption algorithm and / or key group corresponding to the new business resource number group is loaded;
[0050] The preset number is smaller than the maximum service resource number in the currently deployed service resource number group, and the difference between the preset number and the maximum service resource number is a preset value.
[0051] In this way, a smooth upgrade of encryption and decryption algorithms and key groups can be achieved without affecting the normal use of business resource services.
[0052] In a second aspect, an embodiment of the present application provides a business resource service device, including:
[0053] The transmission unit is used to perform data transmission between the client and the business layer at the framework layer;
[0054] An encryption unit, configured to encrypt the unencrypted service resource number before transmitting the data when the framework layer determines that the data to be transmitted is an unencrypted service resource number;
[0055] The decryption unit is used to decrypt the encrypted business resource number before transmitting it when the framework layer determines that the transmitted data is an encrypted business resource number.
[0056] Optionally, the transmission unit is further used for:
[0057] When the framework layer determines that the transmitted data is a business resource, it performs data transparent transmission between the client and the business layer;
[0058] The business resources include business resources uploaded by the client and business resources stored in the database.
[0059] Optionally, the data transmitted between the client and the business layer includes:
[0060] The business resources uploaded by the client to the business layer;
[0061] The business layer stores the business resources in a database and returns the business resource number to the client;
[0062] The encrypted service resource number transmitted by the client to the service layer;
[0063] The service layer returns the service resource corresponding to the encrypted service resource number to the client.
[0064] Optionally, the framework layer encrypts the unencrypted service resource number, or decrypts the encrypted service resource number, including:
[0065] Determine the target business resource number group to which the unencrypted / encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups;
[0066] According to the key groups corresponding to different business resource number groups, a target key is selected from the key group corresponding to the target business resource number group;
[0067] The unencrypted service resource number is encrypted using the target key, or the encrypted service resource number is decrypted.
[0068] Optionally, the framework layer encrypts the unencrypted service resource number / decrypts the encrypted service resource number, including:
[0069] Determine the target business resource number group to which the unencrypted / encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups;
[0070] Determine the target encryption and decryption algorithm corresponding to the target business resource number group according to the encryption and decryption algorithms corresponding to different business resource number groups;
[0071] The target encryption and decryption algorithm is used to encrypt the unencrypted service resource number, or to decrypt the encrypted service resource number.
[0072] Optionally, encrypting the unencrypted service resource number by using the target key includes:
[0073] The unencrypted service resource number is signed using a cyclic redundancy check (CRC) algorithm to obtain a verification signature;
[0074] Using the target key to encrypt the verification signature and the unencrypted service resource number to obtain a ciphertext;
[0075] Constructing a ciphertext data packet including the target service resource number group number and the ciphertext, or constructing a ciphertext data packet including the target service resource number group number, the ciphertext and the target key number;
[0076] The ciphertext data packet is encoded using a coding algorithm and then transmitted.
[0077] Optionally, decrypting the encrypted service resource number using the target key includes:
[0078] Decoding the encrypted service resource number using a decoding algorithm to obtain a target service resource number group number and a ciphertext, or to obtain a ciphertext data packet including the target service resource number group number, the ciphertext and the target key number;
[0079] Determine the target key according to the target service resource number group number, or according to the target service resource number group number and the target key number;
[0080] Decrypting the ciphertext using the target key to obtain a verification signature and the service resource number;
[0081] A cyclic redundancy check (CRC) algorithm is used to calculate the service resource number obtained by decryption. If the calculation result is consistent with the verification signature, the decryption is determined to be successful.
[0082] Optionally, if the key group includes one key, the ciphertext data packet includes the target service resource number group number and the ciphertext;
[0083] If the key group includes multiple keys, the ciphertext data packet includes the target service resource number group number, the ciphertext and the target key number.
[0084] Optionally, if the key group includes multiple keys, selecting a target key from the key group corresponding to the target service resource number group, and using the target key to encrypt the unencrypted service resource number includes:
[0085] Randomly select a key number from the key numbers corresponding to the multiple keys, and determine the target key corresponding to the selected key number; or select a key number according to the key configuration information, and determine the target key corresponding to the selected key number;
[0086] Encrypting the unencrypted service resource number using the target key;
[0087] The key configuration information includes the unencrypted service resource number.
[0088] Optionally, an encryption and decryption algorithm corresponding to at least one service resource number group is pre-deployed at the framework layer;
[0089] The device also includes:
[0090] An upgrade unit, used for loading the encryption and decryption algorithm and / or key group corresponding to the new business resource number group when the business resource number returned by the framework layer after determining that the business layer stores the business resource in the database reaches a preset number;
[0091] The preset number is smaller than the maximum service resource number in the currently deployed service resource number group, and the difference between the preset number and the maximum service resource number is a preset value.
[0092] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the business resource service method when executing the computer program.
[0093] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, which implement the steps of the business resource service method when executed by a processor.
[0094] The business resource service method, device, electronic device and storage medium of the present application realize encryption and decryption operations on business resource numbers by executing the framework layer of interaction between the client and the business layer. There is no need to interact with other services. The data encryption operation is completed directly in the process of interaction between the client and the business layer, thereby improving the encryption and decryption efficiency. Since the business layer does not need to participate in the encryption and decryption operations, the coupling degree between the business layer and the encryption and decryption operations is reduced, which is more conducive to software upgrades and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become readily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, wherein:
[0096] Figure 1 A schematic diagram of an application scenario of a business resource service method provided in an embodiment of the present application;
[0097] Figure 2 A schematic diagram of the framework layer of the business resource service method provided in one embodiment of the present application;
[0098] Figure 3 A flowchart of the encryption process of the business resource service method provided in one embodiment of the present application;
[0099] Figure 4 for Figure 3 A flowchart of the decryption process corresponding to the business resource service method shown;
[0100] Figure 5 A schematic diagram of a process for encrypting the unencrypted service resource number at the framework layer provided in an embodiment of the present application;
[0101] Figure 6 for Figure 5 A schematic diagram of the decryption process corresponding to the process shown;
[0102] Figure 7 A schematic diagram of a process for encrypting the unencrypted service resource number at the framework layer provided in an embodiment of the present application;
[0103] Figure 8 for Figure 7 A schematic diagram of the decryption process corresponding to the process shown;
[0104] Fig. 9 A schematic diagram of a process of encrypting the unencrypted service resource number using the target key according to an embodiment of the present application;
[0105] Fig.10 for Fig. 9A schematic diagram of the decryption process corresponding to the process shown;
[0106] Fig.11 A flowchart of an upgrade process of a business resource service method provided in an embodiment of the present application;
[0107] Fig.12 A flowchart of the encryption process of the business resource service method provided in one embodiment of the present application;
[0108] Fig.13 for Fig.12 A diagram showing the effect of the encryption process;
[0109] Fig.14 for Fig.12 and Fig.13 A schematic diagram of the structure of a ciphertext data packet in an embodiment of the business resource service method shown;
[0110] Fig.15 for Fig.14 A flowchart of the decryption process corresponding to the business resource service method shown;
[0111] Fig.16 for Fig.15 The effect diagram of the decryption process is shown in FIG.
[0112] Fig.17 A schematic diagram of the structure of a business resource service device provided in one embodiment of the present application;
[0113] Fig.18 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;
[0114] Fig.19 A schematic diagram of the structure of a computer program product provided in one embodiment of the present application. DETAILED DESCRIPTION
[0115] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present application, and are not intended to limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0116] Those skilled in the art know that the embodiments of the present application can be implemented as a system, device, equipment, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0117] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.
[0118] Business resources: Business resources in this application refer to business data in Internet applications. For different types of business resource services, the corresponding business resources are also different. For example, for streaming music services, the corresponding business resources include music files, user playlists, user comments and other data. For electronic transaction services, the corresponding business resources include electronic transaction object information data, electronic transaction order data and other data.
[0119] Framework: It is a reusable design of the whole or part of the system, which is expressed as a set of abstract components and the interaction methods between component instances. Since the structure of the same type of application is roughly the same and has a lot of the same source code during the software development process, the common source code of the same type of application can be written through a framework.
[0120] Symmetric encryption algorithm: An encryption algorithm that uses the same key for encryption and decryption. Sometimes called a traditional cryptographic algorithm, the encryption key can be derived from the decryption key, and the decryption key can also be derived from the encryption key. In most symmetric algorithms, the encryption key and decryption key are the same, so this encryption algorithm is also called a secret key algorithm or a single key algorithm.
[0121] Asymmetric encryption algorithm: Asymmetric encryption algorithm requires two keys: public key and private key. The public key and private key are a pair of different keys. The encryption process uses the public key to encrypt the data, and the decryption process uses the corresponding private key to decrypt.
[0122] AES (Advanced Encryption Standard) algorithm: Also known as Rijndael encryption in cryptography, it uses a substitution-permutation network. It can encrypt and decrypt quickly in both software and hardware. It is relatively easy to implement and requires very little memory.
[0123] DES (Data Encryption Standard) algorithm: is a block algorithm that uses key encryption. The plaintext is grouped into 64 bits, and the DES algorithm uses the bit-by-bit substitution or exchange method to form a ciphertext group with a 56-bit key (the actual key length is 64 bits).
[0124] Initial vector: The initial vector is used in the encryption process such as AES algorithm encryption as the first input data of the encryption algorithm, and the actual encrypted data is input into the encryption algorithm starting from the second input data. The encryption algorithm performs encryption operations in the order of the input data.
[0125] CRC (Cyclic Redundancy Check) algorithm: It is a channel coding technology that generates a short fixed-bit check code based on data such as network data packets or computer files. It is mainly used to detect or verify errors that may occur after data transmission or storage.
[0126] The principles and spirit of the present application are explained in detail below with reference to several representative implementations of the present application. SUMMARY OF THE INVENTION
[0128] In order to solve the problem of traversing and obtaining all business resources by exhaustively requesting business resource numbers to the server, the present application provides a business resource service method, including: executing data transmission between the client and the business layer at the framework layer; when the framework layer determines that the transmitted data is an unencrypted business resource number, encrypting the unencrypted business resource number before executing the transmission; when the framework layer determines that the transmitted data is the encrypted business resource number, decrypting the encrypted business resource number before executing the transmission.
[0129] In the business resource service method of the present application, the data sent by the client needs to be processed by the framework layer first, and then handed over to the business layer for processing. The framework layer directly completes the encryption and decryption operations of the business resource number, which improves the encryption and decryption efficiency; and the business layer does not need to participate in the encryption and decryption operations, which greatly reduces the coupling degree of the program and is more conducive to software upgrades and maintenance.
[0130] After introducing the basic principles of the present application, various non-limiting implementation methods of the present application are described in detail below.
[0131] Application Scenario Overview
[0132] refer to Figure 1 , which is a schematic diagram of an application scenario of the business resource service method provided in the embodiment of the present application. Figure 1The application scenario shown includes a terminal device 101 and a server 102. The terminal device 101 and the server 102 may be connected via a wireless communication network or a wired communication network, and the terminal device 101 includes but is not limited to electronic devices such as desktop computers, mobile phones, mobile computers, tablet computers, media players, smart wearable devices, smart TVs, vehicle-mounted devices, and personal digital assistants (PDAs). The server 102 may be an independent physical server, or a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0133] The server 102 is used to provide business resource services, such as electronic transactions, news, video, music and other services. The terminal device 101 is installed with a client, and the user can obtain the business resource services provided by the server 102 through the client, or the user can also access the business resource website through the browser in the terminal device 101 to obtain the business resource services provided by the server 102. For example, any user can upload business resources to the server 102 corresponding to the business resource service platform through the client, so as to publish the business resources through the business resource platform, so that other users can obtain the business resources published by the user. The server 102 generates a corresponding business resource number after performing business processing on the business resources uploaded by the user, and encrypts the business resource number at the framework layer and sends it to the terminal device 101 of the user. Alternatively, the server 102 decrypts the encrypted business resource number uploaded by the user at the framework layer, and then performs business processing to obtain the corresponding business resource and sends it to the terminal device 101.
[0134] It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principle of the present application, and the implementation of the present application is not limited in this respect. On the contrary, the implementation of the present application can be applied to any applicable scenario.
[0135] Exemplary Methods
[0136] refer to Figure 2 The embodiment of the present application provides a business resource service method, which is applied to a server and includes:
[0137] S201, executing data transmission between the client and the business layer at the framework layer;
[0138] S202: When the framework layer determines that the transmitted data is an unencrypted service resource number, the unencrypted service resource number is encrypted before transmission;
[0139] S203: When the framework layer determines that the transmitted data is an encrypted service resource number, the encrypted service resource number is decrypted before transmission.
[0140] The framework layer is a relatively low-level software module that encapsulates some common functions and can be a gateway or application framework. The business layer of the server is developed based on the framework layer. In the present application, the business system that provides business resource services includes the framework layer and the business layer in software. The framework layer performs the transmission of data between the client and the business layer, and during the data transmission process, the framework layer judges the type of data being transmitted. When it is determined that the data type belongs to the type that needs to be encrypted and decrypted (i.e., the encrypted / unencrypted business resource number), the encryption / decryption operation of the transmitted data is directly performed before the transmission is performed. The business layer does not need to call other services to complete the corresponding encryption and decryption. Therefore, the encryption and decryption efficiency is relatively high, and the coupling degree between the business layer and the encryption and decryption operation is reduced, which is more conducive to software upgrades and maintenance.
[0141] The framework layer judges the type of data being transmitted and when it is determined that the data type does not require encryption and decryption (that is, the transmitted data is determined to be a business resource), it performs data transparent transmission between the client and the business layer. The business resources include the business resources uploaded by the client and the business resources stored in the database.
[0142] Specifically, when the client uploads business resources, the business resources are transmitted to the business layer through the framework layer and stored in the database by the business layer. When the business layer sends business resources to the client, the business resources are obtained from the database and transmitted to the client through the framework layer.
[0143] In the embodiment of the present application, the data transmitted between the client and the business layer includes:
[0144] The business resources uploaded by the client to the business layer are stored in the database by the business layer;
[0145] The business layer stores the business resources in a database and returns the business resource number to the client;
[0146] The encrypted service resource number transmitted by the client to the service layer;
[0147] The service layer returns the service resource corresponding to the encrypted service resource number to the client.
[0148] The encryption process of the business resource service implemented by the above business resource service method in the embodiment of the present application is given below. Figure 3 As shown, including:
[0149] S301: After generating business resources, the client uploads the generated business resources to the server.
[0150] S302: After receiving the business resources, the framework layer of the server transparently transmits the business resources to the business layer.
[0151] S303: The business layer performs business processing on business resources.
[0152] S304: The business layer stores the business resources in the storage system.
[0153] S305: After storing the business resources, the storage system generates a corresponding business resource number and returns it to the business layer.
[0154] S306: The business layer transfers the business resource number to the framework layer.
[0155] S307: The framework layer encrypts the received service resource number.
[0156] S308: The framework layer sends the encrypted business resource number to the client.
[0157] Correspondingly, the decryption process of the business resource service implemented by the above-mentioned business resource service method in the embodiment of the present application is given below, such as Figure 4 As shown, including:
[0158] S401. When the client needs to obtain a service resource, the client sends the corresponding encrypted service resource number stored to the server.
[0159] S402: After receiving the encrypted service resource number, the framework layer in the server decrypts the encrypted service resource number.
[0160] S403: The framework layer passes the decrypted business resource number to the business layer.
[0161] S404: The business layer requests the storage system to obtain the corresponding business resource according to the unencrypted business resource number.
[0162] S405: The storage system returns the corresponding business resources to the business layer.
[0163] S406: The business layer performs business processing on the business resources.
[0164] S407: The business layer hands over the business resources to the framework layer.
[0165] S408: The framework layer transparently transmits the business resources to the client.
[0166] In an embodiment of the present application, when the framework layer performs encryption and decryption operations, in order to improve the security of the business resource service method and reduce the possibility of the encryption method being cracked, multiple business resource number groups can be pre-set, and different business resource number groups correspond to different business resource number ranges, and there are no identical business resource numbers between different business resource number groups. In this case, the encryption and decryption operations performed on the business resource numbers in different business resource number groups are different. Specifically, it can be set to use different keys for encryption and decryption of the business resource numbers in different business resource number groups, or use different encryption and decryption algorithms for encryption and decryption, or a combination of the two methods.
[0167] In the specific implementation process, the encryption algorithm can be a symmetric encryption algorithm or an asymmetric encryption algorithm. If the encryption algorithm is a symmetric encryption algorithm, the algorithm can be an AES algorithm, a DES algorithm, etc., which is not limited here. The security of an asymmetric encryption algorithm is relatively higher, but the speed is relatively slow. The speed of a symmetric encryption algorithm is relatively fast, but the security is relatively weaker than that of an asymmetric encryption algorithm. During implementation, a suitable algorithm can be selected according to the requirements for security and speed. The following will be explained using a symmetric encryption algorithm as an example.
[0168] As an optional implementation, different business resource number groups correspond to different key groups. The key group includes one or more keys. When the framework layer encrypts the business resource number, it selects a key from the key group corresponding to the business resource number group according to certain rules for encryption.
[0169] Figure 5 Schematic diagram of the process of using different key groups to encrypt business resource numbers in different business resource number groups. Figure 5 As shown, in step S202, the framework layer encrypts the unencrypted service resource number, including:
[0170] S501, determining the target business resource number group to which the unencrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups;
[0171] S502, selecting a target key from the key group corresponding to the target service resource number group according to the key groups corresponding to different service resource number groups;
[0172] S503: Use the target key to encrypt the unencrypted service resource number.
[0173] Figure 6 For Figure 5 The flowchart of the decryption process corresponding to the encryption process shown in FIG. Figure 6 As shown, in step S203, the framework layer decrypts the encrypted service resource number, including:
[0174] S601, determining the target business resource number group to which the encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups;
[0175] S602, selecting a target key from the key group corresponding to the target service resource number group according to the key groups corresponding to different service resource number groups;
[0176] S603: Decrypt the service resource number encrypted by using the target key.
[0177] As another optional implementation, different service resource number groups correspond to different encryption and decryption algorithms.
[0178] Figure 7 A flowchart of using different encryption algorithms to encrypt business resource numbers in different business resource number groups. Figure 7 As shown, in step S202, the framework layer encrypts the unencrypted service resource number, including:
[0179] S701, determining the target business resource number group to which the unencrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups;
[0180] S702, determining a target encryption and decryption algorithm corresponding to the target service resource number group according to encryption and decryption algorithms corresponding to different service resource number groups;
[0181] S703: Encrypt the unencrypted service resource number using the target encryption and decryption algorithm.
[0182] Figure 8 For Figure 7 The flowchart of the decryption process corresponding to the encryption process shown in FIG. Figure 8 As shown, in step S203, the framework layer decrypts the encrypted service resource number, including:
[0183] S801, determining the target business resource number group to which the encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups;
[0184] S802, determining a target encryption and decryption algorithm corresponding to the target service resource number group according to encryption and decryption algorithms corresponding to different service resource number groups;
[0185] S803: Decrypt the encrypted service resource number using the target encryption and decryption algorithm.
[0186] When the embodiment of the present application adopts multiple business resource number groups, due to the key groups or different encryption and decryption algorithms corresponding to different business resource number groups, in order to correctly decrypt the business resource number after the business resource number is encrypted, the business resource number group number needs to be encapsulated in a data packet in plain text after the business resource number is encrypted, so that the key group or encryption and decryption algorithm used can be determined during decryption. Further, if the key groups corresponding to different business resource number groups are different, and the key group includes multiple keys, the key number of the key in the key group needs to be encapsulated as plain text into the data packet. The specific encryption and decryption process is given below in conjunction with the accompanying drawings.
[0187] Fig. 9 The following is a detailed flow chart of encrypting the business resource number. Fig. 9 As shown, in the step S503, the unencrypted service resource number is encrypted using the target key, including:
[0188] S901, using a CRC algorithm to sign the unencrypted service resource number to obtain a verification signature;
[0189] S902, using the target key to encrypt the verification signature and the unencrypted service resource number to obtain a ciphertext;
[0190] S903, constructing a ciphertext data packet including the target service resource number group number and the ciphertext, or constructing a ciphertext data packet including the target service resource number group number, the ciphertext and the target key number;
[0191] If the key group includes one key, the ciphertext data packet includes the target service resource number group number and the ciphertext.
[0192] If the key group includes multiple keys, the ciphertext data packet includes the target service resource number group number, the ciphertext and the target key number.
[0193] S904: Encode the ciphertext data packet using a coding algorithm and then transmit it.
[0194] Fig.10 FIG. 1 is a flowchart of the process of decrypting an encrypted business resource number. Fig.10 As shown, in step S603, decrypting the encrypted service resource number using the target key includes:
[0195] S1001. Decoding the encrypted service resource number using a decoding algorithm to obtain a target service resource number group number and a ciphertext, or a ciphertext data packet including a target service resource number group number, a ciphertext and a target key number;
[0196] If the key group includes one key, the ciphertext data packet includes the target service resource number group number and the ciphertext.
[0197] If the key group includes multiple keys, the ciphertext data packet includes the target service resource number group number, the ciphertext and the target key number.
[0198] S1002, determining a target key according to the target service resource number group number, or according to the target service resource number group number and the target key number;
[0199] If the key group includes one key, determine the corresponding target key group according to the target service resource number group number to obtain the target key;
[0200] If the key group includes multiple keys, the corresponding target key group is determined according to the target service resource number group number, and the target key is obtained from the target key group according to the target key number.
[0201] S1003, using the target key to decrypt the ciphertext to obtain a verification signature and the business resource number;
[0202] S1004. Use a CRC algorithm to calculate the business resource number obtained by decryption. If the calculation result is consistent with the verification signature, it is determined that the decryption is successful.
[0203] In a specific implementation process, the encoding algorithm may be a Base64 algorithm, a Hex encoding algorithm, etc., which is not limited here.
[0204] The above encryption and decryption process, on the one hand, uses different encryption and decryption operations for different business resource numbers, and on the other hand, combines the CRC verification signature with the encryption and decryption algorithm, thereby increasing the difficulty of deducing the key according to the ciphertext rules during the cracking process, ensuring the security of the data packet and reducing the risk of the ciphertext in the data packet being cracked.
[0205] If the key group includes multiple keys, the step S502 of selecting a target key from the key group corresponding to the target service resource number group includes:
[0206] A key number is randomly selected from the key numbers corresponding to the multiple keys, and a target key corresponding to the selected key number is determined.
[0207] Alternatively, a key number is selected according to the key configuration information, and a target key corresponding to the selected key number is determined.
[0208] In a specific implementation process, selecting a key number according to the key configuration information may be to calculate a key number according to the unencrypted business resource number according to a preset rule, such as performing a remainder operation or a last digit operation on the business resource number. Alternatively, a key number may be determined using a preset rule that is unrelated to the business resource number, such as setting business resource numbers generated in different time periods to correspond to different key numbers. Other reasonable implementation methods may also be used, which are not limited here.
[0209] In this way, by using a different target key in the same key group to encrypt different service resource numbers, the security of the encryption algorithm can be improved and the possibility of being cracked can be reduced.
[0210] In order to improve security, this application adopts different encryption and decryption schemes for different business resource number groups. In the implementation process, it is particularly important to ensure that the normal business resource service is not affected when switching between different encryption and decryption schemes.
[0211] Based on the above-mentioned pre-setting of multiple business resource number groups, the embodiment of the present application loads the encryption and decryption algorithms corresponding to the multiple business resource group numbers into the framework layer by upgrading, such as Fig.11 As shown in the figure, the specific upgrade process includes:
[0212] S1101, pre-deploy an encryption and decryption algorithm corresponding to at least one service resource number group at the framework layer;
[0213] S1102: When the framework layer determines that the upgrade condition is met, the encryption and decryption algorithm and / or key group corresponding to the new service resource number group is loaded;
[0214] Among them, the upgrade condition is that the business resource number returned after the business layer stores the business resources in the database reaches a preset number, the preset number is smaller than the maximum business resource number in the currently deployed business resource number group, and the difference with the maximum business resource number is a preset value.
[0215] During the specific implementation process, the business resource numbers can be grouped according to the range of numerical values. For example, the business resource numbers numbered 1-1000 belong to the same business resource number group A, and the business resource numbers numbered 1001-10000 belong to the same business resource number group B, and the encryption and decryption algorithms and key groups corresponding to the business resource number group A are different from those of the business resource number group B. When the business resource number assigned to the business resource reaches a preset number (for example, 950), the framework layer loads the encryption and decryption algorithms and key groups corresponding to the business resource number group B, so that when the encryption and decryption algorithms and key groups corresponding to the business resource number group B are not loaded, the encryption and decryption algorithms and key groups corresponding to the business resource numbers numbered 950-1000 can still be used for the business resource numbers. Loading time is reserved for the encryption and decryption algorithms and key groups corresponding to the business resource number group B, and when the business resource number is 1001, the encryption and decryption algorithms and key groups corresponding to the business resource number group B can be directly used to achieve a smooth upgrade of the encryption and decryption algorithms and key groups without affecting the normal use of business resource services.
[0216] The following uses the AES algorithm for encryption and decryption in the business resource service method as an example to explain the encryption and decryption process performed by the detailed framework layer. Fig.12 The following is a detailed encryption process, including:
[0217] S1201. Determine the corresponding AES algorithm and key group verInfo.keys according to the business resource number group number ver corresponding to the unencrypted business resource number ID.
[0218] S1202: Use the business resource number ID to perform a modulo operation on the preset parameter verInfo.keysCnt to determine the key number index.
[0219] S1203. According to the key number index, obtain the target key key and the target initial vector iv from the key group verInfo.keys corresponding to the business resource number group.
[0220] S1204: Convert the format of the service resource number ID to obtain the service resource number ID'.
[0221] S1205. Use the CRC algorithm to sign the unencrypted service resource number ID' to obtain a 4-byte verification signature CRC-Bytes.
[0222] S1206. Encapsulate the business resource number ID' and the verification signature CRC-Bytes.
[0223] S1207. Use the target key key and the target initial vector iv to encrypt the encapsulated service resource number ID' and the verification signature CRC-Bytes through the AES algorithm to obtain the ciphertext data M.
[0224] S1208. Construct a ciphertext array package Bytes including a business resource number group number ver, a key number index and ciphertext data M.
[0225] S1209. Encode the ciphertext array package using the Base64 algorithm to obtain the ciphertext array package Bytes'.
[0226] Fig.13 for Fig.12 The encryption process shown is a rendering of the data generated in sequence according to the order of executing the above steps.
[0227] The format of the ciphertext data packet is as follows Fig.14 As shown, the sequence is business resource number group number ver, key number index and ciphertext data M.
[0228] Correspondingly, the steps of the decryption part are as follows Fig.15 As shown, including:
[0229] S1501. Decode the ciphertext data packet Bytes' using the Base64 algorithm to obtain the ciphertext data packet Bytes.
[0230] S1502. Extract the business resource number group number ver, key number index and ciphertext data M from the ciphertext data packet Bytes.
[0231] S1503. Determine the corresponding AES algorithm and key group verInfo.keys according to the business resource number group number ver, and determine the corresponding target key key and target initial vector iv according to the key number index.
[0232] S1504. Use the target key key and the target initial vector iv to decrypt the ciphertext data M using the AES algorithm to obtain plaintext data.
[0233] S1505. Extract the verification signature CRC-Bytes from the first 4 bytes of the plaintext data, and extract the service resource number ID' from the rest of the plaintext data.
[0234] S1506. Use a CRC algorithm to verify the service resource number ID' and generate verification data CRC-Bytes-1.
[0235] S1507. Compare the verification signature CRC-Bytes and the verification data CRC-Bytes-1 to see if they are consistent. If they are consistent, execute step S1508; otherwise, execute step S1509.
[0236] S1508: Convert the service resource number ID' into a format to obtain a service resource number ID in a preset format.
[0237] S1509: Decryption failed.
[0238] Fig.16 for Fig.15 The decryption process shown is a rendering of the data generated in sequence according to the order of executing the above steps.
[0239] Exemplary Devices
[0240] After introducing the method of the exemplary embodiment of the present application, the business resource service device and the like of the exemplary embodiment of the present application are introduced next.
[0241] like Fig.17 , which is a schematic diagram of the structure of a business resource service device 1700 provided in an embodiment of the present application. In one embodiment, the business resource service device 1700 includes: a transmission unit 1701 , an encryption unit 1702 and a decryption unit 1703 .
[0242] The transmission unit 1701 is used to perform data transmission between the client and the business layer at the framework layer;
[0243] The encryption unit 1702 is used for encrypting the unencrypted service resource number before transmitting it when the framework layer determines that the transmitted data is an unencrypted service resource number;
[0244] The decryption unit 1703 is used to decrypt the encrypted service resource number before transmitting it when the framework layer determines that the transmitted data is the encrypted service resource number.
[0245] Optionally, the transmission unit 1701 is further configured to:
[0246] When the framework layer determines that the transmitted data is a business resource, it performs data transparent transmission between the client and the business layer;
[0247] The business resources include business resources uploaded by the client and business resources stored in the database.
[0248] Optionally, the data transmitted between the client and the business layer includes:
[0249] The business resources uploaded by the client to the business layer;
[0250] The business layer stores the business resources in a database and returns the business resource number to the client;
[0251] The encrypted service resource number transmitted by the client to the service layer;
[0252] The service layer returns the service resource corresponding to the encrypted service resource number to the client.
[0253] Optionally, the framework layer encrypts the unencrypted service resource number, or decrypts the encrypted service resource number, including:
[0254] Determine the target business resource number group to which the unencrypted / encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups;
[0255] According to the key groups corresponding to different business resource number groups, a target key is selected from the key group corresponding to the target business resource number group;
[0256] The unencrypted service resource number is encrypted using the target key, or the encrypted service resource number is decrypted.
[0257] Optionally, the framework layer encrypts the unencrypted service resource number, or decrypts the encrypted service resource number, including:
[0258] Determine the target business resource number group to which the unencrypted / encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups;
[0259] Determine the target encryption and decryption algorithm corresponding to the target business resource number group according to the encryption and decryption algorithms corresponding to different business resource number groups;
[0260] The target encryption and decryption algorithm is used to encrypt the unencrypted service resource number, or to decrypt the encrypted service resource number.
[0261] Optionally, encrypting the unencrypted service resource number by using the target key includes:
[0262] Sign the unencrypted service resource number using a CRC algorithm to obtain a verification signature;
[0263] Using the target key to encrypt the verification signature and the unencrypted service resource number to obtain a ciphertext;
[0264] Constructing a ciphertext data packet including the target service resource number group number and the ciphertext, or constructing a ciphertext data packet including the target service resource number group number, the ciphertext and the target key number;
[0265] The ciphertext data packet is encoded using a coding algorithm and then transmitted.
[0266] Optionally, decrypting the encrypted service resource number using the target key includes:
[0267] Decoding the encrypted service resource number using a decoding algorithm to obtain a target service resource number group number and a ciphertext, or to obtain a ciphertext data packet including the target service resource number group number, the ciphertext and the target key number;
[0268] Determine the target key according to the target service resource number group number, or according to the target service resource number group number and the target key number;
[0269] Decrypting the ciphertext using the target key to obtain a verification signature and the service resource number;
[0270] The service resource number obtained by decryption is calculated using a CRC algorithm. If the calculation result is consistent with the verification signature, the decryption is determined to be successful.
[0271] Optionally, if the key group includes one key, the ciphertext data packet includes the target service resource number group number and the ciphertext;
[0272] If the key group includes multiple keys, the ciphertext data packet includes the target service resource number group number, the ciphertext and the target key number.
[0273] Optionally, if the key group includes multiple keys, selecting a target key from the key group corresponding to the target service resource number group, and using the target key to encrypt the unencrypted service resource number includes:
[0274] Randomly select a key number from the key numbers corresponding to the multiple keys, and determine the target key corresponding to the selected key number; or select a key number according to the key configuration information, and determine the target key corresponding to the selected key number;
[0275] Encrypting the unencrypted service resource number using the target key;
[0276] The key configuration information includes the unencrypted service resource number.
[0277] Optionally, an encryption and decryption algorithm corresponding to at least one service resource number group is pre-deployed at the framework layer;
[0278] The device 1700 further includes an upgrade unit ( Fig.17 not shown).
[0279] The upgrade unit is used to load the encryption and decryption algorithm and / or key group corresponding to the new business resource number group when the business resource number returned by the framework layer after determining that the business layer stores the business resource in the database reaches a preset number;
[0280] The preset number is smaller than the maximum service resource number in the currently deployed service resource number group, and the difference between the preset number and the maximum service resource number is a preset value.
[0281] The business resource service device provided in the embodiment of the present application adopts the same inventive concept as the above-mentioned business resource service method and can achieve the same beneficial effects, which will not be described in detail here.
[0282] Based on the same inventive concept as the above-mentioned business resource service method, an embodiment of the present application also provides an electronic device, which may specifically be a single physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0283] Refer to the following Fig.18 To describe the electronic device 1800. Fig.18 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0284] like Fig.18 As shown, the electronic device 1800 can be expressed in the form of a general-purpose computing device, for example, it can be a terminal device. The components of the electronic device 1800 can include but are not limited to: the above-mentioned at least one processing unit 1810, the above-mentioned at least one storage unit 1820, and a bus 1830 connecting different system components (including the storage unit 1820 and the processing unit 1810).
[0285] The processing unit 1810 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or the hardware and software modules in the processor can be combined and executed.
[0286] Bus 1830 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.
[0287] The storage unit 1820 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1821 and / or a cache memory 1822 , and may further include a read-only memory (ROM) 1823 .
[0288] The storage unit 1820 may also include a program / utility 1825 having a set (at least one) of program modules 1824, such program modules 1824 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.
[0289] When program module 1824 is executed by processing unit 1810, processing unit 1810 executes various steps of the text feature extraction model training method or text recommendation method according to various exemplary embodiments of the present application described in the above “Exemplary Method” section of this specification.
[0290] For example, the processing unit 1810 may execute the following Figure 2The business resource service method shown in the figure includes: S201, executing data transmission between the client and the business layer at the framework layer; S202, when the framework layer determines that the transmitted data is an unencrypted business resource number, encrypting the unencrypted business resource number and then executing the transmission; S203, when the framework layer determines that the transmitted data is the encrypted business resource number, decrypting the encrypted business resource number and then executing the transmission.
[0291] The electronic device 1800 may also communicate with one or more external devices 1840 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1800, and / or communicate with any device that enables the electronic device 1800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1850. In addition, the electronic device 1800 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 1860. As shown, the network adapter 1860 communicates with other modules of the electronic device 1800 via a bus 1830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0292] Exemplary Program Products
[0293] An embodiment of the present application provides a computer-readable storage medium for storing computer program instructions used by the above-mentioned electronic device, which includes a program for executing the training method of the text feature extraction model or the text recommendation method in any exemplary embodiment of the present application.
[0294] The above-mentioned computer storage media can be any available media or data storage devices that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)), etc.
[0295] In some possible implementations, such as Fig.19As shown, various aspects of the present application can also be implemented as a computer program product 1900, which includes program code. When the computer program product is run on a server device, the computer program product is used to enable the server device to execute the steps of the text feature extraction model training method or text recommendation method according to various exemplary embodiments of the present application described in the above "Exemplary Method" section of this specification. For example, the server device can execute the following steps: Figure 2 The business resource service method shown in the figure includes: S201, executing data transmission between the client and the business layer at the framework layer; S202, when the framework layer determines that the transmitted data is an unencrypted business resource number, the unencrypted business resource number is encrypted before the transmission is executed; S203, when the framework layer determines that the transmitted data is an encrypted business resource number, the encrypted business resource number is decrypted before the transmission is executed.
[0296] The computer program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0297] According to the computer program product for training a text feature extraction model or text recommendation according to the embodiment of the present application, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a server device. However, the program product of the present application is not limited to this. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, an apparatus or a device or used in combination with it.
[0298] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0299] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0300] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0301] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0302] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0303] Although the spirit and principle of the present application have been described with reference to several specific embodiments, it should be understood that the present application is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present application is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.
Claims
1. A business resource service method, characterized in that: include: Perform data transmission between the client and the business layer at the framework layer; When the framework layer determines that the transmitted data is an unencrypted service resource number, the framework layer encrypts the unencrypted service resource number before transmitting the data; When the framework layer determines that the transmitted data is an encrypted service resource number, the framework layer decrypts the encrypted service resource number before transmitting the data; The framework layer encrypts the unencrypted service resource number or decrypts the encrypted service resource number, including: Determine the target business resource number group to which the unencrypted / encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups; According to the key groups corresponding to different service resource number groups, a target key is selected from the key group corresponding to the target service resource number group; encrypting the unencrypted service resource number using the target key, or decrypting the encrypted service resource number; Pre-deploy an encryption and decryption algorithm corresponding to at least one service resource number group at the framework layer; The method further comprises: When the framework layer determines that the business resource number returned by the business layer after storing the business resource in the database reaches a preset number, the encryption and decryption algorithm and / or key group corresponding to the new business resource number group is loaded; The preset number is smaller than the maximum service resource number in the currently deployed service resource number group, and the difference between the preset number and the maximum service resource number is a preset value.
2. The method according to claim 1, characterized in that Also includes: When the framework layer determines that the transmitted data is a business resource, it performs data transparent transmission between the client and the business layer; The business resources include business resources uploaded by the client and business resources stored in the database.
3. The method according to claim 1 or 2, characterized in that The data transmitted between the client and the business layer includes: The business resources uploaded by the client to the business layer; The business layer stores the business resources in the database and returns the business resource number to the client; The encrypted service resource number transmitted by the client to the service layer; The service layer returns the service resource corresponding to the encrypted service resource number to the client.
4. The method according to claim 1, wherein The framework layer encrypts the unencrypted service resource number or decrypts the encrypted service resource number, including: Determine the target business resource number group to which the unencrypted / encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups; Determine the target encryption and decryption algorithm corresponding to the target business resource number group according to the encryption and decryption algorithms corresponding to different business resource number groups; The target encryption and decryption algorithm is used to encrypt the unencrypted service resource number, or to decrypt the encrypted service resource number.
5. The method according to claim 1, wherein Encrypting the unencrypted service resource number using the target key includes: Signing the unencrypted service resource number using a cyclic redundancy check (CRC) algorithm to obtain a verification signature; Encrypting the verification signature and the unencrypted service resource number using the target key to obtain a ciphertext; Constructing a ciphertext data packet including the target service resource number group number and the ciphertext, or constructing a ciphertext data packet including the target service resource number group number, the ciphertext and the target key number; The ciphertext data packet is encoded using a coding algorithm and then transmitted.
6. The method according to claim 1, wherein Decrypting the encrypted service resource number using the target key includes: Decoding the encrypted service resource number using a decoding algorithm to obtain a target service resource number group number and a ciphertext, or obtaining a ciphertext data packet including the target service resource number group number, the ciphertext, and the target key number; Determine the target key according to the target service resource number group number, or according to the target service resource number group number and the target key number; Decrypting the ciphertext using the target key to obtain a verification signature and the service resource number; A cyclic redundancy check (CRC) algorithm is used to calculate the service resource number obtained by decryption. If the calculation result is consistent with the verification signature, the decryption is determined to be successful.
7. The method according to claim 5 or 6, wherein: If the key group includes one key, the ciphertext data packet includes the target service resource number group number and the ciphertext; If the key group includes multiple keys, the ciphertext data packet includes the target service resource number group number, the ciphertext and the target key number.
8. The method according to claim 1, wherein If the key group includes multiple keys, selecting a target key from the key group corresponding to the target service resource number group, and encrypting the unencrypted service resource number using the target key, includes: Randomly selecting a key number from the key numbers corresponding to the multiple keys and determining a target key corresponding to the selected key number; or selecting a key number according to key configuration information and determining a target key corresponding to the selected key number; The unencrypted service resource number is encrypted using the target key.
9. A business resource service device, characterized in that: include: The transmission unit is used to transmit data between the client and the business layer at the framework layer; an encryption unit, configured to encrypt the unencrypted service resource number before transmitting the data when the framework layer determines that the data to be transmitted is an unencrypted service resource number; a decryption unit, configured to decrypt the encrypted service resource number before transmitting the data when the framework layer determines that the data to be transmitted is an encrypted service resource number; The framework layer encrypts the unencrypted service resource number or decrypts the encrypted service resource number, including: Determine the target business resource number group to which the unencrypted / encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups; According to the key groups corresponding to different service resource number groups, a target key is selected from the key group corresponding to the target service resource number group; encrypting the unencrypted service resource number using the target key, or decrypting the encrypted service resource number; Pre-deploy the encryption and decryption algorithms corresponding to at least one business resource number group at the framework layer; The device further comprises: An upgrading unit, configured to load the encryption and decryption algorithm and / or key group corresponding to a new business resource number group when the framework layer determines that the business resource number returned after the business layer stores the business resource in the database reaches a preset number; The preset number is smaller than the maximum service resource number in the currently deployed service resource number group, and the difference between the preset number and the maximum service resource number is a preset value.
10. The device according to claim 9, characterized in that The transmission unit is further configured to: When the framework layer determines that the transmitted data is a business resource, it performs data transparent transmission between the client and the business layer; The business resources include business resources uploaded by the client and business resources stored in the database.
11. The device according to claim 9 or 10, characterized in that The data transmitted between the client and the business layer includes: The business resources uploaded by the client to the business layer; The business layer stores the business resources in the database and returns the business resource number to the client; The encrypted service resource number transmitted by the client to the service layer; The service layer returns the service resource corresponding to the encrypted service resource number to the client.
12. The device according to claim 9, wherein The framework layer encrypts the unencrypted service resource number or decrypts the encrypted service resource number, including: Determine the target business resource number group to which the unencrypted / encrypted business resource number belongs according to the business resource number ranges corresponding to different business resource number groups; Determine the target encryption and decryption algorithm corresponding to the target business resource number group according to the encryption and decryption algorithms corresponding to different business resource number groups; The target encryption and decryption algorithm is used to encrypt the unencrypted service resource number, or to decrypt the encrypted service resource number.
13. The device according to claim 9, wherein Encrypting the unencrypted service resource number using the target key includes: Signing the unencrypted service resource number using a cyclic redundancy check (CRC) algorithm to obtain a verification signature; Encrypting the verification signature and the unencrypted service resource number using the target key to obtain a ciphertext; Constructing a ciphertext data packet including the target service resource number group number and the ciphertext, or constructing a ciphertext data packet including the target service resource number group number, the ciphertext and the target key number; The ciphertext data packet is encoded using a coding algorithm and then transmitted.
14. The device according to claim 9, wherein Decrypting the encrypted service resource number using the target key includes: Decoding the encrypted service resource number using a decoding algorithm to obtain a target service resource number group number and a ciphertext, or obtaining a ciphertext data packet including the target service resource number group number, the ciphertext, and the target key number; Determine the target key according to the target service resource number group number, or according to the target service resource number group number and the target key number; Decrypting the ciphertext using the target key to obtain a verification signature and the service resource number; A cyclic redundancy check (CRC) algorithm is used to calculate the service resource number obtained by decryption. If the calculation result is consistent with the verification signature, the decryption is determined to be successful.
15. The device according to claim 13 or 14, characterized in that If the key group includes one key, the ciphertext data packet includes the target service resource number group number and the ciphertext; If the key group includes multiple keys, the ciphertext data packet includes the target service resource number group number, the ciphertext and the target key number.
16. The device according to claim 9, wherein If the key group includes multiple keys, selecting a target key from the key group corresponding to the target service resource number group, and encrypting the unencrypted service resource number using the target key, includes: Randomly selecting a key number from the key numbers corresponding to the multiple keys and determining a target key corresponding to the selected key number; or selecting a key number according to key configuration information and determining a target key corresponding to the selected key number; Encrypting the unencrypted service resource number using the target key; The key configuration information includes the unencrypted service resource number.
17. An electronic device, characterized in that: include: a processor and a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the business resource service method according to any one of claims 1 to 8.
18. A computer storage medium, characterized in that The computer storage medium stores a computer program, and the computer program is used to implement the business resource service method according to any one of claims 1 to 8.
Citation Information
Patent Citations
File name protection method for stream media service
CN101309275A
All-purpose digital copyright protection technology frame
CN101339592A
Network resource query method and system
CN101404576A
Firmware processing method based on firmware air transmission technology, device and system thereof
CN101924607A
Digital rights management of streaming contents and services
CN103152321A
